Proof Checker Pro
Write the proof as a program. The compiler checks each command in order and stops where its understanding of the proof breaks.
Problem
Define predicates, inductive types, and recursive functions as needed, then enter one axiom per line. Roman-numeral axiom names are supplied automatically.
Proof language
End punctuation is optional. References are optional when the compiler can infer exactly which earlier lines you mean.
- Declare an inductive type with
inductive BinaryTree, one constructor per line, andend. Constructor fields use forms such asInternalNode(left: BinaryTree, right: BinaryTree). - Define a structurally recursive function with
recursive count(tree: BinaryTree): Natural, one constructor equation per line, andend. Useby definition of countto unfold one equation in a proof. Induct on tbegins structural induction for a universal goal over a declared inductive type. Open a nonrecursive constructor withBaseCase Leafand a recursive constructor withInductiveCase InternalNode(Left, Right).- Immediately after an inductive case, write
For induction assume:, followed by exactly one induction hypothesis for each immediate recursive part. The hypotheses become numbered proof lines. - Close a constructor case with
therefore P(InternalNode(Left, Right)) by induction case. After every constructor is complete, close withtherefore (∀ t in BinaryTrees)P(t) by induction. Pretend Bob is a CreatureorLet Bob be an arbitrary Creatureopens an arbitrary-object world.Pretend X, Y are NumbersorLet X, Y be arbitrary Numbersopens several arbitrary-object worlds at once.Make believe S(Bob)orAssume S(Bob)opens a make-believe world.S(Bob) → M(Bob) by UI Iapplies a rule and cites an axiom.X < Y → F(X) < F(Y) by UImay instantiate several leading quantifiers at once; the source reference may be omitted when it is unambiguous.M(Bob) by detachment 2, 3cites proof lines.therefore S(Bob) → V(Bob) by MB 6closes a make-believe world.therefore (∀ c in Creatures)(S(c) → V(c)) by UG 7closes an arbitrary-object world.Pretend Ari is a witness with P(Ari) by EI IorLet Ari be a witness such that P(Ari)opens an existential-witness world.2(2J^2 + 2J) + 1 = N^2 by algebrachecks polynomial algebra, using available equations such as2J + 1 = N.For contradiction assume ¬Popens a pretend world and changes the current goal to Contradiction. After deriving one,therefore P by contradictioncloses the world.Contradiction from lines 4, 7is valid when one cited line negates the other, including complementary comparisons such asX < YandX ≥ Y. Write simplyContradictionwhen there is only one contradictory pair available.Case 1: Make believe P by cases IIIopens the first branch of a proof by cases. Nested branches may use labels such asCase 1aandCase 1b.- After establishing the goal in a branch,
therefore R by casefinishes that branch. Finish Case 1a before beginning Case 1b. - After both sibling branches are finished,
therefore R by cases IIIcombines them; the checker finds the two matching branch conclusions.
Compiler convention: quantified variables and definition parameters begin lowercase; introduced individuals such as Bob begin uppercase. A quantifier may omit its type when the surrounding proof determines it; two explicitly different types still conflict.
Several variables may share a quantifier, as in (∀ x, y)(x < y → F(x) < F(y)). Function terms may be nested, as in F(G(x)). Definitions may have several parameters, as in Between(x, y, z).
Other rule names: EI, EG, and introduction, and elimination, or introduction, case, cases, De Morgan, double negation, iff introduction, and iff elimination.
Shorthand becomes notation as you type: \forall, \exists, \neg, \not, /\, \/, ->, <->, <=, and >=. The words and and or are also accepted inside formulas.