File: Mathlib/ModelTheory/LanguageMap.lean

full_name: FirstOrder.Language.LHom
code: /-- A language homomorphism maps the symbols of one language to symbols of another. -/
structure LHom where
  onFunction : ∀ ⦃n⦄, L.Functions n → L'.Functions n
  onRelation : ∀ ⦃n⦄, L.Relations n → L'.Relations n
goal: Type (max (max (max u u') v) v')

full_name: FirstOrder.Language.LHom.onFunction
code: /-- A language homomorphism maps the symbols of one language to symbols of another. -/
structure LHom where
  onFunction : ∀ ⦃n⦄, L.Functions n → L'.Functions n
  onRelation : ∀ ⦃n⦄, L.Relations n → L'.Relations n
goal: L.Functions n → L'.Functions n

full_name: FirstOrder.Language.LHom.onRelation
code: /-- A language homomorphism maps the symbols of one language to symbols of another. -/
structure LHom where
  onFunction : ∀ ⦃n⦄, L.Functions n → L'.Functions n
  onRelation : ∀ ⦃n⦄, L.Relations n → L'.Relations n
goal: L.Relations n → L'.Relations n

full_name: FirstOrder.Language.«_aux_Mathlib_ModelTheory_LanguageMap___macroRules_FirstOrder_Language_term_→ᴸ__1»
code: @[inherit_doc FirstOrder.Language.LHom]
infixl:10 " →ᴸ " => LHom
goal: Lean.Macro

full_name: FirstOrder.Language._aux_Mathlib_ModelTheory_LanguageMap___unexpand_FirstOrder_Language_LHom_1
code: @[inherit_doc FirstOrder.Language.LHom]
infixl:10 " →ᴸ " => LHom
goal: Lean.PrettyPrinter.Unexpander

full_name: FirstOrder.Language.LHom.mk₂
code: /-- Defines a map between languages defined with `Language.mk₂`. -/
protected def mk₂ {c f₁ f₂ : Type u} {r₁ r₂ : Type v} (φ₀ : c → L'.Constants)
    (φ₁ : f₁ → L'.Functions 1) (φ₂ : f₂ → L'.Functions 2) (φ₁' : r₁ → L'.Relations 1)
    (φ₂' : r₂ → L'.Relations 2) : Language.mk₂ c f₁ f₂ r₁ r₂ →ᴸ L' 
goal: FirstOrder.Language.mk₂ c f₁ f₂ r₁ r₂ →ᴸ L'

full_name: FirstOrder.Language.LHom.reduct
code: /-- Pulls a structure back along a language map. -/
def reduct (M : Type*) [L'.Structure M] : L.Structure M 
goal: L.Structure M

full_name: FirstOrder.Language.LHom.id_onRelation
code: /-- The identity language homomorphism. -/
@[simps]
protected def id (L : Language) : L →ᴸ L 
goal: (FirstOrder.Language.LHom.id L).onRelation a = id a

full_name: FirstOrder.Language.LHom.id
code: /-- The identity language homomorphism. -/
@[simps]
protected def id (L : Language) : L →ᴸ L 
goal: L →ᴸ L

full_name: FirstOrder.Language.LHom.id_onFunction
code: /-- The identity language homomorphism. -/
@[simps]
protected def id (L : Language) : L →ᴸ L 
goal: (FirstOrder.Language.LHom.id L).onFunction a = id a

full_name: FirstOrder.Language.LHom.instInhabited
code: instance : Inhabited (L →ᴸ L) 
goal: Inhabited (L →ᴸ L)

full_name: FirstOrder.Language.LHom.sumInl_onFunction
code: /-- The inclusion of the left factor into the sum of two languages. -/
@[simps]
protected def sumInl : L →ᴸ L.sum L' 
goal: FirstOrder.Language.LHom.sumInl.onFunction val = Sum.inl val

full_name: FirstOrder.Language.LHom.sumInl
code: /-- The inclusion of the left factor into the sum of two languages. -/
@[simps]
protected def sumInl : L →ᴸ L.sum L' 
goal: L →ᴸ L.sum L'

full_name: FirstOrder.Language.LHom.sumInl_onRelation
code: /-- The inclusion of the left factor into the sum of two languages. -/
@[simps]
protected def sumInl : L →ᴸ L.sum L' 
goal: FirstOrder.Language.LHom.sumInl.onRelation val = Sum.inl val

full_name: FirstOrder.Language.LHom.sumInr_onFunction
code: /-- The inclusion of the right factor into the sum of two languages. -/
@[simps]
protected def sumInr : L' →ᴸ L.sum L' 
goal: FirstOrder.Language.LHom.sumInr.onFunction val = Sum.inr val

full_name: FirstOrder.Language.LHom.sumInr
code: /-- The inclusion of the right factor into the sum of two languages. -/
@[simps]
protected def sumInr : L' →ᴸ L.sum L' 
goal: L' →ᴸ L.sum L'

full_name: FirstOrder.Language.LHom.sumInr_onRelation
code: /-- The inclusion of the right factor into the sum of two languages. -/
@[simps]
protected def sumInr : L' →ᴸ L.sum L' 
goal: FirstOrder.Language.LHom.sumInr.onRelation val = Sum.inr val

full_name: FirstOrder.Language.LHom.ofIsEmpty_onRelation
code: /-- The inclusion of an empty language into any other language. -/
@[simps]
protected def ofIsEmpty [L.IsAlgebraic] [L.IsRelational] : L →ᴸ L' 
goal: (FirstOrder.Language.LHom.ofIsEmpty L L').onRelation a = ⋯.elim a

full_name: FirstOrder.Language.LHom.ofIsEmpty
code: /-- The inclusion of an empty language into any other language. -/
@[simps]
protected def ofIsEmpty [L.IsAlgebraic] [L.IsRelational] : L →ᴸ L' 
goal: L →ᴸ L'

full_name: FirstOrder.Language.LHom.ofIsEmpty_onFunction
code: /-- The inclusion of an empty language into any other language. -/
@[simps]
protected def ofIsEmpty [L.IsAlgebraic] [L.IsRelational] : L →ᴸ L' 
goal: (FirstOrder.Language.LHom.ofIsEmpty L L').onFunction a = ⋯.elim a

full_name: FirstOrder.Language.LHom.funext
code: @[ext]
protected theorem funext {F G : L →ᴸ L'} (h_fun : F.onFunction = G.onFunction)
    (h_rel : F.onRelation = G.onRelation) : F = G 
goal: F = G

full_name: FirstOrder.Language.LHom.instUniqueOfIsAlgebraicOfIsRelational
code: instance [L.IsAlgebraic] [L.IsRelational] : Unique (L →ᴸ L') 
goal: Unique (L →ᴸ L')

full_name: FirstOrder.Language.LHom.mk₂_funext
code: theorem mk₂_funext {c f₁ f₂ : Type u} {r₁ r₂ : Type v} {F G : Language.mk₂ c f₁ f₂ r₁ r₂ →ᴸ L'}
    (h0 : ∀ c : (Language.mk₂ c f₁ f₂ r₁ r₂).Constants, F.onFunction c = G.onFunction c)
    (h1 : ∀ f : (Language.mk₂ c f₁ f₂ r₁ r₂).Functions 1, F.onFunction f = G.onFunction f)
    (h2 : ∀ f : (Language.mk₂ c f₁ f₂ r₁ r₂).Functions 2, F.onFunction f = G.onFunction f)
    (h1' : ∀ r : (Language.mk₂ c f₁ f₂ r₁ r₂).Relations 1, F.onRelation r = G.onRelation r)
    (h2' : ∀ r : (Language.mk₂ c f₁ f₂ r₁ r₂).Relations 2, F.onRelation r = G.onRelation r) :
    F = G 
goal: F = G

full_name: FirstOrder.Language.LHom.comp
code: /-- The composition of two language homomorphisms. -/
@[simps]
def comp (g : L' →ᴸ L'') (f : L →ᴸ L') : L →ᴸ L'' 
goal: L →ᴸ L''

full_name: FirstOrder.Language.LHom.comp_onFunction
code: /-- The composition of two language homomorphisms. -/
@[simps]
def comp (g : L' →ᴸ L'') (f : L →ᴸ L') : L →ᴸ L'' 
goal: (g.comp f).onFunction F = g.onFunction (f.onFunction F)

full_name: FirstOrder.Language.LHom.comp_onRelation
code: /-- The composition of two language homomorphisms. -/
@[simps]
def comp (g : L' →ᴸ L'') (f : L →ᴸ L') : L →ᴸ L'' 
goal: ∀ (x : ℕ) (R : L.Relations x), (g.comp f).onRelation R = g.onRelation (f.onRelation R)

full_name: FirstOrder.Language.LHom.«_aux_Mathlib_ModelTheory_LanguageMap___macroRules_FirstOrder_Language_LHom_term_∘ᴸ__1»
code: @[inherit_doc]
local infixl:60 " ∘ᴸ " => LHom.comp
goal: Lean.Macro

full_name: FirstOrder.Language.LHom._aux_Mathlib_ModelTheory_LanguageMap___unexpand_FirstOrder_Language_LHom_comp_1
code: @[inherit_doc]
local infixl:60 " ∘ᴸ " => LHom.comp
goal: Lean.PrettyPrinter.Unexpander

full_name: FirstOrder.Language.LHom.id_comp
code: @[simp]
theorem id_comp (F : L →ᴸ L') : LHom.id L' ∘ᴸ F = F 
goal: (FirstOrder.Language.LHom.id L').comp F = F

full_name: FirstOrder.Language.LHom.comp_id
code: @[simp]
theorem comp_id (F : L →ᴸ L') : F ∘ᴸ LHom.id L = F 
goal: F.comp (FirstOrder.Language.LHom.id L) = F

full_name: FirstOrder.Language.LHom.comp_assoc
code: theorem comp_assoc {L3 : Language} (F : L'' →ᴸ L3) (G : L' →ᴸ L'') (H : L →ᴸ L') :
    F ∘ᴸ G ∘ᴸ H = F ∘ᴸ (G ∘ᴸ H) 
goal: (F.comp G).comp H = F.comp (G.comp H)

full_name: FirstOrder.Language.LHom.sumElim_onFunction
code: /-- A language map defined on two factors of a sum. -/
@[simps]
protected def sumElim : L.sum L'' →ᴸ L' 
goal: ∀ (a : L.Functions _n ⊕ L''.Functions _n),
  (ϕ.sumElim ψ).onFunction a = Sum.elim (fun f => ϕ.onFunction f) (fun f => ψ.onFunction f) a

full_name: FirstOrder.Language.LHom.sumElim_onRelation
code: /-- A language map defined on two factors of a sum. -/
@[simps]
protected def sumElim : L.sum L'' →ᴸ L' 
goal: ∀ (a : L.Relations _n ⊕ L''.Relations _n),
  (ϕ.sumElim ψ).onRelation a = Sum.elim (fun f => ϕ.onRelation f) (fun f => ψ.onRelation f) a

full_name: FirstOrder.Language.LHom.sumElim
code: /-- A language map defined on two factors of a sum. -/
@[simps]
protected def sumElim : L.sum L'' →ᴸ L' 
goal: L.sum L'' →ᴸ L'

full_name: FirstOrder.Language.LHom.sumElim_comp_inl
code: theorem sumElim_comp_inl (ψ : L'' →ᴸ L') : ϕ.sumElim ψ ∘ᴸ LHom.sumInl = ϕ 
goal: (ϕ.sumElim ψ).comp FirstOrder.Language.LHom.sumInl = ϕ

full_name: FirstOrder.Language.LHom.sumElim_comp_inr
code: theorem sumElim_comp_inr (ψ : L'' →ᴸ L') : ϕ.sumElim ψ ∘ᴸ LHom.sumInr = ψ 
goal: (ϕ.sumElim ψ).comp FirstOrder.Language.LHom.sumInr = ψ

full_name: FirstOrder.Language.LHom.sumElim_inl_inr
code: theorem sumElim_inl_inr : LHom.sumInl.sumElim LHom.sumInr = LHom.id (L.sum L') 
goal: FirstOrder.Language.LHom.sumInl.sumElim FirstOrder.Language.LHom.sumInr = FirstOrder.Language.LHom.id (L.sum L')

full_name: FirstOrder.Language.LHom.comp_sumElim
code: theorem comp_sumElim {L3 : Language} (θ : L' →ᴸ L3) :
    θ ∘ᴸ ϕ.sumElim ψ = (θ ∘ᴸ ϕ).sumElim (θ ∘ᴸ ψ) 
goal: θ.comp (ϕ.sumElim ψ) = (θ.comp ϕ).sumElim (θ.comp ψ)

full_name: FirstOrder.Language.LHom.sumMap_onFunction
code: /-- The map between two sum-languages induced by maps on the two factors. -/
@[simps]
def sumMap : L.sum L₁ →ᴸ L'.sum L₂ 
goal: ∀ (a : L.Functions _n ⊕ L₁.Functions _n),
  (ϕ.sumMap ψ).onFunction a = Sum.map (fun f => ϕ.onFunction f) (fun f => ψ.onFunction f) a

full_name: FirstOrder.Language.LHom.sumMap_onRelation
code: /-- The map between two sum-languages induced by maps on the two factors. -/
@[simps]
def sumMap : L.sum L₁ →ᴸ L'.sum L₂ 
goal: ∀ (a : L.Relations _n ⊕ L₁.Relations _n),
  (ϕ.sumMap ψ).onRelation a = Sum.map (fun f => ϕ.onRelation f) (fun f => ψ.onRelation f) a

full_name: FirstOrder.Language.LHom.sumMap
code: /-- The map between two sum-languages induced by maps on the two factors. -/
@[simps]
def sumMap : L.sum L₁ →ᴸ L'.sum L₂ 
goal: L.sum L₁ →ᴸ L'.sum L₂

full_name: FirstOrder.Language.LHom.sumMap_comp_inl
code: @[simp]
theorem sumMap_comp_inl : ϕ.sumMap ψ ∘ᴸ LHom.sumInl = LHom.sumInl ∘ᴸ ϕ 
goal: (ϕ.sumMap ψ).comp FirstOrder.Language.LHom.sumInl = FirstOrder.Language.LHom.sumInl.comp ϕ

full_name: FirstOrder.Language.LHom.sumMap_comp_inr
code: @[simp]
theorem sumMap_comp_inr : ϕ.sumMap ψ ∘ᴸ LHom.sumInr = LHom.sumInr ∘ᴸ ψ 
goal: (ϕ.sumMap ψ).comp FirstOrder.Language.LHom.sumInr = FirstOrder.Language.LHom.sumInr.comp ψ

full_name: FirstOrder.Language.LHom.Injective.onFunction
code: /-- A language homomorphism is injective when all the maps between symbol types are. -/
protected structure Injective : Prop where
  onFunction {n} : Function.Injective fun f : L.Functions n => onFunction ϕ f
  onRelation {n} : Function.Injective fun R : L.Relations n => onRelation ϕ R
goal: Function.Injective fun f => ϕ.onFunction f

full_name: FirstOrder.Language.LHom.Injective
code: /-- A language homomorphism is injective when all the maps between symbol types are. -/
protected structure Injective : Prop where
  onFunction {n} : Function.Injective fun f : L.Functions n => onFunction ϕ f
  onRelation {n} : Function.Injective fun R : L.Relations n => onRelation ϕ R
goal: Prop

full_name: FirstOrder.Language.LHom.Injective.onRelation
code: /-- A language homomorphism is injective when all the maps between symbol types are. -/
protected structure Injective : Prop where
  onFunction {n} : Function.Injective fun f : L.Functions n => onFunction ϕ f
  onRelation {n} : Function.Injective fun R : L.Relations n => onRelation ϕ R
goal: Function.Injective fun R => ϕ.onRelation R

full_name: FirstOrder.Language.LHom.defaultExpansion
code: /-- Pulls an `L`-structure along a language map `ϕ : L →ᴸ L'`, and then expands it
  to an `L'`-structure arbitrarily. -/
noncomputable def defaultExpansion (ϕ : L →ᴸ L')
    [∀ (n) (f : L'.Functions n), Decidable (f ∈ Set.range fun f : L.Functions n => onFunction ϕ f)]
    [∀ (n) (r : L'.Relations n), Decidable (r ∈ Set.range fun r : L.Relations n => onRelation ϕ r)]
    (M : Type*) [Inhabited M] [L.Structure M] : L'.Structure M 
goal: L'.Structure M

full_name: FirstOrder.Language.LHom.IsExpansionOn.map_onRelation
code: /-- A language homomorphism is an expansion on a structure if it commutes with the interpretation of
all symbols on that structure. -/
class IsExpansionOn (M : Type*) [L.Structure M] [L'.Structure M] : Prop where
  map_onFunction : ∀ {n} (f : L.Functions n) (x : Fin n → M), funMap (ϕ.onFunction f) x = funMap f x
  map_onRelation : ∀ {n} (R : L.Relations n) (x : Fin n → M),
    RelMap (ϕ.onRelation R) x = RelMap R x
goal: FirstOrder.Language.Structure.RelMap (ϕ.onRelation R) x = FirstOrder.Language.Structure.RelMap R x

full_name: FirstOrder.Language.LHom.IsExpansionOn
code: /-- A language homomorphism is an expansion on a structure if it commutes with the interpretation of
all symbols on that structure. -/
class IsExpansionOn (M : Type*) [L.Structure M] [L'.Structure M] : Prop where
  map_onFunction : ∀ {n} (f : L.Functions n) (x : Fin n → M), funMap (ϕ.onFunction f) x = funMap f x
  map_onRelation : ∀ {n} (R : L.Relations n) (x : Fin n → M),
    RelMap (ϕ.onRelation R) x = RelMap R x
goal: Prop

full_name: FirstOrder.Language.LHom.IsExpansionOn.map_onFunction
code: /-- A language homomorphism is an expansion on a structure if it commutes with the interpretation of
all symbols on that structure. -/
class IsExpansionOn (M : Type*) [L.Structure M] [L'.Structure M] : Prop where
  map_onFunction : ∀ {n} (f : L.Functions n) (x : Fin n → M), funMap (ϕ.onFunction f) x = funMap f x
  map_onRelation : ∀ {n} (R : L.Relations n) (x : Fin n → M),
    RelMap (ϕ.onRelation R) x = RelMap R x
goal: FirstOrder.Language.Structure.funMap (ϕ.onFunction f) x = FirstOrder.Language.Structure.funMap f x

full_name: FirstOrder.Language.LHom.map_onFunction
code: @[simp]
theorem map_onFunction {M : Type*} [L.Structure M] [L'.Structure M] [ϕ.IsExpansionOn M] {n}
    (f : L.Functions n) (x : Fin n → M) : funMap (ϕ.onFunction f) x = funMap f x 
goal: FirstOrder.Language.Structure.funMap (ϕ.onFunction f) x = FirstOrder.Language.Structure.funMap f x

full_name: FirstOrder.Language.LHom.map_onRelation
code: @[simp]
theorem map_onRelation {M : Type*} [L.Structure M] [L'.Structure M] [ϕ.IsExpansionOn M] {n}
    (R : L.Relations n) (x : Fin n → M) : RelMap (ϕ.onRelation R) x = RelMap R x 
goal: FirstOrder.Language.Structure.RelMap (ϕ.onRelation R) x = FirstOrder.Language.Structure.RelMap R x

full_name: FirstOrder.Language.LHom.id_isExpansionOn
code: instance id_isExpansionOn (M : Type*) [L.Structure M] : IsExpansionOn (LHom.id L) M 
goal: (FirstOrder.Language.LHom.id L).IsExpansionOn M

full_name: FirstOrder.Language.LHom.ofIsEmpty_isExpansionOn
code: instance ofIsEmpty_isExpansionOn (M : Type*) [L.Structure M] [L'.Structure M] [L.IsAlgebraic]
    [L.IsRelational] : IsExpansionOn (LHom.ofIsEmpty L L') M 
goal: (FirstOrder.Language.LHom.ofIsEmpty L L').IsExpansionOn M

full_name: FirstOrder.Language.LHom.sumElim_isExpansionOn
code: instance sumElim_isExpansionOn {L'' : Language} (ψ : L'' →ᴸ L') (M : Type*) [L.Structure M]
    [L'.Structure M] [L''.Structure M] [ϕ.IsExpansionOn M] [ψ.IsExpansionOn M] :
    (ϕ.sumElim ψ).IsExpansionOn M 
goal: (ϕ.sumElim ψ).IsExpansionOn M

full_name: FirstOrder.Language.LHom.sumMap_isExpansionOn
code: instance sumMap_isExpansionOn {L₁ L₂ : Language} (ψ : L₁ →ᴸ L₂) (M : Type*) [L.Structure M]
    [L'.Structure M] [L₁.Structure M] [L₂.Structure M] [ϕ.IsExpansionOn M] [ψ.IsExpansionOn M] :
    (ϕ.sumMap ψ).IsExpansionOn M 
goal: (ϕ.sumMap ψ).IsExpansionOn M

full_name: FirstOrder.Language.LHom.sumInl_isExpansionOn
code: instance sumInl_isExpansionOn (M : Type*) [L.Structure M] [L'.Structure M] :
    (LHom.sumInl : L →ᴸ L.sum L').IsExpansionOn M 
goal: FirstOrder.Language.LHom.sumInl.IsExpansionOn M

full_name: FirstOrder.Language.LHom.sumInr_isExpansionOn
code: instance sumInr_isExpansionOn (M : Type*) [L.Structure M] [L'.Structure M] :
    (LHom.sumInr : L' →ᴸ L.sum L').IsExpansionOn M 
goal: FirstOrder.Language.LHom.sumInr.IsExpansionOn M

full_name: FirstOrder.Language.LHom.funMap_sumInl
code: @[simp]
theorem funMap_sumInl [(L.sum L').Structure M] [(LHom.sumInl : L →ᴸ L.sum L').IsExpansionOn M] {n}
    {f : L.Functions n} {x : Fin n → M} : @funMap (L.sum L') M _ n (Sum.inl f) x = funMap f x 
goal: FirstOrder.Language.Structure.funMap (Sum.inl f) x = FirstOrder.Language.Structure.funMap f x

full_name: FirstOrder.Language.LHom.funMap_sumInr
code: @[simp]
theorem funMap_sumInr [(L'.sum L).Structure M] [(LHom.sumInr : L →ᴸ L'.sum L).IsExpansionOn M] {n}
    {f : L.Functions n} {x : Fin n → M} : @funMap (L'.sum L) M _ n (Sum.inr f) x = funMap f x 
goal: FirstOrder.Language.Structure.funMap (Sum.inr f) x = FirstOrder.Language.Structure.funMap f x

full_name: FirstOrder.Language.LHom.sumInl_injective
code: theorem sumInl_injective : (LHom.sumInl : L →ᴸ L.sum L').Injective 
goal: FirstOrder.Language.LHom.sumInl.Injective

full_name: FirstOrder.Language.LHom.sumInr_injective
code: theorem sumInr_injective : (LHom.sumInr : L' →ᴸ L.sum L').Injective 
goal: FirstOrder.Language.LHom.sumInr.Injective

full_name: FirstOrder.Language.LHom.isExpansionOn_reduct
code: instance (priority := 100) isExpansionOn_reduct (ϕ : L →ᴸ L') (M : Type*) [L'.Structure M] :
    @IsExpansionOn L L' ϕ M (ϕ.reduct M) _ 
goal: ϕ.IsExpansionOn M

full_name: FirstOrder.Language.LHom.Injective.isExpansionOn_default
code: theorem Injective.isExpansionOn_default {ϕ : L →ᴸ L'}
    [∀ (n) (f : L'.Functions n), Decidable (f ∈ Set.range fun f : L.Functions n => ϕ.onFunction f)]
    [∀ (n) (r : L'.Relations n), Decidable (r ∈ Set.range fun r : L.Relations n => ϕ.onRelation r)]
    (h : ϕ.Injective) (M : Type*) [Inhabited M] [L.Structure M] :
    @IsExpansionOn L L' ϕ M _ (ϕ.defaultExpansion M) 
goal: ϕ.IsExpansionOn M

full_name: FirstOrder.Language.LEquiv.right_inv
code: /-- A language equivalence maps the symbols of one language to symbols of another bijectively. -/
structure LEquiv (L L' : Language) where
  toLHom : L →ᴸ L'
  invLHom : L' →ᴸ L
  left_inv : invLHom.comp toLHom = LHom.id L
  right_inv : toLHom.comp invLHom = LHom.id L'
goal: self.toLHom.comp self.invLHom = FirstOrder.Language.LHom.id L'

full_name: FirstOrder.Language.LEquiv.toLHom
code: /-- A language equivalence maps the symbols of one language to symbols of another bijectively. -/
structure LEquiv (L L' : Language) where
  toLHom : L →ᴸ L'
  invLHom : L' →ᴸ L
  left_inv : invLHom.comp toLHom = LHom.id L
  right_inv : toLHom.comp invLHom = LHom.id L'
goal: L →ᴸ L'

full_name: FirstOrder.Language.LEquiv.left_inv
code: /-- A language equivalence maps the symbols of one language to symbols of another bijectively. -/
structure LEquiv (L L' : Language) where
  toLHom : L →ᴸ L'
  invLHom : L' →ᴸ L
  left_inv : invLHom.comp toLHom = LHom.id L
  right_inv : toLHom.comp invLHom = LHom.id L'
goal: self.invLHom.comp self.toLHom = FirstOrder.Language.LHom.id L

full_name: FirstOrder.Language.LEquiv
code: /-- A language equivalence maps the symbols of one language to symbols of another bijectively. -/
structure LEquiv (L L' : Language) where
  toLHom : L →ᴸ L'
  invLHom : L' →ᴸ L
  left_inv : invLHom.comp toLHom = LHom.id L
  right_inv : toLHom.comp invLHom = LHom.id L'
goal: Type (max (max (max u_1 u_2) u_3) u_4)

full_name: FirstOrder.Language.LEquiv.invLHom
code: /-- A language equivalence maps the symbols of one language to symbols of another bijectively. -/
structure LEquiv (L L' : Language) where
  toLHom : L →ᴸ L'
  invLHom : L' →ᴸ L
  left_inv : invLHom.comp toLHom = LHom.id L
  right_inv : toLHom.comp invLHom = LHom.id L'
goal: L' →ᴸ L

full_name: FirstOrder.Language._aux_Mathlib_ModelTheory_LanguageMap___unexpand_FirstOrder_Language_LEquiv_1
code: infixl:10 " ≃ᴸ " => LEquiv
goal: Lean.PrettyPrinter.Unexpander

full_name: FirstOrder.Language.«_aux_Mathlib_ModelTheory_LanguageMap___macroRules_FirstOrder_Language_term_≃ᴸ__1»
code: infixl:10 " ≃ᴸ " => LEquiv
goal: Lean.Macro

full_name: FirstOrder.Language.LEquiv.refl_invLHom
code: /-- The identity equivalence from a first-order language to itself. -/
@[simps]
protected def refl : L ≃ᴸ L 
goal: (FirstOrder.Language.LEquiv.refl L).invLHom = FirstOrder.Language.LHom.id L

full_name: FirstOrder.Language.LEquiv.refl
code: /-- The identity equivalence from a first-order language to itself. -/
@[simps]
protected def refl : L ≃ᴸ L 
goal: L ≃ᴸ L

full_name: FirstOrder.Language.LEquiv.refl_toLHom
code: /-- The identity equivalence from a first-order language to itself. -/
@[simps]
protected def refl : L ≃ᴸ L 
goal: (FirstOrder.Language.LEquiv.refl L).toLHom = FirstOrder.Language.LHom.id L

full_name: FirstOrder.Language.LEquiv.instInhabited
code: instance : Inhabited (L ≃ᴸ L) 
goal: Inhabited (L ≃ᴸ L)

full_name: FirstOrder.Language.LEquiv.symm_toLHom
code: /-- The inverse of an equivalence of first-order languages. -/
@[simps]
protected def symm : L' ≃ᴸ L 
goal: e.symm.toLHom = e.invLHom

full_name: FirstOrder.Language.LEquiv.symm_invLHom
code: /-- The inverse of an equivalence of first-order languages. -/
@[simps]
protected def symm : L' ≃ᴸ L 
goal: e.symm.invLHom = e.toLHom

full_name: FirstOrder.Language.LEquiv.symm
code: /-- The inverse of an equivalence of first-order languages. -/
@[simps]
protected def symm : L' ≃ᴸ L 
goal: L' ≃ᴸ L

full_name: FirstOrder.Language.LEquiv.trans
code: /-- The composition of equivalences of first-order languages. -/
@[simps, trans]
protected def trans (e : L ≃ᴸ L') (e' : L' ≃ᴸ L'') : L ≃ᴸ L'' 
goal: L ≃ᴸ L''

full_name: FirstOrder.Language.LEquiv.trans_toLHom
code: /-- The composition of equivalences of first-order languages. -/
@[simps, trans]
protected def trans (e : L ≃ᴸ L') (e' : L' ≃ᴸ L'') : L ≃ᴸ L'' 
goal: (e.trans e').toLHom = e'.toLHom.comp e.toLHom

full_name: FirstOrder.Language.LEquiv.trans_invLHom
code: /-- The composition of equivalences of first-order languages. -/
@[simps, trans]
protected def trans (e : L ≃ᴸ L') (e' : L' ≃ᴸ L'') : L ≃ᴸ L'' 
goal: (e.trans e').invLHom = e.invLHom.comp e'.invLHom

full_name: FirstOrder.Language.constantsOn
code: /-- A language with constants indexed by a type. -/
@[simp]
def constantsOn : Language.{u', 0} 
goal: FirstOrder.Language

full_name: FirstOrder.Language.constantsOn_constants
code: theorem constantsOn_constants : (constantsOn α).Constants = α 
goal: (FirstOrder.Language.constantsOn α).Constants = α

full_name: FirstOrder.Language.isAlgebraic_constantsOn
code: instance isAlgebraic_constantsOn : IsAlgebraic (constantsOn α) 
goal: (FirstOrder.Language.constantsOn α).IsAlgebraic

full_name: FirstOrder.Language.isRelational_constantsOn
code: instance isRelational_constantsOn [_ie : IsEmpty α] : IsRelational (constantsOn α) 
goal: (FirstOrder.Language.constantsOn α).IsRelational

full_name: FirstOrder.Language.isEmpty_functions_constantsOn_succ
code: instance isEmpty_functions_constantsOn_succ {n : ℕ} : IsEmpty ((constantsOn α).Functions (n + 1)) 
goal: IsEmpty ((FirstOrder.Language.constantsOn α).Functions (n + 1))

full_name: FirstOrder.Language.card_constantsOn
code: theorem card_constantsOn : (constantsOn α).card = #α 
goal: (FirstOrder.Language.constantsOn α).card = Cardinal.mk α

full_name: FirstOrder.Language.constantsOn.structure
code: /-- Gives a `constantsOn α` structure to a type by assigning each constant a value. -/
def constantsOn.structure (f : α → M) : (constantsOn α).Structure M 
goal: (FirstOrder.Language.constantsOn α).Structure M

full_name: FirstOrder.Language.LHom.constantsOnMap
code: /-- A map between index types induces a map between constant languages. -/
def LHom.constantsOnMap (f : α → β) : constantsOn α →ᴸ constantsOn β 
goal: FirstOrder.Language.constantsOn α →ᴸ FirstOrder.Language.constantsOn β

full_name: FirstOrder.Language.constantsOnMap_isExpansionOn
code: theorem constantsOnMap_isExpansionOn {f : α → β} {fα : α → M} {fβ : β → M} (h : fβ ∘ f = fα) :
    @LHom.IsExpansionOn _ _ (LHom.constantsOnMap f) M (constantsOn.structure fα)
      (constantsOn.structure fβ) 
goal: (FirstOrder.Language.LHom.constantsOnMap f).IsExpansionOn M

full_name: FirstOrder.Language.withConstants
code: /-- Extends a language with a constant for each element of a parameter set in `M`. -/
def withConstants : Language.{max u w', v} 
goal: FirstOrder.Language

full_name: FirstOrder._aux_Mathlib_ModelTheory_LanguageMap___unexpand_FirstOrder_Language_withConstants_1
code: @[inherit_doc FirstOrder.Language.withConstants]
scoped[FirstOrder] notation:95 L "[[" α "]]" => Language.withConstants L α
goal: Lean.PrettyPrinter.Unexpander

full_name: FirstOrder.«_aux_Mathlib_ModelTheory_LanguageMap___macroRules_FirstOrder_term_[[_]]_1»
code: @[inherit_doc FirstOrder.Language.withConstants]
scoped[FirstOrder] notation:95 L "[[" α "]]" => Language.withConstants L α
goal: Lean.Macro

full_name: FirstOrder.Language.card_withConstants
code: @[simp]
theorem card_withConstants :
    L[[α]].card = Cardinal.lift.{w'} L.card + Cardinal.lift.{max u v} #α 
goal: (L.withConstants α).card = Cardinal.lift.{w', max u v} L.card + Cardinal.lift.{max u v, w'} (Cardinal.mk α)

full_name: FirstOrder.Language.lhomWithConstants
code: /-- The language map adding constants.  -/
@[simps!] -- Porting note: add `!` to `simps`
def lhomWithConstants : L →ᴸ L[[α]] 
goal: L →ᴸ L.withConstants α

full_name: FirstOrder.Language.lhomWithConstants_onFunction
code: /-- The language map adding constants.  -/
@[simps!] -- Porting note: add `!` to `simps`
def lhomWithConstants : L →ᴸ L[[α]] 
goal: (L.lhomWithConstants α).onFunction val = Sum.inl val

full_name: FirstOrder.Language.lhomWithConstants_onRelation
code: /-- The language map adding constants.  -/
@[simps!] -- Porting note: add `!` to `simps`
def lhomWithConstants : L →ᴸ L[[α]] 
goal: (L.lhomWithConstants α).onRelation val = Sum.inl val

full_name: FirstOrder.Language.lhomWithConstants_injective
code: theorem lhomWithConstants_injective : (L.lhomWithConstants α).Injective 
goal: (L.lhomWithConstants α).Injective

full_name: FirstOrder.Language.con
code: /-- The constant symbol indexed by a particular element. -/
protected def con (a : α) : L[[α]].Constants 
goal: (L.withConstants α).Constants

full_name: FirstOrder.Language.LHom.addConstants
code: /-- Adds constants to a language map.  -/
def LHom.addConstants {L' : Language} (φ : L →ᴸ L') : L[[α]] →ᴸ L'[[α]] 
goal: L.withConstants α →ᴸ L'.withConstants α

full_name: FirstOrder.Language.paramsStructure
code: instance paramsStructure (A : Set α) : (constantsOn A).Structure α 
goal: (FirstOrder.Language.constantsOn ↑A).Structure α

full_name: FirstOrder.Language.LEquiv.addEmptyConstants_toLHom
code: /-- The language map removing an empty constant set.  -/
@[simps]
def LEquiv.addEmptyConstants [ie : IsEmpty α] : L ≃ᴸ L[[α]] 
goal: (FirstOrder.Language.LEquiv.addEmptyConstants L α).toLHom = L.lhomWithConstants α

full_name: FirstOrder.Language.LEquiv.addEmptyConstants
code: /-- The language map removing an empty constant set.  -/
@[simps]
def LEquiv.addEmptyConstants [ie : IsEmpty α] : L ≃ᴸ L[[α]] 
goal: L ≃ᴸ L.withConstants α

full_name: FirstOrder.Language.LEquiv.addEmptyConstants_invLHom
code: /-- The language map removing an empty constant set.  -/
@[simps]
def LEquiv.addEmptyConstants [ie : IsEmpty α] : L ≃ᴸ L[[α]] 
goal: (FirstOrder.Language.LEquiv.addEmptyConstants L α).invLHom =
  (FirstOrder.Language.LHom.id L).sumElim (FirstOrder.Language.LHom.ofIsEmpty (FirstOrder.Language.constantsOn α) L)

full_name: FirstOrder.Language.withConstants_funMap_sum_inl
code: @[simp]
theorem withConstants_funMap_sum_inl [L[[α]].Structure M] [(lhomWithConstants L α).IsExpansionOn M]
    {n} {f : L.Functions n} {x : Fin n → M} : @funMap (L[[α]]) M _ n (Sum.inl f) x = funMap f x 
goal: FirstOrder.Language.Structure.funMap (Sum.inl f) x = FirstOrder.Language.Structure.funMap f x

full_name: FirstOrder.Language.withConstants_relMap_sum_inl
code: @[simp]
theorem withConstants_relMap_sum_inl [L[[α]].Structure M] [(lhomWithConstants L α).IsExpansionOn M]
    {n} {R : L.Relations n} {x : Fin n → M} : @RelMap (L[[α]]) M _ n (Sum.inl R) x = RelMap R x 
goal: FirstOrder.Language.Structure.RelMap (Sum.inl R) x = FirstOrder.Language.Structure.RelMap R x

full_name: FirstOrder.Language.lhomWithConstantsMap
code: /-- The language map extending the constant set.  -/
def lhomWithConstantsMap (f : α → β) : L[[α]] →ᴸ L[[β]] 
goal: L.withConstants α →ᴸ L.withConstants β

full_name: FirstOrder.Language.LHom.map_constants_comp_sumInl
code: @[simp]
theorem LHom.map_constants_comp_sumInl {f : α → β} :
    (L.lhomWithConstantsMap f).comp LHom.sumInl = L.lhomWithConstants β 
goal: (L.lhomWithConstantsMap f).comp FirstOrder.Language.LHom.sumInl = L.lhomWithConstants β

full_name: FirstOrder.Language.constantsOnSelfStructure
code: instance constantsOnSelfStructure : (constantsOn M).Structure M 
goal: (FirstOrder.Language.constantsOn M).Structure M

full_name: FirstOrder.Language.withConstantsSelfStructure
code: instance withConstantsSelfStructure : L[[M]].Structure M 
goal: (L.withConstants M).Structure M

full_name: FirstOrder.Language.withConstants_self_expansion
code: instance withConstants_self_expansion : (lhomWithConstants L M).IsExpansionOn M 
goal: (L.lhomWithConstants M).IsExpansionOn M

full_name: FirstOrder.Language.withConstantsStructure
code: instance withConstantsStructure : L[[α]].Structure M 
goal: (L.withConstants α).Structure M

full_name: FirstOrder.Language.withConstants_expansion
code: instance withConstants_expansion : (L.lhomWithConstants α).IsExpansionOn M 
goal: (L.lhomWithConstants α).IsExpansionOn M

full_name: FirstOrder.Language.addEmptyConstants_is_expansion_on'
code: instance addEmptyConstants_is_expansion_on' :
    (LEquiv.addEmptyConstants L (∅ : Set M)).toLHom.IsExpansionOn M 
goal: (FirstOrder.Language.LEquiv.addEmptyConstants L ↑∅).toLHom.IsExpansionOn M

full_name: FirstOrder.Language.addEmptyConstants_symm_isExpansionOn
code: instance addEmptyConstants_symm_isExpansionOn :
    (LEquiv.addEmptyConstants L (∅ : Set M)).symm.toLHom.IsExpansionOn M 
goal: (FirstOrder.Language.LEquiv.addEmptyConstants L ↑∅).symm.toLHom.IsExpansionOn M

full_name: FirstOrder.Language.addConstants_expansion
code: instance addConstants_expansion {L' : Language} [L'.Structure M] (φ : L →ᴸ L') [φ.IsExpansionOn M] :
    (φ.addConstants α).IsExpansionOn M 
goal: (FirstOrder.Language.LHom.addConstants α φ).IsExpansionOn M

full_name: FirstOrder.Language.withConstants_funMap_sum_inr
code: @[simp]
theorem withConstants_funMap_sum_inr {a : α} {x : Fin 0 → M} :
    @funMap (L[[α]]) M _ 0 (Sum.inr a : L[[α]].Functions 0) x = L.con a 
goal: FirstOrder.Language.Structure.funMap (Sum.inr a) x = ↑(L.con a)

full_name: FirstOrder.Language.coe_con
code: @[simp]
theorem coe_con {a : A} : (L.con a : M) = a 
goal: ↑(L.con a) = ↑a

full_name: FirstOrder.Language.constantsOnMap_inclusion_isExpansionOn
code: instance constantsOnMap_inclusion_isExpansionOn :
    (LHom.constantsOnMap (Set.inclusion h)).IsExpansionOn M 
goal: (FirstOrder.Language.LHom.constantsOnMap (Set.inclusion h)).IsExpansionOn M

full_name: FirstOrder.Language.map_constants_inclusion_isExpansionOn
code: instance map_constants_inclusion_isExpansionOn :
    (L.lhomWithConstantsMap (Set.inclusion h)).IsExpansionOn M 
goal: (L.lhomWithConstantsMap (Set.inclusion h)).IsExpansionOn M