File: Mathlib/ModelTheory/DirectLimit.lean

full_name: FirstOrder.Language.DirectedSystem.map_self
code: /-- A copy of `DirectedSystem.map_self` specialized to `L`-embeddings, as otherwise the
`fun i j h ↦ f i j h` can confuse the simplifier. -/
nonrec theorem map_self [DirectedSystem G fun i j h => f i j h] (i x h) : f i i h x = x 
goal: (f i i h) x = x

full_name: FirstOrder.Language.DirectedSystem.map_map
code: /-- A copy of `DirectedSystem.map_map` specialized to `L`-embeddings, as otherwise the
`fun i j h ↦ f i j h` can confuse the simplifier. -/
nonrec theorem map_map [DirectedSystem G fun i j h => f i j h] {i j k} (hij hjk x) :
    f j k hjk (f i j hij x) = f i k (le_trans hij hjk) x 
goal: (f j k hjk) ((f i j hij) x) = (f i k ⋯) x

full_name: FirstOrder.Language.DirectedSystem.natLERec
code: /-- Given a chain of embeddings of structures indexed by `ℕ`, defines a `DirectedSystem` by
composing them. -/
def natLERec (m n : ℕ) (h : m ≤ n) : G' m ↪[L] G' n 
goal: G' m ↪[L] G' n

full_name: FirstOrder.Language.DirectedSystem.coe_natLERec
code: @[simp]
theorem coe_natLERec (m n : ℕ) (h : m ≤ n) :
    (natLERec f' m n h : G' m → G' n) = Nat.leRecOn h (@fun k => f' k) 
goal: ⇑(FirstOrder.Language.DirectedSystem.natLERec f' m n h) = fun a => Nat.leRecOn h (fun k => ⇑(f' k)) a

full_name: FirstOrder.Language.DirectedSystem.natLERec.directedSystem
code: instance natLERec.directedSystem : DirectedSystem G' fun i j h => natLERec f' i j h 
goal: DirectedSystem G' fun i j h => ⇑(FirstOrder.Language.DirectedSystem.natLERec f' i j h)

full_name: FirstOrder.Language.Structure.Sigma
code: /-- Alias for `Σ i, G i`. -/
@[nolint unusedArguments]
protected abbrev Structure.Sigma (f : ∀ i j, i ≤ j → G i ↪[L] G j) 
goal: Type (max v w)

full_name: FirstOrder.Language.«_aux_Mathlib_ModelTheory_DirectLimit___macroRules_FirstOrder_Language_termΣˣ_1»
code: local notation "Σˣ" => Structure.Sigma
goal: Lean.Macro

full_name: FirstOrder.Language._aux_Mathlib_ModelTheory_DirectLimit___unexpand_FirstOrder_Language_Structure_Sigma_1
code: local notation "Σˣ" => Structure.Sigma
goal: Lean.PrettyPrinter.Unexpander

full_name: FirstOrder.Language.Structure.Sigma.mk
code: /-- Constructor for `FirstOrder.Language.Structure.Sigma` alias. -/
abbrev Structure.Sigma.mk (i : ι) (x : G i) : Σˣ f 
goal: FirstOrder.Language.Structure.Sigma f

full_name: FirstOrder.Language.DirectLimit.unify
code: /-- Raises a family of elements in the `Σ`-type to the same level along the embeddings. -/
def unify {α : Type*} (x : α → Σˣ f) (i : ι) (h : i ∈ upperBounds (range (Sigma.fst ∘ x)))
    (a : α) : G i 
goal: G i

full_name: FirstOrder.Language.DirectLimit.unify_sigma_mk_self
code: @[simp]
theorem unify_sigma_mk_self {α : Type*} {i : ι} {x : α → G i} :
    (unify f (fun a => .mk f i (x a)) i fun j ⟨a, hj⟩ =>
      _root_.trans (le_of_eq hj.symm) (refl _)) = x 
goal: FirstOrder.Language.DirectLimit.unify f (fun a => FirstOrder.Language.Structure.Sigma.mk f i (x a)) i ⋯ = x

full_name: FirstOrder.Language.DirectLimit.comp_unify
code: theorem 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 
goal: ⇑(f i j ij) ∘ FirstOrder.Language.DirectLimit.unify f x i h = FirstOrder.Language.DirectLimit.unify f x j ⋯

full_name: FirstOrder.Language.DirectLimit.setoid
code: /-- The directed limit glues together the structures along the embeddings. -/
def setoid [DirectedSystem G fun i j h => f i j h] [IsDirected ι (· ≤ ·)] : Setoid (Σˣ f) 
goal: Setoid (FirstOrder.Language.Structure.Sigma f)

