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
mem_top (x : M) : x ∈ (⊤ : L.ElementarySubstructure M) := Set.mem_univ x @[simp]
theorem
ModelTheory
[ "Mathlib.ModelTheory.ElementaryMaps" ]
Mathlib/ModelTheory/ElementarySubstructures.lean
mem_top
null
coe_top : ((⊤ : L.ElementarySubstructure M) : Set M) = Set.univ := rfl @[simp]
theorem
ModelTheory
[ "Mathlib.ModelTheory.ElementaryMaps" ]
Mathlib/ModelTheory/ElementarySubstructures.lean
coe_top
null
realize_sentence (S : L.ElementarySubstructure M) (φ : L.Sentence) : S ⊨ φ ↔ M ⊨ φ := S.subtype.map_sentence φ @[simp]
theorem
ModelTheory
[ "Mathlib.ModelTheory.ElementaryMaps" ]
Mathlib/ModelTheory/ElementarySubstructures.lean
realize_sentence
null
theory_model_iff (S : L.ElementarySubstructure M) (T : L.Theory) : S ⊨ T ↔ M ⊨ T := by simp only [Theory.model_iff, realize_sentence]
theorem
ModelTheory
[ "Mathlib.ModelTheory.ElementaryMaps" ]
Mathlib/ModelTheory/ElementarySubstructures.lean
theory_model_iff
null
theory_model {T : L.Theory} [h : M ⊨ T] {S : L.ElementarySubstructure M} : S ⊨ T := (theory_model_iff S T).2 h
instance
ModelTheory
[ "Mathlib.ModelTheory.ElementaryMaps" ]
Mathlib/ModelTheory/ElementarySubstructures.lean
theory_model
null
instNonempty [Nonempty M] {S : L.ElementarySubstructure M} : Nonempty S := (model_nonemptyTheory_iff L).1 inferInstance
instance
ModelTheory
[ "Mathlib.ModelTheory.ElementaryMaps" ]
Mathlib/ModelTheory/ElementarySubstructures.lean
instNonempty
null
elementarilyEquivalent (S : L.ElementarySubstructure M) : S ≅[L] M := S.subtype.elementarilyEquivalent
theorem
ModelTheory
[ "Mathlib.ModelTheory.ElementaryMaps" ]
Mathlib/ModelTheory/ElementarySubstructures.lean
elementarilyEquivalent
null
isElementary_of_exists (S : L.Substructure M) (htv : ∀ (n : ℕ) (φ : L.BoundedFormula Empty (n + 1)) (x : Fin n → S) (a : M), φ.Realize default (Fin.snoc ((↑) ∘ x) a : _ → M) → ∃ b : S, φ.Realize default (Fin.snoc ((↑) ∘ x) b : _ → M)) : S.IsElementary := fun _ => S.subtype.isElementary_of_exists htv
theorem
ModelTheory
[ "Mathlib.ModelTheory.ElementaryMaps" ]
Mathlib/ModelTheory/ElementarySubstructures.lean
isElementary_of_exists
The Tarski-Vaught test for elementarity of a substructure.
@[simps] toElementarySubstructure (S : L.Substructure M) (htv : ∀ (n : ℕ) (φ : L.BoundedFormula Empty (n + 1)) (x : Fin n → S) (a : M), φ.Realize default (Fin.snoc ((↑) ∘ x) a : _ → M) → ∃ b : S, φ.Realize default (Fin.snoc ((↑) ∘ x) b : _ → M)) : L.ElementarySubstructure M := ⟨S, S.isElementary_of_exists htv⟩
def
ModelTheory
[ "Mathlib.ModelTheory.ElementaryMaps" ]
Mathlib/ModelTheory/ElementarySubstructures.lean
toElementarySubstructure
Bundles a substructure satisfying the Tarski-Vaught test as an elementary substructure.
listEncode : L.Term α → List (α ⊕ (Σ i, L.Functions i)) | var i => [Sum.inl i] | func f ts => Sum.inr (⟨_, f⟩ : Σ i, L.Functions i)::(List.finRange _).flatMap fun i => (ts i).listEncode
def
ModelTheory
[ "Mathlib.Computability.Encoding", "Mathlib.Logic.Small.List", "Mathlib.ModelTheory.Syntax", "Mathlib.SetTheory.Cardinal.Arithmetic" ]
Mathlib/ModelTheory/Encoding.lean
listEncode
Encodes a term as a list of variables and function symbols.
listDecode : List (α ⊕ (Σ i, L.Functions i)) → List (L.Term α) | [] => [] | Sum.inl a::l => (var a)::listDecode l | Sum.inr ⟨n, f⟩::l => if h : n ≤ (listDecode l).length then (func f (fun i => (listDecode l)[i])) :: (listDecode l).drop n else []
def
ModelTheory
[ "Mathlib.Computability.Encoding", "Mathlib.Logic.Small.List", "Mathlib.ModelTheory.Syntax", "Mathlib.SetTheory.Cardinal.Arithmetic" ]
Mathlib/ModelTheory/Encoding.lean
listDecode
Decodes a list of variables and function symbols as a list of terms.
listDecode_encode_list (l : List (L.Term α)) : listDecode (l.flatMap listEncode) = l := by suffices h : ∀ (t : L.Term α) (l : List (α ⊕ (Σ i, L.Functions i))), listDecode (t.listEncode ++ l) = t::listDecode l by induction l with | nil => rfl | cons t l lih => rw [flatMap_cons, h t (l.flatMap listEncode), lih] intro t l induction t generalizing l with | var => rw [listEncode, singleton_append, listDecode] | @func n f ts ih => rw [listEncode, cons_append, listDecode] have h : listDecode (((finRange n).flatMap fun i : Fin n => (ts i).listEncode) ++ l) = (finRange n).map ts ++ listDecode l := by induction finRange n with | nil => rfl | cons i l' l'ih => rw [flatMap_cons, List.append_assoc, ih, map_cons, l'ih, cons_append] simp only [h, length_append, length_map, length_finRange, le_add_iff_nonneg_right, _root_.zero_le, ↓reduceDIte, getElem_fin, cons.injEq, func.injEq, heq_eq_eq, true_and] refine ⟨funext (fun i => ?_), ?_⟩ · simp only [length_map, length_finRange, is_lt, getElem_append_left, getElem_map, getElem_finRange, cast_mk, Fin.eta] · simp only [length_map, length_finRange, drop_left']
theorem
ModelTheory
[ "Mathlib.Computability.Encoding", "Mathlib.Logic.Small.List", "Mathlib.ModelTheory.Syntax", "Mathlib.SetTheory.Cardinal.Arithmetic" ]
Mathlib/ModelTheory/Encoding.lean
listDecode_encode_list
null
@[simps] protected encoding : Encoding (L.Term α) where Γ := α ⊕ (Σ i, L.Functions i) encode := listEncode decode l := (listDecode l).head?.join decode_encode t := by have h := listDecode_encode_list [t] rw [flatMap_singleton] at h simp only [Option.join, h, head?_cons, Option.pure_def, Option.bind_eq_bind, Option.bind_some, id_eq]
def
ModelTheory
[ "Mathlib.Computability.Encoding", "Mathlib.Logic.Small.List", "Mathlib.ModelTheory.Syntax", "Mathlib.SetTheory.Cardinal.Arithmetic" ]
Mathlib/ModelTheory/Encoding.lean
encoding
An encoding of terms as lists.
listEncode_injective : Function.Injective (listEncode : L.Term α → List (α ⊕ (Σ i, L.Functions i))) := Term.encoding.encode_injective
theorem
ModelTheory
[ "Mathlib.Computability.Encoding", "Mathlib.Logic.Small.List", "Mathlib.ModelTheory.Syntax", "Mathlib.SetTheory.Cardinal.Arithmetic" ]
Mathlib/ModelTheory/Encoding.lean
listEncode_injective
null
card_le : #(L.Term α) ≤ max ℵ₀ #(α ⊕ (Σ i, L.Functions i)) := lift_le.1 (_root_.trans Term.encoding.card_le_card_list (lift_le.2 (mk_list_le_max _)))
theorem
ModelTheory
[ "Mathlib.Computability.Encoding", "Mathlib.Logic.Small.List", "Mathlib.ModelTheory.Syntax", "Mathlib.SetTheory.Cardinal.Arithmetic" ]
Mathlib/ModelTheory/Encoding.lean
card_le
null
card_sigma : #(Σ n, L.Term (α ⊕ (Fin n))) = max ℵ₀ #(α ⊕ (Σ i, L.Functions i)) := by refine le_antisymm ?_ ?_ · rw [mk_sigma] refine (sum_le_iSup_lift _).trans ?_ rw [mk_nat, lift_aleph0, mul_eq_max_of_aleph0_le_left le_rfl, max_le_iff, ciSup_le_iff' (bddAbove_range _)] · refine ⟨le_max_left _ _, fun i => card_le.trans ?_⟩ refine max_le (le_max_left _ _) ?_ rw [← add_eq_max le_rfl, mk_sum, mk_sum, mk_sum, add_comm (Cardinal.lift #α), lift_add, add_assoc, lift_lift, lift_lift, mk_fin, lift_natCast] exact add_le_add_right (nat_lt_aleph0 _).le _ · rw [← one_le_iff_ne_zero] refine _root_.trans ?_ (le_ciSup (bddAbove_range _) 1) rw [one_le_iff_ne_zero, mk_ne_zero_iff] exact ⟨var (Sum.inr 0)⟩ · rw [max_le_iff, ← infinite_iff] refine ⟨Infinite.of_injective (fun i => ⟨i + 1, var (Sum.inr (last i))⟩) fun i j ij => ?_, ?_⟩ · cases ij rfl · rw [Cardinal.le_def] refine ⟨⟨Sum.elim (fun i => ⟨0, var (Sum.inl i)⟩) fun F => ⟨1, func F.2 fun _ => var (Sum.inr 0)⟩, ?_⟩⟩ rintro (a | a) (b | b) h · simp only [Sum.elim_inl, Sigma.mk.inj_iff, heq_eq_eq, var.injEq, Sum.inl.injEq, true_and] at h rw [h] · simp only [Sum.elim_inl, Sum.elim_inr, Sigma.mk.inj_iff, false_and, reduceCtorEq] at h · simp only [Sum.elim_inr, Sum.elim_inl, Sigma.mk.inj_iff, false_and, reduceCtorEq] at h · simp only [Sum.elim_inr, Sigma.mk.inj_iff, heq_eq_eq, func.injEq, true_and] at h rw [Sigma.ext_iff.2 ⟨h.1, h.2.1⟩]
theorem
ModelTheory
[ "Mathlib.Computability.Encoding", "Mathlib.Logic.Small.List", "Mathlib.ModelTheory.Syntax", "Mathlib.SetTheory.Cardinal.Arithmetic" ]
Mathlib/ModelTheory/Encoding.lean
card_sigma
null
small [Small.{u} α] : Small.{u} (L.Term α) := small_of_injective listEncode_injective
instance
ModelTheory
[ "Mathlib.Computability.Encoding", "Mathlib.Logic.Small.List", "Mathlib.ModelTheory.Syntax", "Mathlib.SetTheory.Cardinal.Arithmetic" ]
Mathlib/ModelTheory/Encoding.lean
small
null
listEncode : ∀ {n : ℕ}, L.BoundedFormula α n → List ((Σ k, L.Term (α ⊕ Fin k)) ⊕ ((Σ n, L.Relations n) ⊕ ℕ)) | n, falsum => [Sum.inr (Sum.inr (n + 2))] | _, equal t₁ t₂ => [Sum.inl ⟨_, t₁⟩, Sum.inl ⟨_, t₂⟩] | n, rel R ts => [Sum.inr (Sum.inl ⟨_, R⟩), Sum.inr (Sum.inr n)] ++ (List.finRange _).map fun i => Sum.inl ⟨n, ts i⟩ | _, imp φ₁ φ₂ => (Sum.inr (Sum.inr 0)::φ₁.listEncode) ++ φ₂.listEncode | _, all φ => Sum.inr (Sum.inr 1)::φ.listEncode
def
ModelTheory
[ "Mathlib.Computability.Encoding", "Mathlib.Logic.Small.List", "Mathlib.ModelTheory.Syntax", "Mathlib.SetTheory.Cardinal.Arithmetic" ]
Mathlib/ModelTheory/Encoding.lean
listEncode
Encodes a bounded formula as a list of symbols.
sigmaAll : (Σ n, L.BoundedFormula α n) → Σ n, L.BoundedFormula α n | ⟨n + 1, φ⟩ => ⟨n, φ.all⟩ | _ => default @[simp]
def
ModelTheory
[ "Mathlib.Computability.Encoding", "Mathlib.Logic.Small.List", "Mathlib.ModelTheory.Syntax", "Mathlib.SetTheory.Cardinal.Arithmetic" ]
Mathlib/ModelTheory/Encoding.lean
sigmaAll
Applies the `forall` quantifier to an element of `(Σ n, L.BoundedFormula α n)`, or returns `default` if not possible.
sigmaAll_apply {n} {φ : L.BoundedFormula α (n + 1)} : sigmaAll ⟨n + 1, φ⟩ = ⟨n, φ.all⟩ := rfl
lemma
ModelTheory
[ "Mathlib.Computability.Encoding", "Mathlib.Logic.Small.List", "Mathlib.ModelTheory.Syntax", "Mathlib.SetTheory.Cardinal.Arithmetic" ]
Mathlib/ModelTheory/Encoding.lean
sigmaAll_apply
null
sigmaImp : (Σ n, L.BoundedFormula α n) → (Σ n, L.BoundedFormula α n) → Σ n, L.BoundedFormula α n | ⟨m, φ⟩, ⟨n, ψ⟩ => if h : m = n then ⟨m, φ.imp (Eq.mp (by rw [h]) ψ)⟩ else default
def
ModelTheory
[ "Mathlib.Computability.Encoding", "Mathlib.Logic.Small.List", "Mathlib.ModelTheory.Syntax", "Mathlib.SetTheory.Cardinal.Arithmetic" ]
Mathlib/ModelTheory/Encoding.lean
sigmaImp
Applies `imp` to two elements of `(Σ n, L.BoundedFormula α n)`, or returns `default` if not possible.
@[simp] sigmaImp_apply {n} {φ ψ : L.BoundedFormula α n} : sigmaImp ⟨n, φ⟩ ⟨n, ψ⟩ = ⟨n, φ.imp ψ⟩ := by simp only [sigmaImp, ↓reduceDIte, eq_mp_eq_cast, cast_eq]
lemma
ModelTheory
[ "Mathlib.Computability.Encoding", "Mathlib.Logic.Small.List", "Mathlib.ModelTheory.Syntax", "Mathlib.SetTheory.Cardinal.Arithmetic" ]
Mathlib/ModelTheory/Encoding.lean
sigmaImp_apply
Decodes a list of symbols as a list of formulas.
listDecode : List ((Σ k, L.Term (α ⊕ Fin k)) ⊕ ((Σ n, L.Relations n) ⊕ ℕ)) → List (Σ n, L.BoundedFormula α n) | Sum.inr (Sum.inr (n + 2))::l => ⟨n, falsum⟩::(listDecode l) | Sum.inl ⟨n₁, t₁⟩::Sum.inl ⟨n₂, t₂⟩::l => (if h : n₁ = n₂ then ⟨n₁, equal t₁ (Eq.mp (by rw [h]) t₂)⟩ else default)::(listDecode l) | Sum.inr (Sum.inl ⟨n, R⟩)::Sum.inr (Sum.inr k)::l => ( if h : ∀ i : Fin n, (l.map Sum.getLeft?)[i]?.join.isSome then if h' : ∀ i, (Option.get _ (h i)).1 = k then ⟨k, BoundedFormula.rel R fun i => Eq.mp (by rw [h' i]) (Option.get _ (h i)).2⟩ else default else default)::(listDecode (l.drop n)) | Sum.inr (Sum.inr 0)::l => if h : 2 ≤ (listDecode l).length then (sigmaImp (listDecode l)[0] (listDecode l)[1])::(drop 2 (listDecode l)) else [] | Sum.inr (Sum.inr 1)::l => if h : 1 ≤ (listDecode l).length then (sigmaAll (listDecode l)[0])::(drop 1 (listDecode l)) else [] | _ => [] termination_by l => l.length @[simp]
def
ModelTheory
[ "Mathlib.Computability.Encoding", "Mathlib.Logic.Small.List", "Mathlib.ModelTheory.Syntax", "Mathlib.SetTheory.Cardinal.Arithmetic" ]
Mathlib/ModelTheory/Encoding.lean
listDecode
Decodes a list of symbols as a list of formulas.
listDecode_encode_list (l : List (Σ n, L.BoundedFormula α n)) : listDecode (l.flatMap (fun φ => φ.2.listEncode)) = l := by suffices h : ∀ (φ : Σ n, L.BoundedFormula α n) (l' : List ((Σ k, L.Term (α ⊕ Fin k)) ⊕ ((Σ n, L.Relations n) ⊕ ℕ))), (listDecode (listEncode φ.2 ++ l')) = φ::(listDecode l') by induction l with | nil => simp [listDecode] | cons φ l ih => rw [flatMap_cons, h φ _, ih] rintro ⟨n, φ⟩ induction φ with | falsum => intro l; rw [listEncode, singleton_append, listDecode] | equal => intro l rw [listEncode, cons_append, cons_append, listDecode, dif_pos] · simp only [eq_mp_eq_cast, cast_eq, nil_append] · simp only | @rel φ_n φ_l φ_R ts => intro l rw [listEncode, cons_append, cons_append, singleton_append, cons_append, listDecode] have h : ∀ i : Fin φ_l, ((List.map Sum.getLeft? (List.map (fun i : Fin φ_l => Sum.inl (⟨(⟨φ_n, rel φ_R ts⟩ : Σ n, L.BoundedFormula α n).fst, ts i⟩ : Σ n, L.Term (α ⊕ (Fin n)))) (finRange φ_l) ++ l))[↑i]?).join = some ⟨_, ts i⟩ := by intro i simp only [Option.join, map_append, map_map, getElem?_fin, id, Option.bind_eq_some_iff, getElem?_eq_some_iff, length_append, length_map, length_finRange, exists_eq_right] refine ⟨lt_of_lt_of_le i.2 le_self_add, ?_⟩ rw [getElem_append_left, getElem_map] · simp only [getElem_finRange, cast_mk, Fin.eta, Function.comp_apply, Sum.getLeft?_inl] · simp only [length_map, length_finRange, is_lt] rw [dif_pos] swap · exact fun i => Option.isSome_iff_exists.2 ⟨⟨_, ts i⟩, h i⟩ rw [dif_pos] swap · intro i obtain ⟨h1, h2⟩ := Option.eq_some_iff_get_eq.1 (h i) rw [h2] simp only [Option.join, eq_mp_eq_cast, cons.injEq, Sigma.mk.inj_iff, heq_eq_eq, rel.injEq, true_and] refine ⟨funext fun i => ?_, ?_⟩ · obtain ⟨h1, h2⟩ := Option.eq_some_iff_get_eq.1 (h i) rw [cast_eq_iff_heq] exact (Sigma.ext_iff.1 ((Sigma.eta (Option.get _ h1)).trans h2)).2 rw [List.drop_append, length_map, length_finRange, Nat.sub_self, drop, drop_eq_nil_of_le, nil_append] rw [length_map, length_finRange] | imp _ _ ih1 ih2 => intro l simp only [] at * rw [listEncode, List.append_assoc, cons_append, listDecode] ...
theorem
ModelTheory
[ "Mathlib.Computability.Encoding", "Mathlib.Logic.Small.List", "Mathlib.ModelTheory.Syntax", "Mathlib.SetTheory.Cardinal.Arithmetic" ]
Mathlib/ModelTheory/Encoding.lean
listDecode_encode_list
null
@[simps] protected encoding : Encoding (Σ n, L.BoundedFormula α n) where Γ := (Σ k, L.Term (α ⊕ Fin k)) ⊕ ((Σ n, L.Relations n) ⊕ ℕ) encode φ := φ.2.listEncode decode l := (listDecode l)[0]? decode_encode φ := by have h := listDecode_encode_list [φ] rw [flatMap_singleton] at h rw [h] rfl
def
ModelTheory
[ "Mathlib.Computability.Encoding", "Mathlib.Logic.Small.List", "Mathlib.ModelTheory.Syntax", "Mathlib.SetTheory.Cardinal.Arithmetic" ]
Mathlib/ModelTheory/Encoding.lean
encoding
An encoding of bounded formulas as lists.
listEncode_sigma_injective : Function.Injective fun φ : Σ n, L.BoundedFormula α n => φ.2.listEncode := BoundedFormula.encoding.encode_injective
theorem
ModelTheory
[ "Mathlib.Computability.Encoding", "Mathlib.Logic.Small.List", "Mathlib.ModelTheory.Syntax", "Mathlib.SetTheory.Cardinal.Arithmetic" ]
Mathlib/ModelTheory/Encoding.lean
listEncode_sigma_injective
null
card_le : #(Σ n, L.BoundedFormula α n) ≤ max ℵ₀ (Cardinal.lift.{max u v} #α + Cardinal.lift.{u'} L.card) := by refine lift_le.1 (BoundedFormula.encoding.card_le_card_list.trans ?_) rw [encoding_Γ, mk_list_eq_max_mk_aleph0, lift_max, lift_aleph0, lift_max, lift_aleph0, max_le_iff] refine ⟨?_, le_max_left _ _⟩ rw [mk_sum, Term.card_sigma, mk_sum, ← add_eq_max le_rfl, mk_sum, mk_nat] simp only [lift_add, lift_lift, lift_aleph0] rw [← add_assoc, add_comm, ← add_assoc, ← add_assoc, aleph0_add_aleph0, add_assoc, add_eq_max le_rfl, add_assoc, card, Symbols, mk_sum, lift_add, lift_lift, lift_lift]
theorem
ModelTheory
[ "Mathlib.Computability.Encoding", "Mathlib.Logic.Small.List", "Mathlib.ModelTheory.Syntax", "Mathlib.SetTheory.Cardinal.Arithmetic" ]
Mathlib/ModelTheory/Encoding.lean
card_le
null
protected Imp (T : L.Theory) (φ ψ : L.BoundedFormula α n) : Prop := T ⊨ᵇ φ.imp ψ @[inherit_doc FirstOrder.Language.Theory.Imp] scoped[FirstOrder] notation:51 φ:50 " ⟹[" T "] " ψ:51 => Language.Theory.Imp T φ ψ
def
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
Imp
`φ ⟹[T] ψ` indicates that `φ` implies `ψ` in models of `T`.
@[refl] protected refl (φ : L.BoundedFormula α n) : φ ⟹[T] φ := fun _ _ _ => id
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
refl
null
@[trans] protected trans {φ ψ θ : L.BoundedFormula α n} (h1 : φ ⟹[T] ψ) (h2 : ψ ⟹[T] θ) : φ ⟹[T] θ := fun M v xs => (h2 M v xs) ∘ (h1 M v xs)
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
trans
null
bot_imp (φ : L.BoundedFormula α n) : ⊥ ⟹[T] φ := fun M v xs => by simp only [BoundedFormula.realize_imp, BoundedFormula.realize_bot, false_implies]
lemma
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
bot_imp
null
imp_top (φ : L.BoundedFormula α n) : φ ⟹[T] ⊤ := fun M v xs => by simp only [BoundedFormula.realize_imp, BoundedFormula.realize_top, implies_true]
lemma
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
imp_top
null
imp_sup_left (φ ψ : L.BoundedFormula α n) : φ ⟹[T] φ ⊔ ψ := fun M v xs => by simp only [BoundedFormula.realize_imp, BoundedFormula.realize_sup] exact Or.inl
lemma
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
imp_sup_left
null
imp_sup_right (φ ψ : L.BoundedFormula α n) : ψ ⟹[T] φ ⊔ ψ := fun M v xs => by simp only [BoundedFormula.realize_imp, BoundedFormula.realize_sup] exact Or.inr
lemma
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
imp_sup_right
null
sup_imp {φ ψ θ : L.BoundedFormula α n} (h₁ : φ ⟹[T] θ) (h₂ : ψ ⟹[T] θ) : φ ⊔ ψ ⟹[T] θ := fun M v xs => by simp only [BoundedFormula.realize_imp, BoundedFormula.realize_sup] exact fun h => h.elim (h₁ M v xs) (h₂ M v xs)
lemma
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
sup_imp
null
sup_imp_iff {φ ψ θ : L.BoundedFormula α n} : (φ ⊔ ψ ⟹[T] θ) ↔ (φ ⟹[T] θ) ∧ (ψ ⟹[T] θ) := ⟨fun h => ⟨(imp_sup_left _ _).trans h, (imp_sup_right _ _).trans h⟩, fun ⟨h₁, h₂⟩ => sup_imp h₁ h₂⟩
lemma
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
sup_imp_iff
null
inf_imp_left (φ ψ : L.BoundedFormula α n) : φ ⊓ ψ ⟹[T] φ := fun M v xs => by simp only [BoundedFormula.realize_imp, BoundedFormula.realize_inf] exact And.left
lemma
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
inf_imp_left
null
inf_imp_right (φ ψ : L.BoundedFormula α n) : φ ⊓ ψ ⟹[T] ψ := fun M v xs => by simp only [BoundedFormula.realize_imp, BoundedFormula.realize_inf] exact And.right
lemma
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
inf_imp_right
null
imp_inf {φ ψ θ : L.BoundedFormula α n} (h₁ : φ ⟹[T] ψ) (h₂ : φ ⟹[T] θ) : φ ⟹[T] ψ ⊓ θ := fun M v xs => by simp only [BoundedFormula.realize_imp, BoundedFormula.realize_inf] exact fun h => ⟨h₁ M v xs h, h₂ M v xs h⟩
lemma
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
imp_inf
null
imp_inf_iff {φ ψ θ : L.BoundedFormula α n} : (φ ⟹[T] ψ ⊓ θ) ↔ (φ ⟹[T] ψ) ∧ (φ ⟹[T] θ) := ⟨fun h => ⟨h.trans (inf_imp_left _ _), h.trans (inf_imp_right _ _)⟩, fun ⟨h₁, h₂⟩ => imp_inf h₁ h₂⟩
lemma
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
imp_inf_iff
null
protected Iff (T : L.Theory) (φ ψ : L.BoundedFormula α n) : Prop := T ⊨ᵇ φ.iff ψ @[inherit_doc FirstOrder.Language.Theory.Iff] scoped[FirstOrder] notation:51 φ:50 " ⇔[" T "] " ψ:51 => Language.Theory.Iff T φ ψ
def
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
Iff
Two (bounded) formulas are semantically equivalent over a theory `T` when they have the same interpretation in every model of `T`. (This is also known as logical equivalence, which also has a proof-theoretic definition.)
iff_iff_imp_and_imp {φ ψ : L.BoundedFormula α n} : (φ ⇔[T] ψ) ↔ (φ ⟹[T] ψ) ∧ (ψ ⟹[T] φ) := by simp only [Theory.Imp, ModelsBoundedFormula, BoundedFormula.realize_imp, ← forall_and, Theory.Iff, BoundedFormula.realize_iff, iff_iff_implies_and_implies]
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
iff_iff_imp_and_imp
null
imp_antisymm {φ ψ : L.BoundedFormula α n} (h₁ : φ ⟹[T] ψ) (h₂ : ψ ⟹[T] φ) : φ ⇔[T] ψ := iff_iff_imp_and_imp.2 ⟨h₁, h₂⟩
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
imp_antisymm
null
protected mp {φ ψ : L.BoundedFormula α n} (h : φ ⇔[T] ψ) : φ ⟹[T] ψ := (iff_iff_imp_and_imp.1 h).1
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
mp
null
protected mpr {φ ψ : L.BoundedFormula α n} (h : φ ⇔[T] ψ) : ψ ⟹[T] φ := (iff_iff_imp_and_imp.1 h).2 @[refl]
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
mpr
null
protected refl (φ : L.BoundedFormula α n) : φ ⇔[T] φ := fun M v xs => by rw [BoundedFormula.realize_iff]
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
refl
null
@[symm] protected symm {φ ψ : L.BoundedFormula α n} (h : φ ⇔[T] ψ) : ψ ⇔[T] φ := fun M v xs => by rw [BoundedFormula.realize_iff, Iff.comm, ← BoundedFormula.realize_iff] exact h M v xs
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
symm
null
@[trans] protected trans {φ ψ θ : L.BoundedFormula α n} (h1 : φ ⇔[T] ψ) (h2 : ψ ⇔[T] θ) : φ ⇔[T] θ := fun M v xs => by have h1' := h1 M v xs have h2' := h2 M v xs rw [BoundedFormula.realize_iff] at * exact ⟨h2'.1 ∘ h1'.1, h1'.2 ∘ h2'.2⟩
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
trans
null
realize_bd_iff {φ ψ : L.BoundedFormula α n} (h : φ ⇔[T] ψ) {v : α → M} {xs : Fin n → M} : φ.Realize v xs ↔ ψ.Realize v xs := BoundedFormula.realize_iff.1 (h.realize_boundedFormula M)
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
realize_bd_iff
null
realize_iff {φ ψ : L.Formula α} {M : Type*} [Nonempty M] [L.Structure M] [M ⊨ T] (h : φ ⇔[T] ψ) {v : α → M} : φ.Realize v ↔ ψ.Realize v := h.realize_bd_iff
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
realize_iff
null
models_sentence_iff {φ ψ : L.Sentence} {M : Type*} [Nonempty M] [L.Structure M] [M ⊨ T] (h : φ ⇔[T] ψ) : M ⊨ φ ↔ M ⊨ ψ := h.realize_iff
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
models_sentence_iff
null
protected all {φ ψ : L.BoundedFormula α (n + 1)} (h : φ ⇔[T] ψ) : φ.all ⇔[T] ψ.all := by simp_rw [Theory.Iff, ModelsBoundedFormula, BoundedFormula.realize_iff, BoundedFormula.realize_all] exact fun M v xs => forall_congr' fun a => h.realize_bd_iff
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
all
null
protected ex {φ ψ : L.BoundedFormula α (n + 1)} (h : φ ⇔[T] ψ) : φ.ex ⇔[T] ψ.ex := by simp_rw [Theory.Iff, ModelsBoundedFormula, BoundedFormula.realize_iff, BoundedFormula.realize_ex] exact fun M v xs => exists_congr fun a => h.realize_bd_iff
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
ex
null
protected not {φ ψ : L.BoundedFormula α n} (h : φ ⇔[T] ψ) : φ.not ⇔[T] ψ.not := by simp_rw [Theory.Iff, ModelsBoundedFormula, BoundedFormula.realize_iff, BoundedFormula.realize_not] exact fun M v xs => not_congr h.realize_bd_iff
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
not
null
protected imp {φ ψ φ' ψ' : L.BoundedFormula α n} (h : φ ⇔[T] ψ) (h' : φ' ⇔[T] ψ') : (φ.imp φ') ⇔[T] (ψ.imp ψ') := by simp_rw [Theory.Iff, ModelsBoundedFormula, BoundedFormula.realize_iff, BoundedFormula.realize_imp] exact fun M v xs => imp_congr h.realize_bd_iff h'.realize_bd_iff
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
imp
null
iffSetoid (T : L.Theory) : Setoid (L.BoundedFormula α n) where r := T.Iff iseqv := ⟨fun _ => refl _, fun {_ _} h => h.symm, fun {_ _ _} h1 h2 => h1.trans h2⟩
def
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
iffSetoid
Semantic equivalence forms an equivalence relation on formulas.
iff_not_not : φ ⇔[T] φ.not.not := fun M v xs => by simp
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
iff_not_not
null
imp_iff_not_sup : (φ.imp ψ) ⇔[T] (φ.not ⊔ ψ) := fun M v xs => by simp [imp_iff_not_or]
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
imp_iff_not_sup
null
sup_iff_not_inf_not : (φ ⊔ ψ) ⇔[T] (φ.not ⊓ ψ.not).not := fun M v xs => by simp [imp_iff_not_or]
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
sup_iff_not_inf_not
null
inf_iff_not_sup_not : (φ ⊓ ψ) ⇔[T] (φ.not ⊔ ψ.not).not := fun M v xs => by simp
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
inf_iff_not_sup_not
null
all_iff_not_ex_not (φ : L.BoundedFormula α (n + 1)) : φ.all ⇔[T] φ.not.ex.not := fun M v xs => by simp
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
all_iff_not_ex_not
null
ex_iff_not_all_not (φ : L.BoundedFormula α (n + 1)) : φ.ex ⇔[T] φ.not.all.not := fun M v xs => by simp
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
ex_iff_not_all_not
null
iff_all_liftAt : φ ⇔[T] (φ.liftAt 1 n).all := fun M v xs => by rw [realize_iff, realize_all_liftAt_one_self]
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
iff_all_liftAt
null
inf_not_iff_bot : φ ⊓ ∼φ ⇔[T] ⊥ := fun M v xs => by simp only [realize_iff, realize_inf, realize_not, and_not_self, realize_bot]
lemma
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
inf_not_iff_bot
null
sup_not_iff_top : φ ⊔ ∼φ ⇔[T] ⊤ := fun M v xs => by simp only [realize_iff, realize_sup, realize_not, realize_top, or_not]
lemma
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
sup_not_iff_top
null
iff_not_not : φ ⇔[T] φ.not.not := BoundedFormula.iff_not_not φ
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
iff_not_not
null
imp_iff_not_sup : (φ.imp ψ) ⇔[T] (φ.not ⊔ ψ) := BoundedFormula.imp_iff_not_sup φ ψ
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
imp_iff_not_sup
null
sup_iff_not_inf_not : (φ ⊔ ψ) ⇔[T] (φ.not ⊓ ψ.not).not := BoundedFormula.sup_iff_not_inf_not φ ψ
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
sup_iff_not_inf_not
null
inf_iff_not_sup_not : (φ ⊓ ψ) ⇔[T] (φ.not ⊔ ψ.not).not := BoundedFormula.inf_iff_not_sup_not φ ψ
theorem
ModelTheory
[ "Mathlib.ModelTheory.Satisfiability" ]
Mathlib/ModelTheory/Equivalence.lean
inf_iff_not_sup_not
null
FG (N : L.Substructure M) : Prop := ∃ S : Finset M, closure L S = N
def
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
FG
A substructure of `M` is finitely generated if it is the closure of a finite subset of `M`.
fg_def {N : L.Substructure M} : N.FG ↔ ∃ S : Set M, S.Finite ∧ closure L S = N := ⟨fun ⟨t, h⟩ => ⟨_, Finset.finite_toSet t, h⟩, by rintro ⟨t', h, rfl⟩ rcases Finite.exists_finset_coe h with ⟨t, rfl⟩ exact ⟨t, rfl⟩⟩
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
fg_def
null
fg_iff_exists_fin_generating_family {N : L.Substructure M} : N.FG ↔ ∃ (n : ℕ) (s : Fin n → M), closure L (range s) = N := by rw [fg_def] constructor · rintro ⟨S, Sfin, hS⟩ obtain ⟨n, f, rfl⟩ := Sfin.fin_embedding exact ⟨n, f, hS⟩ · rintro ⟨n, s, hs⟩ exact ⟨range s, finite_range s, hs⟩
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
fg_iff_exists_fin_generating_family
null
fg_bot : (⊥ : L.Substructure M).FG := ⟨∅, by rw [Finset.coe_empty, closure_empty]⟩
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
fg_bot
null
instInhabited_fg : Inhabited { S : L.Substructure M // S.FG } := ⟨⊥, fg_bot⟩
instance
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
instInhabited_fg
null
fg_closure {s : Set M} (hs : s.Finite) : FG (closure L s) := ⟨hs.toFinset, by rw [hs.coe_toFinset]⟩
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
fg_closure
null
fg_closure_singleton (x : M) : FG (closure L ({x} : Set M)) := fg_closure (finite_singleton x)
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
fg_closure_singleton
null
FG.sup {N₁ N₂ : L.Substructure M} (hN₁ : N₁.FG) (hN₂ : N₂.FG) : (N₁ ⊔ N₂).FG := let ⟨t₁, ht₁⟩ := fg_def.1 hN₁ let ⟨t₂, ht₂⟩ := fg_def.1 hN₂ fg_def.2 ⟨t₁ ∪ t₂, ht₁.1.union ht₂.1, by rw [closure_union, ht₁.2, ht₂.2]⟩
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
FG.sup
null
FG.map {N : Type*} [L.Structure N] (f : M →[L] N) {s : L.Substructure M} (hs : s.FG) : (s.map f).FG := let ⟨t, ht⟩ := fg_def.1 hs fg_def.2 ⟨f '' t, ht.1.image _, by rw [closure_image, ht.2]⟩
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
FG.map
null
FG.of_map_embedding {N : Type*} [L.Structure N] (f : M ↪[L] N) {s : L.Substructure M} (hs : (s.map f.toHom).FG) : s.FG := by rcases hs with ⟨t, h⟩ rw [fg_def] refine ⟨f ⁻¹' t, t.finite_toSet.preimage f.injective.injOn, ?_⟩ have hf : Function.Injective f.toHom := f.injective refine map_injective_of_injective hf ?_ rw [← h, map_closure, Embedding.coe_toHom, image_preimage_eq_of_subset] intro x hx have h' := subset_closure (L := L) hx rw [h] at h' exact Hom.map_le_range h'
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
FG.of_map_embedding
null
FG.of_finite {s : L.Substructure M} [h : Finite s] : s.FG := ⟨Set.Finite.toFinset h, by simp only [Finite.coe_toFinset, closure_eq]⟩
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
FG.of_finite
null
FG.finite [L.IsRelational] {S : L.Substructure M} (h : S.FG) : Finite S := by obtain ⟨s, rfl⟩ := h have hs := s.finite_toSet rw [← closure_eq_of_isRelational L (s : Set M)] at hs exact hs
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
FG.finite
null
fg_iff_finite [L.IsRelational] {S : L.Substructure M} : S.FG ↔ Finite S := ⟨FG.finite, fun _ => FG.of_finite⟩
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
fg_iff_finite
null
CG (N : L.Substructure M) : Prop := ∃ S : Set M, S.Countable ∧ closure L S = N
def
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
CG
A substructure of `M` is countably generated if it is the closure of a countable subset of `M`.
cg_def {N : L.Substructure M} : N.CG ↔ ∃ S : Set M, S.Countable ∧ closure L S = N := Iff.refl _
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
cg_def
null
FG.cg {N : L.Substructure M} (h : N.FG) : N.CG := by obtain ⟨s, hf, rfl⟩ := fg_def.1 h exact ⟨s, hf.countable, rfl⟩
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
FG.cg
null
cg_iff_empty_or_exists_nat_generating_family {N : L.Substructure M} : N.CG ↔ N = (∅ : Set M) ∨ ∃ s : ℕ → M, closure L (range s) = N := by rw [cg_def] constructor · rintro ⟨S, Scount, hS⟩ rcases eq_empty_or_nonempty (N : Set M) with h | h · exact Or.intro_left _ h obtain ⟨f, h'⟩ := (Scount.union (Set.countable_singleton h.some)).exists_eq_range (singleton_nonempty h.some).inr refine Or.intro_right _ ⟨f, ?_⟩ rw [← h', closure_union, hS, sup_eq_left, closure_le] exact singleton_subset_iff.2 h.some_mem · intro h rcases h with h | h · refine ⟨∅, countable_empty, closure_eq_of_le (empty_subset _) ?_⟩ rw [← SetLike.coe_subset_coe, h] exact empty_subset _ · obtain ⟨f, rfl⟩ := h exact ⟨range f, countable_range _, rfl⟩
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
cg_iff_empty_or_exists_nat_generating_family
null
cg_bot : (⊥ : L.Substructure M).CG := fg_bot.cg
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
cg_bot
null
cg_closure {s : Set M} (hs : s.Countable) : CG (closure L s) := ⟨s, hs, rfl⟩
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
cg_closure
null
cg_closure_singleton (x : M) : CG (closure L ({x} : Set M)) := (fg_closure_singleton x).cg
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
cg_closure_singleton
null
CG.sup {N₁ N₂ : L.Substructure M} (hN₁ : N₁.CG) (hN₂ : N₂.CG) : (N₁ ⊔ N₂).CG := let ⟨t₁, ht₁⟩ := cg_def.1 hN₁ let ⟨t₂, ht₂⟩ := cg_def.1 hN₂ cg_def.2 ⟨t₁ ∪ t₂, ht₁.1.union ht₂.1, by rw [closure_union, ht₁.2, ht₂.2]⟩
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
CG.sup
null
CG.map {N : Type*} [L.Structure N] (f : M →[L] N) {s : L.Substructure M} (hs : s.CG) : (s.map f).CG := let ⟨t, ht⟩ := cg_def.1 hs cg_def.2 ⟨f '' t, ht.1.image _, by rw [closure_image, ht.2]⟩
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
CG.map
null
CG.of_map_embedding {N : Type*} [L.Structure N] (f : M ↪[L] N) {s : L.Substructure M} (hs : (s.map f.toHom).CG) : s.CG := by rcases hs with ⟨t, h1, h2⟩ rw [cg_def] refine ⟨f ⁻¹' t, h1.preimage f.injective, ?_⟩ have hf : Function.Injective f.toHom := f.injective refine map_injective_of_injective hf ?_ rw [← h2, map_closure, Embedding.coe_toHom, image_preimage_eq_of_subset] intro x hx have h' := subset_closure (L := L) hx rw [h2] at h' exact Hom.map_le_range h'
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
CG.of_map_embedding
null
cg_iff_countable [Countable (Σ l, L.Functions l)] {s : L.Substructure M} : s.CG ↔ Countable s := by refine ⟨?_, fun h => ⟨s, h.to_set, s.closure_eq⟩⟩ rintro ⟨s, h, rfl⟩ exact h.substructure_closure L
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
cg_iff_countable
null
cg_of_countable {s : L.Substructure M} [h : Countable s] : s.CG := ⟨s, h.to_set, s.closure_eq⟩
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
cg_of_countable
null
FG : Prop where out : (⊤ : L.Substructure M).FG
class
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
FG
A structure is finitely generated if it is the closure of a finite subset.
CG : Prop where out : (⊤ : L.Substructure M).CG variable {L M}
class
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
CG
A structure is countably generated if it is the closure of a countable subset.
fg_def : FG L M ↔ (⊤ : L.Substructure M).FG := ⟨fun h => h.1, fun h => ⟨h⟩⟩
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
fg_def
null
fg_iff : FG L M ↔ ∃ S : Set M, S.Finite ∧ closure L S = (⊤ : L.Substructure M) := by rw [fg_def, Substructure.fg_def]
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
fg_iff
An equivalent expression of `Structure.FG` in terms of `Set.Finite` instead of `Finset`.
FG.range {N : Type*} [L.Structure N] (h : FG L M) (f : M →[L] N) : f.range.FG := by rw [Hom.range_eq_map] exact (fg_def.1 h).map f
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
FG.range
null
FG.map_of_surjective {N : Type*} [L.Structure N] (h : FG L M) (f : M →[L] N) (hs : Function.Surjective f) : FG L N := by rw [← Hom.range_eq_top] at hs rw [fg_def, ← hs] exact h.range f
theorem
ModelTheory
[ "Mathlib.Data.Set.Finite.Lemmas", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/FinitelyGenerated.lean
FG.map_of_surjective
null