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.Term
is defined so thatL.Term α
is the type ofL
-terms with free variables indexed byα
. - A
FirstOrder.Language.Formula
is defined so thatL.Formula α
is the type ofL
-formulas with free variables indexed byα
. - A
FirstOrder.Language.Sentence
is a formula with no free variables. - A
FirstOrder.Language.Theory
is 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.mapTermRel
gives an operation on formulas. FirstOrder.Language.BoundedFormula.castLE
adds moreFin
-indexed variables.FirstOrder.Language.BoundedFormula.liftAt
raises the indexes of theFin
-indexed variables above a particular index.FirstOrder.Language.Term.subst
andFirstOrder.Language.BoundedFormula.subst
substitute variables with given terms.FirstOrder.Language.Term.substFunc
instead substitutes function definitions with given terms.- Language maps can act on syntactic objects with functions such as
FirstOrder.Language.LHom.onFormula
. FirstOrder.Language.Term.constantsVarsEquiv
andFirstOrder.Language.BoundedFormula.constantsVarsEquiv
switch terms and formulas between having constants in the language and having extra variables indexed by the same type.
Implementation Notes #
- Formulas use a modified version of de Bruijn variables. Specifically, a
L.BoundedFormula α n
is a formula with some variables indexed by a typeα
, which cannot be quantified over, and some indexed byFin n
, which can. For anyφ : L.BoundedFormula α (n + 1)
, we define the formula∀' φ : L.BoundedFormula α n
by 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
Restricts a term to use only a set of the given variables on the left side of a sum.
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
&n
is notation for the n
-th free variable of a bounded formula.
Equations
Instances For
Maps a term's symbols along a language equivalence. Deprecated in favor of LEquiv.onTerm
.
Equations
Instances For
BoundedFormula α n
is the type of formulas with free variables indexed by α
and up to n
additional free variables.
- 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
A sentence is a formula with no free variables.
Equations
Instances For
A theory is a set of sentences.
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
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 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 extra variables of a bounded formula.
Equations
Instances For
Places existential quantifiers on all extra 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 Fin
-indexed 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
Alias of FirstOrder.Language.BoundedFormula.sumElim_comp_relabelAux
.
Alias of FirstOrder.Language.BoundedFormula.relabelAux_sumInl
.
Relabels a bounded formula's variables along a particular function.
Equations
Instances For
Substitutes the variables in a given formula with terms.
Equations
Instances For
A bijection sending formulas with constants to formulas with extra variables.
Equations
Instances For
Turns the extra variables of a bounded formula 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
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
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
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.