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]
The Finset of variables used in a given term.
Instances For
The Finset of variables from the left side of a sum used in a given term.
Instances For
Relabels a term's variables along a particular function.
Instances For
Relabels a term's variables along a bijection.
Instances For
Restricts a term to use only a set of the given variables on the left side of a sum.
Instances For
The representation of a constant symbol as a term.
Instances For
The representation of a function symbol as a term, on fresh variables indexed by Fin.
Instances For
Sends a term with constants to a term with extra variables.
Instances For
Sends a term with extra variables to a term with constants.
Instances For
A bijection between terms with constants and terms with extra variables.
Instances For
A bijection between terms with constants and terms with extra variables.
Instances For
Raises all of the Fin-indexed variables of a term greater than or equal to m by n'.
Instances For
Substitutes the variables in a given term with terms.
Instances For
Substitutes the functions in a given term with expressions.
Instances For
&n is notation for the bound variable indexed by n in a bounded formula.
Instances For
Maps a term's symbols along a language map.
Instances For
Maps a term's symbols along a language equivalence.
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.
Instances For
A sentence is a formula with no free variables.
Instances For
A theory is a set of sentences.
Instances For
Applies a relation to terms as a bounded formula.
Instances For
Applies a unary relation to a term as a bounded formula.
Instances For
Applies a binary relation to two terms as a bounded formula.
Instances For
The equality of two terms as a bounded formula.
Instances For
The equality of two terms as a first-order formula.
Instances For
The negation of a bounded formula is also a bounded formula.
Instances For
Puts an ∃ quantifier on a bounded formula.
Instances For
The biimplication between two bounded formulas.
Instances For
The Finset of free variables used in a given formula.
Instances For
Casts L.BoundedFormula α m as L.BoundedFormula α n, where m ≤ n.
Instances For
Restricts a bounded formula to only use a particular set of free variables.
Instances For
Places universal quantifiers on all in-scope bound variables of a bounded formula.
Instances For
Places existential quantifiers on all in-scope bound variables of a bounded formula.
Instances For
Maps bounded formulas along a map of terms and a map of relations.
Instances For
Raises all of the bound variables of a formula greater than or equal to m by n'.
Instances For
An equivalence of bounded formulas given by an equivalence of terms and an equivalence of relations.
Instances For
A function to help relabel the variables in bounded formulas.
Instances For
Relabels a bounded formula's variables along a particular function.
Instances For
Relabels a bounded formula's free variables along a bijection.
Instances For
Substitutes the free variables in a bounded formula with terms, leaving bound variables unchanged.
Instances For
A bijection sending formulas with constants to formulas with extra free variables.
Instances For
Turns all the in-scope bound variables into free variables.
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.
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.
Instances For
Maps a bounded formula's symbols along a language map.
Instances For
Maps a formula's symbols along a language map.
Instances For
Maps a sentence's symbols along a language map.
Instances For
Maps a bounded formula's symbols along a language equivalence.
Instances For
Maps a formula's symbols along a language equivalence.
Instances For
Maps a sentence's symbols along a language equivalence.
Instances For
The equality of two terms as a bounded formula.
Instances For
The implication between two bounded formulas.
Instances For
The universal quantifier over bounded formulas.
Instances For
The negation of a bounded formula is also a bounded formula.
Instances For
The biimplication between two bounded formulas.
Instances For
Puts an ∃ quantifier on a bounded formula.
Instances For
Relabels a formula's variables along a particular function.
Instances For
The graph of a function as a first-order formula.
Instances For
The negation of a formula.
Instances For
The implication between formulas, as a formula.
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
Instances For
The biimplication between formulas, as a formula.
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.
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.
Instances For
A bijection sending formulas to sentences with constants.
Instances For
The sentence indicating that a basic relation symbol is reflexive.
Instances For
The sentence indicating that a basic relation symbol is irreflexive.
Instances For
The sentence indicating that a basic relation symbol is symmetric.
Instances For
The sentence indicating that a basic relation symbol is antisymmetric.
Instances For
The sentence indicating that a basic relation symbol is transitive.
Instances For
The sentence indicating that a basic relation symbol is total.
Instances For
A sentence indicating that a structure has n distinct elements.
Instances For
A theory indicating that a structure is infinite.
Instances For
A theory that indicates a structure is nonempty.
Instances For
A theory indicating that each of a set of constants is distinct.