full_name: FirstOrder.Language.DirectLimit.sigmaStructure
code: /-- The structure on the `Σ`-type which becomes the structure on the direct limit after quotienting.
 -/
noncomputable def sigmaStructure [IsDirected ι (· ≤ ·)] [Nonempty ι] : L.Structure (Σˣ f) 
goal: L.Structure (FirstOrder.Language.Structure.Sigma f)

full_name: FirstOrder.Language.DirectLimit
code: /-- The direct limit of a directed system is the structures glued together along the embeddings. -/
def DirectLimit [DirectedSystem G fun i j h => f i j h] [IsDirected ι (· ≤ ·)] 
goal: Type (max v w)

full_name: FirstOrder.Language.instInhabitedDirectLimitOfDefault
code: instance [DirectedSystem G fun i j h => f i j h] [IsDirected ι (· ≤ ·)] [Inhabited ι]
    [Inhabited (G default)] : Inhabited (DirectLimit G f) 
goal: Inhabited (FirstOrder.Language.DirectLimit G f)

full_name: FirstOrder.Language.DirectLimit.equiv_iff
code: theorem 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 
goal: x ≈ y ↔ (f x.fst i hx) x.snd = (f y.fst i hy) y.snd

full_name: FirstOrder.Language.DirectLimit.funMap_unify_equiv
code: theorem 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)) 
goal: FirstOrder.Language.Structure.Sigma.mk f i
    (FirstOrder.Language.Structure.funMap F (FirstOrder.Language.DirectLimit.unify f x i hi)) ≈
  FirstOrder.Language.Structure.Sigma.mk f j
    (FirstOrder.Language.Structure.funMap F (FirstOrder.Language.DirectLimit.unify f x j hj))

full_name: FirstOrder.Language.DirectLimit.relMap_unify_equiv
code: theorem 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) 
goal: FirstOrder.Language.Structure.RelMap R (FirstOrder.Language.DirectLimit.unify f x i hi) =
  FirstOrder.Language.Structure.RelMap R (FirstOrder.Language.DirectLimit.unify f x j hj)

full_name: FirstOrder.Language.DirectLimit.exists_unify_eq
code: theorem 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 
goal: ∃ i,
  ∃ (hx : i ∈ upperBounds (Set.range (Sigma.fst ∘ x))) (hy : i ∈ upperBounds (Set.range (Sigma.fst ∘ y))),
    FirstOrder.Language.DirectLimit.unify f x i hx = FirstOrder.Language.DirectLimit.unify f y i hy

full_name: FirstOrder.Language.DirectLimit.funMap_equiv_unify
code: theorem 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)) 
goal: FirstOrder.Language.Structure.funMap F x ≈
  FirstOrder.Language.Structure.Sigma.mk f i
    (FirstOrder.Language.Structure.funMap F (FirstOrder.Language.DirectLimit.unify f x i hi))

full_name: FirstOrder.Language.DirectLimit.relMap_equiv_unify
code: theorem 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) 
goal: FirstOrder.Language.Structure.RelMap R x =
  FirstOrder.Language.Structure.RelMap R (FirstOrder.Language.DirectLimit.unify f x i hi)

full_name: FirstOrder.Language.DirectLimit.prestructure
code: /-- The direct limit `setoid` respects the structure `sigmaStructure`, so quotienting by it
  gives rise to a valid structure. -/
noncomputable instance prestructure : L.Prestructure (DirectLimit.setoid G f) 
goal: L.Prestructure (FirstOrder.Language.DirectLimit.setoid G f)

full_name: FirstOrder.Language.DirectLimit.instStructureDirectLimit
code: /-- The `L.Structure` on a direct limit of `L.Structure`s. -/
noncomputable instance instStructureDirectLimit : L.Structure (DirectLimit G f) 
goal: L.Structure (FirstOrder.Language.DirectLimit G f)

full_name: FirstOrder.Language.DirectLimit.funMap_quotient_mk'_sigma_mk'
code: @[simp]
theorem 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)⟧ 
goal: (FirstOrder.Language.Structure.funMap F fun a => ⟦FirstOrder.Language.Structure.Sigma.mk f i (x a)⟧) =
  ⟦FirstOrder.Language.Structure.Sigma.mk f i (FirstOrder.Language.Structure.funMap F x)⟧

full_name: FirstOrder.Language.DirectLimit.relMap_quotient_mk'_sigma_mk'
code: @[simp]
theorem 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 
goal: (FirstOrder.Language.Structure.RelMap R fun a => ⟦FirstOrder.Language.Structure.Sigma.mk f i (x a)⟧) =
  FirstOrder.Language.Structure.RelMap R x

