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 ⌀ |
|---|---|---|---|---|---|---|
private le_refl (f : M ≃ₚ[L] N) : f ≤ f := ⟨le_rfl, rfl⟩ | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | le_refl | null |
private le_antisymm (f g : M ≃ₚ[L] N) (le_fg : f ≤ g) (le_gf : g ≤ f) : f = g := by
let ⟨dom_f, cod_f, equiv_f⟩ := f
cases _root_.le_antisymm (dom_le_dom le_fg) (dom_le_dom le_gf)
cases _root_.le_antisymm (cod_le_cod le_fg) (cod_le_cod le_gf)
convert rfl
exact Equiv.injective_toEmbedding ((subtype _).comp_inj... | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | le_antisymm | null |
@[gcongr] symm_le_symm {f g : M ≃ₚ[L] N} (hfg : f ≤ g) : f.symm ≤ g.symm := by
rw [le_iff]
refine ⟨cod_le_cod hfg, dom_le_dom hfg, ?_⟩
intro x
apply g.toEquiv.injective
change g.toEquiv (inclusion _ (f.toEquiv.symm x)) = g.toEquiv (g.toEquiv.symm _)
rw [g.toEquiv.apply_symm_apply, (Equiv.apply_symm_apply f.... | lemma | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | symm_le_symm | null |
monotone_symm : Monotone (fun (f : M ≃ₚ[L] N) ↦ f.symm) := fun _ _ => symm_le_symm | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | monotone_symm | null |
symm_le_iff {f : M ≃ₚ[L] N} {g : N ≃ₚ[L] M} : f.symm ≤ g ↔ f ≤ g.symm :=
⟨by intro h; rw [← f.symm_symm]; exact monotone_symm h,
by intro h; rw [← g.symm_symm]; exact monotone_symm h⟩ | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | symm_le_iff | null |
ext {f g : M ≃ₚ[L] N} (h_dom : f.dom = g.dom) : (∀ x : M, ∀ h : x ∈ f.dom,
subtype _ (f.toEquiv ⟨x, h⟩) = subtype _ (g.toEquiv ⟨x, (h_dom ▸ h)⟩)) → f = g := by
intro h
rcases f with ⟨dom_f, cod_f, equiv_f⟩
cases h_dom
apply le_antisymm <;> (rw [le_def]; use le_rfl; ext ⟨x, hx⟩)
· exact (h x hx).symm
· e... | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | ext | null |
ext_iff {f g : M ≃ₚ[L] N} : f = g ↔ ∃ h_dom : f.dom = g.dom,
∀ x : M, ∀ h : x ∈ f.dom,
subtype _ (f.toEquiv ⟨x, h⟩) = subtype _ (g.toEquiv ⟨x, (h_dom ▸ h)⟩) := by
constructor
· intro h_eq
rcases f with ⟨dom_f, cod_f, equiv_f⟩
cases h_eq
exact ⟨rfl, fun _ _ ↦ rfl⟩
· rintro ⟨h, H⟩; exact ext h H | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | ext_iff | null |
monotone_dom : Monotone (fun f : M ≃ₚ[L] N ↦ f.dom) := fun _ _ ↦ dom_le_dom | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | monotone_dom | null |
monotone_cod : Monotone (fun f : M ≃ₚ[L] N ↦ f.cod) := fun _ _ ↦ cod_le_cod | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | monotone_cod | null |
noncomputable domRestrict (f : M ≃ₚ[L] N) {A : L.Substructure M} (h : A ≤ f.dom) :
M ≃ₚ[L] N := by
let g := (subtype _).comp (f.toEquiv.toEmbedding.comp (A.inclusion h))
exact {
dom := A
cod := g.toHom.range
toEquiv := g.equivRange
} | def | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | domRestrict | Restriction of a partial equivalence to a substructure of the domain. |
domRestrict_le (f : M ≃ₚ[L] N) {A : L.Substructure M} (h : A ≤ f.dom) :
f.domRestrict h ≤ f := ⟨h, rfl⟩ | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | domRestrict_le | null |
le_domRestrict (f g : M ≃ₚ[L] N) {A : L.Substructure M} (hf : f.dom ≤ A)
(hg : A ≤ g.dom) (hfg : f ≤ g) : f ≤ g.domRestrict hg :=
⟨hf, by rw [← (subtype_toEquiv_inclusion hfg)]; rfl⟩ | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | le_domRestrict | null |
noncomputable codRestrict (f : M ≃ₚ[L] N) {A : L.Substructure N} (h : A ≤ f.cod) :
M ≃ₚ[L] N :=
(f.symm.domRestrict h).symm | def | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | codRestrict | Restriction of a partial equivalence to a substructure of the codomain. |
codRestrict_le (f : M ≃ₚ[L] N) {A : L.Substructure N} (h : A ≤ f.cod) :
codRestrict f h ≤ f :=
symm_le_iff.2 (f.symm.domRestrict_le h) | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | codRestrict_le | null |
le_codRestrict (f g : M ≃ₚ[L] N) {A : L.Substructure N} (hf : f.cod ≤ A)
(hg : A ≤ g.cod) (hfg : f ≤ g) : f ≤ g.codRestrict hg :=
symm_le_iff.1 (le_domRestrict f.symm g.symm hf hg (monotone_symm hfg)) | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | le_codRestrict | null |
toEmbedding (f : M ≃ₚ[L] N) : f.dom ↪[L] N :=
(subtype _).comp f.toEquiv.toEmbedding
@[simp] | def | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | toEmbedding | A partial equivalence as an embedding from its domain. |
toEmbedding_apply {f : M ≃ₚ[L] N} (m : f.dom) :
f.toEmbedding m = f.toEquiv m :=
rfl | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | toEmbedding_apply | null |
toEmbeddingOfEqTop {f : M ≃ₚ[L] N} (h : f.dom = ⊤) : M ↪[L] N :=
(h ▸ f.toEmbedding).comp topEquiv.symm.toEmbedding
@[simp] | def | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | toEmbeddingOfEqTop | Given a partial equivalence which has the whole structure as domain,
returns the corresponding embedding. |
toEmbeddingOfEqTop_apply {f : M ≃ₚ[L] N} (h : f.dom = ⊤) (m : M) :
toEmbeddingOfEqTop h m = f.toEquiv ⟨m, h.symm ▸ mem_top m⟩ := by
rcases f with ⟨dom, cod, g⟩
cases h
rfl
set_option linter.style.nameCheck false in | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | toEmbeddingOfEqTop_apply | null |
toEquivOfEqTop {f : M ≃ₚ[L] N} (h_dom : f.dom = ⊤)
(h_cod : f.cod = ⊤) : M ≃[L] N :=
(topEquiv (M := N)).comp ((h_dom ▸ h_cod ▸ f.toEquiv).comp (topEquiv (M := M)).symm)
@[simp] | def | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | toEquivOfEqTop | Given a partial equivalence which has the whole structure as domain and
as codomain, returns the corresponding equivalence. |
toEquivOfEqTop_toEmbedding {f : M ≃ₚ[L] N} (h_dom : f.dom = ⊤)
(h_cod : f.cod = ⊤) :
(toEquivOfEqTop h_dom h_cod).toEmbedding = toEmbeddingOfEqTop h_dom := by
rcases f with ⟨dom, cod, g⟩
cases h_dom
cases h_cod
rfl | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | toEquivOfEqTop_toEmbedding | null |
dom_fg_iff_cod_fg {N : Type*} [L.Structure N] (f : M ≃ₚ[L] N) :
f.dom.FG ↔ f.cod.FG := by
rw [Substructure.fg_iff_structure_fg, f.toEquiv.fg_iff, Substructure.fg_iff_structure_fg] | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | dom_fg_iff_cod_fg | null |
noncomputable toPartialEquiv (f : M ↪[L] N) : M ≃ₚ[L] N :=
⟨⊤, f.toHom.range, f.equivRange.comp (Substructure.topEquiv)⟩ | def | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | toPartialEquiv | Given an embedding, returns the corresponding partial equivalence with `⊤` as domain. |
toPartialEquiv_injective :
Function.Injective (fun f : M ↪[L] N ↦ f.toPartialEquiv) := by
intro _ _ h
ext
rw [PartialEquiv.ext_iff] at h
rcases h with ⟨_, H⟩
exact H _ (Substructure.mem_top _)
@[simp] | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | toPartialEquiv_injective | null |
toEmbedding_toPartialEquiv (f : M ↪[L] N) :
PartialEquiv.toEmbeddingOfEqTop (f := f.toPartialEquiv) rfl = f :=
rfl
@[simp] | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | toEmbedding_toPartialEquiv | null |
toPartialEquiv_toEmbedding {f : M ≃ₚ[L] N} (h : f.dom = ⊤) :
(PartialEquiv.toEmbeddingOfEqTop h).toPartialEquiv = f := by
rcases f with ⟨_, _, _⟩
cases h
apply PartialEquiv.ext
· intro _ _
rfl
· rfl | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | toPartialEquiv_toEmbedding | null |
noncomputable partialEquivLimit : M ≃ₚ[L] N where
dom := iSup (fun i ↦ (S i).dom)
cod := iSup (fun i ↦ (S i).cod)
toEquiv :=
(Equiv_iSup {
toFun := (fun i ↦ (S i).cod)
monotone' := monotone_cod.comp S.monotone}
).comp
((DirectLimit.equiv_lift L ι (fun i ↦ (S i).dom)
(fun _ _ hij ... | def | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | partialEquivLimit | The limit of a directed system of PartialEquivs. |
dom_partialEquivLimit : (partialEquivLimit S).dom = iSup (fun x ↦ (S x).dom) := rfl
@[simp] | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | dom_partialEquivLimit | null |
cod_partialEquivLimit : (partialEquivLimit S).cod = iSup (fun x ↦ (S x).cod) := rfl
@[simp] | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | cod_partialEquivLimit | null |
partialEquivLimit_comp_inclusion {i : ι} :
(partialEquivLimit S).toEquiv.toEmbedding.comp (Substructure.inclusion (le_iSup _ i)) =
(Substructure.inclusion (le_iSup _ i)).comp (S i).toEquiv.toEmbedding := by
simp only [partialEquivLimit, Equiv.comp_toEmbedding, Embedding.comp_assoc]
rw [Equiv_isup_symm_inclu... | lemma | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | partialEquivLimit_comp_inclusion | null |
le_partialEquivLimit (i : ι) : S i ≤ partialEquivLimit S :=
⟨le_iSup (f := fun i ↦ (S i).dom) _, by
#adaptation_note /-- https://github.com/leanprover/lean4/pull/5020
these two `simp` calls cannot be combined. -/
simp only [partialEquivLimit_comp_inclusion]
simp only [cod_partialEquivLimit, ← Embeddin... | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | le_partialEquivLimit | null |
FGEquiv := {f : M ≃ₚ[L] N // f.dom.FG} | abbrev | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | FGEquiv | The type of equivalences between finitely generated substructures. |
IsExtensionPair : Prop := ∀ (f : L.FGEquiv M N) (m : M), ∃ g, m ∈ g.1.dom ∧ f ≤ g
variable {M N L} | def | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | IsExtensionPair | Two structures `M` and `N` form an extension pair if the domain of any finitely-generated map
from `M` to `N` can be extended to include any element of `M`. |
countable_self_fgequiv_of_countable [Countable M] :
Countable (L.FGEquiv M M) := by
let g : L.FGEquiv M M →
Σ U : { S : L.Substructure M // S.FG }, U.val →[L] M :=
fun f ↦ ⟨⟨f.val.dom, f.prop⟩, (subtype _).toHom.comp f.val.toEquiv.toHom⟩
have g_inj : Function.Injective g := by
intro f f' h
ext... | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | countable_self_fgequiv_of_countable | null |
inhabited_self_FGEquiv : Inhabited (L.FGEquiv M M) :=
⟨⟨⟨⊥, ⊥, Equiv.refl L (⊥ : L.Substructure M)⟩, fg_bot⟩⟩ | instance | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | inhabited_self_FGEquiv | null |
inhabited_FGEquiv_of_IsEmpty_Constants_and_Relations
[IsEmpty L.Constants] [IsEmpty (L.Relations 0)] [L.Structure N] :
Inhabited (L.FGEquiv M N) :=
⟨⟨⟨⊥, ⊥, {
toFun := isEmptyElim
invFun := isEmptyElim
left_inv := isEmptyElim
right_inv := isEmptyElim
map_fun' := fun {n} f x => by... | instance | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | inhabited_FGEquiv_of_IsEmpty_Constants_and_Relations | null |
@[simps]
FGEquiv.symm (f : L.FGEquiv M N) : L.FGEquiv N M := ⟨f.1.symm, f.1.dom_fg_iff_cod_fg.1 f.2⟩ | def | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | FGEquiv.symm | Maps to the symmetric finitely-generated partial equivalence. |
isExtensionPair_iff_cod : L.IsExtensionPair M N ↔
∀ (f : L.FGEquiv N M) (m : M), ∃ g, m ∈ g.1.cod ∧ f ≤ g := by
refine Iff.intro ?_ ?_ <;>
· intro h f m
obtain ⟨g, h1, h2⟩ := h f.symm m
exact ⟨g.symm, h1, monotone_symm h2⟩ | lemma | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | isExtensionPair_iff_cod | null |
isExtensionPair_iff_exists_embedding_closure_singleton_sup :
L.IsExtensionPair M N ↔
∀ (S : L.Substructure M) (_ : S.FG) (f : S ↪[L] N) (m : M),
∃ g : (closure L {m} ⊔ S : L.Substructure M) ↪[L] N, f =
g.comp (Substructure.inclusion le_sup_right) := by
refine ⟨fun h S S_FG f m => ?_, fun h ⟨f, f... | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | isExtensionPair_iff_exists_embedding_closure_singleton_sup | An alternate characterization of an extension pair is that every finitely generated partial
isomorphism can be extended to include any particular element of the domain. |
definedAtLeft
(h : L.IsExtensionPair M N) (m : M) : Order.Cofinal (FGEquiv L M N) where
carrier := {f | m ∈ f.val.dom}
isCofinal := fun f => h f m | def | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | definedAtLeft | The cofinal set of finite equivalences with a given element in their domain. |
definedAtRight
(h : L.IsExtensionPair N M) (n : N) : Order.Cofinal (FGEquiv L M N) where
carrier := {f | n ∈ f.val.cod}
isCofinal := fun f => h.cod f n | def | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | definedAtRight | The cofinal set of finite equivalences with a given element in their codomain. |
embedding_from_cg (M_cg : Structure.CG L M) (g : L.FGEquiv M N)
(H : L.IsExtensionPair M N) :
∃ f : M ↪[L] N, g ≤ f.toPartialEquiv := by
rcases M_cg with ⟨X, _, X_gen⟩
have _ : Countable (↑X : Type _) := by simpa only [countable_coe_iff]
have _ : Encodable (↑X : Type _) := Encodable.ofCountable _
let D ... | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | embedding_from_cg | For a countably generated structure `M` and a structure `N`, if any partial equivalence
between finitely generated substructures can be extended to any element in the domain,
then there exists an embedding of `M` in `N`. |
equiv_between_cg (M_cg : Structure.CG L M) (N_cg : Structure.CG L N)
(g : L.FGEquiv M N)
(ext_dom : L.IsExtensionPair M N)
(ext_cod : L.IsExtensionPair N M) :
∃ f : M ≃[L] N, g ≤ f.toEmbedding.toPartialEquiv := by
rcases M_cg with ⟨X, X_count, X_gen⟩
rcases N_cg with ⟨Y, Y_count, Y_gen⟩
have _ : C... | theorem | ModelTheory | [
"Mathlib.ModelTheory.DirectLimit",
"Mathlib.Order.Ideal"
] | Mathlib/ModelTheory/PartialEquiv.lean | equiv_between_cg | For two countably generated structure `M` and `N`, if any PartialEquiv
between finitely generated substructures can be extended to any element in the domain and to
any element in the codomain, then there exists an equivalence between `M` and `N`. |
Prestructure (s : Setoid M) where
/-- The underlying first-order structure -/
toStructure : L.Structure M
fun_equiv : ∀ {n} {f : L.Functions n} (x y : Fin n → M), x ≈ y → funMap f x ≈ funMap f y
rel_equiv : ∀ {n} {r : L.Relations n} (x y : Fin n → M) (_ : x ≈ y), RelMap r x = RelMap r y
variable {L} {s : Setoid... | class | ModelTheory | [
"Mathlib.Data.Fintype.Quotient",
"Mathlib.ModelTheory.Semantics"
] | Mathlib/ModelTheory/Quotients.lean | Prestructure | A prestructure is a first-order structure with a `Setoid` equivalence relation on it,
such that quotienting by that equivalence relation is still a structure. |
quotientStructure : L.Structure (Quotient s) where
funMap {n} f x :=
Quotient.map (@funMap L M ps.toStructure n f) Prestructure.fun_equiv (Quotient.finChoice x)
RelMap {n} r x :=
Quotient.lift (@RelMap L M ps.toStructure n r) Prestructure.rel_equiv (Quotient.finChoice x)
variable (s) | instance | ModelTheory | [
"Mathlib.Data.Fintype.Quotient",
"Mathlib.ModelTheory.Semantics"
] | Mathlib/ModelTheory/Quotients.lean | quotientStructure | null |
funMap_quotient_mk' {n : ℕ} (f : L.Functions n) (x : Fin n → M) :
(funMap f fun i => (⟦x i⟧ : Quotient s)) = ⟦@funMap _ _ ps.toStructure _ f x⟧ := by
change
Quotient.map (@funMap L M ps.toStructure n f) Prestructure.fun_equiv (Quotient.finChoice _) =
_
rw [Quotient.finChoice_eq, Quotient.map_mk] | theorem | ModelTheory | [
"Mathlib.Data.Fintype.Quotient",
"Mathlib.ModelTheory.Semantics"
] | Mathlib/ModelTheory/Quotients.lean | funMap_quotient_mk' | null |
relMap_quotient_mk' {n : ℕ} (r : L.Relations n) (x : Fin n → M) :
(RelMap r fun i => (⟦x i⟧ : Quotient s)) ↔ @RelMap _ _ ps.toStructure _ r x := by
change
Quotient.lift (@RelMap L M ps.toStructure n r) Prestructure.rel_equiv (Quotient.finChoice _) ↔
_
rw [Quotient.finChoice_eq, Quotient.lift_mk] | theorem | ModelTheory | [
"Mathlib.Data.Fintype.Quotient",
"Mathlib.ModelTheory.Semantics"
] | Mathlib/ModelTheory/Quotients.lean | relMap_quotient_mk' | null |
Term.realize_quotient_mk' {β : Type*} (t : L.Term β) (x : β → M) :
(t.realize fun i => (⟦x i⟧ : Quotient s)) = ⟦@Term.realize _ _ ps.toStructure _ x t⟧ := by
induction t with
| var => rfl
| func _ _ ih => simp only [ih, funMap_quotient_mk', Term.realize] | theorem | ModelTheory | [
"Mathlib.Data.Fintype.Quotient",
"Mathlib.ModelTheory.Semantics"
] | Mathlib/ModelTheory/Quotients.lean | Term.realize_quotient_mk' | null |
IsSatisfiable : Prop :=
Nonempty (ModelType.{u, v, max u v} T) | def | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | IsSatisfiable | A theory is satisfiable if a structure models it. |
IsFinitelySatisfiable : Prop :=
∀ T0 : Finset L.Sentence, (T0 : L.Theory) ⊆ T → IsSatisfiable (T0 : L.Theory)
variable {T} {T' : L.Theory} | def | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | IsFinitelySatisfiable | A theory is finitely satisfiable if all of its finite subtheories are satisfiable. |
Model.isSatisfiable (M : Type w) [Nonempty M] [L.Structure M] [M ⊨ T] :
T.IsSatisfiable :=
⟨((⊥ : Substructure _ (ModelType.of T M)).elementarySkolem₁Reduct.toModel T).shrink⟩ | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | Model.isSatisfiable | null |
IsSatisfiable.mono (h : T'.IsSatisfiable) (hs : T ⊆ T') : T.IsSatisfiable :=
⟨(Theory.Model.mono (ModelType.is_model h.some) hs).bundled⟩ | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | IsSatisfiable.mono | null |
isSatisfiable_empty (L : Language.{u, v}) : IsSatisfiable (∅ : L.Theory) :=
⟨default⟩ | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | isSatisfiable_empty | null |
isSatisfiable_of_isSatisfiable_onTheory {L' : Language.{w, w'}} (φ : L →ᴸ L')
(h : (φ.onTheory T).IsSatisfiable) : T.IsSatisfiable :=
Model.isSatisfiable (h.some.reduct φ) | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | isSatisfiable_of_isSatisfiable_onTheory | null |
isSatisfiable_onTheory_iff {L' : Language.{w, w'}} {φ : L →ᴸ L'} (h : φ.Injective) :
(φ.onTheory T).IsSatisfiable ↔ T.IsSatisfiable := by
classical
refine ⟨isSatisfiable_of_isSatisfiable_onTheory φ, fun h' => ?_⟩
haveI : Inhabited h'.some := Classical.inhabited_of_nonempty'
exact Model.isSatisfiable (... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | isSatisfiable_onTheory_iff | null |
IsSatisfiable.isFinitelySatisfiable (h : T.IsSatisfiable) : T.IsFinitelySatisfiable :=
fun _ => h.mono | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | IsSatisfiable.isFinitelySatisfiable | null |
isSatisfiable_iff_isFinitelySatisfiable {T : L.Theory} :
T.IsSatisfiable ↔ T.IsFinitelySatisfiable :=
⟨Theory.IsSatisfiable.isFinitelySatisfiable, fun h => by
classical
set M : Finset T → Type max u v := fun T0 : Finset T =>
(h (T0.map (Function.Embedding.subtype fun x => x ∈ T)) T0.map_subtype_... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | isSatisfiable_iff_isFinitelySatisfiable | The **Compactness Theorem of first-order logic**: A theory is satisfiable if and only if it is
finitely satisfiable. |
isSatisfiable_directed_union_iff {ι : Type*} [Nonempty ι] {T : ι → L.Theory}
(h : Directed (· ⊆ ·) T) : Theory.IsSatisfiable (⋃ i, T i) ↔ ∀ i, (T i).IsSatisfiable := by
refine ⟨fun h' i => h'.mono (Set.subset_iUnion _ _), fun h' => ?_⟩
rw [isSatisfiable_iff_isFinitelySatisfiable, IsFinitelySatisfiable]
intro ... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | isSatisfiable_directed_union_iff | null |
isSatisfiable_union_distinctConstantsTheory_of_card_le (T : L.Theory) (s : Set α)
(M : Type w') [Nonempty M] [L.Structure M] [M ⊨ T]
(h : Cardinal.lift.{w'} #s ≤ Cardinal.lift.{w} #M) :
((L.lhomWithConstants α).onTheory T ∪ L.distinctConstantsTheory s).IsSatisfiable := by
haveI : Inhabited M := Classical.... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | isSatisfiable_union_distinctConstantsTheory_of_card_le | null |
isSatisfiable_union_distinctConstantsTheory_of_infinite (T : L.Theory) (s : Set α)
(M : Type w') [L.Structure M] [M ⊨ T] [Infinite M] :
((L.lhomWithConstants α).onTheory T ∪ L.distinctConstantsTheory s).IsSatisfiable := by
classical
rw [distinctConstantsTheory_eq_iUnion, Set.union_iUnion, isSatisfiable_di... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | isSatisfiable_union_distinctConstantsTheory_of_infinite | null |
exists_large_model_of_infinite_model (T : L.Theory) (κ : Cardinal.{w}) (M : Type w')
[L.Structure M] [M ⊨ T] [Infinite M] :
∃ N : ModelType.{_, _, max u v w} T, Cardinal.lift.{max u v w} κ ≤ #N := by
obtain ⟨N⟩ :=
isSatisfiable_union_distinctConstantsTheory_of_infinite T (Set.univ : Set κ.out) M
refine ... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | exists_large_model_of_infinite_model | Any theory with an infinite model has arbitrarily large models. |
isSatisfiable_iUnion_iff_isSatisfiable_iUnion_finset {ι : Type*} (T : ι → L.Theory) :
IsSatisfiable (⋃ i, T i) ↔ ∀ s : Finset ι, IsSatisfiable (⋃ i ∈ s, T i) := by
classical
refine
⟨fun h s => h.mono (Set.iUnion_mono fun _ => Set.iUnion_subset_iff.2 fun _ => refl _),
fun h => ?_⟩
rw [isSatis... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | isSatisfiable_iUnion_iff_isSatisfiable_iUnion_finset | null |
exists_elementaryEmbedding_card_eq_of_le (M : Type w') [L.Structure M] [Nonempty M]
(κ : Cardinal.{w}) (h1 : ℵ₀ ≤ κ) (h2 : lift.{w} L.card ≤ Cardinal.lift.{max u v} κ)
(h3 : lift.{w'} κ ≤ Cardinal.lift.{w} #M) :
∃ N : Bundled L.Structure, Nonempty (N ↪ₑ[L] M) ∧ #N = κ := by
obtain ⟨S, _, hS⟩ := exists_ele... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | exists_elementaryEmbedding_card_eq_of_le | A version of The Downward Löwenheim–Skolem theorem where the structure `N` elementarily embeds
into `M`, but is not by type a substructure of `M`, and thus can be chosen to belong to the universe
of the cardinal `κ`. |
exists_elementaryEmbedding_card_eq_of_ge (M : Type w') [L.Structure M] [iM : Infinite M]
(κ : Cardinal.{w}) (h1 : Cardinal.lift.{w} L.card ≤ Cardinal.lift.{max u v} κ)
(h2 : Cardinal.lift.{w} #M ≤ Cardinal.lift.{w'} κ) :
∃ N : Bundled L.Structure, Nonempty (M ↪ₑ[L] N) ∧ #N = κ := by
obtain ⟨N0, hN0⟩ := (L... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | exists_elementaryEmbedding_card_eq_of_ge | The **Upward Löwenheim–Skolem Theorem**: If `κ` is a cardinal greater than the cardinalities of
`L` and an infinite `L`-structure `M`, then `M` has an elementary extension of cardinality `κ`. |
exists_elementaryEmbedding_card_eq (M : Type w') [L.Structure M] [iM : Infinite M]
(κ : Cardinal.{w}) (h1 : ℵ₀ ≤ κ) (h2 : lift.{w} L.card ≤ Cardinal.lift.{max u v} κ) :
∃ N : Bundled L.Structure, (Nonempty (N ↪ₑ[L] M) ∨ Nonempty (M ↪ₑ[L] N)) ∧ #N = κ := by
cases le_or_gt (lift.{w'} κ) (Cardinal.lift.{w} #M) w... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | exists_elementaryEmbedding_card_eq | The Löwenheim–Skolem Theorem: If `κ` is a cardinal greater than the cardinalities of `L`
and an infinite `L`-structure `M`, then there is an elementary embedding in the appropriate
direction between then `M` and a structure of cardinality `κ`. |
exists_elementarilyEquivalent_card_eq (M : Type w') [L.Structure M] [Infinite M]
(κ : Cardinal.{w}) (h1 : ℵ₀ ≤ κ) (h2 : lift.{w} L.card ≤ Cardinal.lift.{max u v} κ) :
∃ N : CategoryTheory.Bundled L.Structure, (M ≅[L] N) ∧ #N = κ := by
obtain ⟨N, NM | MN, hNκ⟩ := exists_elementaryEmbedding_card_eq L M κ h1 h2
... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | exists_elementarilyEquivalent_card_eq | A consequence of the Löwenheim–Skolem Theorem: If `κ` is a cardinal greater than the
cardinalities of `L` and an infinite `L`-structure `M`, then there is a structure of cardinality `κ`
elementarily equivalent to `M`. |
exists_model_card_eq (h : ∃ M : ModelType.{u, v, max u v} T, Infinite M) (κ : Cardinal.{w})
(h1 : ℵ₀ ≤ κ) (h2 : Cardinal.lift.{w} L.card ≤ Cardinal.lift.{max u v} κ) :
∃ N : ModelType.{u, v, w} T, #N = κ := by
cases h with
| intro M MI =>
obtain ⟨N, hN, rfl⟩ := exists_elementarilyEquivalent_card_eq L M ... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | exists_model_card_eq | null |
ModelsBoundedFormula (φ : L.BoundedFormula α n) : Prop :=
∀ (M : ModelType.{u, v, max u v w} T) (v : α → M) (xs : Fin n → M), φ.Realize v xs
@[inherit_doc FirstOrder.Language.Theory.ModelsBoundedFormula]
infixl:51 " ⊨ᵇ " => ModelsBoundedFormula -- input using \|= or \vDash, but not using \models
variable {T} | def | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | ModelsBoundedFormula | A theory models a (bounded) formula when any of its nonempty models realizes that formula on all
inputs. |
models_formula_iff {φ : L.Formula α} :
T ⊨ᵇ φ ↔ ∀ (M : ModelType.{u, v, max u v w} T) (v : α → M), φ.Realize v :=
forall_congr' fun _ => forall_congr' fun _ => Unique.forall_iff | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | models_formula_iff | null |
models_sentence_iff {φ : L.Sentence} : T ⊨ᵇ φ ↔ ∀ M : ModelType.{u, v, max u v} T, M ⊨ φ :=
models_formula_iff.trans (forall_congr' fun _ => Unique.forall_iff) | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | models_sentence_iff | null |
models_sentence_of_mem {φ : L.Sentence} (h : φ ∈ T) : T ⊨ᵇ φ :=
models_sentence_iff.2 fun _ => realize_sentence_of_mem T h | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | models_sentence_of_mem | null |
models_iff_not_satisfiable (φ : L.Sentence) : T ⊨ᵇ φ ↔ ¬IsSatisfiable (T ∪ {φ.not}) := by
rw [models_sentence_iff, IsSatisfiable]
refine
⟨fun h1 h2 =>
(Sentence.realize_not _).1
(realize_sentence_of_mem (T ∪ {Formula.not φ})
(Set.subset_union_right (Set.mem_singleton _)))
(h1 (h2... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | models_iff_not_satisfiable | null |
ModelsBoundedFormula.realize_sentence {φ : L.Sentence} (h : T ⊨ᵇ φ) (M : Type*)
[L.Structure M] [M ⊨ T] [Nonempty M] : M ⊨ φ := by
rw [models_iff_not_satisfiable] at h
contrapose! h
have : M ⊨ T ∪ {Formula.not φ} := by
simp only [Set.union_singleton, model_iff, Set.mem_insert_iff, forall_eq_or_imp,
... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | ModelsBoundedFormula.realize_sentence | null |
models_formula_iff_onTheory_models_equivSentence {φ : L.Formula α} :
T ⊨ᵇ φ ↔ (L.lhomWithConstants α).onTheory T ⊨ᵇ Formula.equivSentence φ := by
refine ⟨fun h => models_sentence_iff.2 (fun M => ?_),
fun h => models_formula_iff.2 (fun M v => ?_)⟩
· letI := (L.lhomWithConstants α).reduct M
have : (L.lhom... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | models_formula_iff_onTheory_models_equivSentence | null |
ModelsBoundedFormula.realize_formula {φ : L.Formula α} (h : T ⊨ᵇ φ) (M : Type*)
[L.Structure M] [M ⊨ T] [Nonempty M] {v : α → M} : φ.Realize v := by
rw [models_formula_iff_onTheory_models_equivSentence] at h
letI : (constantsOn α).Structure M := constantsOn.structure v
have : M ⊨ (L.lhomWithConstants α).onThe... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | ModelsBoundedFormula.realize_formula | null |
models_toFormula_iff {φ : L.BoundedFormula α n} : T ⊨ᵇ φ.toFormula ↔ T ⊨ᵇ φ := by
refine ⟨fun h M v xs => ?_, ?_⟩
· have h' : φ.toFormula.Realize (Sum.elim v xs) := h.realize_formula M
simp only [BoundedFormula.realize_toFormula, Sum.elim_comp_inl, Sum.elim_comp_inr] at h'
exact h'
· simp only [models_for... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | models_toFormula_iff | null |
ModelsBoundedFormula.realize_boundedFormula
{φ : L.BoundedFormula α n} (h : T ⊨ᵇ φ) (M : Type*)
[L.Structure M] [M ⊨ T] [Nonempty M] {v : α → M} {xs : Fin n → M} : φ.Realize v xs := by
have h' : φ.toFormula.Realize (Sum.elim v xs) := (models_toFormula_iff.2 h).realize_formula M
simp only [BoundedFormula.rea... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | ModelsBoundedFormula.realize_boundedFormula | null |
models_of_models_theory {T' : L.Theory}
(h : ∀ φ : L.Sentence, φ ∈ T' → T ⊨ᵇ φ)
{φ : L.Formula α} (hφ : T' ⊨ᵇ φ) : T ⊨ᵇ φ := fun M => by
have hM : M ⊨ T' := T'.model_iff.2 (fun ψ hψ => (h ψ hψ).realize_sentence M)
let M' : ModelType T' := ⟨M⟩
exact hφ M' | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | models_of_models_theory | null |
models_iff_finset_models {φ : L.Sentence} :
T ⊨ᵇ φ ↔ ∃ T0 : Finset L.Sentence, (T0 : L.Theory) ⊆ T ∧ (T0 : L.Theory) ⊨ᵇ φ := by
simp only [models_iff_not_satisfiable]
rw [← not_iff_not, not_not, isSatisfiable_iff_isFinitelySatisfiable, IsFinitelySatisfiable]
push_neg
letI := Classical.decEq (Sentence L)
c... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | models_iff_finset_models | An alternative statement of the Compactness Theorem. A formula `φ` is modeled by a
theory iff there is a finite subset `T0` of the theory such that `φ` is modeled by `T0` |
IsComplete (T : L.Theory) : Prop :=
T.IsSatisfiable ∧ ∀ φ : L.Sentence, T ⊨ᵇ φ ∨ T ⊨ᵇ φ.not | def | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | IsComplete | A theory is complete when it is satisfiable and models each sentence or its negation. |
models_not_iff (h : T.IsComplete) (φ : L.Sentence) : T ⊨ᵇ φ.not ↔ ¬T ⊨ᵇ φ := by
rcases h.2 φ with hφ | hφn
· simp only [hφ, not_true, iff_false]
rw [models_sentence_iff, not_forall]
refine ⟨h.1.some, ?_⟩
simp only [Sentence.realize_not, Classical.not_not]
exact models_sentence_iff.1 hφ _
· simp on... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | models_not_iff | null |
realize_sentence_iff (h : T.IsComplete) (φ : L.Sentence) (M : Type*) [L.Structure M]
[M ⊨ T] [Nonempty M] : M ⊨ φ ↔ T ⊨ᵇ φ := by
rcases h.2 φ with hφ | hφn
· exact iff_of_true (hφ.realize_sentence M) hφ
· exact
iff_of_false ((Sentence.realize_not M).1 (hφn.realize_sentence M))
((h.models_not_iff... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | realize_sentence_iff | null |
IsMaximal (T : L.Theory) : Prop :=
T.IsSatisfiable ∧ ∀ φ : L.Sentence, φ ∈ T ∨ φ.not ∈ T | def | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | IsMaximal | A theory is maximal when it is satisfiable and contains each sentence or its negation.
Maximal theories are complete. |
IsMaximal.isComplete (h : T.IsMaximal) : T.IsComplete :=
h.imp_right (forall_imp fun _ => Or.imp models_sentence_of_mem models_sentence_of_mem) | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | IsMaximal.isComplete | null |
IsMaximal.mem_or_not_mem (h : T.IsMaximal) (φ : L.Sentence) : φ ∈ T ∨ φ.not ∈ T :=
h.2 φ | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | IsMaximal.mem_or_not_mem | null |
IsMaximal.mem_of_models (h : T.IsMaximal) {φ : L.Sentence} (hφ : T ⊨ᵇ φ) : φ ∈ T := by
refine (h.mem_or_not_mem φ).resolve_right fun con => ?_
rw [models_iff_not_satisfiable, Set.union_singleton, Set.insert_eq_of_mem con] at hφ
exact hφ h.1 | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | IsMaximal.mem_of_models | null |
IsMaximal.mem_iff_models (h : T.IsMaximal) (φ : L.Sentence) : φ ∈ T ↔ T ⊨ᵇ φ :=
⟨models_sentence_of_mem, h.mem_of_models⟩ | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | IsMaximal.mem_iff_models | null |
isSatisfiable [Nonempty M] : (L.completeTheory M).IsSatisfiable :=
Theory.Model.isSatisfiable M | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | isSatisfiable | null |
mem_or_not_mem (φ : L.Sentence) : φ ∈ L.completeTheory M ∨ φ.not ∈ L.completeTheory M := by
simp_rw [completeTheory, Set.mem_setOf_eq, Sentence.Realize, Formula.realize_not, or_not] | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | mem_or_not_mem | null |
isMaximal [Nonempty M] : (L.completeTheory M).IsMaximal :=
⟨isSatisfiable L M, mem_or_not_mem L M⟩ | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | isMaximal | null |
isComplete [Nonempty M] : (L.completeTheory M).IsComplete :=
(completeTheory.isMaximal L M).isComplete | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | isComplete | null |
Categorical : Prop :=
∀ M N : T.ModelType, #M = κ → #N = κ → Nonempty (M ≃[L] N) | def | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | Categorical | A theory is `κ`-categorical if all models of size `κ` are isomorphic. |
Categorical.isComplete (h : κ.Categorical T) (h1 : ℵ₀ ≤ κ)
(h2 : Cardinal.lift.{w} L.card ≤ Cardinal.lift.{max u v} κ) (hS : T.IsSatisfiable)
(hT : ∀ M : Theory.ModelType.{u, v, max u v} T, Infinite M) : T.IsComplete :=
⟨hS, fun φ => by
obtain ⟨_, _⟩ := Theory.exists_model_card_eq ⟨hS.some, hT hS.some⟩ κ ... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | Categorical.isComplete | The Łoś–Vaught Test : a criterion for categorical theories to be complete. |
empty_theory_categorical (T : Language.empty.Theory) : κ.Categorical T := fun M N hM hN =>
by rw [empty.nonempty_equiv_iff, hM, hN] | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | empty_theory_categorical | null |
empty_infinite_Theory_isComplete : Language.empty.infiniteTheory.IsComplete :=
(empty_theory_categorical.{0} ℵ₀ _).isComplete ℵ₀ _ le_rfl (by simp)
⟨by
haveI : Language.empty.Structure ℕ := emptyStructure
exact ((model_infiniteTheory_iff Language.empty).2 (inferInstanceAs (Infinite ℕ))).bundled⟩
f... | theorem | ModelTheory | [
"Mathlib.ModelTheory.Ultraproducts",
"Mathlib.ModelTheory.Bundled",
"Mathlib.ModelTheory.Skolem",
"Mathlib.Order.Filter.AtTopBot.Basic"
] | Mathlib/ModelTheory/Satisfiability.lean | empty_infinite_Theory_isComplete | null |
realize (v : α → M) : ∀ _t : L.Term α, M
| var k => v k
| func f ts => funMap f fun i => (ts i).realize v
@[simp] | def | ModelTheory | [
"Mathlib.Data.Finset.Basic",
"Mathlib.ModelTheory.Syntax",
"Mathlib.Data.List.ProdSigma"
] | Mathlib/ModelTheory/Semantics.lean | realize | A term `t` with variables indexed by `α` can be evaluated by giving a value to each variable. |
realize_var (v : α → M) (k) : realize v (var k : L.Term α) = v k := rfl
@[simp] | theorem | ModelTheory | [
"Mathlib.Data.Finset.Basic",
"Mathlib.ModelTheory.Syntax",
"Mathlib.Data.List.ProdSigma"
] | Mathlib/ModelTheory/Semantics.lean | realize_var | null |
realize_func (v : α → M) {n} (f : L.Functions n) (ts) :
realize v (func f ts : L.Term α) = funMap f fun i => (ts i).realize v := rfl
@[simp] | theorem | ModelTheory | [
"Mathlib.Data.Finset.Basic",
"Mathlib.ModelTheory.Syntax",
"Mathlib.Data.List.ProdSigma"
] | Mathlib/ModelTheory/Semantics.lean | realize_func | null |
realize_function_term {n} (v : Fin n → M) (f : L.Functions n) :
f.term.realize v = funMap f v := by
rfl
@[simp] | theorem | ModelTheory | [
"Mathlib.Data.Finset.Basic",
"Mathlib.ModelTheory.Syntax",
"Mathlib.Data.List.ProdSigma"
] | Mathlib/ModelTheory/Semantics.lean | realize_function_term | null |
realize_relabel {t : L.Term α} {g : α → β} {v : β → M} :
(t.relabel g).realize v = t.realize (v ∘ g) := by
induction t with
| var => rfl
| func f ts ih => simp [ih]
@[simp] | theorem | ModelTheory | [
"Mathlib.Data.Finset.Basic",
"Mathlib.ModelTheory.Syntax",
"Mathlib.Data.List.ProdSigma"
] | Mathlib/ModelTheory/Semantics.lean | realize_relabel | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.