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
IsAtomic.liftAt {k m : ℕ} (h : IsAtomic φ) : (φ.liftAt k m).IsAtomic := IsAtomic.recOn h (fun _ _ => IsAtomic.equal _ _) fun _ _ => IsAtomic.rel _ _
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsAtomic.liftAt
null
IsAtomic.castLE {h : l ≤ n} (hφ : IsAtomic φ) : (φ.castLE h).IsAtomic := IsAtomic.recOn hφ (fun _ _ => IsAtomic.equal _ _) fun _ _ => IsAtomic.rel _ _
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsAtomic.castLE
null
IsQF : L.BoundedFormula α n → Prop | falsum : IsQF falsum | of_isAtomic {φ} (h : IsAtomic φ) : IsQF φ | imp {φ₁ φ₂} (h₁ : IsQF φ₁) (h₂ : IsQF φ₂) : IsQF (φ₁.imp φ₂)
inductive
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsQF
A quantifier-free formula is a formula defined without quantifiers. These are all equivalent to Boolean combinations of atomic formulas.
IsAtomic.isQF {φ : L.BoundedFormula α n} : IsAtomic φ → IsQF φ := IsQF.of_isAtomic
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsAtomic.isQF
null
isQF_bot : IsQF (⊥ : L.BoundedFormula α n) := IsQF.falsum
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
isQF_bot
null
not {φ : L.BoundedFormula α n} (h : IsQF φ) : IsQF φ.not := h.imp isQF_bot
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
not
null
top : IsQF (⊤ : L.BoundedFormula α n) := isQF_bot.not
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
top
null
sup {φ ψ : L.BoundedFormula α n} (hφ : IsQF φ) (hψ : IsQF ψ) : IsQF (φ ⊔ ψ) := hφ.not.imp hψ
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
sup
null
inf {φ ψ : L.BoundedFormula α n} (hφ : IsQF φ) (hψ : IsQF ψ) : IsQF (φ ⊓ ψ) := (hφ.imp hψ.not).not
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
inf
null
protected relabel {m : ℕ} {φ : L.BoundedFormula α m} (h : φ.IsQF) (f : α → β ⊕ (Fin n)) : (φ.relabel f).IsQF := IsQF.recOn h isQF_bot (fun h => (h.relabel f).isQF) fun _ _ h1 h2 => h1.imp h2
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
relabel
null
protected liftAt {k m : ℕ} (h : IsQF φ) : (φ.liftAt k m).IsQF := IsQF.recOn h isQF_bot (fun ih => ih.liftAt.isQF) fun _ _ ih1 ih2 => ih1.imp ih2
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
liftAt
null
protected castLE {h : l ≤ n} (hφ : IsQF φ) : (φ.castLE h).IsQF := IsQF.recOn hφ isQF_bot (fun ih => ih.castLE.isQF) fun _ _ ih1 ih2 => ih1.imp ih2
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
castLE
null
not_all_isQF (φ : L.BoundedFormula α (n + 1)) : ¬φ.all.IsQF := fun con => by obtain - | con := con exact φ.not_all_isAtomic con
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
not_all_isQF
null
not_ex_isQF (φ : L.BoundedFormula α (n + 1)) : ¬φ.ex.IsQF := fun con => by obtain - | con | con := con · exact φ.not_ex_isAtomic con · exact not_all_isQF _ con
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
not_ex_isQF
null
IsPrenex : ∀ {n}, L.BoundedFormula α n → Prop | of_isQF {n} {φ : L.BoundedFormula α n} (h : IsQF φ) : IsPrenex φ | all {n} {φ : L.BoundedFormula α (n + 1)} (h : IsPrenex φ) : IsPrenex φ.all | ex {n} {φ : L.BoundedFormula α (n + 1)} (h : IsPrenex φ) : IsPrenex φ.ex
inductive
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsPrenex
Indicates that a bounded formula is in prenex normal form - that is, it consists of quantifiers applied to a quantifier-free formula.
IsQF.isPrenex {φ : L.BoundedFormula α n} : IsQF φ → IsPrenex φ := IsPrenex.of_isQF
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsQF.isPrenex
null
IsAtomic.isPrenex {φ : L.BoundedFormula α n} (h : IsAtomic φ) : IsPrenex φ := h.isQF.isPrenex
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsAtomic.isPrenex
null
IsPrenex.induction_on_all_not {P : ∀ {n}, L.BoundedFormula α n → Prop} {φ : L.BoundedFormula α n} (h : IsPrenex φ) (hq : ∀ {m} {ψ : L.BoundedFormula α m}, ψ.IsQF → P ψ) (ha : ∀ {m} {ψ : L.BoundedFormula α (m + 1)}, P ψ → P ψ.all) (hn : ∀ {m} {ψ : L.BoundedFormula α m}, P ψ → P ψ.not) : P φ := IsPrenex.recOn h hq (fun _ => ha) fun _ ih => hn (ha (hn ih))
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsPrenex.induction_on_all_not
null
IsPrenex.relabel {m : ℕ} {φ : L.BoundedFormula α m} (h : φ.IsPrenex) (f : α → β ⊕ (Fin n)) : (φ.relabel f).IsPrenex := IsPrenex.recOn h (fun h => (h.relabel f).isPrenex) (fun _ h => by simp [h.all]) fun _ h => by simp [h.ex]
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsPrenex.relabel
null
IsPrenex.castLE (hφ : IsPrenex φ) : ∀ {n} {h : l ≤ n}, (φ.castLE h).IsPrenex := IsPrenex.recOn (motive := @fun l φ _ => ∀ (n : ℕ) (h : l ≤ n), (φ.castLE h).IsPrenex) hφ (@fun _ _ ih _ _ => ih.castLE.isPrenex) (@fun _ _ _ ih _ _ => (ih _ _).all) (@fun _ _ _ ih _ _ => (ih _ _).ex) _ _
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsPrenex.castLE
null
IsPrenex.liftAt {k m : ℕ} (h : IsPrenex φ) : (φ.liftAt k m).IsPrenex := IsPrenex.recOn h (fun ih => ih.liftAt.isPrenex) (fun _ ih => ih.castLE.all) fun _ ih => ih.castLE.ex
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsPrenex.liftAt
null
toPrenexImpRight : ∀ {n}, L.BoundedFormula α n → L.BoundedFormula α n → L.BoundedFormula α n | n, φ, BoundedFormula.ex ψ => ((φ.liftAt 1 n).toPrenexImpRight ψ).ex | n, φ, all ψ => ((φ.liftAt 1 n).toPrenexImpRight ψ).all | _n, φ, ψ => φ.imp ψ
def
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
toPrenexImpRight
An auxiliary operation to `FirstOrder.Language.BoundedFormula.toPrenex`. If `φ` is quantifier-free and `ψ` is in prenex normal form, then `φ.toPrenexImpRight ψ` is a prenex normal form for `φ.imp ψ`.
IsQF.toPrenexImpRight {φ : L.BoundedFormula α n} : ∀ {ψ : L.BoundedFormula α n}, IsQF ψ → φ.toPrenexImpRight ψ = φ.imp ψ | _, IsQF.falsum => rfl | _, IsQF.of_isAtomic (IsAtomic.equal _ _) => rfl | _, IsQF.of_isAtomic (IsAtomic.rel _ _) => rfl | _, IsQF.imp IsQF.falsum _ => rfl | _, IsQF.imp (IsQF.of_isAtomic (IsAtomic.equal _ _)) _ => rfl | _, IsQF.imp (IsQF.of_isAtomic (IsAtomic.rel _ _)) _ => rfl | _, IsQF.imp (IsQF.imp _ _) _ => rfl
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsQF.toPrenexImpRight
null
isPrenex_toPrenexImpRight {φ ψ : L.BoundedFormula α n} (hφ : IsQF φ) (hψ : IsPrenex ψ) : IsPrenex (φ.toPrenexImpRight ψ) := by induction hψ with | of_isQF hψ => rw [hψ.toPrenexImpRight]; exact (hφ.imp hψ).isPrenex | all _ ih1 => exact (ih1 hφ.liftAt).all | ex _ ih2 => exact (ih2 hφ.liftAt).ex
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
isPrenex_toPrenexImpRight
null
toPrenexImp : ∀ {n}, L.BoundedFormula α n → L.BoundedFormula α n → L.BoundedFormula α n | n, BoundedFormula.ex φ, ψ => (φ.toPrenexImp (ψ.liftAt 1 n)).all | n, all φ, ψ => (φ.toPrenexImp (ψ.liftAt 1 n)).ex | _, φ, ψ => φ.toPrenexImpRight ψ
def
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
toPrenexImp
An auxiliary operation to `FirstOrder.Language.BoundedFormula.toPrenex`. If `φ` and `ψ` are in prenex normal form, then `φ.toPrenexImp ψ` is a prenex normal form for `φ.imp ψ`.
IsQF.toPrenexImp : ∀ {φ ψ : L.BoundedFormula α n}, φ.IsQF → φ.toPrenexImp ψ = φ.toPrenexImpRight ψ | _, _, IsQF.falsum => rfl | _, _, IsQF.of_isAtomic (IsAtomic.equal _ _) => rfl | _, _, IsQF.of_isAtomic (IsAtomic.rel _ _) => rfl | _, _, IsQF.imp IsQF.falsum _ => rfl | _, _, IsQF.imp (IsQF.of_isAtomic (IsAtomic.equal _ _)) _ => rfl | _, _, IsQF.imp (IsQF.of_isAtomic (IsAtomic.rel _ _)) _ => rfl | _, _, IsQF.imp (IsQF.imp _ _) _ => rfl
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsQF.toPrenexImp
null
isPrenex_toPrenexImp {φ ψ : L.BoundedFormula α n} (hφ : IsPrenex φ) (hψ : IsPrenex ψ) : IsPrenex (φ.toPrenexImp ψ) := by induction hφ with | of_isQF hφ => rw [hφ.toPrenexImp]; exact isPrenex_toPrenexImpRight hφ hψ | all _ ih1 => exact (ih1 hψ.liftAt).ex | ex _ ih2 => exact (ih2 hψ.liftAt).all
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
isPrenex_toPrenexImp
null
toPrenex : ∀ {n}, L.BoundedFormula α n → L.BoundedFormula α n | _, falsum => ⊥ | _, equal t₁ t₂ => t₁.bdEqual t₂ | _, rel R ts => rel R ts | _, imp f₁ f₂ => f₁.toPrenex.toPrenexImp f₂.toPrenex | _, all f => f.toPrenex.all
def
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
toPrenex
For any bounded formula `φ`, `φ.toPrenex` is a semantically-equivalent formula in prenex normal form.
toPrenex_isPrenex (φ : L.BoundedFormula α n) : φ.toPrenex.IsPrenex := BoundedFormula.recOn φ isQF_bot.isPrenex (fun _ _ => (IsAtomic.equal _ _).isPrenex) (fun _ _ => (IsAtomic.rel _ _).isPrenex) (fun _ _ h1 h2 => isPrenex_toPrenexImp h1 h2) fun _ => IsPrenex.all variable [Nonempty M]
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
toPrenex_isPrenex
null
realize_toPrenexImpRight {φ ψ : L.BoundedFormula α n} (hφ : IsQF φ) (hψ : IsPrenex ψ) {v : α → M} {xs : Fin n → M} : (φ.toPrenexImpRight ψ).Realize v xs ↔ (φ.imp ψ).Realize v xs := by induction hψ with | of_isQF hψ => rw [hψ.toPrenexImpRight] | all _ ih => refine _root_.trans (forall_congr' fun _ => ih hφ.liftAt) ?_ simp only [realize_imp, realize_liftAt_one_self, snoc_comp_castSucc, realize_all] exact ⟨fun h1 a h2 => h1 h2 a, fun h1 h2 a => h1 a h2⟩ | ex _ ih => unfold toPrenexImpRight rw [realize_ex] refine _root_.trans (exists_congr fun _ => ih hφ.liftAt) ?_ simp only [realize_imp, realize_liftAt_one_self, snoc_comp_castSucc, realize_ex] refine ⟨?_, fun h' => ?_⟩ · rintro ⟨a, ha⟩ h exact ⟨a, ha h⟩ · by_cases h : φ.Realize v xs · obtain ⟨a, ha⟩ := h' h exact ⟨a, fun _ => ha⟩ · inhabit M exact ⟨default, fun h'' => (h h'').elim⟩
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
realize_toPrenexImpRight
null
realize_toPrenexImp {φ ψ : L.BoundedFormula α n} (hφ : IsPrenex φ) (hψ : IsPrenex ψ) {v : α → M} {xs : Fin n → M} : (φ.toPrenexImp ψ).Realize v xs ↔ (φ.imp ψ).Realize v xs := by revert ψ induction hφ with | of_isQF hφ => intro ψ hψ rw [hφ.toPrenexImp] exact realize_toPrenexImpRight hφ hψ | all _ ih => intro ψ hψ unfold toPrenexImp rw [realize_ex] refine _root_.trans (exists_congr fun _ => ih hψ.liftAt) ?_ simp only [realize_imp, realize_liftAt_one_self, snoc_comp_castSucc, realize_all] exact Iff.symm forall_imp_iff_exists_imp | ex _ ih => intro ψ hψ refine _root_.trans (forall_congr' fun _ => ih hψ.liftAt) ?_ simp @[simp]
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
realize_toPrenexImp
null
realize_toPrenex (φ : L.BoundedFormula α n) {v : α → M} : ∀ {xs : Fin n → M}, φ.toPrenex.Realize v xs ↔ φ.Realize v xs := by induction φ with | falsum => exact Iff.rfl | equal => exact Iff.rfl | rel => exact Iff.rfl | imp f1 f2 h1 h2 => intros rw [toPrenex, realize_toPrenexImp f1.toPrenex_isPrenex f2.toPrenex_isPrenex, realize_imp, realize_imp, h1, h2] | all _ h => intros rw [realize_all, toPrenex, realize_all] exact forall_congr' fun a => h
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
realize_toPrenex
null
IsQF.induction_on_sup_not {P : L.BoundedFormula α n → Prop} {φ : L.BoundedFormula α n} (h : IsQF φ) (hf : P (⊥ : L.BoundedFormula α n)) (ha : ∀ ψ : L.BoundedFormula α n, IsAtomic ψ → P ψ) (hsup : ∀ {φ₁ φ₂}, P φ₁ → P φ₂ → P (φ₁ ⊔ φ₂)) (hnot : ∀ {φ}, P φ → P φ.not) (hse : ∀ {φ₁ φ₂ : L.BoundedFormula α n}, (φ₁ ⇔[∅] φ₂) → (P φ₁ ↔ P φ₂)) : P φ := IsQF.recOn h hf @(ha) fun {φ₁ φ₂} _ _ h1 h2 => (hse (φ₁.imp_iff_not_sup φ₂)).2 (hsup (hnot h1) h2)
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsQF.induction_on_sup_not
null
IsQF.induction_on_inf_not {P : L.BoundedFormula α n → Prop} {φ : L.BoundedFormula α n} (h : IsQF φ) (hf : P (⊥ : L.BoundedFormula α n)) (ha : ∀ ψ : L.BoundedFormula α n, IsAtomic ψ → P ψ) (hinf : ∀ {φ₁ φ₂}, P φ₁ → P φ₂ → P (φ₁ ⊓ φ₂)) (hnot : ∀ {φ}, P φ → P φ.not) (hse : ∀ {φ₁ φ₂ : L.BoundedFormula α n}, (φ₁ ⇔[∅] φ₂) → (P φ₁ ↔ P φ₂)) : P φ := h.induction_on_sup_not hf ha (fun {φ₁ φ₂} h1 h2 => (hse (φ₁.sup_iff_not_inf_not φ₂)).2 (hnot (hinf (hnot h1) (hnot h2)))) (fun {_} => hnot) fun {_ _} => hse
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsQF.induction_on_inf_not
null
iff_toPrenex (φ : L.BoundedFormula α n) : φ ⇔[∅] φ.toPrenex := fun M v xs => by rw [realize_iff, realize_toPrenex]
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
iff_toPrenex
null
induction_on_all_ex {P : ∀ {m}, L.BoundedFormula α m → Prop} (φ : L.BoundedFormula α n) (hqf : ∀ {m} {ψ : L.BoundedFormula α m}, IsQF ψ → P ψ) (hall : ∀ {m} {ψ : L.BoundedFormula α (m + 1)}, P ψ → P ψ.all) (hex : ∀ {m} {φ : L.BoundedFormula α (m + 1)}, P φ → P φ.ex) (hse : ∀ {m} {φ₁ φ₂ : L.BoundedFormula α m}, (φ₁ ⇔[∅] φ₂) → (P φ₁ ↔ P φ₂)) : P φ := by suffices h' : ∀ {m} {φ : L.BoundedFormula α m}, φ.IsPrenex → P φ from (hse φ.iff_toPrenex).2 (h' φ.toPrenex_isPrenex) intro m φ hφ induction hφ with | of_isQF hφ => exact hqf hφ | all _ hφ => exact hall hφ | ex _ hφ => exact hex hφ
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
induction_on_all_ex
null
induction_on_exists_not {P : ∀ {m}, L.BoundedFormula α m → Prop} (φ : L.BoundedFormula α n) (hqf : ∀ {m} {ψ : L.BoundedFormula α m}, IsQF ψ → P ψ) (hnot : ∀ {m} {φ : L.BoundedFormula α m}, P φ → P φ.not) (hex : ∀ {m} {φ : L.BoundedFormula α (m + 1)}, P φ → P φ.ex) (hse : ∀ {m} {φ₁ φ₂ : L.BoundedFormula α m}, (φ₁ ⇔[∅] φ₂) → (P φ₁ ↔ P φ₂)) : P φ := φ.induction_on_all_ex (fun {_ _} => hqf) (fun {_ φ} hφ => (hse φ.all_iff_not_ex_not).2 (hnot (hex (hnot hφ)))) (fun {_ _} => hex) fun {_ _ _} => hse
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
induction_on_exists_not
null
IsUniversal : ∀ {n}, L.BoundedFormula α n → Prop | of_isQF {n} {φ : L.BoundedFormula α n} (h : IsQF φ) : IsUniversal φ | all {n} {φ : L.BoundedFormula α (n + 1)} (h : IsUniversal φ) : IsUniversal φ.all
inductive
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsUniversal
A universal formula is a formula defined by applying only universal quantifiers to a quantifier-free formula.
IsQF.isUniversal {φ : L.BoundedFormula α n} : IsQF φ → IsUniversal φ := IsUniversal.of_isQF
lemma
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsQF.isUniversal
null
IsAtomic.isUniversal {φ : L.BoundedFormula α n} (h : IsAtomic φ) : IsUniversal φ := h.isQF.isUniversal
lemma
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsAtomic.isUniversal
null
IsExistential : ∀ {n}, L.BoundedFormula α n → Prop | of_isQF {n} {φ : L.BoundedFormula α n} (h : IsQF φ) : IsExistential φ | ex {n} {φ : L.BoundedFormula α (n + 1)} (h : IsExistential φ) : IsExistential φ.ex
inductive
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsExistential
An existential formula is a formula defined by applying only existential quantifiers to a quantifier-free formula.
IsQF.isExistential {φ : L.BoundedFormula α n} : IsQF φ → IsExistential φ := IsExistential.of_isQF
lemma
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsQF.isExistential
null
IsAtomic.isExistential {φ : L.BoundedFormula α n} (h : IsAtomic φ) : IsExistential φ := h.isQF.isExistential
lemma
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsAtomic.isExistential
null
IsAtomic.realize_comp_of_injective {φ : L.BoundedFormula α n} (hA : φ.IsAtomic) [L.HomClass F M N] {f : F} (hInj : Function.Injective f) {v : α → M} {xs : Fin n → M} : φ.Realize v xs → φ.Realize (f ∘ v) (f ∘ xs) := by induction hA with | equal t₁ t₂ => simp only [realize_bdEqual, ← Sum.comp_elim, HomClass.realize_term, hInj.eq_iff, imp_self] | rel R ts => simp only [realize_rel, ← Sum.comp_elim, HomClass.realize_term] exact HomClass.map_rel f R (fun i => Term.realize (Sum.elim v xs) (ts i))
lemma
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsAtomic.realize_comp_of_injective
null
IsAtomic.realize_comp {φ : L.BoundedFormula α n} (hA : φ.IsAtomic) [EmbeddingLike F M N] [L.HomClass F M N] (f : F) {v : α → M} {xs : Fin n → M} : φ.Realize v xs → φ.Realize (f ∘ v) (f ∘ xs) := hA.realize_comp_of_injective (EmbeddingLike.injective f) variable [EmbeddingLike F M N] [L.StrongHomClass F M N]
lemma
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsAtomic.realize_comp
null
IsQF.realize_embedding {φ : L.BoundedFormula α n} (hQF : φ.IsQF) (f : F) {v : α → M} {xs : Fin n → M} : φ.Realize (f ∘ v) (f ∘ xs) ↔ φ.Realize v xs := by induction hQF with | falsum => rfl | of_isAtomic hA => induction hA with | equal t₁ t₂ => simp only [realize_bdEqual, ← Sum.comp_elim, HomClass.realize_term, (EmbeddingLike.injective f).eq_iff] | rel R ts => simp only [realize_rel, ← Sum.comp_elim, HomClass.realize_term] exact StrongHomClass.map_rel f R (fun i => Term.realize (Sum.elim v xs) (ts i)) | imp _ _ ihφ ihψ => simp only [realize_imp, ihφ, ihψ]
lemma
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsQF.realize_embedding
null
IsUniversal.realize_embedding {φ : L.BoundedFormula α n} (hU : φ.IsUniversal) (f : F) {v : α → M} {xs : Fin n → M} : φ.Realize (f ∘ v) (f ∘ xs) → φ.Realize v xs := by induction hU with | of_isQF hQF => simp [hQF.realize_embedding] | all _ ih => simp only [realize_all, Nat.succ_eq_add_one] refine fun h a => ih ?_ rw [Fin.comp_snoc] exact h (f a)
lemma
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsUniversal.realize_embedding
null
IsExistential.realize_embedding {φ : L.BoundedFormula α n} (hE : φ.IsExistential) (f : F) {v : α → M} {xs : Fin n → M} : φ.Realize v xs → φ.Realize (f ∘ v) (f ∘ xs) := by induction hE with | of_isQF hQF => simp [hQF.realize_embedding] | ex _ ih => simp only [realize_ex, Nat.succ_eq_add_one] refine fun ⟨a, ha⟩ => ⟨f a, ?_⟩ rw [← Fin.comp_snoc] exact ih ha
lemma
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
IsExistential.realize_embedding
null
Theory.IsUniversal (T : L.Theory) : Prop where isUniversal_of_mem : ∀ ⦃φ⦄, φ ∈ T → φ.IsUniversal
class
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
Theory.IsUniversal
A theory is universal when it is comprised only of universal sentences - these theories apply also to substructures.
Theory.IsUniversal.models_of_embedding {T : L.Theory} [hT : T.IsUniversal] {N : Type*} [L.Structure N] [N ⊨ T] (f : M ↪[L] N) : M ⊨ T := by simp only [model_iff] refine fun φ hφ => (hT.isUniversal_of_mem hφ).realize_embedding f (?_) rw [Subsingleton.elim (f ∘ default) default, Subsingleton.elim (f ∘ default) default] exact Theory.realize_sentence_of_mem T hφ
lemma
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
Theory.IsUniversal.models_of_embedding
null
Substructure.models_of_isUniversal (S : L.Substructure M) (T : L.Theory) [T.IsUniversal] [M ⊨ T] : S ⊨ T := Theory.IsUniversal.models_of_embedding (Substructure.subtype S)
instance
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
Substructure.models_of_isUniversal
null
Theory.IsUniversal.insert {T : L.Theory} [hT : T.IsUniversal] {φ : L.Sentence} (hφ : φ.IsUniversal) : (insert φ T).IsUniversal := ⟨by simp only [Set.mem_insert_iff, forall_eq_or_imp, hφ, true_and] exact hT.isUniversal_of_mem⟩
lemma
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
Theory.IsUniversal.insert
null
isAtomic (r : L.Relations l) (ts : Fin l → L.Term (α ⊕ (Fin n))) : IsAtomic (r.boundedFormula ts) := IsAtomic.rel r ts
lemma
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
isAtomic
null
isQF (r : L.Relations l) (ts : Fin l → L.Term (α ⊕ (Fin n))) : IsQF (r.boundedFormula ts) := (r.isAtomic ts).isQF variable (r : L.Relations 2)
lemma
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
isQF
null
protected isUniversal_reflexive : r.reflexive.IsUniversal := (r.isQF _).isUniversal.all
lemma
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
isUniversal_reflexive
null
protected isUniversal_irreflexive : r.irreflexive.IsUniversal := (r.isAtomic _).isQF.not.isUniversal.all
lemma
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
isUniversal_irreflexive
null
protected isUniversal_symmetric : r.symmetric.IsUniversal := ((r.isQF _).imp (r.isQF _)).isUniversal.all.all
lemma
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
isUniversal_symmetric
null
protected isUniversal_antisymmetric : r.antisymmetric.IsUniversal := ((r.isQF _).imp ((r.isQF _).imp (IsAtomic.equal _ _).isQF)).isUniversal.all.all
lemma
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
isUniversal_antisymmetric
null
protected isUniversal_transitive : r.transitive.IsUniversal := ((r.isQF _).imp ((r.isQF _).imp (r.isQF _))).isUniversal.all.all.all
lemma
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
isUniversal_transitive
null
protected isUniversal_total : r.total.IsUniversal := ((r.isQF _).sup (r.isQF _)).isUniversal.all.all
lemma
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
isUniversal_total
null
Formula.isAtomic_graph (f : L.Functions n) : (Formula.graph f).IsAtomic := BoundedFormula.IsAtomic.equal _ _
theorem
ModelTheory
[ "Mathlib.ModelTheory.Equivalence" ]
Mathlib/ModelTheory/Complexity.lean
Formula.isAtomic_graph
null
Definable (s : Set (α → M)) : Prop := ∃ φ : L[[A]].Formula α, s = setOf φ.Realize variable {L} {A} {B : Set M} {s : Set (α → M)}
def
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
Definable
A subset of a finite Cartesian product of a structure is definable over a set `A` when membership in the set is given by a first-order formula with parameters from `A`.
Definable.map_expansion {L' : FirstOrder.Language} [L'.Structure M] (h : A.Definable L s) (φ : L →ᴸ L') [φ.IsExpansionOn M] : A.Definable L' s := by obtain ⟨ψ, rfl⟩ := h refine ⟨(φ.addConstants A).onFormula ψ, ?_⟩ ext x simp only [mem_setOf_eq, LHom.realize_onFormula]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
Definable.map_expansion
null
definable_iff_exists_formula_sum : A.Definable L s ↔ ∃ φ : L.Formula (A ⊕ α), s = {v | φ.Realize (Sum.elim (↑) v)} := by rw [Definable, Equiv.exists_congr_left (BoundedFormula.constantsVarsEquiv)] refine exists_congr (fun φ => iff_iff_eq.2 (congr_arg (s = ·) ?_)) ext simp only [BoundedFormula.constantsVarsEquiv, constantsOn, BoundedFormula.mapTermRelEquiv_symm_apply, mem_setOf_eq, Formula.Realize] refine BoundedFormula.realize_mapTermRel_id ?_ (fun _ _ _ => rfl) intros simp only [Term.constantsVarsEquivLeft_symm_apply, Term.realize_varsToConstants, coe_con, Term.realize_relabel] congr 1 with a rcases a with (_ | _) | _ <;> rfl
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
definable_iff_exists_formula_sum
null
empty_definable_iff : (∅ : Set M).Definable L s ↔ ∃ φ : L.Formula α, s = setOf φ.Realize := by rw [Definable, Equiv.exists_congr_left (LEquiv.addEmptyConstants L (∅ : Set M)).onFormula] simp
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
empty_definable_iff
null
definable_iff_empty_definable_with_params : A.Definable L s ↔ (∅ : Set M).Definable (L[[A]]) s := empty_definable_iff.symm
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
definable_iff_empty_definable_with_params
null
Definable.mono (hAs : A.Definable L s) (hAB : A ⊆ B) : B.Definable L s := by rw [definable_iff_empty_definable_with_params] at * exact hAs.map_expansion (L.lhomWithConstantsMap (Set.inclusion hAB)) @[simp]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
Definable.mono
null
definable_empty : A.Definable L (∅ : Set (α → M)) := ⟨⊥, by ext simp⟩ @[simp]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
definable_empty
null
definable_univ : A.Definable L (univ : Set (α → M)) := ⟨⊤, by ext simp⟩ @[simp]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
definable_univ
null
Definable.inter {f g : Set (α → M)} (hf : A.Definable L f) (hg : A.Definable L g) : A.Definable L (f ∩ g) := by rcases hf with ⟨φ, rfl⟩ rcases hg with ⟨θ, rfl⟩ refine ⟨φ ⊓ θ, ?_⟩ ext simp @[simp]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
Definable.inter
null
Definable.union {f g : Set (α → M)} (hf : A.Definable L f) (hg : A.Definable L g) : A.Definable L (f ∪ g) := by rcases hf with ⟨φ, hφ⟩ rcases hg with ⟨θ, hθ⟩ refine ⟨φ ⊔ θ, ?_⟩ ext rw [hφ, hθ, mem_setOf_eq, Formula.realize_sup, mem_union, mem_setOf_eq, mem_setOf_eq]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
Definable.union
null
definable_finset_inf {ι : Type*} {f : ι → Set (α → M)} (hf : ∀ i, A.Definable L (f i)) (s : Finset ι) : A.Definable L (s.inf f) := by classical refine Finset.induction definable_univ (fun i s _ h => ?_) s rw [Finset.inf_insert] exact (hf i).inter h
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
definable_finset_inf
null
definable_finset_sup {ι : Type*} {f : ι → Set (α → M)} (hf : ∀ i, A.Definable L (f i)) (s : Finset ι) : A.Definable L (s.sup f) := by classical refine Finset.induction definable_empty (fun i s _ h => ?_) s rw [Finset.sup_insert] exact (hf i).union h
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
definable_finset_sup
null
definable_biInter_finset {ι : Type*} {f : ι → Set (α → M)} (hf : ∀ i, A.Definable L (f i)) (s : Finset ι) : A.Definable L (⋂ i ∈ s, f i) := by rw [← Finset.inf_set_eq_iInter] exact definable_finset_inf hf s @[deprecated (since := "2025-08-28")] alias definable_finset_biInter := definable_biInter_finset
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
definable_biInter_finset
null
definable_biUnion_finset {ι : Type*} {f : ι → Set (α → M)} (hf : ∀ i, A.Definable L (f i)) (s : Finset ι) : A.Definable L (⋃ i ∈ s, f i) := by rw [← Finset.sup_set_eq_biUnion] exact definable_finset_sup hf s @[deprecated (since := "2025-08-28")] alias definable_finset_biUnion := definable_biUnion_finset @[simp]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
definable_biUnion_finset
null
Definable.compl {s : Set (α → M)} (hf : A.Definable L s) : A.Definable L sᶜ := by rcases hf with ⟨φ, hφ⟩ refine ⟨φ.not, ?_⟩ ext v rw [hφ, compl_setOf, mem_setOf, mem_setOf, Formula.realize_not] @[simp]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
Definable.compl
null
Definable.sdiff {s t : Set (α → M)} (hs : A.Definable L s) (ht : A.Definable L t) : A.Definable L (s \ t) := hs.inter ht.compl @[simp] lemma Definable.himp {s t : Set (α → M)} (hs : A.Definable L s) (ht : A.Definable L t) : A.Definable L (s ⇨ t) := by rw [himp_eq]; exact ht.union hs.compl
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
Definable.sdiff
null
Definable.preimage_comp (f : α → β) {s : Set (α → M)} (h : A.Definable L s) : A.Definable L ((fun g : β → M => g ∘ f) ⁻¹' s) := by obtain ⟨φ, rfl⟩ := h refine ⟨φ.relabel f, ?_⟩ ext simp only [Set.preimage_setOf_eq, mem_setOf_eq, Formula.realize_relabel]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
Definable.preimage_comp
null
Definable.image_comp_equiv {s : Set (β → M)} (h : A.Definable L s) (f : α ≃ β) : A.Definable L ((fun g : β → M => g ∘ f) '' s) := by refine (congr rfl ?_).mp (h.preimage_comp f.symm) rw [image_eq_preimage_of_inverse] · intro i ext b simp only [Function.comp_apply, Equiv.apply_symm_apply] · intro i ext a simp
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
Definable.image_comp_equiv
null
definable_iff_finitely_definable : A.Definable L s ↔ ∃ (A0 : Finset M), (A0 : Set M) ⊆ A ∧ (A0 : Set M).Definable L s := by classical constructor · simp only [definable_iff_exists_formula_sum] rintro ⟨φ, rfl⟩ let A0 := (φ.freeVarFinset.toLeft).image Subtype.val refine ⟨A0, by simp [A0], (φ.restrictFreeVar <| fun x => Sum.casesOn x.1 (fun x hx => Sum.inl ⟨x, by simp [A0, hx]⟩) (fun x _ => Sum.inr x) x.2), ?_⟩ ext simp only [Formula.Realize, mem_setOf_eq, Finset.coe_sort_coe] exact iff_comm.1 <| BoundedFormula.realize_restrictFreeVar _ (by simp) · rintro ⟨A0, hA0, hd⟩ exact Definable.mono hd hA0
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
definable_iff_finitely_definable
null
Definable.image_comp_sumInl_fin (m : ℕ) {s : Set (Sum α (Fin m) → M)} (h : A.Definable L s) : A.Definable L ((fun g : Sum α (Fin m) → M => g ∘ Sum.inl) '' s) := by obtain ⟨φ, rfl⟩ := h refine ⟨(BoundedFormula.relabel id φ).exs, ?_⟩ ext x simp only [Set.mem_image, mem_setOf_eq, BoundedFormula.realize_exs, BoundedFormula.realize_relabel, Function.comp_id, Fin.castAdd_zero, Fin.cast_refl] constructor · rintro ⟨y, hy, rfl⟩ exact ⟨y ∘ Sum.inr, (congr (congr rfl (Sum.elim_comp_inl_inr y).symm) (funext finZeroElim)).mp hy⟩ · rintro ⟨y, hy⟩ exact ⟨Sum.elim x y, (congr rfl (funext finZeroElim)).mp hy, Sum.elim_comp_inl _ _⟩
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
Definable.image_comp_sumInl_fin
This lemma is only intended as a helper for `Definable.image_comp`.
Definable.image_comp_embedding {s : Set (β → M)} (h : A.Definable L s) (f : α ↪ β) [Finite β] : A.Definable L ((fun g : β → M => g ∘ f) '' s) := by classical cases nonempty_fintype β refine (congr rfl (ext fun x => ?_)).mp (((h.image_comp_equiv (Equiv.Set.sumCompl (range f))).image_comp_equiv (Equiv.sumCongr (Equiv.ofInjective f f.injective) (Fintype.equivFin (↥(range f)ᶜ)).symm)).image_comp_sumInl_fin _) simp only [mem_image, exists_exists_and_eq_and] refine exists_congr fun y => and_congr_right fun _ => Eq.congr_left (funext fun a => ?_) simp
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
Definable.image_comp_embedding
Shows that definability is closed under finite projections.
Definable.image_comp {s : Set (β → M)} (h : A.Definable L s) (f : α → β) [Finite α] [Finite β] : A.Definable L ((fun g : β → M => g ∘ f) '' s) := by classical cases nonempty_fintype α cases nonempty_fintype β have h := (((h.image_comp_equiv (Equiv.Set.sumCompl (range f))).image_comp_equiv (Equiv.sumCongr (_root_.Equiv.refl _) (Fintype.equivFin _).symm)).image_comp_sumInl_fin _).preimage_comp (rangeSplitting f) have h' : A.Definable L { x : α → M | ∀ a, x a = x (rangeSplitting f (rangeFactorization f a)) } := by have h' : ∀ a, A.Definable L { x : α → M | x a = x (rangeSplitting f (rangeFactorization f a)) } := by refine fun a => ⟨(var a).equal (var (rangeSplitting f (rangeFactorization f a))), ext ?_⟩ simp refine (congr rfl (ext ?_)).mp (definable_biInter_finset h' Finset.univ) simp refine (congr rfl (ext fun x => ?_)).mp (h.inter h') simp only [mem_inter_iff, mem_preimage, mem_image, exists_exists_and_eq_and, mem_setOf_eq] constructor · rintro ⟨⟨y, ys, hy⟩, hx⟩ refine ⟨y, ys, ?_⟩ ext a rw [hx a, ← Function.comp_apply (f := x), ← hy] simp · rintro ⟨y, ys, rfl⟩ refine ⟨⟨y, ys, ?_⟩, fun a => ?_⟩ · ext simp [Set.apply_rangeSplitting f] · rw [Function.comp_apply, Function.comp_apply, apply_rangeSplitting f, rangeFactorization_coe] variable (L A)
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
Definable.image_comp
Shows that definability is closed under finite projections.
Definable₁ (s : Set M) : Prop := A.Definable L { x : Fin 1 → M | x 0 ∈ s }
def
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
Definable₁
A 1-dimensional version of `Definable`, for `Set M`.
Definable₂ (s : Set (M × M)) : Prop := A.Definable L { x : Fin 2 → M | (x 0, x 1) ∈ s }
def
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
Definable₂
A 2-dimensional version of `Definable`, for `Set (M × M)`.
DefinableSet := { s : Set (α → M) // A.Definable L s }
def
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
DefinableSet
Definable sets are subsets of finite Cartesian products of a structure such that membership is given by a first-order formula.
instSetLike : SetLike (L.DefinableSet A α) (α → M) where coe := Subtype.val coe_injective' := Subtype.val_injective
instance
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
instSetLike
null
instTop : Top (L.DefinableSet A α) := ⟨⟨⊤, definable_univ⟩⟩
instance
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
instTop
null
instBot : Bot (L.DefinableSet A α) := ⟨⟨⊥, definable_empty⟩⟩
instance
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
instBot
null
instSup : Max (L.DefinableSet A α) := ⟨fun s t => ⟨s ∪ t, s.2.union t.2⟩⟩
instance
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
instSup
null
instInf : Min (L.DefinableSet A α) := ⟨fun s t => ⟨s ∩ t, s.2.inter t.2⟩⟩
instance
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
instInf
null
instHasCompl : HasCompl (L.DefinableSet A α) := ⟨fun s => ⟨sᶜ, s.2.compl⟩⟩
instance
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
instHasCompl
null
instSDiff : SDiff (L.DefinableSet A α) := ⟨fun s t => ⟨s \ t, s.2.sdiff t.2⟩⟩
instance
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
instSDiff
null
noncomputable instHImp : HImp (L.DefinableSet A α) where himp s t := ⟨s ⇨ t, s.2.himp t.2⟩
instance
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
instHImp
null
instInhabited : Inhabited (L.DefinableSet A α) := ⟨⊥⟩
instance
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
instInhabited
null
le_iff : s ≤ t ↔ (s : Set (α → M)) ≤ (t : Set (α → M)) := Iff.rfl @[simp]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
le_iff
null
mem_top : x ∈ (⊤ : L.DefinableSet A α) := mem_univ x @[simp]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
mem_top
null
notMem_bot {x : α → M} : x ∉ (⊥ : L.DefinableSet A α) := notMem_empty x @[deprecated (since := "2025-05-23")] alias not_mem_bot := notMem_bot @[simp]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
notMem_bot
null
mem_sup : x ∈ s ⊔ t ↔ x ∈ s ∨ x ∈ t := Iff.rfl @[simp]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
mem_sup
null
mem_inf : x ∈ s ⊓ t ↔ x ∈ s ∧ x ∈ t := Iff.rfl @[simp]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
mem_inf
null