full_name: FirstOrder.Language.DirectLimit.exists_quotient_mk'_sigma_mk'_eq
code: theorem exists_quotient_mk'_sigma_mk'_eq {α : Type*} [Finite α] (x : α → DirectLimit G f) :
    ∃ (i : ι) (y : α → G i), x = fun a => ⟦.mk f i (y a)⟧ 
goal: ∃ i y, x = fun a => ⟦FirstOrder.Language.Structure.Sigma.mk f i (y a)⟧

full_name: FirstOrder.Language.DirectLimit.of
code: /-- The canonical map from a component to the direct limit. -/
def of (i : ι) : G i ↪[L] DirectLimit G f 
goal: G i ↪[L] FirstOrder.Language.DirectLimit G f

full_name: FirstOrder.Language.DirectLimit.of_apply
code: @[simp]
theorem of_apply {i : ι} {x : G i} : of L ι G f i x = ⟦.mk f i x⟧ 
goal: (FirstOrder.Language.DirectLimit.of L ι G f i) x = ⟦FirstOrder.Language.Structure.Sigma.mk f i x⟧

full_name: FirstOrder.Language.DirectLimit.of_f
code: theorem 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 
goal: (FirstOrder.Language.DirectLimit.of L ι G f j) ((f i j hij) x) = (FirstOrder.Language.DirectLimit.of L ι G f i) x

full_name: FirstOrder.Language.DirectLimit.exists_of
code: /-- Every element of the direct limit corresponds to some element in
some component of the directed system. -/
theorem exists_of (z : DirectLimit G f) : ∃ i x, of L ι G f i x = z 
goal: ∃ i x, (FirstOrder.Language.DirectLimit.of L ι G f i) x = z

full_name: FirstOrder.Language.DirectLimit.inductionOn
code: @[elab_as_elim]
protected theorem inductionOn {C : DirectLimit G f → Prop} (z : DirectLimit G f)
    (ih : ∀ i x, C (of L ι G f i x)) : C z 
goal: C z

full_name: FirstOrder.Language.DirectLimit.iSup_range_of_eq_top
code: theorem iSup_range_of_eq_top : ⨆ i, (of L ι G f i).toHom.range = ⊤ 
goal: ⨆ i, (FirstOrder.Language.DirectLimit.of L ι G f i).toHom.range = ⊤

full_name: FirstOrder.Language.DirectLimit.exists_fg_substructure_in_Sigma
code: /-- Every finitely generated substructure of the direct limit corresponds to some
substructure in some component of the directed system. -/
theorem 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 
goal: ∃ i T, FirstOrder.Language.Substructure.map (FirstOrder.Language.DirectLimit.of L ι G f i).toHom T = S

full_name: FirstOrder.Language.DirectLimit.lift
code: /-- 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. -/
def lift : DirectLimit G f ↪[L] P 
goal: FirstOrder.Language.DirectLimit G f ↪[L] P

full_name: FirstOrder.Language.DirectLimit.lift_quotient_mk'_sigma_mk'
code: @[simp]
theorem lift_quotient_mk'_sigma_mk' {i} (x : G i) : lift L ι G f g Hg ⟦.mk f i x⟧ = (g i) x 
goal: (FirstOrder.Language.DirectLimit.lift L ι G f g Hg) ⟦FirstOrder.Language.Structure.Sigma.mk f i x⟧ = (g i) x

full_name: FirstOrder.Language.DirectLimit.lift_of
code: theorem lift_of {i} (x : G i) : lift L ι G f g Hg (of L ι G f i x) = g i x 
goal: (FirstOrder.Language.DirectLimit.lift L ι G f g Hg) ((FirstOrder.Language.DirectLimit.of L ι G f i) x) = (g i) x

full_name: FirstOrder.Language.DirectLimit.lift_unique
code: theorem 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 
goal: F x =
  (FirstOrder.Language.DirectLimit.lift L ι G f (fun i => F.comp (FirstOrder.Language.DirectLimit.of L ι G f i)) ⋯) x

full_name: FirstOrder.Language.DirectLimit.range_lift
code: lemma range_lift : (lift L ι G f g Hg).toHom.range = ⨆ i, (g i).toHom.range 
goal: (FirstOrder.Language.DirectLimit.lift L ι G f g Hg).toHom.range = ⨆ i, (g i).toHom.range

full_name: FirstOrder.Language.DirectLimit.equiv_lift
code: /-- The isomorphism between limits of isomorphic systems. -/
noncomputable def equiv_lift : DirectLimit G f ≃[L] DirectLimit G' f' 
goal: FirstOrder.Language.DirectLimit G f ≃[L] FirstOrder.Language.DirectLimit G' f'

