File: Mathlib/ModelTheory/Substructures.lean

full_name: FirstOrder.Language.ClosedUnder
code: /-- Indicates that a set in a given structure is a closed under a function symbol. -/
def ClosedUnder : Prop 
goal: Prop

full_name: FirstOrder.Language.closedUnder_univ
code: @[simp]
theorem closedUnder_univ : ClosedUnder f (univ : Set M) 
goal: FirstOrder.Language.ClosedUnder f Set.univ

full_name: FirstOrder.Language.ClosedUnder.inter
code: theorem inter (hs : ClosedUnder f s) (ht : ClosedUnder f t) : ClosedUnder f (s ∩ t) 
goal: FirstOrder.Language.ClosedUnder f (s ∩ t)

full_name: FirstOrder.Language.ClosedUnder.inf
code: theorem inf (hs : ClosedUnder f s) (ht : ClosedUnder f t) : ClosedUnder f (s ⊓ t) 
goal: FirstOrder.Language.ClosedUnder f (s ⊓ t)

full_name: FirstOrder.Language.ClosedUnder.sInf
code: theorem sInf (hS : ∀ s, s ∈ S → ClosedUnder f s) : ClosedUnder f (sInf S) 
goal: FirstOrder.Language.ClosedUnder f (sInf S)

full_name: FirstOrder.Language.Substructure.carrier
code: /-- A substructure of a structure `M` is a set closed under application of function symbols. -/
structure Substructure where
  carrier : Set M
  fun_mem : ∀ {n}, ∀ f : L.Functions n, ClosedUnder f carrier
goal: Set M

full_name: FirstOrder.Language.Substructure.fun_mem
code: /-- A substructure of a structure `M` is a set closed under application of function symbols. -/
structure Substructure where
  carrier : Set M
  fun_mem : ∀ {n}, ∀ f : L.Functions n, ClosedUnder f carrier
goal: FirstOrder.Language.ClosedUnder f ↑self

full_name: FirstOrder.Language.Substructure
code: /-- A substructure of a structure `M` is a set closed under application of function symbols. -/
structure Substructure where
  carrier : Set M
  fun_mem : ∀ {n}, ∀ f : L.Functions n, ClosedUnder f carrier
goal: Type w

full_name: FirstOrder.Language.Substructure.instSetLike
code: instance instSetLike : SetLike (L.Substructure M) M 
goal: SetLike (L.Substructure M) M

full_name: FirstOrder.Language.Substructure.Simps.coe
code: /-- See Note [custom simps projection] -/
def Simps.coe (S : L.Substructure M) : Set M 
goal: Set M

full_name: FirstOrder.Language.Substructure.mem_carrier
code: @[simp]
theorem mem_carrier {s : L.Substructure M} {x : M} : x ∈ s.carrier ↔ x ∈ s 
goal: x ∈ ↑s ↔ x ∈ s

full_name: FirstOrder.Language.Substructure.ext
code: /-- Two substructures are equal if they have the same elements. -/
@[ext]
theorem ext {S T : L.Substructure M} (h : ∀ x, x ∈ S ↔ x ∈ T) : S = T 
goal: S = T

full_name: FirstOrder.Language.Substructure.copy
code: /-- Copy a substructure replacing `carrier` with a set that is equal to it. -/
protected def copy (S : L.Substructure M) (s : Set M) (hs : s = S) : L.Substructure M 
goal: L.Substructure M

full_name: FirstOrder.Language.Term.realize_mem
code: theorem Term.realize_mem {α : Type*} (t : L.Term α) (xs : α → M) (h : ∀ a, xs a ∈ S) :
    t.realize xs ∈ S 
goal: FirstOrder.Language.Term.realize xs t ∈ S

full_name: FirstOrder.Language.Substructure.coe_copy
code: @[simp]
theorem coe_copy {s : Set M} (hs : s = S) : (S.copy s hs : Set M) = s 
goal: ↑(S.copy s hs) = s

full_name: FirstOrder.Language.Substructure.copy_eq
code: theorem copy_eq {s : Set M} (hs : s = S) : S.copy s hs = S 
goal: S.copy s hs = S

full_name: FirstOrder.Language.Substructure.constants_mem
code: theorem constants_mem (c : L.Constants) : (c : M) ∈ S 
goal: ↑c ∈ S

full_name: FirstOrder.Language.Substructure.instTop
code: /-- The substructure `M` of the structure `M`. -/
instance instTop : Top (L.Substructure M) 
goal: Top (L.Substructure M)

full_name: FirstOrder.Language.Substructure.instInhabited
code: instance instInhabited : Inhabited (L.Substructure M) 
goal: Inhabited (L.Substructure M)

full_name: FirstOrder.Language.Substructure.mem_top
code: @[simp]
theorem mem_top (x : M) : x ∈ (⊤ : L.Substructure M) 
goal: x ∈ ⊤

full_name: FirstOrder.Language.Substructure.coe_top
code: @[simp]
theorem coe_top : ((⊤ : L.Substructure M) : Set M) = Set.univ 
goal: ↑⊤ = Set.univ

full_name: FirstOrder.Language.Substructure.instInf
code: /-- The inf of two substructures is their intersection. -/
instance instInf : Inf (L.Substructure M) 
goal: Inf (L.Substructure M)

