MODULE (
  HEADER (
    SPEC (
      NAME ("new"),
      VERSION ("1.00.@number@"),
      VERSION ("1.02.00"),
      LOCATIONS (
        LOCATION (".")
 
      )
    ),
    HEADLINE ("This is a qedeq module template."),
    DESCRIPTION (
      "You could modify this document and save it."
    ),
    EMAIL ("module@unknown.org"),
    AUTHORS (
      AUTHOR ("Your Name", EMAIL ("somebody@unknown.org"))
    )
  ),
  IMPORTS (
    IMPORT (
      SPEC (
        NAME ("predtheo2"),
        VERSION ("1.00.00"),
        VERSION ("1.02.00"),
        LOCATIONS (
          LOCATION ("http://www.qedeq.org/0_00_53")
        )
      )
    )
  ),
  PARAGRAPHS (
    PARAGRAPH (
      LABEL ("templateexample"),
      "A simple implication:",
      PROPOSITION (
        SENTENCE (
          IMPL(FORALL(VAR(1), PREDVAR(1, L(VAR(1)))), EXISTS(VAR(1), PREDVAR(1, L(VAR(1)))))
        ),
        PROOF (
          LINE (
            IMPL(FORALL(VAR(1), PREDVAR(1, L(VAR(1)))), PREDVAR(1, L(VAR(2)))),
            ADDAXIOM ( LINK ("axiom5"))
          ),
          LINE (
            IMPL(PREDVAR(1, L(VAR(2))), EXISTS(VAR(1), PREDVAR(1, L(VAR(1))))),
            ADDAXIOM ( LINK ("axiom6"))
          ),
          LINE (
            IMPL(FORALL(VAR(1), PREDVAR(1, L(VAR(1)))), EXISTS(VAR(1), PREDVAR(1, L(VAR(1))))),
            HYPOTHETICALSYLLOGISM (1, 2)
          )
        )
      )
    ),
    PARAGRAPH (
      LABEL ("templateexample2"),
      "A well known implication:",
      PROPOSITION (
        SENTENCE (
          IMPL(EXISTS(VAR(1), PREDVAR(1, L(VAR(1)))), NOT(FORALL(VAR(1), NOT(PREDVAR(1, L(VAR(1)))))))
        ),
        PROOF (
          LINE (
            IMPL(FORALL(VAR(1), PREDVAR(1, L(VAR(1)))), PREDVAR(1, L(VAR(2)))),
            ADDAXIOM ( LINK ("axiom5"))
          ),
          LINE (
            IMPL(FORALL(VAR(1), NOT(PREDVAR(1, L(VAR(1))))), NOT(PREDVAR(1, L(VAR(2))))),
            REPLACEPREDICATE (
              1, 
              PREDVAR(1, L(SPATTERN(1))),
              NOT(PREDVAR(1, L(SPATTERN(1))))
            )
          ),
          LINE (
            OR(NOT(FORALL(VAR(1), NOT(PREDVAR(1, L(VAR(1)))))), NOT(PREDVAR(1, L(VAR(2))))),
            USEABBREVIATION (2, LINK ("impl"), 1)
          ),
          LINE (
            IMPL(OR(PROP(1), PROP(2)), OR(PROP(2), PROP(1))),
            ADDAXIOM ( LINK ("axiom3"))
          ),
          LINE (
            IMPL(OR(NOT(FORALL(VAR(1), NOT(PREDVAR(1, L(VAR(1)))))), PROP(2)), OR(PROP(2), NOT(FORALL(VAR(1), NOT(PREDVAR(1, L(VAR(1)))))))),
            REPLACEPROP (
              4, 
              PROP(1),
              NOT(FORALL(VAR(1), NOT(PREDVAR(1, L(VAR(1))))))
            )
          ),
          LINE (
            IMPL(OR(NOT(FORALL(VAR(1), NOT(PREDVAR(1, L(VAR(1)))))), NOT(PREDVAR(1, L(VAR(2))))), OR(NOT(PREDVAR(1, L(VAR(2)))), NOT(FORALL(VAR(1), NOT(PREDVAR(1, L(VAR(1)))))))),
            REPLACEPROP (
              5, 
              PROP(2),
              NOT(PREDVAR(1, L(VAR(2))))
            )
          ),
          LINE (
            OR(NOT(PREDVAR(1, L(VAR(2)))), NOT(FORALL(VAR(1), NOT(PREDVAR(1, L(VAR(1))))))),
            MODUSPONENS (3, 6)
          ),
          LINE (
            IMPL(PREDVAR(1, L(VAR(2))), NOT(FORALL(VAR(1), NOT(PREDVAR(1, L(VAR(1))))))),
            REVERSEABBREVIATION (7, LINK ("impl"), 1)
          ),
          LINE (
            IMPL(EXISTS(VAR(2), PREDVAR(1, L(VAR(2)))), NOT(FORALL(VAR(1), NOT(PREDVAR(1, L(VAR(1))))))),
            PARTICULARIZATION (8, VAR(2))
          ),
          LINE (
            IMPL(EXISTS(VAR(1), PREDVAR(1, L(VAR(1)))), NOT(FORALL(VAR(1), NOT(PREDVAR(1, L(VAR(1))))))),
            RENAMEBOUNDVARIABLE (9, VAR(2), VAR(1), 1)
          )
        )
      )
    ),
    PARAGRAPH (
      LABEL ("templateexample3"),
      "The reverse is also true:",
      PROPOSITION (
        SENTENCE (
          IMPL(NOT(FORALL(VAR(1), NOT(PREDVAR(1, L(VAR(1)))))), EXISTS(VAR(1), PREDVAR(1, L(VAR(1)))))
        ),
        PROOF (
          LINE (
            IMPL(PREDVAR(1, L(VAR(2))), EXISTS(VAR(1), PREDVAR(1, L(VAR(1))))),
            ADDAXIOM ( LINK ("axiom6"))
          ),
          LINE (
            IMPL(NOT(EXISTS(VAR(1), PREDVAR(1, L(VAR(1))))), NOT(PREDVAR(1, L(VAR(2))))),
            APPLYSENTENCE (1, LINK("hilb7"))
          ),
          LINE (
            IMPL(NOT(EXISTS(VAR(1), PREDVAR(1, L(VAR(1))))), FORALL(VAR(2), NOT(PREDVAR(1, L(VAR(2)))))),
            GENERALIZATION (2, VAR(2))
          ),
          LINE (
            IMPL(NOT(FORALL(VAR(2), NOT(PREDVAR(1, L(VAR(2)))))), NOT(NOT(EXISTS(VAR(1), PREDVAR(1, L(VAR(1))))))),
            APPLYSENTENCE (3, LINK("hilb7"))
          ),
          LINE (
            IMPL(NOT(FORALL(VAR(2), NOT(PREDVAR(1, L(VAR(2)))))), EXISTS(VAR(1), PREDVAR(1, L(VAR(1))))),
            IMPLICATIONEQUIVALENT (4, LINK("hilb6"), LINK("hilb5"), 1)
          ),
          LINE (
            IMPL(NOT(FORALL(VAR(1), NOT(PREDVAR(1, L(VAR(1)))))), EXISTS(VAR(1), PREDVAR(1, L(VAR(1))))),
            RENAMEBOUNDVARIABLE (5, VAR(2), VAR(1), 1)
          )
        )
      )
    )
  )
)