full_name: FirstOrder.Language.DirectLimit.equiv_lift_of
code: theorem 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) 
goal: (FirstOrder.Language.DirectLimit.equiv_lift L ι G f G' f' g H_commuting)
    ((FirstOrder.Language.DirectLimit.of L ι G f i) x) =
  (FirstOrder.Language.DirectLimit.of L ι G' f' i) ((g i) x)

full_name: FirstOrder.Language.DirectLimit.cg
code: /-- The direct limit of countably many countably generated structures is countably generated. -/
theorem 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) 
goal: FirstOrder.Language.Structure.CG L (FirstOrder.Language.DirectLimit G f)

full_name: FirstOrder.Language.DirectLimit.cg'
code: instance 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) 
goal: FirstOrder.Language.Structure.CG L (FirstOrder.Language.DirectLimit G f)

full_name: FirstOrder.Language.instDirectedSystemSubtypeMemSubstructureCoeOrderHomEmbeddingInclusion
code: instance : DirectedSystem (fun i ↦ S i) (fun _ _ h ↦ Substructure.inclusion (S.monotone h)) 
goal: DirectedSystem (fun i => ↥(S i)) fun x x_1 h => ⇑(FirstOrder.Language.Substructure.inclusion ⋯)

full_name: FirstOrder.Language.DirectLimit.liftInclusion
code: /-- The map from a direct limit of a system of substructures of `M` into `M`. -/
def liftInclusion :
    DirectLimit (fun i ↦ S i) (fun _ _ h ↦ Substructure.inclusion (S.monotone h)) ↪[L] M 
goal: (FirstOrder.Language.DirectLimit (fun i => ↥(S i)) fun x x_1 h => FirstOrder.Language.Substructure.inclusion ⋯) ↪[L] M

full_name: FirstOrder.Language.DirectLimit.liftInclusion_of
code: theorem liftInclusion_of {i : ι} (x : S i) :
    (liftInclusion S) (of L ι _ (fun _ _ h ↦ Substructure.inclusion (S.monotone h)) i x)
    = Substructure.subtype (S i) x 
goal: (FirstOrder.Language.DirectLimit.liftInclusion S)
    ((FirstOrder.Language.DirectLimit.of L ι (fun x => ↥(S x))
        (fun x x_1 h => FirstOrder.Language.Substructure.inclusion ⋯) i)
      x) =
  (S i).subtype x

full_name: FirstOrder.Language.DirectLimit.rangeLiftInclusion
code: lemma rangeLiftInclusion : (liftInclusion S).toHom.range = ⨆ i, S i 
goal: (FirstOrder.Language.DirectLimit.liftInclusion S).toHom.range = ⨆ i, S i

full_name: FirstOrder.Language.DirectLimit.Equiv_iSup
code: /-- The isomorphism between a direct limit of a system of substructures and their union. -/
noncomputable def Equiv_iSup :
    DirectLimit (fun i ↦ S i) (fun _ _ h ↦ Substructure.inclusion (S.monotone h)) ≃[L]
    (iSup S : L.Substructure M) 
goal: (FirstOrder.Language.DirectLimit (fun i => ↥(S i)) fun x x_1 h => FirstOrder.Language.Substructure.inclusion ⋯) ≃[L]
  ↥(iSup ⇑S)

full_name: FirstOrder.Language.DirectLimit.Equiv_isup_of_apply
code: theorem 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 
goal: (FirstOrder.Language.DirectLimit.Equiv_iSup S)
    ((FirstOrder.Language.DirectLimit.of L ι (fun x => ↥(S x))
        (fun x x_1 h => FirstOrder.Language.Substructure.inclusion ⋯) i)
      x) =
  (FirstOrder.Language.Substructure.inclusion ⋯) x

full_name: FirstOrder.Language.DirectLimit.Equiv_isup_symm_inclusion_apply
code: theorem 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 
goal: (FirstOrder.Language.DirectLimit.Equiv_iSup S).symm ((FirstOrder.Language.Substructure.inclusion ⋯) x) =
  (FirstOrder.Language.DirectLimit.of L ι (fun x => ↥(S x))
      (fun x x_1 h => FirstOrder.Language.Substructure.inclusion ⋯) i)
    x

full_name: FirstOrder.Language.DirectLimit.Equiv_isup_symm_inclusion
code: @[simp]
theorem 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 
goal: (FirstOrder.Language.DirectLimit.Equiv_iSup S).symm.toEmbedding.comp (FirstOrder.Language.Substructure.inclusion ⋯) =
  FirstOrder.Language.DirectLimit.of L ι (fun x => ↥(S x)) (fun x x_1 h => FirstOrder.Language.Substructure.inclusion ⋯)
    i