full_name: FirstOrder.Language.Substructure.coe_inf
code: @[simp]
theorem coe_inf (p p' : L.Substructure M) :
    ((p ⊓ p' : L.Substructure M) : Set M) = (p : Set M) ∩ (p' : Set M) 
goal: ↑(p ⊓ p') = ↑p ∩ ↑p'

full_name: FirstOrder.Language.Substructure.mem_inf
code: @[simp]
theorem mem_inf {p p' : L.Substructure M} {x : M} : x ∈ p ⊓ p' ↔ x ∈ p ∧ x ∈ p' 
goal: x ∈ p ⊓ p' ↔ x ∈ p ∧ x ∈ p'

full_name: FirstOrder.Language.Substructure.instInfSet
code: instance instInfSet : InfSet (L.Substructure M) 
goal: InfSet (L.Substructure M)

full_name: FirstOrder.Language.Substructure.coe_sInf
code: @[simp, norm_cast]
theorem coe_sInf (S : Set (L.Substructure M)) :
    ((sInf S : L.Substructure M) : Set M) = ⋂ s ∈ S, (s : Set M) 
goal: ↑(sInf S) = ⋂ s ∈ S, ↑s

full_name: FirstOrder.Language.Substructure.mem_sInf
code: theorem mem_sInf {S : Set (L.Substructure M)} {x : M} : x ∈ sInf S ↔ ∀ p ∈ S, x ∈ p 
goal: x ∈ sInf S ↔ ∀ p ∈ S, x ∈ p

full_name: FirstOrder.Language.Substructure.mem_iInf
code: theorem mem_iInf {ι : Sort*} {S : ι → L.Substructure M} {x : M} :
    (x ∈ ⨅ i, S i) ↔ ∀ i, x ∈ S i 
goal: x ∈ ⨅ i, S i ↔ ∀ (i : ι), x ∈ S i

full_name: FirstOrder.Language.Substructure.coe_iInf
code: @[simp, norm_cast]
theorem coe_iInf {ι : Sort*} {S : ι → L.Substructure M} :
    ((⨅ i, S i : L.Substructure M) : Set M) = ⋂ i, (S i : Set M) 
goal: ↑(⨅ i, S i) = ⋂ i, ↑(S i)

full_name: FirstOrder.Language.Substructure.instCompleteLattice
code: /-- Substructures of a structure form a complete lattice. -/
instance instCompleteLattice : CompleteLattice (L.Substructure M) 
goal: CompleteLattice (L.Substructure M)

full_name: FirstOrder.Language.Substructure.closure
code: /-- The `L.Substructure` generated by a set. -/
def closure : LowerAdjoint ((↑) : L.Substructure M → Set M) 
goal: LowerAdjoint SetLike.coe

full_name: FirstOrder.Language.Substructure.mem_closure
code: theorem mem_closure {x : M} : x ∈ closure L s ↔ ∀ S : L.Substructure M, s ⊆ S → x ∈ S 
goal: x ∈ (FirstOrder.Language.Substructure.closure L).toFun s ↔ ∀ (S : L.Substructure M), s ⊆ ↑S → x ∈ S

full_name: FirstOrder.Language.Substructure.subset_closure
code: /-- The substructure generated by a set includes the set. -/
@[simp]
theorem subset_closure : s ⊆ closure L s 
goal: s ⊆ ↑((FirstOrder.Language.Substructure.closure L).toFun s)

full_name: FirstOrder.Language.Substructure.not_mem_of_not_mem_closure
code: theorem not_mem_of_not_mem_closure {P : M} (hP : P ∉ closure L s) : P ∉ s 
goal: P ∉ s

full_name: FirstOrder.Language.Substructure.closed
code: @[simp]
theorem closed (S : L.Substructure M) : (closure L).closed (S : Set M) 
goal: (FirstOrder.Language.Substructure.closure L).closed ↑S

full_name: FirstOrder.Language.Substructure.closure_le
code: /-- A substructure `S` includes `closure L s` if and only if it includes `s`. -/
@[simp]
theorem closure_le : closure L s ≤ S ↔ s ⊆ S 
goal: (FirstOrder.Language.Substructure.closure L).toFun s ≤ S ↔ s ⊆ ↑S

full_name: FirstOrder.Language.Substructure.closure_mono
code: /-- Substructure closure of a set is monotone in its argument: if `s ⊆ t`,
then `closure L s ≤ closure L t`. -/
theorem closure_mono ⦃s t : Set M⦄ (h : s ⊆ t) : closure L s ≤ closure L t 
goal: (FirstOrder.Language.Substructure.closure L).toFun s ≤ (FirstOrder.Language.Substructure.closure L).toFun t

full_name: FirstOrder.Language.Substructure.closure_eq_of_le
code: theorem closure_eq_of_le (h₁ : s ⊆ S) (h₂ : S ≤ closure L s) : closure L s = S 
goal: (FirstOrder.Language.Substructure.closure L).toFun s = S

full_name: FirstOrder.Language.Substructure.coe_closure_eq_range_term_realize
code: theorem coe_closure_eq_range_term_realize :
    (closure L s : Set M) = range (@Term.realize L _ _ _ ((↑) : s → M)) 
goal: ↑((FirstOrder.Language.Substructure.closure L).toFun s) = Set.range (FirstOrder.Language.Term.realize Subtype.val)

full_name: FirstOrder.Language.Substructure.small_closure
code: instance small_closure [Small.{u} s] : Small.{u} (closure L s) 
goal: Small.{u, w} ↥((FirstOrder.Language.Substructure.closure L).toFun s)

full_name: FirstOrder.Language.Substructure.mem_closure_iff_exists_term
code: theorem mem_closure_iff_exists_term {x : M} :
    x ∈ closure L s ↔ ∃ t : L.Term s, t.realize ((↑) : s → M) = x 
goal: x ∈ (FirstOrder.Language.Substructure.closure L).toFun s ↔ ∃ t, FirstOrder.Language.Term.realize Subtype.val t = x

full_name: FirstOrder.Language.Substructure.lift_card_closure_le_card_term
code: theorem lift_card_closure_le_card_term : Cardinal.lift.{max u w} #(closure L s) ≤ #(L.Term s) 
goal: Cardinal.lift.{max u w, w} (Cardinal.mk ↥((FirstOrder.Language.Substructure.closure L).toFun s)) ≤
  Cardinal.mk (L.Term ↑s)

full_name: FirstOrder.Language.Substructure.lift_card_closure_le
code: theorem lift_card_closure_le :
    Cardinal.lift.{u, w} #(closure L s) ≤
      max ℵ₀ (Cardinal.lift.{u, w} #s + Cardinal.lift.{w, u} #(Σi, L.Functions i)) 
goal: Cardinal.lift.{u, w} (Cardinal.mk ↥((FirstOrder.Language.Substructure.closure L).toFun s)) ≤
  max Cardinal.aleph0
    (Cardinal.lift.{u, w} (Cardinal.mk ↑s) + Cardinal.lift.{w, u} (Cardinal.mk ((i : ℕ) × L.Functions i)))

full_name: Set.Countable.substructure_closure
code: theorem _root_.Set.Countable.substructure_closure
    [Countable (Σl, L.Functions l)] (h : s.Countable) : Countable.{w + 1} (closure L s) 
goal: Countable ↥((FirstOrder.Language.Substructure.closure L).toFun s)

full_name: FirstOrder.Language.Substructure.closure_induction
code: /-- An induction principle for closure membership. If `p` holds for all elements of `s`, and
is preserved under function symbols, then `p` holds for all elements of the closure of `s`. -/
@[elab_as_elim]
theorem closure_induction {p : M → Prop} {x} (h : x ∈ closure L s) (Hs : ∀ x ∈ s, p x)
    (Hfun : ∀ {n : ℕ} (f : L.Functions n), ClosedUnder f (setOf p)) : p x 
goal: p x

full_name: FirstOrder.Language.Substructure.dense_induction
code: /-- If `s` is a dense set in a structure `M`, `Substructure.closure L s = ⊤`, then in order to prove
that some predicate `p` holds for all `x : M` it suffices to verify `p x` for `x ∈ s`, and verify
that `p` is preserved under function symbols. -/
@[elab_as_elim]
theorem dense_induction {p : M → Prop} (x : M) {s : Set M} (hs : closure L s = ⊤)
    (Hs : ∀ x ∈ s, p x) (Hfun : ∀ {n : ℕ} (f : L.Functions n), ClosedUnder f (setOf p)) : p x 
goal: p x

full_name: FirstOrder.Language.Substructure.gi
code: /-- `closure` forms a Galois insertion with the coercion to set. -/
protected def gi : GaloisInsertion (@closure L M _) (↑) 
goal: GaloisInsertion (FirstOrder.Language.Substructure.closure L).toFun SetLike.coe

full_name: FirstOrder.Language.Substructure.closure_eq
code: /-- Closure of a substructure `S` equals `S`. -/
@[simp]
theorem closure_eq : closure L (S : Set M) = S 
goal: (FirstOrder.Language.Substructure.closure L).toFun ↑S = S

full_name: FirstOrder.Language.Substructure.closure_empty
code: @[simp]
theorem closure_empty : closure L (∅ : Set M) = ⊥ 
goal: (FirstOrder.Language.Substructure.closure L).toFun ∅ = ⊥

full_name: FirstOrder.Language.Substructure.closure_univ
code: @[simp]
theorem closure_univ : closure L (univ : Set M) = ⊤ 
goal: (FirstOrder.Language.Substructure.closure L).toFun Set.univ = ⊤

full_name: FirstOrder.Language.Substructure.closure_union
code: theorem closure_union (s t : Set M) : closure L (s ∪ t) = closure L s ⊔ closure L t 
goal: (FirstOrder.Language.Substructure.closure L).toFun (s ∪ t) =
  (FirstOrder.Language.Substructure.closure L).toFun s ⊔ (FirstOrder.Language.Substructure.closure L).toFun t

full_name: FirstOrder.Language.Substructure.closure_unionᵢ
code: theorem closure_unionᵢ {ι} (s : ι → Set M) : closure L (⋃ i, s i) = ⨆ i, closure L (s i) 
goal: (FirstOrder.Language.Substructure.closure L).toFun (⋃ i, s i) =
  ⨆ i, (FirstOrder.Language.Substructure.closure L).toFun (s i)

full_name: FirstOrder.Language.Substructure.small_bot
code: instance small_bot : Small.{u} (⊥ : L.Substructure M) 
goal: Small.{u, w} ↥⊥

full_name: FirstOrder.Language.Substructure.comap
code: /-- The preimage of a substructure along a homomorphism is a substructure. -/
@[simps]
def comap (φ : M →[L] N) (S : L.Substructure N) : L.Substructure M 
goal: L.Substructure M

full_name: FirstOrder.Language.Substructure.comap_coe
code: /-- The preimage of a substructure along a homomorphism is a substructure. -/
@[simps]
def comap (φ : M →[L] N) (S : L.Substructure N) : L.Substructure M 
goal: ↑(FirstOrder.Language.Substructure.comap φ S) = ⇑φ ⁻¹' ↑S

full_name: FirstOrder.Language.Substructure.mem_comap
code: @[simp]
theorem mem_comap {S : L.Substructure N} {f : M →[L] N} {x : M} : x ∈ S.comap f ↔ f x ∈ S 
goal: x ∈ FirstOrder.Language.Substructure.comap f S ↔ f x ∈ S

full_name: FirstOrder.Language.Substructure.comap_comap
code: theorem comap_comap (S : L.Substructure P) (g : N →[L] P) (f : M →[L] N) :
    (S.comap g).comap f = S.comap (g.comp f) 
goal: FirstOrder.Language.Substructure.comap f (FirstOrder.Language.Substructure.comap g S) =
  FirstOrder.Language.Substructure.comap (g.comp f) S

full_name: FirstOrder.Language.Substructure.comap_id
code: @[simp]
theorem comap_id (S : L.Substructure P) : S.comap (Hom.id _ _) = S 
goal: FirstOrder.Language.Substructure.comap (FirstOrder.Language.Hom.id L P) S = S

full_name: FirstOrder.Language.Substructure.map
code: /-- The image of a substructure along a homomorphism is a substructure. -/
@[simps]
def map (φ : M →[L] N) (S : L.Substructure M) : L.Substructure N 
goal: L.Substructure N

full_name: FirstOrder.Language.Substructure.map_coe
code: /-- The image of a substructure along a homomorphism is a substructure. -/
@[simps]
def map (φ : M →[L] N) (S : L.Substructure M) : L.Substructure N 
goal: ↑(FirstOrder.Language.Substructure.map φ S) = ⇑φ '' ↑S

full_name: FirstOrder.Language.Substructure.mem_map
code: @[simp]
theorem mem_map {f : M →[L] N} {S : L.Substructure M} {y : N} :
    y ∈ S.map f ↔ ∃ x ∈ S, f x = y 
goal: y ∈ FirstOrder.Language.Substructure.map f S ↔ ∃ x ∈ S, f x = y

full_name: FirstOrder.Language.Substructure.mem_map_of_mem
code: theorem mem_map_of_mem (f : M →[L] N) {S : L.Substructure M} {x : M} (hx : x ∈ S) : f x ∈ S.map f 
goal: f x ∈ FirstOrder.Language.Substructure.map f S

full_name: FirstOrder.Language.Substructure.apply_coe_mem_map
code: theorem apply_coe_mem_map (f : M →[L] N) (S : L.Substructure M) (x : S) : f x ∈ S.map f 
goal: f ↑x ∈ FirstOrder.Language.Substructure.map f S

full_name: FirstOrder.Language.Substructure.map_map
code: theorem map_map (g : N →[L] P) (f : M →[L] N) : (S.map f).map g = S.map (g.comp f) 
goal: FirstOrder.Language.Substructure.map g (FirstOrder.Language.Substructure.map f S) =
  FirstOrder.Language.Substructure.map (g.comp f) S

full_name: FirstOrder.Language.Substructure.map_le_iff_le_comap
code: theorem map_le_iff_le_comap {f : M →[L] N} {S : L.Substructure M} {T : L.Substructure N} :
    S.map f ≤ T ↔ S ≤ T.comap f 
goal: FirstOrder.Language.Substructure.map f S ≤ T ↔ S ≤ FirstOrder.Language.Substructure.comap f T

full_name: FirstOrder.Language.Substructure.gc_map_comap
code: theorem gc_map_comap (f : M →[L] N) : GaloisConnection (map f) (comap f) 
goal: GaloisConnection (FirstOrder.Language.Substructure.map f) (FirstOrder.Language.Substructure.comap f)

full_name: FirstOrder.Language.Substructure.map_le_of_le_comap
code: theorem map_le_of_le_comap {T : L.Substructure N} {f : M →[L] N} : S ≤ T.comap f → S.map f ≤ T 
goal: S ≤ FirstOrder.Language.Substructure.comap f T → FirstOrder.Language.Substructure.map f S ≤ T

full_name: FirstOrder.Language.Substructure.le_comap_of_map_le
code: theorem le_comap_of_map_le {T : L.Substructure N} {f : M →[L] N} : S.map f ≤ T → S ≤ T.comap f 
goal: FirstOrder.Language.Substructure.map f S ≤ T → S ≤ FirstOrder.Language.Substructure.comap f T

full_name: FirstOrder.Language.Substructure.le_comap_map
code: theorem le_comap_map {f : M →[L] N} : S ≤ (S.map f).comap f 
goal: S ≤ FirstOrder.Language.Substructure.comap f (FirstOrder.Language.Substructure.map f S)

full_name: FirstOrder.Language.Substructure.map_comap_le
code: theorem map_comap_le {S : L.Substructure N} {f : M →[L] N} : (S.comap f).map f ≤ S 
goal: FirstOrder.Language.Substructure.map f (FirstOrder.Language.Substructure.comap f S) ≤ S

full_name: FirstOrder.Language.Substructure.monotone_map
code: theorem monotone_map {f : M →[L] N} : Monotone (map f) 
goal: Monotone (FirstOrder.Language.Substructure.map f)

full_name: FirstOrder.Language.Substructure.monotone_comap
code: theorem monotone_comap {f : M →[L] N} : Monotone (comap f) 
goal: Monotone (FirstOrder.Language.Substructure.comap f)

full_name: FirstOrder.Language.Substructure.map_comap_map
code: @[simp]
theorem map_comap_map {f : M →[L] N} : ((S.map f).comap f).map f = S.map f 
goal: FirstOrder.Language.Substructure.map f
    (FirstOrder.Language.Substructure.comap f (FirstOrder.Language.Substructure.map f S)) =
  FirstOrder.Language.Substructure.map f S

full_name: FirstOrder.Language.Substructure.comap_map_comap
code: @[simp]
theorem comap_map_comap {S : L.Substructure N} {f : M →[L] N} :
    ((S.comap f).map f).comap f = S.comap f 
goal: FirstOrder.Language.Substructure.comap f
    (FirstOrder.Language.Substructure.map f (FirstOrder.Language.Substructure.comap f S)) =
  FirstOrder.Language.Substructure.comap f S

full_name: FirstOrder.Language.Substructure.map_sup
code: theorem map_sup (S T : L.Substructure M) (f : M →[L] N) : (S ⊔ T).map f = S.map f ⊔ T.map f 
goal: FirstOrder.Language.Substructure.map f (S ⊔ T) =
  FirstOrder.Language.Substructure.map f S ⊔ FirstOrder.Language.Substructure.map f T

full_name: FirstOrder.Language.Substructure.map_iSup
code: theorem map_iSup {ι : Sort*} (f : M →[L] N) (s : ι → L.Substructure M) :
    (iSup s).map f = ⨆ i, (s i).map f 
goal: FirstOrder.Language.Substructure.map f (iSup s) = ⨆ i, FirstOrder.Language.Substructure.map f (s i)

full_name: FirstOrder.Language.Substructure.comap_inf
code: theorem comap_inf (S T : L.Substructure N) (f : M →[L] N) :
    (S ⊓ T).comap f = S.comap f ⊓ T.comap f 
goal: FirstOrder.Language.Substructure.comap f (S ⊓ T) =
  FirstOrder.Language.Substructure.comap f S ⊓ FirstOrder.Language.Substructure.comap f T

full_name: FirstOrder.Language.Substructure.comap_iInf
code: theorem comap_iInf {ι : Sort*} (f : M →[L] N) (s : ι → L.Substructure N) :
    (iInf s).comap f = ⨅ i, (s i).comap f 
goal: FirstOrder.Language.Substructure.comap f (iInf s) = ⨅ i, FirstOrder.Language.Substructure.comap f (s i)

full_name: FirstOrder.Language.Substructure.map_bot
code: @[simp]
theorem map_bot (f : M →[L] N) : (⊥ : L.Substructure M).map f = ⊥ 
goal: FirstOrder.Language.Substructure.map f ⊥ = ⊥

full_name: FirstOrder.Language.Substructure.comap_top
code: @[simp]
theorem comap_top (f : M →[L] N) : (⊤ : L.Substructure N).comap f = ⊤ 
goal: FirstOrder.Language.Substructure.comap f ⊤ = ⊤

full_name: FirstOrder.Language.Substructure.map_id
code: @[simp]
theorem map_id (S : L.Substructure M) : S.map (Hom.id L M) = S 
goal: FirstOrder.Language.Substructure.map (FirstOrder.Language.Hom.id L M) S = S

full_name: FirstOrder.Language.Substructure.map_closure
code: theorem map_closure (f : M →[L] N) (s : Set M) : (closure L s).map f = closure L (f '' s) 
goal: FirstOrder.Language.Substructure.map f ((FirstOrder.Language.Substructure.closure L).toFun s) =
  (FirstOrder.Language.Substructure.closure L).toFun (⇑f '' s)

full_name: FirstOrder.Language.Substructure.closure_image
code: @[simp]
theorem closure_image (f : M →[L] N) : closure L (f '' s) = map f (closure L s) 
goal: (FirstOrder.Language.Substructure.closure L).toFun (⇑f '' s) =
  FirstOrder.Language.Substructure.map f ((FirstOrder.Language.Substructure.closure L).toFun s)

full_name: FirstOrder.Language.Substructure.gciMapComap
code: /-- `map f` and `comap f` form a `GaloisCoinsertion` when `f` is injective. -/
def gciMapComap : GaloisCoinsertion (map f) (comap f) 
goal: GaloisCoinsertion (FirstOrder.Language.Substructure.map f) (FirstOrder.Language.Substructure.comap f)

full_name: FirstOrder.Language.Substructure.comap_map_eq_of_injective
code: theorem comap_map_eq_of_injective (S : L.Substructure M) : (S.map f).comap f = S 
goal: FirstOrder.Language.Substructure.comap f (FirstOrder.Language.Substructure.map f S) = S

full_name: FirstOrder.Language.Substructure.comap_surjective_of_injective
code: theorem comap_surjective_of_injective : Function.Surjective (comap f) 
goal: Function.Surjective (FirstOrder.Language.Substructure.comap f)

full_name: FirstOrder.Language.Substructure.map_injective_of_injective
code: theorem map_injective_of_injective : Function.Injective (map f) 
goal: Function.Injective (FirstOrder.Language.Substructure.map f)

full_name: FirstOrder.Language.Substructure.comap_inf_map_of_injective
code: theorem comap_inf_map_of_injective (S T : L.Substructure M) : (S.map f ⊓ T.map f).comap f = S ⊓ T 
goal: FirstOrder.Language.Substructure.comap f
    (FirstOrder.Language.Substructure.map f S ⊓ FirstOrder.Language.Substructure.map f T) =
  S ⊓ T

full_name: FirstOrder.Language.Substructure.comap_iInf_map_of_injective
code: theorem comap_iInf_map_of_injective (S : ι → L.Substructure M) :
    (⨅ i, (S i).map f).comap f = iInf S 
goal: FirstOrder.Language.Substructure.comap f (⨅ i, FirstOrder.Language.Substructure.map f (S i)) = iInf S

full_name: FirstOrder.Language.Substructure.comap_sup_map_of_injective
code: theorem comap_sup_map_of_injective (S T : L.Substructure M) : (S.map f ⊔ T.map f).comap f = S ⊔ T 
goal: FirstOrder.Language.Substructure.comap f
    (FirstOrder.Language.Substructure.map f S ⊔ FirstOrder.Language.Substructure.map f T) =
  S ⊔ T

full_name: FirstOrder.Language.Substructure.comap_iSup_map_of_injective
code: theorem comap_iSup_map_of_injective (S : ι → L.Substructure M) :
    (⨆ i, (S i).map f).comap f = iSup S 
goal: FirstOrder.Language.Substructure.comap f (⨆ i, FirstOrder.Language.Substructure.map f (S i)) = iSup S

full_name: FirstOrder.Language.Substructure.map_le_map_iff_of_injective
code: theorem map_le_map_iff_of_injective {S T : L.Substructure M} : S.map f ≤ T.map f ↔ S ≤ T 
goal: FirstOrder.Language.Substructure.map f S ≤ FirstOrder.Language.Substructure.map f T ↔ S ≤ T

full_name: FirstOrder.Language.Substructure.map_strictMono_of_injective
code: theorem map_strictMono_of_injective : StrictMono (map f) 
goal: StrictMono (FirstOrder.Language.Substructure.map f)

full_name: FirstOrder.Language.Substructure.giMapComap
code: /-- `map f` and `comap f` form a `GaloisInsertion` when `f` is surjective. -/
def giMapComap : GaloisInsertion (map f) (comap f) 
goal: GaloisInsertion (FirstOrder.Language.Substructure.map f) (FirstOrder.Language.Substructure.comap f)

full_name: FirstOrder.Language.Substructure.map_comap_eq_of_surjective
code: theorem map_comap_eq_of_surjective (S : L.Substructure N) : (S.comap f).map f = S 
goal: FirstOrder.Language.Substructure.map f (FirstOrder.Language.Substructure.comap f S) = S

full_name: FirstOrder.Language.Substructure.map_surjective_of_surjective
code: theorem map_surjective_of_surjective : Function.Surjective (map f) 
goal: Function.Surjective (FirstOrder.Language.Substructure.map f)

full_name: FirstOrder.Language.Substructure.comap_injective_of_surjective
code: theorem comap_injective_of_surjective : Function.Injective (comap f) 
goal: Function.Injective (FirstOrder.Language.Substructure.comap f)

full_name: FirstOrder.Language.Substructure.map_inf_comap_of_surjective
code: theorem map_inf_comap_of_surjective (S T : L.Substructure N) :
    (S.comap f ⊓ T.comap f).map f = S ⊓ T 
goal: FirstOrder.Language.Substructure.map f
    (FirstOrder.Language.Substructure.comap f S ⊓ FirstOrder.Language.Substructure.comap f T) =
  S ⊓ T

full_name: FirstOrder.Language.Substructure.map_iInf_comap_of_surjective
code: theorem map_iInf_comap_of_surjective (S : ι → L.Substructure N) :
    (⨅ i, (S i).comap f).map f = iInf S 
goal: FirstOrder.Language.Substructure.map f (⨅ i, FirstOrder.Language.Substructure.comap f (S i)) = iInf S

full_name: FirstOrder.Language.Substructure.map_sup_comap_of_surjective
code: theorem map_sup_comap_of_surjective (S T : L.Substructure N) :
    (S.comap f ⊔ T.comap f).map f = S ⊔ T 
goal: FirstOrder.Language.Substructure.map f
    (FirstOrder.Language.Substructure.comap f S ⊔ FirstOrder.Language.Substructure.comap f T) =
  S ⊔ T

full_name: FirstOrder.Language.Substructure.map_iSup_comap_of_surjective
code: theorem map_iSup_comap_of_surjective (S : ι → L.Substructure N) :
    (⨆ i, (S i).comap f).map f = iSup S 
goal: FirstOrder.Language.Substructure.map f (⨆ i, FirstOrder.Language.Substructure.comap f (S i)) = iSup S

full_name: FirstOrder.Language.Substructure.comap_le_comap_iff_of_surjective
code: theorem comap_le_comap_iff_of_surjective {S T : L.Substructure N} : S.comap f ≤ T.comap f ↔ S ≤ T 
goal: FirstOrder.Language.Substructure.comap f S ≤ FirstOrder.Language.Substructure.comap f T ↔ S ≤ T

full_name: FirstOrder.Language.Substructure.comap_strictMono_of_surjective
code: theorem comap_strictMono_of_surjective : StrictMono (comap f) 
goal: StrictMono (FirstOrder.Language.Substructure.comap f)

full_name: FirstOrder.Language.Substructure.inducedStructure
code: instance inducedStructure {S : L.Substructure M} : L.Structure S 
goal: L.Structure ↥S

full_name: FirstOrder.Language.Substructure.subtype
code: /-- The natural embedding of an `L.Substructure` of `M` into `M`. -/
def subtype (S : L.Substructure M) : S ↪[L] M 
goal: L.Embedding (↥S) M

full_name: FirstOrder.Language.Substructure.coeSubtype
code: @[simp]
theorem coeSubtype : ⇑S.subtype = ((↑) : S → M) 
goal: ⇑S.subtype = Subtype.val

full_name: FirstOrder.Language.Substructure.topEquiv
code: /-- The equivalence between the maximal substructure of a structure and the structure itself. -/
def topEquiv : (⊤ : L.Substructure M) ≃[L] M 
goal: L.Equiv (↥⊤) M

full_name: FirstOrder.Language.Substructure.coe_topEquiv
code: @[simp]
theorem coe_topEquiv :
    ⇑(topEquiv : (⊤ : L.Substructure M) ≃[L] M) = ((↑) : (⊤ : L.Substructure M) → M) 
goal: ⇑FirstOrder.Language.Substructure.topEquiv = Subtype.val

full_name: FirstOrder.Language.Substructure.realize_boundedFormula_top
code: @[simp]
theorem realize_boundedFormula_top {α : Type*} {n : ℕ} {φ : L.BoundedFormula α n}
    {v : α → (⊤ : L.Substructure M)} {xs : Fin n → (⊤ : L.Substructure M)} :
    φ.Realize v xs ↔ φ.Realize (((↑) : _ → M) ∘ v) ((↑) ∘ xs) 
goal: φ.Realize v xs ↔ φ.Realize (Subtype.val ∘ v) (Subtype.val ∘ xs)

full_name: FirstOrder.Language.Substructure.realize_formula_top
code: @[simp]
theorem realize_formula_top {α : Type*} {φ : L.Formula α} {v : α → (⊤ : L.Substructure M)} :
    φ.Realize v ↔ φ.Realize (((↑) : (⊤ : L.Substructure M) → M) ∘ v) 
goal: φ.Realize v ↔ φ.Realize (Subtype.val ∘ v)

full_name: FirstOrder.Language.Substructure.closure_induction'
code: /-- A dependent version of `Substructure.closure_induction`. -/
@[elab_as_elim]
theorem closure_induction' (s : Set M) {p : ∀ x, x ∈ closure L s → Prop}
    (Hs : ∀ (x) (h : x ∈ s), p x (subset_closure h))
    (Hfun : ∀ {n : ℕ} (f : L.Functions n), ClosedUnder f { x | ∃ hx, p x hx }) {x}
    (hx : x ∈ closure L s) : p x hx 
goal: p x hx

full_name: FirstOrder.Language.LHom.substructureReduct
code: /-- Reduces the language of a substructure along a language hom. -/
def substructureReduct : L'.Substructure M ↪o L.Substructure M 
goal: L'.Substructure M ↪o L.Substructure M

full_name: FirstOrder.Language.LHom.mem_substructureReduct
code: @[simp]
theorem mem_substructureReduct {x : M} {S : L'.Substructure M} :
    x ∈ φ.substructureReduct S ↔ x ∈ S 
goal: x ∈ φ.substructureReduct S ↔ x ∈ S

full_name: FirstOrder.Language.LHom.coe_substructureReduct
code: @[simp]
theorem coe_substructureReduct {S : L'.Substructure M} : (φ.substructureReduct S : Set M) = ↑S 
goal: ↑(φ.substructureReduct S) = ↑S

full_name: FirstOrder.Language.Substructure.withConstants
code: /-- Turns any substructure containing a constant set `A` into a `L[[A]]`-substructure. -/
def withConstants (S : L.Substructure M) {A : Set M} (h : A ⊆ S) : L[[A]].Substructure M 
goal: (L.withConstants ↑A).Substructure M

full_name: FirstOrder.Language.Substructure.mem_withConstants
code: @[simp]
theorem mem_withConstants {x : M} : x ∈ S.withConstants h ↔ x ∈ S 
goal: x ∈ S.withConstants h ↔ x ∈ S

full_name: FirstOrder.Language.Substructure.coe_withConstants
code: @[simp]
theorem coe_withConstants : (S.withConstants h : Set M) = ↑S 
goal: ↑(S.withConstants h) = ↑S

full_name: FirstOrder.Language.Substructure.reduct_withConstants
code: @[simp]
theorem reduct_withConstants :
    (L.lhomWithConstants A).substructureReduct (S.withConstants h) = S 
goal: (L.lhomWithConstants ↑A).substructureReduct (S.withConstants h) = S

full_name: FirstOrder.Language.Substructure.subset_closure_withConstants
code: theorem subset_closure_withConstants : A ⊆ closure (L[[A]]) s 
goal: A ⊆ ↑((FirstOrder.Language.Substructure.closure (L.withConstants ↑A)).toFun s)

full_name: FirstOrder.Language.Substructure.closure_withConstants_eq
code: theorem closure_withConstants_eq :
    closure (L[[A]]) s =
      (closure L (A ∪ s)).withConstants ((A.subset_union_left).trans subset_closure) 
goal: (FirstOrder.Language.Substructure.closure (L.withConstants ↑A)).toFun s =
  ((FirstOrder.Language.Substructure.closure L).toFun (A ∪ s)).withConstants ⋯

full_name: FirstOrder.Language.Hom.domRestrict_toFun
code: /-- The restriction of a first-order hom to a substructure `s ⊆ M` gives a hom `s → N`. -/
@[simps!]
def domRestrict (f : M →[L] N) (p : L.Substructure M) : p →[L] N 
goal: ∀ (a : ↥p), (f.domRestrict p) a = f ↑a

full_name: FirstOrder.Language.Hom.domRestrict
code: /-- The restriction of a first-order hom to a substructure `s ⊆ M` gives a hom `s → N`. -/
@[simps!]
def domRestrict (f : M →[L] N) (p : L.Substructure M) : p →[L] N 
goal: L.Hom (↥p) N

full_name: FirstOrder.Language.Hom.codRestrict
code: /-- A first-order hom `f : M → N` whose values lie in a substructure `p ⊆ N` can be restricted to a
hom `M → p`. -/
@[simps]
def codRestrict (p : L.Substructure N) (f : M →[L] N) (h : ∀ c, f c ∈ p) : M →[L] p 
goal: L.Hom M ↥p

full_name: FirstOrder.Language.Hom.codRestrict_toFun_coe
code: /-- A first-order hom `f : M → N` whose values lie in a substructure `p ⊆ N` can be restricted to a
hom `M → p`. -/
@[simps]
def codRestrict (p : L.Substructure N) (f : M →[L] N) (h : ∀ c, f c ∈ p) : M →[L] p 
goal: ↑((FirstOrder.Language.Hom.codRestrict p f h) c) = f c

full_name: FirstOrder.Language.Hom.comp_codRestrict
code: @[simp]
theorem comp_codRestrict (f : M →[L] N) (g : N →[L] P) (p : L.Substructure P) (h : ∀ b, g b ∈ p) :
    ((codRestrict p g h).comp f : M →[L] p) = codRestrict p (g.comp f) fun _ => h _ 
goal: (FirstOrder.Language.Hom.codRestrict p g h).comp f = FirstOrder.Language.Hom.codRestrict p (g.comp f) ⋯

full_name: FirstOrder.Language.Hom.subtype_comp_codRestrict
code: @[simp]
theorem subtype_comp_codRestrict (f : M →[L] N) (p : L.Substructure N) (h : ∀ b, f b ∈ p) :
    p.subtype.toHom.comp (codRestrict p f h) = f 
goal: p.subtype.toHom.comp (FirstOrder.Language.Hom.codRestrict p f h) = f

full_name: FirstOrder.Language.Hom.range
code: /-- The range of a first-order hom `f : M → N` is a submodule of `N`.
See Note [range copy pattern]. -/
def range (f : M →[L] N) : L.Substructure N 
goal: L.Substructure N

full_name: FirstOrder.Language.Hom.range_coe
code: theorem range_coe (f : M →[L] N) : (range f : Set N) = Set.range f 
goal: ↑f.range = Set.range ⇑f

full_name: FirstOrder.Language.Hom.mem_range
code: @[simp]
theorem mem_range {f : M →[L] N} {x} : x ∈ range f ↔ ∃ y, f y = x 
goal: x ∈ f.range ↔ ∃ y, f y = x

full_name: FirstOrder.Language.Hom.range_eq_map
code: theorem range_eq_map (f : M →[L] N) : f.range = map f ⊤ 
goal: f.range = FirstOrder.Language.Substructure.map f ⊤

full_name: FirstOrder.Language.Hom.mem_range_self
code: theorem mem_range_self (f : M →[L] N) (x : M) : f x ∈ f.range 
goal: f x ∈ f.range

full_name: FirstOrder.Language.Hom.range_id
code: @[simp]
theorem range_id : range (id L M) = ⊤ 
goal: (FirstOrder.Language.Hom.id L M).range = ⊤

full_name: FirstOrder.Language.Hom.range_comp
code: theorem range_comp (f : M →[L] N) (g : N →[L] P) : range (g.comp f : M →[L] P) = map g (range f) 
goal: (g.comp f).range = FirstOrder.Language.Substructure.map g f.range

full_name: FirstOrder.Language.Hom.range_comp_le_range
code: theorem range_comp_le_range (f : M →[L] N) (g : N →[L] P) : range (g.comp f : M →[L] P) ≤ range g 
goal: (g.comp f).range ≤ g.range

full_name: FirstOrder.Language.Hom.range_eq_top
code: theorem range_eq_top {f : M →[L] N} : range f = ⊤ ↔ Function.Surjective f 
goal: f.range = ⊤ ↔ Function.Surjective ⇑f

full_name: FirstOrder.Language.Hom.range_le_iff_comap
code: theorem range_le_iff_comap {f : M →[L] N} {p : L.Substructure N} : range f ≤ p ↔ comap f p = ⊤ 
goal: f.range ≤ p ↔ FirstOrder.Language.Substructure.comap f p = ⊤

full_name: FirstOrder.Language.Hom.map_le_range
code: theorem map_le_range {f : M →[L] N} {p : L.Substructure M} : map f p ≤ range f 
goal: FirstOrder.Language.Substructure.map f p ≤ f.range

full_name: FirstOrder.Language.Hom.eqLocus
code: /-- The substructure of elements `x : M` such that `f x = g x` -/
def eqLocus (f g : M →[L] N) : Substructure L M 
goal: L.Substructure M

full_name: FirstOrder.Language.Hom.eqOn_closure
code: /-- If two `L.Hom`s are equal on a set, then they are equal on its substructure closure. -/
theorem eqOn_closure {f g : M →[L] N} {s : Set M} (h : Set.EqOn f g s) :
    Set.EqOn f g (closure L s) 
goal: Set.EqOn ⇑f ⇑g ↑((FirstOrder.Language.Substructure.closure L).toFun s)

full_name: FirstOrder.Language.Hom.eq_of_eqOn_top
code: theorem eq_of_eqOn_top {f g : M →[L] N} (h : Set.EqOn f g (⊤ : Substructure L M)) : f = g 
goal: f = g

full_name: FirstOrder.Language.Hom.eq_of_eqOn_dense
code: theorem eq_of_eqOn_dense (hs : closure L s = ⊤) {f g : M →[L] N} (h : s.EqOn f g) : f = g 
goal: f = g

full_name: FirstOrder.Language.Embedding.domRestrict
code: /-- The restriction of a first-order embedding to a substructure `s ⊆ M` gives an embedding `s → N`.
-/
def domRestrict (f : M ↪[L] N) (p : L.Substructure M) : p ↪[L] N 
goal: L.Embedding (↥p) N

full_name: FirstOrder.Language.Embedding.domRestrict_apply
code: @[simp]
theorem domRestrict_apply (f : M ↪[L] N) (p : L.Substructure M) (x : p) : f.domRestrict p x = f x 
goal: (f.domRestrict p) x = f ↑x

full_name: FirstOrder.Language.Embedding.codRestrict
code: /-- A first-order embedding `f : M → N` whose values lie in a substructure `p ⊆ N` can be restricted
to an embedding `M → p`. -/
def codRestrict (p : L.Substructure N) (f : M ↪[L] N) (h : ∀ c, f c ∈ p) : M ↪[L] p 
goal: L.Embedding M ↥p

full_name: FirstOrder.Language.Embedding.codRestrict_apply
code: @[simp]
theorem codRestrict_apply (p : L.Substructure N) (f : M ↪[L] N) {h} (x : M) :
    (codRestrict p f h x : N) = f x 
goal: ↑((FirstOrder.Language.Embedding.codRestrict p f h) x) = f x

full_name: FirstOrder.Language.Embedding.codRestrict_apply'
code: @[simp]
theorem codRestrict_apply' (p : L.Substructure N) (f : M ↪[L] N) {h} (x : M) :
    codRestrict p f h x = ⟨f x, h x⟩ 
goal: (FirstOrder.Language.Embedding.codRestrict p f h) x = ⟨f x, ⋯⟩

full_name: FirstOrder.Language.Embedding.comp_codRestrict
code: @[simp]
theorem comp_codRestrict (f : M ↪[L] N) (g : N ↪[L] P) (p : L.Substructure P) (h : ∀ b, g b ∈ p) :
    ((codRestrict p g h).comp f : M ↪[L] p) = codRestrict p (g.comp f) fun _ => h _ 
goal: (FirstOrder.Language.Embedding.codRestrict p g h).comp f = FirstOrder.Language.Embedding.codRestrict p (g.comp f) ⋯

full_name: FirstOrder.Language.Embedding.subtype_comp_codRestrict
code: @[simp]
theorem subtype_comp_codRestrict (f : M ↪[L] N) (p : L.Substructure N) (h : ∀ b, f b ∈ p) :
    p.subtype.comp (codRestrict p f h) = f 
goal: p.subtype.comp (FirstOrder.Language.Embedding.codRestrict p f h) = f

full_name: FirstOrder.Language.Embedding.substructureEquivMap
code: /-- The equivalence between a substructure `s` and its image `s.map f.toHom`, where `f` is an
  embedding. -/
noncomputable def substructureEquivMap (f : M ↪[L] N) (s : L.Substructure M) :
    s ≃[L] s.map f.toHom 
goal: L.Equiv ↥s ↥(FirstOrder.Language.Substructure.map f.toHom s)

full_name: FirstOrder.Language.Embedding.substructureEquivMap_apply
code: @[simp]
theorem substructureEquivMap_apply (f : M ↪[L] N) (p : L.Substructure M) (x : p) :
    (f.substructureEquivMap p x : N) = f x 
goal: ↑((f.substructureEquivMap p) x) = f ↑x

full_name: FirstOrder.Language.Embedding.subtype_substructureEquivMap
code: @[simp]
theorem subtype_substructureEquivMap (f : M ↪[L] N) (s : L.Substructure M) :
    (subtype _).comp (f.substructureEquivMap s).toEmbedding = f.comp (subtype _) 
goal: (FirstOrder.Language.Substructure.map f.toHom s).subtype.comp (f.substructureEquivMap s).toEmbedding = f.comp s.subtype

full_name: FirstOrder.Language.Embedding.equivRange
code: /-- The equivalence between the domain and the range of an embedding `f`. -/
noncomputable def equivRange (f : M ↪[L] N) : M ≃[L] f.toHom.range 
goal: L.Equiv M ↥f.toHom.range

full_name: FirstOrder.Language.Embedding.equivRange_apply
code: @[simp]
theorem equivRange_apply (f : M ↪[L] N) (x : M) : (f.equivRange x : N) = f x 
goal: ↑(f.equivRange x) = f x

full_name: FirstOrder.Language.Embedding.subtype_equivRange
code: @[simp]
theorem subtype_equivRange (f : M ↪[L] N) : (subtype _).comp f.equivRange.toEmbedding = f 
goal: f.toHom.range.subtype.comp f.equivRange.toEmbedding = f

full_name: FirstOrder.Language.Equiv.toHom_range
code: theorem toHom_range (f : M ≃[L] N) : f.toHom.range = ⊤ 
goal: f.toHom.range = ⊤

full_name: FirstOrder.Language.Substructure.inclusion
code: /-- The embedding associated to an inclusion of substructures. -/
def inclusion {S T : L.Substructure M} (h : S ≤ T) : S ↪[L] T 
goal: L.Embedding ↥S ↥T

full_name: FirstOrder.Language.Substructure.inclusion_self
code: @[simp]
theorem inclusion_self (S : L.Substructure M) : inclusion (le_refl S) = Embedding.refl L S 
goal: FirstOrder.Language.Substructure.inclusion ⋯ = FirstOrder.Language.Embedding.refl L ↥S

full_name: FirstOrder.Language.Substructure.coe_inclusion
code: @[simp]
theorem coe_inclusion {S T : L.Substructure M} (h : S ≤ T) :
    (inclusion h : S → T) = Set.inclusion h 
goal: ⇑(FirstOrder.Language.Substructure.inclusion h) = Set.inclusion h

full_name: FirstOrder.Language.Substructure.range_subtype
code: theorem range_subtype (S : L.Substructure M) : S.subtype.toHom.range = S 
goal: S.subtype.toHom.range = S