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_compl : x ∈ sᶜ ↔ x ∉ s := Iff.rfl @[simp]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
mem_compl
null
mem_sdiff : x ∈ s \ t ↔ x ∈ s ∧ x ∉ t := Iff.rfl @[simp, norm_cast]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
mem_sdiff
null
coe_top : ((⊤ : L.DefinableSet A α) : Set (α → M)) = univ := rfl @[simp, norm_cast]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
coe_top
null
coe_bot : ((⊥ : L.DefinableSet A α) : Set (α → M)) = ∅ := rfl @[simp, norm_cast]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
coe_bot
null
coe_sup (s t : L.DefinableSet A α) : ((s ⊔ t : L.DefinableSet A α) : Set (α → M)) = (s : Set (α → M)) ∪ (t : Set (α → M)) := rfl @[simp, norm_cast]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
coe_sup
null
coe_inf (s t : L.DefinableSet A α) : ((s ⊓ t : L.DefinableSet A α) : Set (α → M)) = (s : Set (α → M)) ∩ (t : Set (α → M)) := rfl @[simp, norm_cast]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
coe_inf
null
coe_compl (s : L.DefinableSet A α) : ((sᶜ : L.DefinableSet A α) : Set (α → M)) = (s : Set (α → M))ᶜ := rfl @[simp, norm_cast]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
coe_compl
null
coe_sdiff (s t : L.DefinableSet A α) : ((s \ t : L.DefinableSet A α) : Set (α → M)) = (s : Set (α → M)) \ (t : Set (α → M)) := rfl @[simp, norm_cast]
theorem
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
coe_sdiff
null
coe_himp (s t : L.DefinableSet A α) : ↑(s ⇨ t) = (s ⇨ t : Set (α → M)) := rfl
lemma
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
coe_himp
null
noncomputable instBooleanAlgebra : BooleanAlgebra (L.DefinableSet A α) := Function.Injective.booleanAlgebra (α := L.DefinableSet A α) _ Subtype.coe_injective coe_sup coe_inf coe_top coe_bot coe_compl coe_sdiff coe_himp
instance
ModelTheory
[ "Mathlib.Data.SetLike.Basic", "Mathlib.ModelTheory.Semantics" ]
Mathlib/ModelTheory/Definability.lean
instBooleanAlgebra
null
natLERec (m n : ℕ) (h : m ≤ n) : G' m ↪[L] G' n := Nat.leRecOn h (@fun k g => (f' k).comp g) (Embedding.refl L _) @[simp]
def
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
natLERec
Given a chain of embeddings of structures indexed by `ℕ`, defines a `DirectedSystem` by composing them.
coe_natLERec (m n : ℕ) (h : m ≤ n) : (natLERec f' m n h : G' m → G' n) = Nat.leRecOn h (@fun k => f' k) := by obtain ⟨k, rfl⟩ := Nat.exists_eq_add_of_le h ext x induction k with | zero => erw [natLERec, Nat.leRecOn_self, Embedding.refl_apply, Nat.leRecOn_self] | succ k ih => erw [Nat.leRecOn_succ le_self_add, natLERec, Nat.leRecOn_succ le_self_add, ← natLERec, Embedding.comp_apply, ih]
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
coe_natLERec
null
natLERec.directedSystem : DirectedSystem G' fun i j h => natLERec f' i j h := ⟨fun _ _ => congr (congr rfl (Nat.leRecOn_self _)) rfl, fun _ _ _ hij hjk => by simp [Nat.leRecOn_trans hij hjk]⟩
instance
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
natLERec.directedSystem
null
@[nolint unusedArguments] protected Structure.Sigma (f : ∀ i j, i ≤ j → G i ↪[L] G j) := Σ i, G i local notation "Σˣ" => Structure.Sigma
abbrev
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
Structure.Sigma
Alias for `Σ i, G i`. Instead of `Σ i, G i`, we use the alias `Language.Structure.Sigma` which depends on `f`. This way, Lean can infer what `L` and `f` are in the `Setoid` instance. Otherwise we have a "cannot find synthesization order" error. See also the discussion at https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/local.20instance.20cannot.20find.20synthesization.20order.20in.20porting
Structure.Sigma.mk (i : ι) (x : G i) : Σˣ f := ⟨i, x⟩
abbrev
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
Structure.Sigma.mk
Constructor for `FirstOrder.Language.Structure.Sigma` alias.
unify {α : Type*} (x : α → Σˣ f) (i : ι) (h : i ∈ upperBounds (range (Sigma.fst ∘ x))) (a : α) : G i := f (x a).1 i (h (mem_range_self a)) (x a).2 variable [DirectedSystem G fun i j h => f i j h] @[simp]
def
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
unify
Raises a family of elements in the `Σ`-type to the same level along the embeddings.
unify_sigma_mk_self {α : Type*} {i : ι} {x : α → G i} : (unify f (fun a => .mk f i (x a)) i fun _ ⟨_, hj⟩ => _root_.trans (le_of_eq hj.symm) (refl _)) = x := by ext a rw [unify] apply DirectedSystem.map_self
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
unify_sigma_mk_self
null
comp_unify {α : Type*} {x : α → Σˣ f} {i j : ι} (ij : i ≤ j) (h : i ∈ upperBounds (range (Sigma.fst ∘ x))) : f i j ij ∘ unify f x i h = unify f x j fun k hk => _root_.trans (mem_upperBounds.1 h k hk) ij := by ext a simp [unify, DirectedSystem.map_map]
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
comp_unify
null
setoid [DirectedSystem G fun i j h => f i j h] [IsDirected ι (· ≤ ·)] : Setoid (Σˣ f) where r := fun ⟨i, x⟩ ⟨j, y⟩ => ∃ (k : ι) (ik : i ≤ k) (jk : j ≤ k), f i k ik x = f j k jk y iseqv := ⟨fun ⟨i, _⟩ => ⟨i, refl i, refl i, rfl⟩, @fun ⟨_, _⟩ ⟨_, _⟩ ⟨k, ik, jk, h⟩ => ⟨k, jk, ik, h.symm⟩, @fun ⟨i, x⟩ ⟨j, y⟩ ⟨k, z⟩ ⟨ij, hiij, hjij, hij⟩ ⟨jk, hjjk, hkjk, hjk⟩ => by obtain ⟨ijk, hijijk, hjkijk⟩ := directed_of (· ≤ ·) ij jk refine ⟨ijk, le_trans hiij hijijk, le_trans hkjk hjkijk, ?_⟩ rw [← DirectedSystem.map_map _ hiij hijijk, hij, DirectedSystem.map_map] rw [← DirectedSystem.map_map _ hkjk hjkijk, ← hjk, DirectedSystem.map_map]⟩
def
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
setoid
The directed limit glues together the structures along the embeddings.
noncomputable sigmaStructure [IsDirected ι (· ≤ ·)] [Nonempty ι] : L.Structure (Σˣ f) where funMap F x := ⟨_, funMap F (unify f x (Classical.choose (Finite.bddAbove_range fun a => (x a).1)) (Classical.choose_spec (Finite.bddAbove_range fun a => (x a).1)))⟩ RelMap R x := RelMap R (unify f x (Classical.choose (Finite.bddAbove_range fun a => (x a).1)) (Classical.choose_spec (Finite.bddAbove_range fun a => (x a).1)))
def
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
sigmaStructure
The structure on the `Σ`-type which becomes the structure on the direct limit after quotienting.
DirectLimit [DirectedSystem G fun i j h => f i j h] [IsDirected ι (· ≤ ·)] := Quotient (DirectLimit.setoid G f) attribute [local instance] DirectLimit.setoid DirectLimit.sigmaStructure
def
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
DirectLimit
The direct limit of a directed system is the structures glued together along the embeddings.
equiv_iff {x y : Σˣ f} {i : ι} (hx : x.1 ≤ i) (hy : y.1 ≤ i) : x ≈ y ↔ (f x.1 i hx) x.2 = (f y.1 i hy) y.2 := by cases x cases y refine ⟨fun xy => ?_, fun xy => ⟨i, hx, hy, xy⟩⟩ obtain ⟨j, _, _, h⟩ := xy obtain ⟨k, ik, jk⟩ := directed_of (· ≤ ·) i j have h := congr_arg (f j k jk) h apply (f i k ik).injective rw [DirectedSystem.map_map, DirectedSystem.map_map] at * exact h
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
equiv_iff
null
funMap_unify_equiv {n : ℕ} (F : L.Functions n) (x : Fin n → Σˣ f) (i j : ι) (hi : i ∈ upperBounds (range (Sigma.fst ∘ x))) (hj : j ∈ upperBounds (range (Sigma.fst ∘ x))) : Structure.Sigma.mk f i (funMap F (unify f x i hi)) ≈ .mk f j (funMap F (unify f x j hj)) := by obtain ⟨k, ik, jk⟩ := directed_of (· ≤ ·) i j refine ⟨k, ik, jk, ?_⟩ rw [(f i k ik).map_fun, (f j k jk).map_fun, comp_unify, comp_unify]
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
funMap_unify_equiv
null
relMap_unify_equiv {n : ℕ} (R : L.Relations n) (x : Fin n → Σˣ f) (i j : ι) (hi : i ∈ upperBounds (range (Sigma.fst ∘ x))) (hj : j ∈ upperBounds (range (Sigma.fst ∘ x))) : RelMap R (unify f x i hi) = RelMap R (unify f x j hj) := by obtain ⟨k, ik, jk⟩ := directed_of (· ≤ ·) i j rw [← (f i k ik).map_rel, comp_unify, ← (f j k jk).map_rel, comp_unify] variable [Nonempty ι]
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
relMap_unify_equiv
null
exists_unify_eq {α : Type*} [Finite α] {x y : α → Σˣ f} (xy : x ≈ y) : ∃ (i : ι) (hx : i ∈ upperBounds (range (Sigma.fst ∘ x))) (hy : i ∈ upperBounds (range (Sigma.fst ∘ y))), unify f x i hx = unify f y i hy := by obtain ⟨i, hi⟩ := Finite.bddAbove_range (Sum.elim (fun a => (x a).1) fun a => (y a).1) rw [Sum.elim_range, upperBounds_union] at hi simp_rw [← Function.comp_apply (f := Sigma.fst)] at hi exact ⟨i, hi.1, hi.2, funext fun a => (equiv_iff G f _ _).1 (xy a)⟩
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
exists_unify_eq
null
funMap_equiv_unify {n : ℕ} (F : L.Functions n) (x : Fin n → Σˣ f) (i : ι) (hi : i ∈ upperBounds (range (Sigma.fst ∘ x))) : funMap F x ≈ .mk f _ (funMap F (unify f x i hi)) := funMap_unify_equiv G f F x (Classical.choose (Finite.bddAbove_range fun a => (x a).1)) i _ hi
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
funMap_equiv_unify
null
relMap_equiv_unify {n : ℕ} (R : L.Relations n) (x : Fin n → Σˣ f) (i : ι) (hi : i ∈ upperBounds (range (Sigma.fst ∘ x))) : RelMap R x = RelMap R (unify f x i hi) := relMap_unify_equiv G f R x (Classical.choose (Finite.bddAbove_range fun a => (x a).1)) i _ hi
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
relMap_equiv_unify
null
noncomputable prestructure : L.Prestructure (DirectLimit.setoid G f) where toStructure := sigmaStructure G f fun_equiv {n} {F} x y xy := by obtain ⟨i, hx, hy, h⟩ := exists_unify_eq G f xy refine Setoid.trans (funMap_equiv_unify G f F x i hx) (Setoid.trans ?_ (Setoid.symm (funMap_equiv_unify G f F y i hy))) rw [h] rel_equiv {n} {R} x y xy := by obtain ⟨i, hx, hy, h⟩ := exists_unify_eq G f xy refine _root_.trans (relMap_equiv_unify G f R x i hx) (_root_.trans ?_ (symm (relMap_equiv_unify G f R y i hy))) rw [h]
instance
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
prestructure
The direct limit `setoid` respects the structure `sigmaStructure`, so quotienting by it gives rise to a valid structure.
noncomputable instStructureDirectLimit : L.Structure (DirectLimit G f) := Language.quotientStructure @[simp]
instance
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
instStructureDirectLimit
The `L.Structure` on a direct limit of `L.Structure`s.
funMap_quotient_mk'_sigma_mk' {n : ℕ} {F : L.Functions n} {i : ι} {x : Fin n → G i} : funMap F (fun a => (⟦.mk f i (x a)⟧ : DirectLimit G f)) = ⟦.mk f i (funMap F x)⟧ := by simp only [funMap_quotient_mk', Quotient.eq] obtain ⟨k, ik, jk⟩ := directed_of (· ≤ ·) i (Classical.choose (Finite.bddAbove_range fun _ : Fin n => i)) refine ⟨k, jk, ik, ?_⟩ simp only [Embedding.map_fun, comp_unify] rfl @[simp]
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
funMap_quotient_mk'_sigma_mk'
null
relMap_quotient_mk'_sigma_mk' {n : ℕ} {R : L.Relations n} {i : ι} {x : Fin n → G i} : RelMap R (fun a => (⟦.mk f i (x a)⟧ : DirectLimit G f)) = RelMap R x := by rw [relMap_quotient_mk'] obtain ⟨k, _, _⟩ := directed_of (· ≤ ·) i (Classical.choose (Finite.bddAbove_range fun _ : Fin n => i)) rw [relMap_equiv_unify G f R (fun a => .mk f i (x a)) i (fun _ ⟨_, hj⟩ => le_of_eq hj.symm)] rw [unify_sigma_mk_self]
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
relMap_quotient_mk'_sigma_mk'
null
exists_quotient_mk'_sigma_mk'_eq {α : Type*} [Finite α] (x : α → DirectLimit G f) : ∃ (i : ι) (y : α → G i), x = fun a => ⟦.mk f i (y a)⟧ := by obtain ⟨i, hi⟩ := Finite.bddAbove_range fun a => (x a).out.1 refine ⟨i, unify f (Quotient.out ∘ x) i hi, ?_⟩ ext a rw [Quotient.eq_mk_iff_out, unify] generalize_proofs r change _ ≈ Structure.Sigma.mk f i (f (Quotient.out (x a)).fst i r (Quotient.out (x a)).snd) have : (.mk f i (f (Quotient.out (x a)).fst i r (Quotient.out (x a)).snd) : Σˣ f).fst ≤ i := le_rfl rw [equiv_iff G f (i := i) (hi _) this] · simp only [DirectedSystem.map_self] exact ⟨a, rfl⟩ variable (L ι)
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
exists_quotient_mk'_sigma_mk'_eq
null
noncomputable of (i : ι) : G i ↪[L] DirectLimit G f where toFun := fun a => ⟦.mk f i a⟧ inj' x y h := by rw [Quotient.eq] at h obtain ⟨j, h1, _, h3⟩ := h exact (f i j h1).injective h3 map_fun' F x := by rw [← funMap_quotient_mk'_sigma_mk'] rfl map_rel' := by intro n R x change RelMap R (fun a => (⟦.mk f i (x a)⟧ : DirectLimit G f)) ↔ _ simp only [relMap_quotient_mk'_sigma_mk'] variable {L ι G f} @[simp]
def
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
of
The canonical map from a component to the direct limit.
of_apply {i : ι} {x : G i} : of L ι G f i x = ⟦.mk f i x⟧ := rfl
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
of_apply
null
of_f {i j : ι} {hij : i ≤ j} {x : G i} : of L ι G f j (f i j hij x) = of L ι G f i x := by rw [of_apply, of_apply, Quotient.eq] refine Setoid.symm ⟨j, hij, refl j, ?_⟩ simp only [DirectedSystem.map_self]
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
of_f
null
exists_of (z : DirectLimit G f) : ∃ i x, of L ι G f i x = z := ⟨z.out.1, z.out.2, by simp⟩ @[elab_as_elim]
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
exists_of
Every element of the direct limit corresponds to some element in some component of the directed system.
protected inductionOn {C : DirectLimit G f → Prop} (z : DirectLimit G f) (ih : ∀ i x, C (of L ι G f i x)) : C z := let ⟨i, x, h⟩ := exists_of z h ▸ ih i x
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
inductionOn
null
iSup_range_of_eq_top : ⨆ i, (of L ι G f i).toHom.range = ⊤ := eq_top_iff.2 (fun x _ ↦ DirectLimit.inductionOn x (fun i _ ↦ le_iSup (fun i ↦ Hom.range (Embedding.toHom (of L ι G f i))) i (mem_range_self _)))
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
iSup_range_of_eq_top
null
exists_fg_substructure_in_Sigma (S : L.Substructure (DirectLimit G f)) (S_fg : S.FG) : ∃ i, ∃ T : L.Substructure (G i), T.map (of L ι G f i).toHom = S := by let ⟨A, A_closure⟩ := S_fg let ⟨i, y, eq_y⟩ := exists_quotient_mk'_sigma_mk'_eq G _ (fun a : A ↦ a.1) use i use Substructure.closure L (range y) rw [Substructure.map_closure] simp only [Embedding.coe_toHom, of_apply] rw [← image_univ, image_image, image_univ, ← eq_y, Subtype.range_coe_subtype, Finset.setOf_mem, A_closure] variable {P : Type u₁} [L.Structure P] variable (L ι G f) in
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
exists_fg_substructure_in_Sigma
Every finitely generated substructure of the direct limit corresponds to some substructure in some component of the directed system.
noncomputable lift (g : ∀ i, G i ↪[L] P) (Hg : ∀ i j hij x, g j (f i j hij x) = g i x) : DirectLimit G f ↪[L] P where toFun := Quotient.lift (fun x : Σˣ f => (g x.1) x.2) fun x y xy => by simp only obtain ⟨i, hx, hy⟩ := directed_of (· ≤ ·) x.1 y.1 rw [← Hg x.1 i hx, ← Hg y.1 i hy] exact congr_arg _ ((equiv_iff ..).1 xy) inj' x y xy := by rw [← Quotient.out_eq x, ← Quotient.out_eq y, Quotient.lift_mk, Quotient.lift_mk] at xy obtain ⟨i, hx, hy⟩ := directed_of (· ≤ ·) x.out.1 y.out.1 rw [← Hg x.out.1 i hx, ← Hg y.out.1 i hy] at xy rw [← Quotient.out_eq x, ← Quotient.out_eq y, Quotient.eq_iff_equiv, equiv_iff G f hx hy] exact (g i).injective xy map_fun' F x := by obtain ⟨i, y, rfl⟩ := exists_quotient_mk'_sigma_mk'_eq G f x change _ = funMap F (Quotient.lift _ _ ∘ Quotient.mk _ ∘ Structure.Sigma.mk f i ∘ y) rw [funMap_quotient_mk'_sigma_mk', ← Function.comp_assoc, Quotient.lift_comp_mk] simp only [Quotient.lift_mk, Embedding.map_fun] rfl map_rel' R x := by obtain ⟨i, y, rfl⟩ := exists_quotient_mk'_sigma_mk'_eq G f x change RelMap R (Quotient.lift _ _ ∘ Quotient.mk _ ∘ Structure.Sigma.mk f i ∘ y) ↔ _ rw [relMap_quotient_mk'_sigma_mk' G f, ← (g i).map_rel R y, ← Function.comp_assoc, Quotient.lift_comp_mk] rfl variable (g : ∀ i, G i ↪[L] P) (Hg : ∀ i j hij x, g j (f i j hij x) = g i x) @[simp]
def
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
lift
The universal property of the direct limit: maps from the components to another module that respect the directed system structure (i.e. make some diagram commute) give rise to a unique map out of the direct limit.
lift_quotient_mk'_sigma_mk' {i} (x : G i) : lift L ι G f g Hg ⟦.mk f i x⟧ = (g i) x := by change (lift L ι G f g Hg).toFun ⟦.mk f i x⟧ = _ simp only [lift, Quotient.lift_mk]
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
lift_quotient_mk'_sigma_mk'
null
lift_of {i} (x : G i) : lift L ι G f g Hg (of L ι G f i x) = g i x := by simp
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
lift_of
null
lift_unique (F : DirectLimit G f ↪[L] P) (x) : F x = lift L ι G f (fun i => F.comp <| of L ι G f i) (fun i j hij x => by rw [F.comp_apply, F.comp_apply, of_f]) x := DirectLimit.inductionOn x fun i x => by rw [lift_of]; rfl
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
lift_unique
null
range_lift : (lift L ι G f g Hg).toHom.range = ⨆ i, (g i).toHom.range := by simp_rw [Hom.range_eq_map] rw [← iSup_range_of_eq_top, Substructure.map_iSup] simp_rw [Hom.range_eq_map, Substructure.map_map] rfl variable (L ι G f) variable (G' : ι → Type w') [∀ i, L.Structure (G' i)] variable (f' : ∀ i j, i ≤ j → G' i ↪[L] G' j) variable (g : ∀ i, G i ≃[L] G' i) variable [DirectedSystem G' fun i j h => f' i j h]
lemma
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
range_lift
null
noncomputable equiv_lift (H_commuting : ∀ i j hij x, g j (f i j hij x) = f' i j hij (g i x)) : DirectLimit G f ≃[L] DirectLimit G' f' := by let U i : G i ↪[L] DirectLimit G' f' := (of L _ G' f' i).comp (g i).toEmbedding let F : DirectLimit G f ↪[L] DirectLimit G' f' := lift L _ G f U <| by intro _ _ _ _ simp only [U, Embedding.comp_apply, Equiv.coe_toEmbedding, H_commuting, of_f] have surj_f : Function.Surjective F := by intro x rcases x with ⟨i, pre_x⟩ use of L _ G f i ((g i).symm pre_x) simp only [F, U, lift_of, Embedding.comp_apply, Equiv.coe_toEmbedding, Equiv.apply_symm_apply] rfl exact ⟨Equiv.ofBijective F ⟨F.injective, surj_f⟩, F.map_fun', F.map_rel'⟩ variable (H_commuting : ∀ i j hij x, g j (f i j hij x) = f' i j hij (g i x))
def
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
equiv_lift
The isomorphism between limits of isomorphic systems.
equiv_lift_of {i : ι} (x : G i) : equiv_lift L ι G f G' f' g H_commuting (of L ι G f i x) = of L ι G' f' i (g i x) := rfl variable {L ι G f}
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
equiv_lift_of
null
cg {ι : Type*} [Countable ι] [Preorder ι] [IsDirected ι (· ≤ ·)] [Nonempty ι] {G : ι → Type w} [∀ i, L.Structure (G i)] (f : ∀ i j, i ≤ j → G i ↪[L] G j) (h : ∀ i, Structure.CG L (G i)) [DirectedSystem G fun i j h => f i j h] : Structure.CG L (DirectLimit G f) := by refine ⟨⟨⋃ i, DirectLimit.of L ι G f i '' Classical.choose (h i).out, ?_, ?_⟩⟩ · exact Set.countable_iUnion fun i => Set.Countable.image (Classical.choose_spec (h i).out).1 _ · rw [eq_top_iff, Substructure.closure_iUnion] simp_rw [← Embedding.coe_toHom, Substructure.closure_image] rw [le_iSup_iff] intro S hS x _ let out := Quotient.out (s := DirectLimit.setoid G f) refine hS (out x).1 ⟨(out x).2, ?_, ?_⟩ · rw [(Classical.choose_spec (h (out x).1).out).2] trivial · simp only [out, Embedding.coe_toHom, DirectLimit.of_apply, Sigma.eta, Quotient.out_eq]
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
cg
The direct limit of countably many countably generated structures is countably generated.
cg' {ι : Type*} [Countable ι] [Preorder ι] [IsDirected ι (· ≤ ·)] [Nonempty ι] {G : ι → Type w} [∀ i, L.Structure (G i)] (f : ∀ i j, i ≤ j → G i ↪[L] G j) [h : ∀ i, Structure.CG L (G i)] [DirectedSystem G fun i j h => f i j h] : Structure.CG L (DirectLimit G f) := cg f h
instance
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
cg'
null
noncomputable liftInclusion : DirectLimit (fun i ↦ S i) (fun _ _ h ↦ Substructure.inclusion (S.monotone h)) ↪[L] M := DirectLimit.lift L ι (fun i ↦ S i) (fun _ _ h ↦ Substructure.inclusion (S.monotone h)) (fun _ ↦ Substructure.subtype _) (fun _ _ _ _ ↦ rfl)
def
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
liftInclusion
The map from a direct limit of a system of substructures of `M` into `M`.
liftInclusion_of {i : ι} (x : S i) : (liftInclusion S) (of L ι _ (fun _ _ h ↦ Substructure.inclusion (S.monotone h)) i x) = Substructure.subtype (S i) x := rfl
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
liftInclusion_of
null
rangeLiftInclusion : (liftInclusion S).toHom.range = ⨆ i, S i := by simp_rw [liftInclusion, range_lift, Substructure.range_subtype]
lemma
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
rangeLiftInclusion
null
noncomputable Equiv_iSup : DirectLimit (fun i ↦ S i) (fun _ _ h ↦ Substructure.inclusion (S.monotone h)) ≃[L] (iSup S : L.Substructure M) := by have liftInclusion_in_sup : ∀ x, liftInclusion S x ∈ (⨆ i, S i) := by simp only [← rangeLiftInclusion, Hom.mem_range, Embedding.coe_toHom] intro x; use x let F := Embedding.codRestrict (⨆ i, S i) _ liftInclusion_in_sup have F_surj : Function.Surjective F := by rintro ⟨m, hm⟩ rw [← rangeLiftInclusion, Hom.mem_range] at hm rcases hm with ⟨a, _⟩; use a simpa only [F, Embedding.codRestrict_apply', Subtype.mk.injEq] exact ⟨Equiv.ofBijective F ⟨F.injective, F_surj⟩, F.map_fun', F.map_rel'⟩
def
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
Equiv_iSup
The isomorphism between a direct limit of a system of substructures and their union.
Equiv_isup_of_apply {i : ι} (x : S i) : Equiv_iSup S (of L ι _ (fun _ _ h ↦ Substructure.inclusion (S.monotone h)) i x) = Substructure.inclusion (le_iSup _ _) x := rfl
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
Equiv_isup_of_apply
null
Equiv_isup_symm_inclusion_apply {i : ι} (x : S i) : (Equiv_iSup S).symm (Substructure.inclusion (le_iSup _ _) x) = of L ι _ (fun _ _ h ↦ Substructure.inclusion (S.monotone h)) i x := by apply (Equiv_iSup S).injective simp only [Equiv.apply_symm_apply] rfl @[simp]
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
Equiv_isup_symm_inclusion_apply
null
Equiv_isup_symm_inclusion (i : ι) : (Equiv_iSup S).symm.toEmbedding.comp (Substructure.inclusion (le_iSup _ _)) = of L ι _ (fun _ _ h ↦ Substructure.inclusion (S.monotone h)) i := by ext x; exact Equiv_isup_symm_inclusion_apply _ x
theorem
ModelTheory
[ "Mathlib.Data.Finite.Sum", "Mathlib.Data.Fintype.Order", "Mathlib.ModelTheory.FinitelyGenerated", "Mathlib.ModelTheory.Quotients", "Mathlib.Order.DirectedInverseSystem" ]
Mathlib/ModelTheory/DirectLimit.lean
Equiv_isup_symm_inclusion
null
ElementaryEmbedding where /-- The underlying embedding -/ toFun : M → N map_formula' : ∀ ⦃n⦄ (φ : L.Formula (Fin n)) (x : Fin n → M), φ.Realize (toFun ∘ x) ↔ φ.Realize x := by aesop @[inherit_doc FirstOrder.Language.ElementaryEmbedding] scoped[FirstOrder] notation:25 A " ↪ₑ[" L "] " B => FirstOrder.Language.ElementaryEmbedding L A B variable {L} {M} {N}
structure
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
ElementaryEmbedding
An elementary embedding of first-order structures is an embedding that commutes with the realizations of formulas.
instFunLike : FunLike (M ↪ₑ[L] N) M N where coe f := f.toFun coe_injective' f g h := by cases f cases g simpa only [ElementaryEmbedding.mk.injEq] @[simp]
instance
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
instFunLike
null
map_boundedFormula (f : M ↪ₑ[L] N) {α : Type*} {n : ℕ} (φ : L.BoundedFormula α n) (v : α → M) (xs : Fin n → M) : φ.Realize (f ∘ v) (f ∘ xs) ↔ φ.Realize v xs := by classical rw [← BoundedFormula.realize_restrictFreeVar' Set.Subset.rfl, Set.inclusion_eq_id, iff_eq_eq] have h := f.map_formula' ((φ.restrictFreeVar id).toFormula.relabel (Fintype.equivFin _)) (Sum.elim (v ∘ (↑)) xs ∘ (Fintype.equivFin _).symm) simp only [Formula.realize_relabel, BoundedFormula.realize_toFormula, iff_eq_eq] at h rw [← Function.comp_assoc _ _ (Fintype.equivFin _).symm, Function.comp_assoc _ (Fintype.equivFin _).symm (Fintype.equivFin _), _root_.Equiv.symm_comp_self, Function.comp_id, Function.comp_assoc, Sum.elim_comp_inl, Function.comp_assoc _ _ Sum.inr, Sum.elim_comp_inr, ← Function.comp_assoc] at h refine h.trans ?_ erw [Function.comp_assoc _ _ (Fintype.equivFin _), _root_.Equiv.symm_comp_self, Function.comp_id, Sum.elim_comp_inl, Sum.elim_comp_inr (v ∘ Subtype.val) xs, ← Set.inclusion_eq_id (s := (BoundedFormula.freeVarFinset φ : Set α)) Set.Subset.rfl, BoundedFormula.realize_restrictFreeVar' Set.Subset.rfl] @[simp]
theorem
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
map_boundedFormula
null
map_formula (f : M ↪ₑ[L] N) {α : Type*} (φ : L.Formula α) (x : α → M) : φ.Realize (f ∘ x) ↔ φ.Realize x := by rw [Formula.Realize, Formula.Realize, ← f.map_boundedFormula, Unique.eq_default (f ∘ default)]
theorem
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
map_formula
null
map_sentence (f : M ↪ₑ[L] N) (φ : L.Sentence) : M ⊨ φ ↔ N ⊨ φ := by rw [Sentence.Realize, Sentence.Realize, ← f.map_formula, Unique.eq_default (f ∘ default)]
theorem
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
map_sentence
null
theory_model_iff (f : M ↪ₑ[L] N) (T : L.Theory) : M ⊨ T ↔ N ⊨ T := by simp only [Theory.model_iff, f.map_sentence]
theorem
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
theory_model_iff
null
elementarilyEquivalent (f : M ↪ₑ[L] N) : M ≅[L] N := elementarilyEquivalent_iff.2 f.map_sentence @[simp]
theorem
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
elementarilyEquivalent
null
injective (φ : M ↪ₑ[L] N) : Function.Injective φ := by intro x y have h := φ.map_formula ((var 0).equal (var 1) : L.Formula (Fin 2)) fun i => if i = 0 then x else y rw [Formula.realize_equal, Formula.realize_equal] at h simp only [Term.realize, Fin.one_eq_zero_iff, if_true, Function.comp_apply] at h exact h.1
theorem
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
injective
null
embeddingLike : EmbeddingLike (M ↪ₑ[L] N) M N := { show FunLike (M ↪ₑ[L] N) M N from inferInstance with injective' := injective } @[simp]
instance
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
embeddingLike
null
map_fun (φ : M ↪ₑ[L] N) {n : ℕ} (f : L.Functions n) (x : Fin n → M) : φ (funMap f x) = funMap f (φ ∘ x) := by have h := φ.map_formula (Formula.graph f) (Fin.cons (funMap f x) x) rw [Formula.realize_graph, Fin.comp_cons, Formula.realize_graph] at h rw [eq_comm, h] @[simp]
theorem
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
map_fun
null
map_rel (φ : M ↪ₑ[L] N) {n : ℕ} (r : L.Relations n) (x : Fin n → M) : RelMap r (φ ∘ x) ↔ RelMap r x := haveI h := φ.map_formula (r.formula var) x h
theorem
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
map_rel
null
strongHomClass : StrongHomClass L (M ↪ₑ[L] N) M N where map_fun := map_fun map_rel := map_rel @[simp]
instance
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
strongHomClass
null
map_constants (φ : M ↪ₑ[L] N) (c : L.Constants) : φ c = c := HomClass.map_constants φ c
theorem
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
map_constants
null
toEmbedding (f : M ↪ₑ[L] N) : M ↪[L] N where toFun := f inj' := f.injective map_fun' {_} f x := by simp map_rel' {_} R x := by simp
def
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
toEmbedding
An elementary embedding is also a first-order embedding.
toHom (f : M ↪ₑ[L] N) : M →[L] N where toFun := f map_fun' {_} f x := by simp map_rel' {_} R x := by simp @[simp]
def
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
toHom
An elementary embedding is also a first-order homomorphism.
toEmbedding_toHom (f : M ↪ₑ[L] N) : f.toEmbedding.toHom = f.toHom := rfl @[simp]
theorem
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
toEmbedding_toHom
null
coe_toHom {f : M ↪ₑ[L] N} : (f.toHom : M → N) = (f : M → N) := rfl @[simp]
theorem
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
coe_toHom
null
coe_toEmbedding (f : M ↪ₑ[L] N) : (f.toEmbedding : M → N) = (f : M → N) := rfl
theorem
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
coe_toEmbedding
null
coe_injective : @Function.Injective (M ↪ₑ[L] N) (M → N) (↑) := DFunLike.coe_injective @[ext]
theorem
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
coe_injective
null
ext ⦃f g : M ↪ₑ[L] N⦄ (h : ∀ x, f x = g x) : f = g := DFunLike.ext f g h variable (L) (M)
theorem
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
ext
null
@[refl] refl : M ↪ₑ[L] M where toFun := id variable {L} {M}
def
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
refl
The identity elementary embedding from a structure to itself
@[simp] refl_apply (x : M) : refl L M x = x := rfl
theorem
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
refl_apply
null
@[trans] comp (hnp : N ↪ₑ[L] P) (hmn : M ↪ₑ[L] N) : M ↪ₑ[L] P where toFun := hnp ∘ hmn map_formula' n φ x := by obtain ⟨_, hhnp⟩ := hnp obtain ⟨_, hhmn⟩ := hmn erw [hhnp, hhmn] @[simp]
def
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
comp
Composition of elementary embeddings
comp_apply (g : N ↪ₑ[L] P) (f : M ↪ₑ[L] N) (x : M) : g.comp f x = g (f x) := rfl
theorem
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
comp_apply
null
comp_assoc (f : M ↪ₑ[L] N) (g : N ↪ₑ[L] P) (h : P ↪ₑ[L] Q) : (h.comp g).comp f = h.comp (g.comp f) := rfl
theorem
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
comp_assoc
Composition of elementary embeddings is associative.
elementaryDiagram : L[[M]].Theory := L[[M]].completeTheory M
abbrev
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
elementaryDiagram
The elementary diagram of an `L`-structure is the set of all sentences with parameters it satisfies.
@[simps] ElementaryEmbedding.ofModelsElementaryDiagram (N : Type*) [L.Structure N] [L[[M]].Structure N] [(lhomWithConstants L M).IsExpansionOn N] [N ⊨ L.elementaryDiagram M] : M ↪ₑ[L] N := ⟨((↑) : L[[M]].Constants → N) ∘ Sum.inr, fun n φ x => by refine _root_.trans ?_ ((realize_iff_of_model_completeTheory M N (((L.lhomWithConstants M).onBoundedFormula φ).subst (Constants.term ∘ Sum.inr ∘ x)).alls).trans ?_) · simp_rw [Sentence.Realize, BoundedFormula.realize_alls, BoundedFormula.realize_subst, LHom.realize_onBoundedFormula, Formula.Realize, Unique.forall_iff, Function.comp_def, Term.realize_constants] · simp_rw [Sentence.Realize, BoundedFormula.realize_alls, BoundedFormula.realize_subst, LHom.realize_onBoundedFormula, Formula.Realize, Unique.forall_iff] rfl⟩ variable {L M}
def
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
ElementaryEmbedding.ofModelsElementaryDiagram
The canonical elementary embedding of an `L`-structure into any model of its elementary diagram
isElementary_of_exists (f : M ↪[L] N) (htv : ∀ (n : ℕ) (φ : L.BoundedFormula Empty (n + 1)) (x : Fin n → M) (a : N), φ.Realize default (Fin.snoc (f ∘ x) a : _ → N) → ∃ b : M, φ.Realize default (Fin.snoc (f ∘ x) (f b) : _ → N)) : ∀ {n} (φ : L.Formula (Fin n)) (x : Fin n → M), φ.Realize (f ∘ x) ↔ φ.Realize x := by suffices h : ∀ (n : ℕ) (φ : L.BoundedFormula Empty n) (xs : Fin n → M), φ.Realize (f ∘ default) (f ∘ xs) ↔ φ.Realize default xs by intro n φ x exact φ.realize_relabel_sumInr.symm.trans (_root_.trans (h n _ _) φ.realize_relabel_sumInr) refine fun n φ => φ.recOn ?_ ?_ ?_ ?_ ?_ · exact fun {_} _ => Iff.rfl · intros simp [BoundedFormula.Realize, ← Sum.comp_elim, HomClass.realize_term] · intros simp only [BoundedFormula.Realize, ← Sum.comp_elim, HomClass.realize_term] erw [map_rel f] · intro _ _ _ ih1 ih2 _ simp [ih1, ih2] · intro n φ ih xs simp only [BoundedFormula.realize_all] refine ⟨fun h a => ?_, ?_⟩ · rw [← ih, Fin.comp_snoc] exact h (f a) · contrapose! rintro ⟨a, ha⟩ obtain ⟨b, hb⟩ := htv n φ.not xs a (by rw [BoundedFormula.realize_not, ← Unique.eq_default (f ∘ default)] exact ha) refine ⟨b, fun h => hb (Eq.mp ?_ ((ih _).2 h))⟩ rw [Unique.eq_default (f ∘ default), Fin.comp_snoc]
theorem
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
isElementary_of_exists
The **Tarski-Vaught test** for elementarity of an embedding.
@[simps] toElementaryEmbedding (f : M ↪[L] N) (htv : ∀ (n : ℕ) (φ : L.BoundedFormula Empty (n + 1)) (x : Fin n → M) (a : N), φ.Realize default (Fin.snoc (f ∘ x) a : _ → N) → ∃ b : M, φ.Realize default (Fin.snoc (f ∘ x) (f b) : _ → N)) : M ↪ₑ[L] N := ⟨f, fun _ => f.isElementary_of_exists htv⟩
def
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
toElementaryEmbedding
Bundles an embedding satisfying the Tarski-Vaught test as an elementary embedding.
toElementaryEmbedding (f : M ≃[L] N) : M ↪ₑ[L] N where toFun := f @[simp]
def
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
toElementaryEmbedding
A first-order equivalence is also an elementary embedding.
toElementaryEmbedding_toEmbedding (f : M ≃[L] N) : f.toElementaryEmbedding.toEmbedding = f.toEmbedding := rfl @[simp]
theorem
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
toElementaryEmbedding_toEmbedding
null
coe_toElementaryEmbedding (f : M ≃[L] N) : (f.toElementaryEmbedding : M → N) = (f : M → N) := rfl
theorem
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
coe_toElementaryEmbedding
null
@[simp] realize_term_substructure {α : Type*} {S : L.Substructure M} (v : α → S) (t : L.Term α) : t.realize ((↑) ∘ v) = (↑(t.realize v) : M) := HomClass.realize_term S.subtype
theorem
ModelTheory
[ "Mathlib.Data.Fintype.Basic", "Mathlib.ModelTheory.Substructures" ]
Mathlib/ModelTheory/ElementaryMaps.lean
realize_term_substructure
null
Substructure.IsElementary (S : L.Substructure M) : Prop := ∀ ⦃n⦄ (φ : L.Formula (Fin n)) (x : Fin n → S), φ.Realize (((↑) : _ → M) ∘ x) ↔ φ.Realize x variable (L M)
def
ModelTheory
[ "Mathlib.ModelTheory.ElementaryMaps" ]
Mathlib/ModelTheory/ElementarySubstructures.lean
Substructure.IsElementary
A substructure is elementary when every formula applied to a tuple in the substructure agrees with its value in the overall structure.
ElementarySubstructure where /-- The underlying substructure -/ toSubstructure : L.Substructure M isElementary' : toSubstructure.IsElementary variable {L M}
structure
ModelTheory
[ "Mathlib.ModelTheory.ElementaryMaps" ]
Mathlib/ModelTheory/ElementarySubstructures.lean
ElementarySubstructure
An elementary substructure is one in which every formula applied to a tuple in the substructure agrees with its value in the overall structure.
instCoe : Coe (L.ElementarySubstructure M) (L.Substructure M) := ⟨ElementarySubstructure.toSubstructure⟩
instance
ModelTheory
[ "Mathlib.ModelTheory.ElementaryMaps" ]
Mathlib/ModelTheory/ElementarySubstructures.lean
instCoe
null
instSetLike : SetLike (L.ElementarySubstructure M) M := ⟨fun x => x.toSubstructure.carrier, fun ⟨⟨s, hs1⟩, hs2⟩ ⟨⟨t, ht1⟩, _⟩ _ => by congr⟩
instance
ModelTheory
[ "Mathlib.ModelTheory.ElementaryMaps" ]
Mathlib/ModelTheory/ElementarySubstructures.lean
instSetLike
null
inducedStructure (S : L.ElementarySubstructure M) : L.Structure S := Substructure.inducedStructure @[simp]
instance
ModelTheory
[ "Mathlib.ModelTheory.ElementaryMaps" ]
Mathlib/ModelTheory/ElementarySubstructures.lean
inducedStructure
null
isElementary (S : L.ElementarySubstructure M) : (S : L.Substructure M).IsElementary := S.isElementary'
theorem
ModelTheory
[ "Mathlib.ModelTheory.ElementaryMaps" ]
Mathlib/ModelTheory/ElementarySubstructures.lean
isElementary
null
subtype (S : L.ElementarySubstructure M) : S ↪ₑ[L] M where toFun := (↑) map_formula' := S.isElementary @[simp]
def
ModelTheory
[ "Mathlib.ModelTheory.ElementaryMaps" ]
Mathlib/ModelTheory/ElementarySubstructures.lean
subtype
The natural embedding of an `L.Substructure` of `M` into `M`.
subtype_apply {S : L.ElementarySubstructure M} {x : S} : subtype S x = x := rfl
theorem
ModelTheory
[ "Mathlib.ModelTheory.ElementaryMaps" ]
Mathlib/ModelTheory/ElementarySubstructures.lean
subtype_apply
null
subtype_injective (S : L.ElementarySubstructure M) : Function.Injective (subtype S) := Subtype.coe_injective @[simp]
theorem
ModelTheory
[ "Mathlib.ModelTheory.ElementaryMaps" ]
Mathlib/ModelTheory/ElementarySubstructures.lean
subtype_injective
null
coe_subtype (S : L.ElementarySubstructure M) : ⇑S.subtype = Subtype.val := rfl
theorem
ModelTheory
[ "Mathlib.ModelTheory.ElementaryMaps" ]
Mathlib/ModelTheory/ElementarySubstructures.lean
coe_subtype
null
instTop : Top (L.ElementarySubstructure M) := ⟨⟨⊤, fun _ _ _ => Substructure.realize_formula_top.symm⟩⟩
instance
ModelTheory
[ "Mathlib.ModelTheory.ElementaryMaps" ]
Mathlib/ModelTheory/ElementarySubstructures.lean
instTop
The substructure `M` of the structure `M` is elementary.
instInhabited : Inhabited (L.ElementarySubstructure M) := ⟨⊤⟩ @[simp]
instance
ModelTheory
[ "Mathlib.ModelTheory.ElementaryMaps" ]
Mathlib/ModelTheory/ElementarySubstructures.lean
instInhabited
null