Basics on First-Order Syntax #
This file defines first-order terms, formulas, sentences, and theories in a style inspired by the Flypitch project.
Main Definitions #
- A
FirstOrder.Language.Termis defined so thatL.Term αis the type ofL-terms with free variables indexed byα. - A
FirstOrder.Language.Formulais defined so thatL.Formula αis the type ofL-formulas with free variables indexed byα. - A
FirstOrder.Language.Sentenceis a formula with no free variables. - A
FirstOrder.Language.Theoryis a set of sentences. - The variables of terms and formulas can be relabelled with
FirstOrder.Language.Term.relabel,FirstOrder.Language.BoundedFormula.relabel, andFirstOrder.Language.Formula.relabel. - Given an operation on terms and an operation on relations,
FirstOrder.Language.BoundedFormula.mapTermRelgives an operation on formulas. FirstOrder.Language.BoundedFormula.castLEadds more bound variables.FirstOrder.Language.BoundedFormula.liftAtraises the indexes of the bound variables above a particular index.FirstOrder.Language.Term.substandFirstOrder.Language.BoundedFormula.substsubstitute variables with given terms.FirstOrder.Language.Term.substFuncinstead substitutes function definitions with given terms.- Language maps can act on syntactic objects with functions such as
FirstOrder.Language.LHom.onFormula. FirstOrder.Language.Term.constantsVarsEquivandFirstOrder.Language.BoundedFormula.constantsVarsEquivswitch terms and formulas between having constants in the language and having extra free variables indexed by the same type.
Implementation Notes #
BoundedFormulauses a locally nameless representation with bound variables as well-scoped de Bruijn levels (the variable bounded by the outermost quantifier is indexed by0). Specifically, aL.BoundedFormula α nis a formula with free variables indexed by a typeα, which cannot be quantified over, and bound variables indexed byFin n, which can. For anyφ : L.BoundedFormula α (n + 1), we define the formula∀' φ : L.BoundedFormula α nby universally quantifying over the variable indexed byn : Fin (n + 1).
References #
For the Flypitch project:
- [J. Han, F. van Doorn, A formal proof of the independence of the continuum hypothesis] [flypitch_cpp]
- [J. Han, F. van Doorn, A formalization of forcing and the unprovability of the continuum hypothesis][flypitch_itp]
Equations
The Finset of variables used in a given term.
Equations
Instances For
The Finset of variables from the left side of a sum used in a given term.
Equations
Instances For
Relabels a term's variables along a particular function.
Equations
Instances For
Relabels a term's variables along a bijection.
Equations
Instances For
Restricts a term to use only a set of the given variables.
Equations
Instances For
Restricts a term to use only a set of the given variables on the left side of a sum.
Equations
Instances For
The representation of a constant symbol as a term.
Equations
Instances For
The representation of a function symbol as a term, on fresh variables indexed by Fin.
Equations
Instances For
Sends a term with constants to a term with extra variables.
Equations
Instances For
Sends a term with extra variables to a term with constants.
Equations
Instances For
A bijection between terms with constants and terms with extra variables.
Equations
Instances For
A bijection between terms with constants and terms with extra variables.
Equations
Instances For
Equations
Equations
Substitutes the variables in a given term with terms.
Equations
Instances For
&n is notation for the bound variable indexed by n in a bounded formula.
Equations
Instances For
Maps a term's symbols along a language map.
Equations
Instances For
Maps a term's symbols along a language equivalence.
Equations
Instances For
BoundedFormula α n is the type of formulas with free variables indexed by α and n in-scope
bound variables indexed by Fin n.
- falsum {L : Language} {α : Type u'} {n : ℕ} : L.BoundedFormula α n
- equal {L : Language} {α : Type u'} {n : ℕ} (t₁ t₂ : L.Term (α ⊕ Fin n)) : L.BoundedFormula α n
- rel {L : Language} {α : Type u'} {n l : ℕ} (R : L.Relations l) (ts : Fin l → L.Term (α ⊕ Fin n)) : L.BoundedFormula α n
- imp
{L : Language}
{α : Type u'}
{n : ℕ}
(f₁ f₂ : L.BoundedFormula α n)
: L.BoundedFormula α n
The implication between two bounded formulas.
- all
{L : Language}
{α : Type u'}
{n : ℕ}
(f : L.BoundedFormula α (n + 1))
: L.BoundedFormula α n
The universal quantifier over bounded formulas.
Instances For
Formula α is the type of formulas with free variables indexed by α and no bound variables in
scope.
Equations
Instances For
A sentence is a formula with no free variables.
Equations
Instances For
A theory is a set of sentences.
Equations
Instances For
Applies a relation to terms as a bounded formula.
Equations
Instances For
Applies a unary relation to a term as a bounded formula.
Equations
Instances For
Applies a binary relation to two terms as a bounded formula.
Equations
Instances For
The equality of two terms as a bounded formula.
Equations
Instances For
The equality of two terms as a first-order formula.
Equations
Instances For
Equations
Equations
The negation of a bounded formula is also a bounded formula.
Equations
Instances For
Puts an ∃ quantifier on a bounded formula.
Equations
Instances For
Equations
Equations
Equations
The biimplication between two bounded formulas.
Equations
Instances For
The Finset of free variables used in a given formula.
Equations
Instances For
Casts L.BoundedFormula α m as L.BoundedFormula α n, where m ≤ n.
Equations
Instances For
Restricts a bounded formula to only use a particular set of free variables.
Equations
Instances For
Places universal quantifiers on all in-scope bound variables of a bounded formula.
Equations
Instances For
Places existential quantifiers on all in-scope bound variables of a bounded formula.
Equations
Instances For
Maps bounded formulas along a map of terms and a map of relations.
Equations
Instances For
Raises all of the bound variables of a formula greater than or equal to m by n'.
Equations
Instances For
An equivalence of bounded formulas given by an equivalence of terms and an equivalence of relations.
Equations
Instances For
Relabels a bounded formula's variables along a particular function.
Equations
Instances For
Substitutes the free variables in a bounded formula with terms, leaving bound variables unchanged.
Equations
Instances For
A bijection sending formulas with constants to formulas with extra free variables.
Equations
Instances For
Turns all the in-scope bound variables into free variables.
Equations
Instances For
Take the disjunction of a finite set of formulas.
Note that this is an arbitrary formula defined using the axiom of choice. It is only well-defined up to equivalence of formulas.
Equations
Instances For
Take the conjunction of a finite set of formulas.
Note that this is an arbitrary formula defined using the axiom of choice. It is only well-defined up to equivalence of formulas.
Equations
Instances For
Maps a bounded formula's symbols along a language map.
Equations
Instances For
Maps a formula's symbols along a language map.
Equations
Instances For
Maps a sentence's symbols along a language map.
Equations
Instances For
Maps a formula's symbols along a language equivalence.
Equations
Instances For
Maps a sentence's symbols along a language equivalence.
Equations
Instances For
The equality of two terms as a bounded formula.
Equations
Instances For
The implication between two bounded formulas.
Equations
Instances For
The universal quantifier over bounded formulas.
Equations
Instances For
The negation of a bounded formula is also a bounded formula.
Equations
Instances For
The biimplication between two bounded formulas.
Equations
Instances For
Puts an ∃ quantifier on a bounded formula.
Equations
Instances For
Relabels a formula's variables along a particular function.
Equations
Instances For
The graph of a function as a first-order formula.
Equations
Instances For
The negation of a formula.
Equations
Instances For
The implication between formulas, as a formula.
Equations
Instances For
iExsUnique f φ transforms a L.Formula (α ⊕ β) into a L.Formula α by existentially
quantifying over all variables Sum.inr _ and asserting that the solution should be unique
Equations
Instances For
The biimplication between formulas, as a formula.
Equations
Instances For
Take the disjunction of finitely many formulas.
Note that this is an arbitrary formula defined using the axiom of choice. It is only well-defined up to equivalence of formulas.
Equations
Instances For
Take the conjunction of finitely many formulas.
Note that this is an arbitrary formula defined using the axiom of choice. It is only well-defined up to equivalence of formulas.
Equations
Instances For
A bijection sending formulas to sentences with constants.
Equations
Instances For
The sentence indicating that a basic relation symbol is reflexive.
Equations
Instances For
The sentence indicating that a basic relation symbol is irreflexive.
Equations
Instances For
The sentence indicating that a basic relation symbol is symmetric.
Equations
Instances For
The sentence indicating that a basic relation symbol is antisymmetric.
Equations
Instances For
The sentence indicating that a basic relation symbol is transitive.
Equations
Instances For
The sentence indicating that a basic relation symbol is total.
Equations
Instances For
A sentence indicating that a structure has n distinct elements.
Equations
Instances For
A theory indicating that a structure is infinite.
Equations
Instances For
A theory that indicates a structure is nonempty.
Equations
Instances For
A theory indicating that each of a set of constants is distinct.