Basics on First-Order Syntax #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4. This file defines first-order terms, formulas, sentences, and theories in a style inspired by the Flypitch project.
Main Definitions #
- A
first_order.language.term
is defined so thatL.term α
is the type ofL
-terms with free variables indexed byα
. - A
first_order.language.formula
is defined so thatL.formula α
is the type ofL
-formulas with free variables indexed byα
. - A
first_order.language.sentence
is a formula with no free variables. - A
first_order.language.Theory
is a set of sentences. - The variables of terms and formulas can be relabelled with
first_order.language.term.relabel
,first_order.language.bounded_formula.relabel
, andfirst_order.language.formula.relabel
. - Given an operation on terms and an operation on relations,
first_order.language.bounded_formula.map_term_rel
gives an operation on formulas. first_order.language.bounded_formula.cast_le
adds morefin
-indexed variables.first_order.language.bounded_formula.lift_at
raises the indexes of thefin
-indexed variables above a particular index.first_order.language.term.subst
andfirst_order.language.bounded_formula.subst
substitute variables with given terms.- Language maps can act on syntactic objects with functions such as
first_order.language.Lhom.on_formula
. first_order.language.term.constants_vars_equiv
andfirst_order.language.bounded_formula.constants_vars_equiv
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.bounded_formula α 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.bounded_formula α (n + 1)
, we define the formula∀' φ : L.bounded_formula α n
by universally quantifying over the variable indexed byn : fin (n + 1)
.
References #
For the Flypitch project:
- var : Π {L : first_order.language} {α : Type u'}, α → L.term α
- func : Π {L : first_order.language} {α : Type u'} {l : ℕ}, L.functions l → (fin l → L.term α) → L.term α
A term on α
is either a variable indexed by an element of α
or a function symbol applied to simpler terms.
Instances for first_order.language.term
The finset
of variables used in a given term.
Equations
- (first_order.language.term.func f ts).var_finset = finset.univ.bUnion (λ (i : fin a_2), (ts i).var_finset)
- (first_order.language.term.var i).var_finset = {i}
The finset
of variables from the left side of a sum used in a given term.
Equations
- (first_order.language.term.func f ts).var_finset_left = finset.univ.bUnion (λ (i : fin a_5), (ts i).var_finset_left)
- (first_order.language.term.var (sum.inr i)).var_finset_left = ∅
- (first_order.language.term.var (sum.inl i)).var_finset_left = {i}
Relabels a term's variables along a particular function.
Equations
- first_order.language.term.relabel g (first_order.language.term.func f ts) = first_order.language.term.func f (λ (i : fin a_8), first_order.language.term.relabel g (ts i))
- first_order.language.term.relabel g (first_order.language.term.var i) = first_order.language.term.var (g i)
Relabels a term's variables along a bijection.
Equations
- first_order.language.term.relabel_equiv g = {to_fun := first_order.language.term.relabel ⇑g, inv_fun := first_order.language.term.relabel ⇑(g.symm), left_inv := _, right_inv := _}
Restricts a term to use only a set of the given variables.
Equations
- (first_order.language.term.func F ts).restrict_var f = first_order.language.term.func F (λ (i : fin a_13), (ts i).restrict_var (f ∘ set.inclusion _))
- (first_order.language.term.var a).restrict_var f = first_order.language.term.var (f ⟨a, _⟩)
Restricts a term to use only a set of the given variables on the left side of a sum.
Equations
- (first_order.language.term.func F ts).restrict_var_left f = first_order.language.term.func F (λ (i : fin a_18), (ts i).restrict_var_left (f ∘ set.inclusion _))
- (first_order.language.term.var (sum.inr a)).restrict_var_left f = first_order.language.term.var (sum.inr a)
- (first_order.language.term.var (sum.inl a)).restrict_var_left f = first_order.language.term.var (sum.inl (f ⟨a, _⟩))
The representation of a constant symbol as a term.
Equations
Applies a unary function to a term.
Equations
- f.apply₁ t = first_order.language.term.func f ![t]
Applies a binary function to two terms.
Equations
- f.apply₂ t₁ t₂ = first_order.language.term.func f ![t₁, t₂]
Sends a term with constants to a term with extra variables.
Equations
- (first_order.language.term.func f ts).constants_to_vars = sum.cases_on f (λ (f : L.functions (n + 1)), first_order.language.term.func f (λ (i : fin (n + 1)), (ts i).constants_to_vars)) (λ (c : (first_order.language.constants_on γ).functions (n + 1)), is_empty_elim c)
- (first_order.language.term.func f ts).constants_to_vars = sum.cases_on f (λ (f : L.functions 0), first_order.language.term.func f (λ (i : fin 0), (ts i).constants_to_vars)) (λ (c : (first_order.language.constants_on γ).functions 0), first_order.language.term.var (sum.inl c))
- (first_order.language.term.var a).constants_to_vars = first_order.language.term.var (sum.inr a)
Sends a term with extra variables to a term with constants.
Equations
- (first_order.language.term.func f ts).vars_to_constants = first_order.language.term.func (sum.inl f) (λ (i : fin a_21), (ts i).vars_to_constants)
- (first_order.language.term.var (sum.inr a)).vars_to_constants = first_order.language.term.var a
- (first_order.language.term.var (sum.inl c)).vars_to_constants = first_order.language.constants.term (sum.inr c)
A bijection between terms with constants and terms with extra variables.
Equations
A bijection between terms with constants and terms with extra variables.
Raises all of the fin
-indexed variables of a term greater than or equal to m
by n'
.
Equations
- first_order.language.term.lift_at n' m = first_order.language.term.relabel (sum.map id (λ (i : fin n), ite (↑i < m) (⇑(fin.cast_add n') i) (⇑(fin.add_nat n') i)))
Substitutes the variables in a given term with terms.
Equations
- (first_order.language.term.func f ts).subst tf = first_order.language.term.func f (λ (i : fin a_24), (ts i).subst tf)
- (first_order.language.term.var a).subst tf = tf a
Maps a term's symbols along a language map.
Equations
- φ.on_term (first_order.language.term.func f ts) = first_order.language.term.func (φ.on_function f) (λ (i : fin a_27), φ.on_term (ts i))
- φ.on_term (first_order.language.term.var i) = first_order.language.term.var i
Maps a term's symbols along a language equivalence.
- falsum : Π {L : first_order.language} {α : Type u'} {n : ℕ}, L.bounded_formula α n
- equal : Π {L : first_order.language} {α : Type u'} {n : ℕ}, L.term (α ⊕ fin n) → L.term (α ⊕ fin n) → L.bounded_formula α n
- rel : Π {L : first_order.language} {α : Type u'} {n l : ℕ}, L.relations l → (fin l → L.term (α ⊕ fin n)) → L.bounded_formula α n
- imp : Π {L : first_order.language} {α : Type u'} {n : ℕ}, L.bounded_formula α n → L.bounded_formula α n → L.bounded_formula α n
- all : Π {L : first_order.language} {α : Type u'} {n : ℕ}, L.bounded_formula α (n + 1) → L.bounded_formula α n
bounded_formula α n
is the type of formulas with free variables indexed by α
and up to n
additional free variables.
Instances for first_order.language.bounded_formula
- first_order.language.bounded_formula.has_sizeof_inst
- first_order.language.bounded_formula.inhabited
- first_order.language.bounded_formula.has_bot
- first_order.language.bounded_formula.has_top
- first_order.language.bounded_formula.has_inf
- first_order.language.bounded_formula.has_sup
- first_order.language.Theory.semantically_equivalent.is_refl
- first_order.language.Theory.complete_type.sentence.set_like
formula α
is the type of formulas with all free variables indexed by α
.
Equations
- L.formula α = L.bounded_formula α 0
A sentence is a formula with no free variables.
A theory is a set of sentences.
Applies a relation to terms as a bounded formula.
Equations
Applies a unary relation to a term as a bounded formula.
Equations
- r.bounded_formula₁ t = r.bounded_formula ![t]
Applies a binary relation to two terms as a bounded formula.
Equations
- r.bounded_formula₂ t₁ t₂ = r.bounded_formula ![t₁, t₂]
The equality of two terms as a bounded formula.
Equations
- t₁.bd_equal t₂ = first_order.language.bounded_formula.equal t₁ t₂
Applies a relation to terms as a bounded formula.
Equations
- R.formula ts = R.bounded_formula (λ (i : fin n), first_order.language.term.relabel sum.inl (ts i))
The equality of two terms as a first-order formula.
Equations
The negation of a bounded formula is also a bounded formula.
Puts an ∃
quantifier on a bounded formula.
Equations
- first_order.language.bounded_formula.has_inf = {inf := λ (f g : L.bounded_formula α n), (f.imp g.not).not}
Equations
- first_order.language.bounded_formula.has_sup = {sup := λ (f g : L.bounded_formula α n), f.not.imp g}
The biimplication between two bounded formulas.
The finset
of variables used in a given formula.
Equations
- f.all.free_var_finset = f.free_var_finset
- (f₁.imp f₂).free_var_finset = f₁.free_var_finset ∪ f₂.free_var_finset
- (first_order.language.bounded_formula.rel R ts).free_var_finset = finset.univ.bUnion (λ (i : fin a_30), (ts i).var_finset_left)
- (first_order.language.bounded_formula.equal t₁ t₂).free_var_finset = t₁.var_finset_left ∪ t₂.var_finset_left
- first_order.language.bounded_formula.falsum.free_var_finset = ∅
Casts L.bounded_formula α m
as L.bounded_formula α n
, where m ≤ n
.
Equations
- first_order.language.bounded_formula.cast_le h f.all = (first_order.language.bounded_formula.cast_le _ f).all
- first_order.language.bounded_formula.cast_le h (f₁.imp f₂) = (first_order.language.bounded_formula.cast_le h f₁).imp (first_order.language.bounded_formula.cast_le h f₂)
- first_order.language.bounded_formula.cast_le h (first_order.language.bounded_formula.rel R ts) = first_order.language.bounded_formula.rel R (first_order.language.term.relabel (sum.map id ⇑(fin.cast_le h)) ∘ ts)
- first_order.language.bounded_formula.cast_le h (first_order.language.bounded_formula.equal t₁ t₂) = first_order.language.bounded_formula.equal (first_order.language.term.relabel (sum.map id ⇑(fin.cast_le h)) t₁) (first_order.language.term.relabel (sum.map id ⇑(fin.cast_le h)) t₂)
- first_order.language.bounded_formula.cast_le h first_order.language.bounded_formula.falsum = first_order.language.bounded_formula.falsum
Restricts a bounded formula to only use a particular set of free variables.
Equations
- φ.all.restrict_free_var f = (φ.restrict_free_var f).all
- (φ₁.imp φ₂).restrict_free_var f = (φ₁.restrict_free_var (f ∘ set.inclusion _)).imp (φ₂.restrict_free_var (f ∘ set.inclusion _))
- (first_order.language.bounded_formula.rel R ts).restrict_free_var f = first_order.language.bounded_formula.rel R (λ (i : fin a_38), (ts i).restrict_var_left (f ∘ set.inclusion _))
- (first_order.language.bounded_formula.equal t₁ t₂).restrict_free_var f = first_order.language.bounded_formula.equal (t₁.restrict_var_left (f ∘ set.inclusion _)) (t₂.restrict_var_left (f ∘ set.inclusion _))
- first_order.language.bounded_formula.falsum.restrict_free_var f = first_order.language.bounded_formula.falsum
Places universal quantifiers on all extra variables of a bounded formula.
Places existential quantifiers on all extra variables of a bounded formula.
Maps bounded formulas along a map of terms and a map of relations.
Equations
- first_order.language.bounded_formula.map_term_rel ft fr h φ.all = (h n (first_order.language.bounded_formula.map_term_rel ft fr h φ)).all
- first_order.language.bounded_formula.map_term_rel ft fr h (φ₁.imp φ₂) = (first_order.language.bounded_formula.map_term_rel ft fr h φ₁).imp (first_order.language.bounded_formula.map_term_rel ft fr h φ₂)
- first_order.language.bounded_formula.map_term_rel ft fr h (first_order.language.bounded_formula.rel R ts) = first_order.language.bounded_formula.rel (fr a_41 R) (λ (i : fin a_41), ft n (ts i))
- first_order.language.bounded_formula.map_term_rel ft fr h (first_order.language.bounded_formula.equal t₁ t₂) = first_order.language.bounded_formula.equal (ft n t₁) (ft n t₂)
- first_order.language.bounded_formula.map_term_rel ft fr h first_order.language.bounded_formula.falsum = first_order.language.bounded_formula.falsum
Raises all of the fin
-indexed variables of a formula greater than or equal to m
by n'
.
Equations
- first_order.language.bounded_formula.lift_at = λ (n n' m : ℕ) (φ : L.bounded_formula α n), first_order.language.bounded_formula.map_term_rel (λ (k : ℕ) (t : L.term (α ⊕ fin k)), first_order.language.term.lift_at n' m t) (λ (_x : ℕ), id) (λ (_x : ℕ), first_order.language.bounded_formula.cast_le _) φ
An equivalence of bounded formulas given by an equivalence of terms and an equivalence of relations.
Equations
- first_order.language.bounded_formula.map_term_rel_equiv ft fr = {to_fun := first_order.language.bounded_formula.map_term_rel (λ (n : ℕ), ⇑(ft n)) (λ (n : ℕ), ⇑(fr n)) (λ (_x : ℕ), id) n, inv_fun := first_order.language.bounded_formula.map_term_rel (λ (n : ℕ), ⇑((ft n).symm)) (λ (n : ℕ), ⇑((fr n).symm)) (λ (_x : ℕ), id) n, left_inv := _, right_inv := _}
A function to help relabel the variables in bounded formulas.
Equations
- first_order.language.bounded_formula.relabel_aux g k = sum.map id ⇑fin_sum_fin_equiv ∘ ⇑(equiv.sum_assoc β (fin n) (fin k)) ∘ sum.map g id
Relabels a bounded formula's variables along a particular function.
Equations
- first_order.language.bounded_formula.relabel g φ = first_order.language.bounded_formula.map_term_rel (λ (_x : ℕ) (t : L.term (α ⊕ fin _x)), first_order.language.term.relabel (first_order.language.bounded_formula.relabel_aux g _x) t) (λ (_x : ℕ), id) (λ (_x : ℕ), first_order.language.bounded_formula.cast_le _) φ
Relabels a bounded formula's free variables along a bijection.
Equations
- first_order.language.bounded_formula.relabel_equiv g = first_order.language.bounded_formula.map_term_rel_equiv (λ (n : ℕ), first_order.language.term.relabel_equiv (g.sum_congr (equiv.refl (fin n)))) (λ (n : ℕ), equiv.refl (L.relations n))
Substitutes the variables in a given formula with terms.
A bijection sending formulas with constants to formulas with extra variables.
Equations
Turns the extra variables of a bounded formula into free variables.
Equations
- φ.all.to_formula = (first_order.language.bounded_formula.relabel (sum.elim (sum.inl ∘ sum.inl) (sum.map sum.inr id ∘ ⇑(fin_sum_fin_equiv.symm))) φ.to_formula).all
- (φ₁.imp φ₂).to_formula = first_order.language.bounded_formula.imp φ₁.to_formula φ₂.to_formula
- (first_order.language.bounded_formula.rel R ts).to_formula = R.formula ts
- (first_order.language.bounded_formula.equal t₁ t₂).to_formula = t₁.equal t₂
- first_order.language.bounded_formula.falsum.to_formula = first_order.language.bounded_formula.falsum
- equal : ∀ {L : first_order.language} {α : Type u'} {n : ℕ} (t₁ t₂ : L.term (α ⊕ fin n)), (t₁.bd_equal t₂).is_atomic
- rel : ∀ {L : first_order.language} {α : Type u'} {n l : ℕ} (R : L.relations l) (ts : fin l → L.term (α ⊕ fin n)), (R.bounded_formula ts).is_atomic
An atomic formula is either equality or a relation symbol applied to terms.
Note that ⊥
and ⊤
are not considered atomic in this convention.
- falsum : ∀ {L : first_order.language} {α : Type u'} {n : ℕ}, first_order.language.bounded_formula.falsum.is_qf
- of_is_atomic : ∀ {L : first_order.language} {α : Type u'} {n : ℕ} {φ : L.bounded_formula α n}, φ.is_atomic → φ.is_qf
- imp : ∀ {L : first_order.language} {α : Type u'} {n : ℕ} {φ₁ φ₂ : L.bounded_formula α n}, φ₁.is_qf → φ₂.is_qf → (φ₁.imp φ₂).is_qf
A quantifier-free formula is a formula defined without quantifiers. These are all equivalent to boolean combinations of atomic formulas.
- of_is_qf : ∀ {L : first_order.language} {α : Type u'} {n : ℕ} {φ : L.bounded_formula α n}, φ.is_qf → φ.is_prenex
- all : ∀ {L : first_order.language} {α : Type u'} {n : ℕ} {φ : L.bounded_formula α (n + 1)}, φ.is_prenex → φ.all.is_prenex
- ex : ∀ {L : first_order.language} {α : Type u'} {n : ℕ} {φ : L.bounded_formula α (n + 1)}, φ.is_prenex → φ.ex.is_prenex
Indicates that a bounded formula is in prenex normal form - that is, it consists of quantifiers applied to a quantifier-free formula.
An auxiliary operation to first_order.language.bounded_formula.to_prenex
.
If φ
is quantifier-free and ψ
is in prenex normal form, then φ.to_prenex_imp_right ψ
is a prenex normal form for φ.imp ψ
.
Equations
- φ.to_prenex_imp_right ψ.all = ((first_order.language.bounded_formula.lift_at 1 n φ).to_prenex_imp_right ψ).all
- φ.to_prenex_imp_right (f.all.all.imp f₂) = φ.imp (f.all.all.imp f₂)
- φ.to_prenex_imp_right ((f₁.imp f.all).all.imp f₂) = φ.imp ((f₁.imp f.all).all.imp f₂)
- φ.to_prenex_imp_right ((f₁.imp (f₁_1.imp f₂)).all.imp f₂_1) = φ.imp ((f₁.imp (f₁_1.imp f₂)).all.imp f₂_1)
- φ.to_prenex_imp_right ((f₁.imp (first_order.language.bounded_formula.rel R ts)).all.imp f₂) = φ.imp ((f₁.imp (first_order.language.bounded_formula.rel R ts)).all.imp f₂)
- φ.to_prenex_imp_right ((f₁.imp (first_order.language.bounded_formula.equal t₁ t₂)).all.imp f₂) = φ.imp ((f₁.imp (first_order.language.bounded_formula.equal t₁ t₂)).all.imp f₂)
- φ.to_prenex_imp_right ((f₁.imp first_order.language.bounded_formula.falsum).all.imp f.all) = φ.imp ((f₁.imp first_order.language.bounded_formula.falsum).all.imp f.all)
- φ.to_prenex_imp_right ((f₁.imp first_order.language.bounded_formula.falsum).all.imp (f₁_1.imp f₂)) = φ.imp ((f₁.imp first_order.language.bounded_formula.falsum).all.imp (f₁_1.imp f₂))
- φ.to_prenex_imp_right ((f₁.imp first_order.language.bounded_formula.falsum).all.imp (first_order.language.bounded_formula.rel R ts)) = φ.imp ((f₁.imp first_order.language.bounded_formula.falsum).all.imp (first_order.language.bounded_formula.rel R ts))
- φ.to_prenex_imp_right ((f₁.imp first_order.language.bounded_formula.falsum).all.imp (first_order.language.bounded_formula.equal t₁ t₂)) = φ.imp ((f₁.imp first_order.language.bounded_formula.falsum).all.imp (first_order.language.bounded_formula.equal t₁ t₂))
- φ.to_prenex_imp_right ψ.ex = ((first_order.language.bounded_formula.lift_at 1 n φ).to_prenex_imp_right ψ).ex
- φ.to_prenex_imp_right ((first_order.language.bounded_formula.rel R ts).all.imp f₂) = φ.imp ((first_order.language.bounded_formula.rel R ts).all.imp f₂)
- φ.to_prenex_imp_right ((first_order.language.bounded_formula.equal t₁ t₂).all.imp f₂) = φ.imp ((first_order.language.bounded_formula.equal t₁ t₂).all.imp f₂)
- φ.to_prenex_imp_right (first_order.language.bounded_formula.falsum.all.imp f₂) = φ.imp (first_order.language.bounded_formula.falsum.all.imp f₂)
- φ.to_prenex_imp_right ((f₁.imp f₂).imp f₂_1) = φ.imp ((f₁.imp f₂).imp f₂_1)
- φ.to_prenex_imp_right ((first_order.language.bounded_formula.rel R ts).imp f₂) = φ.imp ((first_order.language.bounded_formula.rel R ts).imp f₂)
- φ.to_prenex_imp_right ((first_order.language.bounded_formula.equal t₁ t₂).imp f₂) = φ.imp ((first_order.language.bounded_formula.equal t₁ t₂).imp f₂)
- φ.to_prenex_imp_right (first_order.language.bounded_formula.falsum.imp f₂) = φ.imp (first_order.language.bounded_formula.falsum.imp f₂)
- φ.to_prenex_imp_right (first_order.language.bounded_formula.rel R ts) = φ.imp (first_order.language.bounded_formula.rel R ts)
- φ.to_prenex_imp_right (first_order.language.bounded_formula.equal t₁ t₂) = φ.imp (first_order.language.bounded_formula.equal t₁ t₂)
- φ.to_prenex_imp_right first_order.language.bounded_formula.falsum = φ.imp first_order.language.bounded_formula.falsum
An auxiliary operation to first_order.language.bounded_formula.to_prenex
.
If φ
and ψ
are in prenex normal form, then φ.to_prenex_imp ψ
is a prenex normal form for φ.imp ψ
.
Equations
- φ.all.to_prenex_imp ψ = (φ.to_prenex_imp (first_order.language.bounded_formula.lift_at 1 n ψ)).ex
- (f.all.all.imp f₂).to_prenex_imp ψ = (f.all.all.imp f₂).to_prenex_imp_right ψ
- ((f₁.imp f.all).all.imp f₂).to_prenex_imp ψ = ((f₁.imp f.all).all.imp f₂).to_prenex_imp_right ψ
- ((f₁.imp (f₁_1.imp f₂)).all.imp f₂_1).to_prenex_imp ψ = ((f₁.imp (f₁_1.imp f₂)).all.imp f₂_1).to_prenex_imp_right ψ
- ((f₁.imp (first_order.language.bounded_formula.rel R ts)).all.imp f₂).to_prenex_imp ψ = ((f₁.imp (first_order.language.bounded_formula.rel R ts)).all.imp f₂).to_prenex_imp_right ψ
- ((f₁.imp (first_order.language.bounded_formula.equal t₁ t₂)).all.imp f₂).to_prenex_imp ψ = ((f₁.imp (first_order.language.bounded_formula.equal t₁ t₂)).all.imp f₂).to_prenex_imp_right ψ
- ((f₁.imp first_order.language.bounded_formula.falsum).all.imp f.all).to_prenex_imp ψ = ((f₁.imp first_order.language.bounded_formula.falsum).all.imp f.all).to_prenex_imp_right ψ
- ((f₁.imp first_order.language.bounded_formula.falsum).all.imp (f₁_1.imp f₂)).to_prenex_imp ψ = ((f₁.imp first_order.language.bounded_formula.falsum).all.imp (f₁_1.imp f₂)).to_prenex_imp_right ψ
- ((f₁.imp first_order.language.bounded_formula.falsum).all.imp (first_order.language.bounded_formula.rel R ts)).to_prenex_imp ψ = ((f₁.imp first_order.language.bounded_formula.falsum).all.imp (first_order.language.bounded_formula.rel R ts)).to_prenex_imp_right ψ
- ((f₁.imp first_order.language.bounded_formula.falsum).all.imp (first_order.language.bounded_formula.equal t₁ t₂)).to_prenex_imp ψ = ((f₁.imp first_order.language.bounded_formula.falsum).all.imp (first_order.language.bounded_formula.equal t₁ t₂)).to_prenex_imp_right ψ
- φ.ex.to_prenex_imp ψ = (φ.to_prenex_imp (first_order.language.bounded_formula.lift_at 1 n ψ)).all
- ((first_order.language.bounded_formula.rel R ts).all.imp f₂).to_prenex_imp ψ = ((first_order.language.bounded_formula.rel R ts).all.imp f₂).to_prenex_imp_right ψ
- ((first_order.language.bounded_formula.equal t₁ t₂).all.imp f₂).to_prenex_imp ψ = ((first_order.language.bounded_formula.equal t₁ t₂).all.imp f₂).to_prenex_imp_right ψ
- (first_order.language.bounded_formula.falsum.all.imp f₂).to_prenex_imp ψ = (first_order.language.bounded_formula.falsum.all.imp f₂).to_prenex_imp_right ψ
- ((f₁.imp f₂).imp f₂_1).to_prenex_imp ψ = ((f₁.imp f₂).imp f₂_1).to_prenex_imp_right ψ
- ((first_order.language.bounded_formula.rel R ts).imp f₂).to_prenex_imp ψ = ((first_order.language.bounded_formula.rel R ts).imp f₂).to_prenex_imp_right ψ
- ((first_order.language.bounded_formula.equal t₁ t₂).imp f₂).to_prenex_imp ψ = ((first_order.language.bounded_formula.equal t₁ t₂).imp f₂).to_prenex_imp_right ψ
- (first_order.language.bounded_formula.falsum.imp f₂).to_prenex_imp ψ = (first_order.language.bounded_formula.falsum.imp f₂).to_prenex_imp_right ψ
- (first_order.language.bounded_formula.rel R ts).to_prenex_imp ψ = (first_order.language.bounded_formula.rel R ts).to_prenex_imp_right ψ
- (first_order.language.bounded_formula.equal t₁ t₂).to_prenex_imp ψ = (first_order.language.bounded_formula.equal t₁ t₂).to_prenex_imp_right ψ
- first_order.language.bounded_formula.falsum.to_prenex_imp ψ = first_order.language.bounded_formula.falsum.to_prenex_imp_right ψ
For any bounded formula φ
, φ.to_prenex
is a semantically-equivalent formula in prenex normal
form.
Equations
- f.all.to_prenex = f.to_prenex.all
- (f₁.imp f₂).to_prenex = f₁.to_prenex.to_prenex_imp f₂.to_prenex
- (first_order.language.bounded_formula.rel R ts).to_prenex = first_order.language.bounded_formula.rel R ts
- (first_order.language.bounded_formula.equal t₁ t₂).to_prenex = t₁.bd_equal t₂
- first_order.language.bounded_formula.falsum.to_prenex = ⊥
Maps a bounded formula's symbols along a language map.
Equations
- g.on_bounded_formula f.all = (g.on_bounded_formula f).all
- g.on_bounded_formula (f₁.imp f₂) = (g.on_bounded_formula f₁).imp (g.on_bounded_formula f₂)
- g.on_bounded_formula (first_order.language.bounded_formula.rel R ts) = (g.on_relation R).bounded_formula (g.on_term ∘ ts)
- g.on_bounded_formula (first_order.language.bounded_formula.equal t₁ t₂) = (g.on_term t₁).bd_equal (g.on_term t₂)
- g.on_bounded_formula first_order.language.bounded_formula.falsum = first_order.language.bounded_formula.falsum
Maps a formula's symbols along a language map.
Equations
Maps a sentence's symbols along a language map.
Equations
- g.on_sentence = g.on_formula
Maps a theory's symbols along a language map.
Equations
- g.on_Theory T = g.on_sentence '' T
Maps a bounded formula's symbols along a language equivalence.
Equations
- φ.on_bounded_formula = {to_fun := φ.to_Lhom.on_bounded_formula n, inv_fun := φ.inv_Lhom.on_bounded_formula n, left_inv := _, right_inv := _}
Maps a formula's symbols along a language equivalence.
Equations
Maps a sentence's symbols along a language equivalence.
Equations
- φ.on_sentence = φ.on_formula
Relabels a formula's variables along a particular function.
The graph of a function as a first-order formula.
Equations
The negation of a formula.
Equations
The implication between formulas, as a formula.
The biimplication between formulas, as a formula.
Equations
A bijection sending formulas to sentences with constants.
The sentence indicating that a basic relation symbol is reflexive.
Equations
- r.reflexive = (r.bounded_formula₂ ((first_order.language.term.var ∘ sum.inr) 0) ((first_order.language.term.var ∘ sum.inr) 0)).all
The sentence indicating that a basic relation symbol is irreflexive.
Equations
- r.irreflexive = (r.bounded_formula₂ ((first_order.language.term.var ∘ sum.inr) 0) ((first_order.language.term.var ∘ sum.inr) 0)).not.all
The sentence indicating that a basic relation symbol is symmetric.
Equations
- r.symmetric = ((r.bounded_formula₂ ((first_order.language.term.var ∘ sum.inr) 0) ((first_order.language.term.var ∘ sum.inr) 1)).imp (r.bounded_formula₂ ((first_order.language.term.var ∘ sum.inr) 1) ((first_order.language.term.var ∘ sum.inr) 0))).all.all
The sentence indicating that a basic relation symbol is antisymmetric.
Equations
- r.antisymmetric = ((r.bounded_formula₂ ((first_order.language.term.var ∘ sum.inr) 0) ((first_order.language.term.var ∘ sum.inr) 1)).imp ((r.bounded_formula₂ ((first_order.language.term.var ∘ sum.inr) 1) ((first_order.language.term.var ∘ sum.inr) 0)).imp (((first_order.language.term.var ∘ sum.inr) 0).bd_equal ((first_order.language.term.var ∘ sum.inr) 1)))).all.all
The sentence indicating that a basic relation symbol is transitive.
Equations
- r.transitive = ((r.bounded_formula₂ ((first_order.language.term.var ∘ sum.inr) 0) ((first_order.language.term.var ∘ sum.inr) 1)).imp ((r.bounded_formula₂ ((first_order.language.term.var ∘ sum.inr) 1) ((first_order.language.term.var ∘ sum.inr) 2)).imp (r.bounded_formula₂ ((first_order.language.term.var ∘ sum.inr) 0) ((first_order.language.term.var ∘ sum.inr) 2)))).all.all.all
The sentence indicating that a basic relation symbol is total.
Equations
- r.total = (r.bounded_formula₂ ((first_order.language.term.var ∘ sum.inr) 0) ((first_order.language.term.var ∘ sum.inr) 1) ⊔ r.bounded_formula₂ ((first_order.language.term.var ∘ sum.inr) 1) ((first_order.language.term.var ∘ sum.inr) 0)).all.all
A sentence indicating that a structure has n
distinct elements.
Equations
- first_order.language.sentence.card_ge L n = (list.foldr has_inf.inf ⊤ (list.map (λ (ij : fin n × fin n), (((first_order.language.term.var ∘ sum.inr) ij.fst).bd_equal ((first_order.language.term.var ∘ sum.inr) ij.snd)).not) (list.filter (λ (ij : fin n × fin n), ij.fst ≠ ij.snd) (list.fin_range n ×ˢ list.fin_range n)))).exs
A theory indicating that a structure is infinite.
Equations
Instances for first_order.language.infinite_theory
A theory that indicates a structure is nonempty.
Equations
Instances for first_order.language.nonempty_theory
A theory indicating that each of a set of constants is distinct.