Metamath
Metamath is a formal language and an associated computer program (a proof assistant) for archiving and verifying mathematical proofs. Several databases of proved theorems have been developed using Metamath covering standard results in logic, set theory, number theory, algebra, topology and analysis, among others. By 2023, Metamath had been used to prove 74 of the 100 theorems of the "Formalizing 100 Theorems" challenge. At least 19 proof verifiers use the Metamath format. The Metamath website provides a database of formalized theorems which can be browsed interactively. Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.
Metamath is a formal language and an associated computer program (a proof assistant) for archiving and verifying mathematical proofs. Several databases of proved theorems have been developed using Metamath covering standard results in logic, set theory, number theory, algebra, topology and analysis, among others. By 2023, Metamath had been used to prove 74 of the 100 theorems of the "Formalizing 100 Theorems" challenge. At least 19 proof verifiers use the Metamath format. The Metamath website provides a database of formalized theorems which can be browsed interactively. ==Metamath language== The Metamath language is a metalanguage for formal systems. The Metamath language has no specific logic embedded in it. Instead, it can be regarded as a way to prove that inference rules (asserted as axioms or proven later) can be applied. The largest database of proved theorems follows conventional first-order logic and ZFC set theory. The Metamath language design (employed to state the definitions, axioms, inference rules and theorems) is focused on simplicity. Proofs are checked using an algorithm based on variable substitution. The algorithm also has optional provisos for what variables must remain distinct after a substitution is made. ===Language basics=== Comments are enclosed in $( ... $) . The set of symbols that can be used for constructing formulas is declared using $c (constant symbols) and $v (variable symbols) statements. The end of a statement is denoted by $. . For example: $( Declare the nine constant symbols we will use $) $c 0 + = -> ( ) term wff |- $. $( Declare the five metavariables we will use $) $v t r s P Q $. The grammar for formulas is specified using a combination of $f (floating (variable-type) hypotheses) and $a (axiomatic assertion) statements. Each such statement is preceded with a name so that it can be referred to in proofs. For example: $( Specify properties of the metavariables $) tt $f term t $. tr $f term r $. ts $f term s $. wp $f wff P $. wq $f wff Q $. $( Define "term": zero and sums $) tze $a term 0 $. tpl $a term ( t + r ) $. $( Define "wff": equations and implications $) weq $a wff t = r $. wim $a wff ( P -> Q ) $. Axioms and rules of inference are specified with $a statements along with ${ and $} for block scoping and optional $e (essential hypotheses) statements; for example: $( Axiom a1: substituting in equations $) a1 $a |- ( t = r -> ( t = s -> r = s ) ) $. $( Axiom a2: Zero is neutral $) a2 $a |- ( t + 0 ) = t $. $( Define the modus ponens inference rule $) ${ min $e |- P $. maj $e |- ( P -> Q ) $. mp $a |- Q $. $} A single construct, $a statements, is used to capture syntactic rules, axiom schemas, and rules of inference. This is intended to provide a level of flexibility similar to higher order logical frameworks without a dependency on a complex type system. ===Proofs=== Theorems (and derived rules of inference) along with their proofs are stated with $p statements. The proofs are introduced with $= and are given as a list of names of axioms, rules and theorems to be applied. For example: $( Theorem th1: reflexivity of equality $) th1 $p |- t = t $= $( Here is its proof: $) tt tze tpl tt weq tt tt weq tt a2 tt tze tpl tt weq tt tze tpl tt weq tt tt weq wim tt a2 tt tze tpl tt tt a1 mp mp $. This abbreviates the following detailed proof: tt $f term t tze $a term 0 1,2 tpl $a term ( t + 0 ) 3,1 weq $a wff ( t + 0 ) = t 1,1 weq $a wff t = t 1 a2 $a |- ( t + 0 ) = t 1,2 tpl $a term ( t + 0 ) 7,1 weq $a wff ( t + 0 ) = t 1,2 tpl $a term ( t + 0 ) 9,1 weq $a wff ( t + 0 ) = t 1,1 weq $a wff t = t 10,11 wim $a wff ( ( t + 0 ) = t -> t = t ) 1 a2 $a |- ( t + 0 ) = t 1,2 tpl $a term ( t + 0 ) 14,1,1 a1 $a |- ( ( t + 0 ) = t -> ( ( t + 0 ) = t -> t = t ) ) 8,12,13,15 mp $a |- ( ( t + 0 ) = t -> t = t ) 4,5,6,16 mp $a |- t = t The "essential" form of the proof elides syntactic details, leaving a more conventional presentation: a2 $a |- ( t + 0 ) = t a2 $a |- ( t + 0 ) = t a1 $a |- ( ( t + 0 ) = t -> ( ( t + 0 ) = t -> t = t ) ) 2,3 mp $a |- ( ( t + 0 ) = t -> t = t ) 1,4 mp $a |- t = t ===Substitution=== All Metamath proof steps use a single substitution rule, which is just the simple replacement of a variable with an expression and not the proper substitution described in works on predicate calculus. Proper substitution, in Metamath databases that support it, is a derived construct instead of one built into the Metamath language itself. The substitution rule makes no assumption about the logic system in use and only requires that the substitutions of variables are correctly done. Here is a detailed example of how this algorithm works. Steps 1 and 2 of the theorem 2p2e4 in the Metamath Proof Explorer (set.mm) are depicted left. Let's explain how Metamath uses its substitution algorithm to check that step 2 is the logical consequence of step 1 when you use the theorem opreq2i . Step 2 states that . It is the conclusion of the theorem opreq2i . The theorem opreq2i states that if , then . This theorem would never appear under this cryptic form in a textbook but its literate formulation is banal: when two quantities are equal, one can replace one by the other in an operation. To check the proof Metamath attempts to unify with . There is only one way to do so: unifying with , with , with and with . So now Metamath uses the premise of opreq2i . This premise states that . As a consequence of its previous computation, Metamath knows that should be substituted by and by . The premise becomes and thus step 1 is therefore generated. In its turn step 1 is unified with df-2 . df-2 is the definition of the number 2 and states that 2 = ( 1 + 1 ) . Here the unification is simply a matter of constants and is straightforward (no problem of variables to substitute). So the verification is finished and these two steps of the proof of 2p2e4 are correct. When Metamath unifies with it has to check that the syntactical rules are respected. In fact has the type class thus Metamath has to check that is also typed class . ==Natural deduction== Because Metamath has a very generic concept of what a proof is (namely a tree of formulas connected by inference rules) and no specific logic is embedded in the software, Metamath can be used with species of logic as different as Hilbert-style logics or sequents-based logics or even with lambda calculus. However, Metamath provides no direct support for natural deduction systems. As noted earlier, the database nat.mm formalizes natural deduction. The Metamath Proof Explorer (with its database set.mm) instead uses a set of conventions that allow the use of natural deduction approaches within a Hilbert-style logic. ==Other works connected to Metamath== ==References== ==External links== Metamath: official website.
Cite this
"Metamath". 1790039612. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1376107517 JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy