fact
stringlengths
6
3.84k
type
stringclasses
11 values
library
stringclasses
32 values
imports
listlengths
1
14
filename
stringlengths
20
95
symbolic_name
stringlengths
1
90
docstring
stringlengths
7
20k
inhabitedOfVar [Inhabited α] : Inhabited (L.Term α) := ⟨var default⟩
instance
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
inhabitedOfVar
null
inhabitedOfConstant [Inhabited L.Constants] : Inhabited (L.Term α) := ⟨(default : L.Constants).term⟩
instance
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
inhabitedOfConstant
null
liftAt {n : ℕ} (n' m : ℕ) : L.Term (α ⊕ (Fin n)) → L.Term (α ⊕ (Fin (n + n'))) := relabel (Sum.map id fun i => if ↑i < m then Fin.castAdd n' i else Fin.addNat i n')
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
liftAt
Raises all of the `Fin`-indexed variables of a term greater than or equal to `m` by `n'`.
@[simp] subst : L.Term α → (α → L.Term β) → L.Term β | var a, tf => tf a | func f ts, tf => func f fun i => (ts i).subst tf
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
subst
Substitutes the variables in a given term with terms.
@[simp] substFunc : L.Term α → (∀ {n : ℕ}, L.Functions n → L'.Term (Fin n)) → L'.Term α | var a, _ => var a | func f ts, tf => (tf f).subst fun i ↦ (ts i).substFunc tf @[simp]
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
substFunc
Substitutes the functions in a given term with expressions.
substFunc_term (t : L.Term α) : t.substFunc Functions.term = t := by induction t · rfl · simp only [substFunc, Functions.term, subst, ‹∀ _, _›]
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
substFunc_term
null
@[simp] onTerm (φ : L →ᴸ L') : L.Term α → L'.Term α | var i => var i | func f ts => func (φ.onFunction f) fun i => onTerm φ (ts i) @[simp]
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
onTerm
`&n` is notation for the bound variable indexed by `n` in a bounded formula. -/ scoped[FirstOrder] prefix:arg "&" => FirstOrder.Language.Term.var ∘ Sum.inr namespace LHom open Term /-- Maps a term's symbols along a language map.
id_onTerm : ((LHom.id L).onTerm : L.Term α → L.Term α) = id := by ext t induction t with | var => rfl | func _ _ ih => simp_rw [onTerm, ih]; rfl @[simp]
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
id_onTerm
null
comp_onTerm {L'' : Language} (φ : L' →ᴸ L'') (ψ : L →ᴸ L') : ((φ.comp ψ).onTerm : L.Term α → L''.Term α) = φ.onTerm ∘ ψ.onTerm := by ext t induction t with | var => rfl | func _ _ ih => simp_rw [onTerm, ih]; rfl
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
comp_onTerm
null
@[simps] LEquiv.onTerm (φ : L ≃ᴸ L') : L.Term α ≃ L'.Term α where toFun := φ.toLHom.onTerm invFun := φ.invLHom.onTerm left_inv := by rw [Function.leftInverse_iff_comp, ← LHom.comp_onTerm, φ.left_inv, LHom.id_onTerm] right_inv := by rw [Function.rightInverse_iff_comp, ← LHom.comp_onTerm, φ.right_inv, LHo...
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
LEquiv.onTerm
Maps a term's symbols along a language equivalence.
BoundedFormula : ℕ → Type max u v u' | falsum {n} : BoundedFormula n | equal {n} (t₁ t₂ : L.Term (α ⊕ (Fin n))) : BoundedFormula n | rel {n l : ℕ} (R : L.Relations l) (ts : Fin l → L.Term (α ⊕ (Fin n))) : BoundedFormula n /-- The implication between two bounded formulas. -/ | imp {n} (f₁ f₂ : BoundedFormula n...
inductive
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
BoundedFormula
Maps a term's symbols along a language equivalence. Deprecated in favor of `LEquiv.onTerm`. -/ @[deprecated LEquiv.onTerm (since := "2025-03-31")] alias Lequiv.onTerm := LEquiv.onTerm variable (L) (α) /-- `BoundedFormula α n` is the type of formulas with free variables indexed by `α` and `n` in-scope bound variables ...
Formula := L.BoundedFormula α 0
abbrev
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
Formula
`Formula α` is the type of formulas with free variables indexed by `α` and no bound variables in scope.
Sentence := L.Formula Empty
abbrev
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
Sentence
A sentence is a formula with no free variables.
Theory := Set L.Sentence variable {L} {α} {n : ℕ}
abbrev
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
Theory
A theory is a set of sentences.
Relations.boundedFormula {l : ℕ} (R : L.Relations n) (ts : Fin n → L.Term (α ⊕ (Fin l))) : L.BoundedFormula α l := BoundedFormula.rel R ts
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
Relations.boundedFormula
Applies a relation to terms as a bounded formula.
Relations.boundedFormula₁ (r : L.Relations 1) (t : L.Term (α ⊕ (Fin n))) : L.BoundedFormula α n := r.boundedFormula ![t]
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
Relations.boundedFormula₁
Applies a unary relation to a term as a bounded formula.
Relations.boundedFormula₂ (r : L.Relations 2) (t₁ t₂ : L.Term (α ⊕ (Fin n))) : L.BoundedFormula α n := r.boundedFormula ![t₁, t₂]
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
Relations.boundedFormula₂
Applies a binary relation to two terms as a bounded formula.
Term.bdEqual (t₁ t₂ : L.Term (α ⊕ (Fin n))) : L.BoundedFormula α n := BoundedFormula.equal t₁ t₂
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
Term.bdEqual
The equality of two terms as a bounded formula.
Relations.formula (R : L.Relations n) (ts : Fin n → L.Term α) : L.Formula α := R.boundedFormula fun i => (ts i).relabel Sum.inl
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
Relations.formula
Applies a relation to terms as a formula.
Relations.formula₁ (r : L.Relations 1) (t : L.Term α) : L.Formula α := r.formula ![t]
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
Relations.formula₁
Applies a unary relation to a term as a formula.
Relations.formula₂ (r : L.Relations 2) (t₁ t₂ : L.Term α) : L.Formula α := r.formula ![t₁, t₂]
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
Relations.formula₂
Applies a binary relation to two terms as a formula.
Term.equal (t₁ t₂ : L.Term α) : L.Formula α := (t₁.relabel Sum.inl).bdEqual (t₂.relabel Sum.inl)
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
Term.equal
The equality of two terms as a first-order formula.
@[match_pattern] protected not (φ : L.BoundedFormula α n) : L.BoundedFormula α n := φ.imp ⊥
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
not
The negation of a bounded formula is also a bounded formula.
@[match_pattern] protected ex (φ : L.BoundedFormula α (n + 1)) : L.BoundedFormula α n := φ.not.all.not
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
ex
Puts an `∃` quantifier on a bounded formula.
protected iff (φ ψ : L.BoundedFormula α n) := φ.imp ψ ⊓ ψ.imp φ open Finset
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
iff
The biimplication between two bounded formulas.
@[simp] freeVarFinset [DecidableEq α] : ∀ {n}, L.BoundedFormula α n → Finset α | _n, falsum => ∅ | _n, equal t₁ t₂ => t₁.varFinsetLeft ∪ t₂.varFinsetLeft | _n, rel _R ts => univ.biUnion fun i => (ts i).varFinsetLeft | _n, imp f₁ f₂ => f₁.freeVarFinset ∪ f₂.freeVarFinset | _n, all f => f.freeVarFinset
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
freeVarFinset
The `Finset` of free variables used in a given formula.
@[simp] castLE : ∀ {m n : ℕ} (_h : m ≤ n), L.BoundedFormula α m → L.BoundedFormula α n | _m, _n, _h, falsum => falsum | _m, _n, h, equal t₁ t₂ => equal (t₁.relabel (Sum.map id (Fin.castLE h))) (t₂.relabel (Sum.map id (Fin.castLE h))) | _m, _n, h, rel R ts => rel R (Term.relabel (Sum.map id (Fin.castLE h)) ∘ t...
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
castLE
Casts `L.BoundedFormula α m` as `L.BoundedFormula α n`, where `m ≤ n`.
castLE_rfl {n} (h : n ≤ n) (φ : L.BoundedFormula α n) : φ.castLE h = φ := by induction φ with | falsum => rfl | equal => simp | rel => simp | imp _ _ ih1 ih2 => simp [ih1, ih2] | all _ ih3 => simp [ih3] @[simp]
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
castLE_rfl
null
castLE_castLE {k m n} (km : k ≤ m) (mn : m ≤ n) (φ : L.BoundedFormula α k) : (φ.castLE km).castLE mn = φ.castLE (km.trans mn) := by revert m n induction φ with | falsum => intros; rfl | equal => simp | rel => intros simp only [castLE] rw [← Function.comp_assoc, Term.relabel_comp_relabel] s...
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
castLE_castLE
null
castLE_comp_castLE {k m n} (km : k ≤ m) (mn : m ≤ n) : (BoundedFormula.castLE mn ∘ BoundedFormula.castLE km : L.BoundedFormula α k → L.BoundedFormula α n) = BoundedFormula.castLE (km.trans mn) := funext (castLE_castLE km mn)
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
castLE_comp_castLE
null
restrictFreeVar [DecidableEq α] : ∀ {n : ℕ} (φ : L.BoundedFormula α n) (_f : φ.freeVarFinset → β), L.BoundedFormula β n | _n, falsum, _f => falsum | _n, equal t₁ t₂, f => equal (t₁.restrictVarLeft (f ∘ Set.inclusion subset_union_left)) (t₂.restrictVarLeft (f ∘ Set.inclusion subset_union_right)) | _n...
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
restrictFreeVar
Restricts a bounded formula to only use a particular set of free variables.
alls : ∀ {n}, L.BoundedFormula α n → L.Formula α | 0, φ => φ | _n + 1, φ => φ.all.alls
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
alls
Places universal quantifiers on all in-scope bound variables of a bounded formula.
exs : ∀ {n}, L.BoundedFormula α n → L.Formula α | 0, φ => φ | _n + 1, φ => φ.ex.exs
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
exs
Places existential quantifiers on all in-scope bound variables of a bounded formula.
mapTermRel {g : ℕ → ℕ} (ft : ∀ n, L.Term (α ⊕ (Fin n)) → L'.Term (β ⊕ (Fin (g n)))) (fr : ∀ n, L.Relations n → L'.Relations n) (h : ∀ n, L'.BoundedFormula β (g (n + 1)) → L'.BoundedFormula β (g n + 1)) : ∀ {n}, L.BoundedFormula α n → L'.BoundedFormula β (g n) | _n, falsum => falsum | _n, equal t₁ t₂ => ...
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
mapTermRel
Maps bounded formulas along a map of terms and a map of relations.
liftAt : ∀ {n : ℕ} (n' _m : ℕ), L.BoundedFormula α n → L.BoundedFormula α (n + n') := fun {_} n' m φ => φ.mapTermRel (fun _ t => t.liftAt n' m) (fun _ => id) fun _ => castLE (by rw [add_assoc, add_comm 1, add_assoc]) @[simp]
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
liftAt
Raises all of the bound variables of a formula greater than or equal to `m` by `n'`.
mapTermRel_mapTermRel {L'' : Language} (ft : ∀ n, L.Term (α ⊕ (Fin n)) → L'.Term (β ⊕ (Fin n))) (fr : ∀ n, L.Relations n → L'.Relations n) (ft' : ∀ n, L'.Term (β ⊕ Fin n) → L''.Term (γ ⊕ (Fin n))) (fr' : ∀ n, L'.Relations n → L''.Relations n) {n} (φ : L.BoundedFormula α n) : ((φ.mapTermRel ft fr fun...
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
mapTermRel_mapTermRel
null
mapTermRel_id_id_id {n} (φ : L.BoundedFormula α n) : (φ.mapTermRel (fun _ => id) (fun _ => id) fun _ => id) = φ := by induction φ with | falsum => rfl | equal => simp [mapTermRel] | rel => simp [mapTermRel] | imp _ _ ih1 ih2 => simp [mapTermRel, ih1, ih2] | all _ ih3 => simp [mapTermRel, ih3]
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
mapTermRel_id_id_id
null
@[simps] mapTermRelEquiv (ft : ∀ n, L.Term (α ⊕ (Fin n)) ≃ L'.Term (β ⊕ (Fin n))) (fr : ∀ n, L.Relations n ≃ L'.Relations n) {n} : L.BoundedFormula α n ≃ L'.BoundedFormula β n := ⟨mapTermRel (fun n => ft n) (fun n => fr n) fun _ => id, mapTermRel (fun n => (ft n).symm) (fun n => (fr n).symm) fun _ => id, fun ...
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
mapTermRelEquiv
An equivalence of bounded formulas given by an equivalence of terms and an equivalence of relations.
relabelAux (g : α → β ⊕ (Fin n)) (k : ℕ) : α ⊕ (Fin k) → β ⊕ (Fin (n + k)) := Sum.map id finSumFinEquiv ∘ Equiv.sumAssoc _ _ _ ∘ Sum.map g id @[simp]
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
relabelAux
A function to help relabel the variables in bounded formulas.
sumElim_comp_relabelAux {m : ℕ} {g : α → β ⊕ (Fin n)} {v : β → M} {xs : Fin (n + m) → M} : Sum.elim v xs ∘ relabelAux g m = Sum.elim (Sum.elim v (xs ∘ castAdd m) ∘ g) (xs ∘ natAdd n) := by ext x rcases x with x | x · simp only [BoundedFormula.relabelAux, Function.comp_apply, Sum.map_inl, Sum.elim_inl] ...
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
sumElim_comp_relabelAux
null
relabelAux_sumInl (k : ℕ) : relabelAux (Sum.inl : α → α ⊕ (Fin n)) k = Sum.map id (natAdd n) := by ext x cases x <;> · simp [relabelAux]
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
relabelAux_sumInl
null
relabel (g : α → β ⊕ (Fin n)) {k} (φ : L.BoundedFormula α k) : L.BoundedFormula β (n + k) := φ.mapTermRel (fun _ t => t.relabel (relabelAux g _)) (fun _ => id) fun _ => castLE (ge_of_eq (add_assoc _ _ _))
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
relabel
Relabels a bounded formula's variables along a particular function.
relabelEquiv (g : α ≃ β) {k} : L.BoundedFormula α k ≃ L.BoundedFormula β k := mapTermRelEquiv (fun _n => Term.relabelEquiv (g.sumCongr (_root_.Equiv.refl _))) fun _n => _root_.Equiv.refl _ @[simp]
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
relabelEquiv
Relabels a bounded formula's free variables along a bijection.
relabel_falsum (g : α → β ⊕ (Fin n)) {k} : (falsum : L.BoundedFormula α k).relabel g = falsum := rfl @[simp]
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
relabel_falsum
null
relabel_bot (g : α → β ⊕ (Fin n)) {k} : (⊥ : L.BoundedFormula α k).relabel g = ⊥ := rfl @[simp]
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
relabel_bot
null
relabel_imp (g : α → β ⊕ (Fin n)) {k} (φ ψ : L.BoundedFormula α k) : (φ.imp ψ).relabel g = (φ.relabel g).imp (ψ.relabel g) := rfl @[simp]
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
relabel_imp
null
relabel_not (g : α → β ⊕ (Fin n)) {k} (φ : L.BoundedFormula α k) : φ.not.relabel g = (φ.relabel g).not := by simp [BoundedFormula.not] @[simp]
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
relabel_not
null
relabel_all (g : α → β ⊕ (Fin n)) {k} (φ : L.BoundedFormula α (k + 1)) : φ.all.relabel g = (φ.relabel g).all := by rw [relabel, mapTermRel, relabel] simp @[simp]
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
relabel_all
null
relabel_ex (g : α → β ⊕ (Fin n)) {k} (φ : L.BoundedFormula α (k + 1)) : φ.ex.relabel g = (φ.relabel g).ex := by simp [BoundedFormula.ex] @[simp]
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
relabel_ex
null
relabel_sumInl (φ : L.BoundedFormula α n) : (φ.relabel Sum.inl : L.BoundedFormula α (0 + n)) = φ.castLE (ge_of_eq (zero_add n)) := by simp only [relabel, relabelAux_sumInl] induction φ with | falsum => rfl | equal => simp [Fin.natAdd_zero, castLE_of_eq, mapTermRel] | rel => simp [Fin.natAdd_zero, castLE_o...
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
relabel_sumInl
null
subst {n : ℕ} (φ : L.BoundedFormula α n) (f : α → L.Term β) : L.BoundedFormula β n := φ.mapTermRel (fun _ t => t.subst (Sum.elim (Term.relabel Sum.inl ∘ f) (var ∘ Sum.inr))) (fun _ => id) fun _ => id
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
subst
Substitutes the free variables in a bounded formula with terms, leaving bound variables unchanged.
constantsVarsEquiv : L[[γ]].BoundedFormula α n ≃ L.BoundedFormula (γ ⊕ α) n := mapTermRelEquiv (fun _ => Term.constantsVarsEquivLeft) fun _ => Equiv.sumEmpty _ _
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
constantsVarsEquiv
A bijection sending formulas with constants to formulas with extra free variables.
@[simp] toFormula : ∀ {n : ℕ}, L.BoundedFormula α n → L.Formula (α ⊕ (Fin n)) | _n, falsum => falsum | _n, equal t₁ t₂ => t₁.equal t₂ | _n, rel R ts => R.formula ts | _n, imp φ₁ φ₂ => φ₁.toFormula.imp φ₂.toFormula | _n, all φ => (φ.toFormula.relabel (Sum.elim (Sum.inl ∘ Sum.inl) (Sum.map Sum.inr i...
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
toFormula
Turns all the in-scope bound variables into free variables.
noncomputable iSup [Finite β] (f : β → L.BoundedFormula α n) : L.BoundedFormula α n := let _ := Fintype.ofFinite β ((Finset.univ : Finset β).toList.map f).foldr (· ⊔ ·) ⊥
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
iSup
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.
noncomputable iInf [Finite β] (f : β → L.BoundedFormula α n) : L.BoundedFormula α n := let _ := Fintype.ofFinite β ((Finset.univ : Finset β).toList.map f).foldr (· ⊓ ·) ⊤
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
iInf
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.
@[simp] onBoundedFormula (g : L →ᴸ L') : ∀ {k : ℕ}, L.BoundedFormula α k → L'.BoundedFormula α k | _k, falsum => falsum | _k, equal t₁ t₂ => (g.onTerm t₁).bdEqual (g.onTerm t₂) | _k, rel R ts => (g.onRelation R).boundedFormula (g.onTerm ∘ ts) | _k, imp f₁ f₂ => (onBoundedFormula g f₁).imp (onBoundedFormula g f₂...
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
onBoundedFormula
Maps a bounded formula's symbols along a language map.
id_onBoundedFormula : ((LHom.id L).onBoundedFormula : L.BoundedFormula α n → L.BoundedFormula α n) = id := by ext f induction f with | falsum => rfl | equal => rw [onBoundedFormula, LHom.id_onTerm, id, id, id, Term.bdEqual] | rel => rw [onBoundedFormula, LHom.id_onTerm]; rfl | imp _ _ ih1 ih2 => rw [onB...
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
id_onBoundedFormula
null
comp_onBoundedFormula {L'' : Language} (φ : L' →ᴸ L'') (ψ : L →ᴸ L') : ((φ.comp ψ).onBoundedFormula : L.BoundedFormula α n → L''.BoundedFormula α n) = φ.onBoundedFormula ∘ ψ.onBoundedFormula := by ext f induction f with | falsum => rfl | equal => simp [Term.bdEqual] | rel => simp only [onBoundedForm...
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
comp_onBoundedFormula
null
onFormula (g : L →ᴸ L') : L.Formula α → L'.Formula α := g.onBoundedFormula
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
onFormula
Maps a formula's symbols along a language map.
onSentence (g : L →ᴸ L') : L.Sentence → L'.Sentence := g.onFormula
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
onSentence
Maps a sentence's symbols along a language map.
onTheory (g : L →ᴸ L') (T : L.Theory) : L'.Theory := g.onSentence '' T @[simp]
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
onTheory
Maps a theory's symbols along a language map.
mem_onTheory {g : L →ᴸ L'} {T : L.Theory} {φ : L'.Sentence} : φ ∈ g.onTheory T ↔ ∃ φ₀, φ₀ ∈ T ∧ g.onSentence φ₀ = φ := Set.mem_image _ _ _
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
mem_onTheory
null
@[simps] onBoundedFormula (φ : L ≃ᴸ L') : L.BoundedFormula α n ≃ L'.BoundedFormula α n where toFun := φ.toLHom.onBoundedFormula invFun := φ.invLHom.onBoundedFormula left_inv := by rw [Function.leftInverse_iff_comp, ← LHom.comp_onBoundedFormula, φ.left_inv, LHom.id_onBoundedFormula] right_inv := by ...
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
onBoundedFormula
Maps a bounded formula's symbols along a language equivalence.
onBoundedFormula_symm (φ : L ≃ᴸ L') : (φ.onBoundedFormula.symm : L'.BoundedFormula α n ≃ L.BoundedFormula α n) = φ.symm.onBoundedFormula := rfl
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
onBoundedFormula_symm
null
onFormula (φ : L ≃ᴸ L') : L.Formula α ≃ L'.Formula α := φ.onBoundedFormula @[simp]
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
onFormula
Maps a formula's symbols along a language equivalence.
onFormula_apply (φ : L ≃ᴸ L') : (φ.onFormula : L.Formula α → L'.Formula α) = φ.toLHom.onFormula := rfl @[simp]
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
onFormula_apply
null
onFormula_symm (φ : L ≃ᴸ L') : (φ.onFormula.symm : L'.Formula α ≃ L.Formula α) = φ.symm.onFormula := rfl
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
onFormula_symm
null
@[simps!] onSentence (φ : L ≃ᴸ L') : L.Sentence ≃ L'.Sentence := φ.onFormula
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
onSentence
Maps a sentence's symbols along a language equivalence.
relabel (g : α → β) : L.Formula α → L.Formula β := @BoundedFormula.relabel _ _ _ 0 (Sum.inl ∘ g) 0
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
relabel
Relabels a formula's variables along a particular function.
graph (f : L.Functions n) : L.Formula (Fin (n + 1)) := Term.equal (var 0) (func f fun i => var i.succ)
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
graph
The graph of a function as a first-order formula.
protected imp : L.Formula α → L.Formula α → L.Formula α := BoundedFormula.imp variable (β) in
abbrev
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
imp
The negation of a formula. -/ protected nonrec abbrev not (φ : L.Formula α) : L.Formula α := φ.not /-- The implication between formulas, as a formula.
noncomputable iAlls [Finite β] (φ : L.Formula (α ⊕ β)) : L.Formula α := let e := Classical.choice (Classical.choose_spec (Finite.exists_equiv_fin β)) (BoundedFormula.relabel (fun a => Sum.map id e a) φ).alls variable (β) in
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
iAlls
`iAlls f φ` transforms a `L.Formula (α ⊕ β)` into a `L.Formula α` by universally quantifying over all variables `Sum.inr _`.
noncomputable iExs [Finite β] (φ : L.Formula (α ⊕ β)) : L.Formula α := let e := Classical.choice (Classical.choose_spec (Finite.exists_equiv_fin β)) (BoundedFormula.relabel (fun a => Sum.map id e a) φ).exs variable (β) in
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
iExs
`iExs f φ` transforms a `L.Formula (α ⊕ β)` into a `L.Formula α` by existentially quantifying over all variables `Sum.inr _`.
noncomputable iExsUnique [Finite β] (φ : L.Formula (α ⊕ β)) : L.Formula α := iExs β <| φ ⊓ iAlls β ((φ.relabel (fun a => Sum.elim (.inl ∘ .inl) .inr a)).imp <| .iInf fun g => Term.equal (var (.inr g)) (var (.inl (.inr g))))
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
iExsUnique
`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
noncomputable iSup [Finite α] (f : α → L.Formula β) : L.Formula β := BoundedFormula.iSup f
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
iSup
The biimplication between formulas, as a formula. -/ protected nonrec abbrev iff (φ ψ : L.Formula α) : L.Formula α := φ.iff ψ /-- 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.
noncomputable iInf [Finite α] (f : α → L.Formula β) : L.Formula β := BoundedFormula.iInf f
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
iInf
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.
equivSentence : L.Formula α ≃ L[[α]].Sentence := (BoundedFormula.constantsVarsEquiv.trans (BoundedFormula.relabelEquiv (Equiv.sumEmpty _ _))).symm
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
equivSentence
A bijection sending formulas to sentences with constants.
equivSentence_not (φ : L.Formula α) : equivSentence φ.not = (equivSentence φ).not := rfl
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
equivSentence_not
null
equivSentence_inf (φ ψ : L.Formula α) : equivSentence (φ ⊓ ψ) = equivSentence φ ⊓ equivSentence ψ := rfl
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
equivSentence_inf
null
protected reflexive : L.Sentence := ∀'r.boundedFormula₂ (&0) &0
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
reflexive
The sentence indicating that a basic relation symbol is reflexive.
protected irreflexive : L.Sentence := ∀'∼(r.boundedFormula₂ (&0) &0)
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
irreflexive
The sentence indicating that a basic relation symbol is irreflexive.
protected symmetric : L.Sentence := ∀'∀'(r.boundedFormula₂ (&0) &1 ⟹ r.boundedFormula₂ (&1) &0)
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
symmetric
The sentence indicating that a basic relation symbol is symmetric.
protected antisymmetric : L.Sentence := ∀'∀'(r.boundedFormula₂ (&0) &1 ⟹ r.boundedFormula₂ (&1) &0 ⟹ Term.bdEqual (&0) &1)
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
antisymmetric
The sentence indicating that a basic relation symbol is antisymmetric.
protected transitive : L.Sentence := ∀'∀'∀'(r.boundedFormula₂ (&0) &1 ⟹ r.boundedFormula₂ (&1) &2 ⟹ r.boundedFormula₂ (&0) &2)
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
transitive
The sentence indicating that a basic relation symbol is transitive.
protected total : L.Sentence := ∀'∀'(r.boundedFormula₂ (&0) &1 ⊔ r.boundedFormula₂ (&1) &0)
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
total
The sentence indicating that a basic relation symbol is total.
protected Sentence.cardGe (n : ℕ) : L.Sentence := ((((List.finRange n ×ˢ List.finRange n).filter fun ij : _ × _ => ij.1 ≠ ij.2).map fun ij : _ × _ => ∼((&ij.1).bdEqual &ij.2)).foldr (· ⊓ ·) ⊤).exs
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
Sentence.cardGe
A sentence indicating that a structure has `n` distinct elements.
infiniteTheory : L.Theory := Set.range (Sentence.cardGe L)
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
infiniteTheory
A theory indicating that a structure is infinite.
nonemptyTheory : L.Theory := {Sentence.cardGe L 1}
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
nonemptyTheory
A theory that indicates a structure is nonempty.
distinctConstantsTheory (s : Set α) : L[[α]].Theory := (fun ab : α × α => ((L.con ab.1).term.equal (L.con ab.2).term).not) '' (s ×ˢ s ∩ (Set.diagonal α)ᶜ) variable {L} open Set
def
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
distinctConstantsTheory
A theory indicating that each of a set of constants is distinct.
distinctConstantsTheory_mono {s t : Set α} (h : s ⊆ t) : L.distinctConstantsTheory s ⊆ L.distinctConstantsTheory t := by unfold distinctConstantsTheory; gcongr
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
distinctConstantsTheory_mono
null
monotone_distinctConstantsTheory : Monotone (L.distinctConstantsTheory : Set α → L[[α]].Theory) := fun _s _t st => L.distinctConstantsTheory_mono st
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
monotone_distinctConstantsTheory
null
directed_distinctConstantsTheory : Directed (· ⊆ ·) (L.distinctConstantsTheory : Set α → L[[α]].Theory) := Monotone.directed_le monotone_distinctConstantsTheory
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
directed_distinctConstantsTheory
null
distinctConstantsTheory_eq_iUnion (s : Set α) : L.distinctConstantsTheory s = ⋃ t : Finset s, L.distinctConstantsTheory (t.map (Function.Embedding.subtype fun x => x ∈ s)) := by classical simp only [distinctConstantsTheory] rw [← image_iUnion, ← iUnion_inter] refine congr(_ '' ($(?_) ∩ _...
theorem
ModelTheory
[ "Mathlib.Data.Set.Prod", "Mathlib.Logic.Equiv.Fin.Basic", "Mathlib.ModelTheory.LanguageMap", "Mathlib.Algebra.Order.Group.Nat" ]
Mathlib/ModelTheory/Syntax.lean
distinctConstantsTheory_eq_iUnion
null
CompleteType where /-- The underlying theory -/ toTheory : L[[α]].Theory subset' : (L.lhomWithConstants α).onTheory T ⊆ toTheory isMaximal' : toTheory.IsMaximal variable {T α}
structure
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Types.lean
CompleteType
A complete type over a given theory in a certain type of variables is a maximally consistent (with the theory) set of formulas in that type.
Sentence.instSetLike : SetLike (T.CompleteType α) (L[[α]].Sentence) := ⟨fun p => p.toTheory, fun p q h => by cases p cases q congr ⟩
instance
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Types.lean
Sentence.instSetLike
null
isMaximal (p : T.CompleteType α) : IsMaximal (p : L[[α]].Theory) := p.isMaximal'
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Types.lean
isMaximal
null
subset (p : T.CompleteType α) : (L.lhomWithConstants α).onTheory T ⊆ (p : L[[α]].Theory) := p.subset'
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Types.lean
subset
null
mem_or_not_mem (p : T.CompleteType α) (φ : L[[α]].Sentence) : φ ∈ p ∨ φ.not ∈ p := p.isMaximal.mem_or_not_mem φ
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Types.lean
mem_or_not_mem
null
mem_of_models (p : T.CompleteType α) {φ : L[[α]].Sentence} (h : (L.lhomWithConstants α).onTheory T ⊨ᵇ φ) : φ ∈ p := (p.mem_or_not_mem φ).resolve_right fun con => ((models_iff_not_satisfiable _).1 h) (p.isMaximal.1.mono (union_subset p.subset (singleton_subset_iff.2 con)))
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Types.lean
mem_of_models
null
not_mem_iff (p : T.CompleteType α) (φ : L[[α]].Sentence) : φ.not ∈ p ↔ φ ∉ p := ⟨fun hf ht => by have h : ¬IsSatisfiable ({φ, φ.not} : L[[α]].Theory) := by rintro ⟨@⟨_, _, h, _⟩⟩ simp only [model_iff, mem_insert_iff, mem_singleton_iff, forall_eq_or_imp, forall_eq] at h exact h.2 h.1 refine h...
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Types.lean
not_mem_iff
null