File: Mathlib/ModelTheory/Basic.lean

full_name: FirstOrder.Language.Relations
code: /-- A first-order language consists of a type of functions of every natural-number arity and a
  type of relations of every natural-number arity. -/
@[nolint checkUnivs]
structure Language where
  /-- For every arity, a `Type*` of functions of that arity -/
  Functions : ℕ → Type u
  /-- For every arity, a `Type*` of relations of that arity -/
  Relations : ℕ → Type v
goal: ℕ → Type v

full_name: FirstOrder.Language.Functions
code: /-- A first-order language consists of a type of functions of every natural-number arity and a
  type of relations of every natural-number arity. -/
@[nolint checkUnivs]
structure Language where
  /-- For every arity, a `Type*` of functions of that arity -/
  Functions : ℕ → Type u
  /-- For every arity, a `Type*` of relations of that arity -/
  Relations : ℕ → Type v
goal: ℕ → Type u

full_name: FirstOrder.Language
code: /-- A first-order language consists of a type of functions of every natural-number arity and a
  type of relations of every natural-number arity. -/
@[nolint checkUnivs]
structure Language where
  /-- For every arity, a `Type*` of functions of that arity -/
  Functions : ℕ → Type u
  /-- For every arity, a `Type*` of relations of that arity -/
  Relations : ℕ → Type v
goal: Type (max (u + 1) (v + 1))

full_name: FirstOrder.Sequence₂
code: /-- Used to define `FirstOrder.Language₂`. -/
--@[simp]
def Sequence₂ (a₀ a₁ a₂ : Type u) : ℕ → Type u
  
goal: ℕ → Type u

full_name: FirstOrder.Sequence₂.inhabited₀
code: instance inhabited₀ [h : Inhabited a₀] : Inhabited (Sequence₂ a₀ a₁ a₂ 0) 
goal: Inhabited (FirstOrder.Sequence₂ a₀ a₁ a₂ 0)

full_name: FirstOrder.Sequence₂.inhabited₁
code: instance inhabited₁ [h : Inhabited a₁] : Inhabited (Sequence₂ a₀ a₁ a₂ 1) 
goal: Inhabited (FirstOrder.Sequence₂ a₀ a₁ a₂ 1)

full_name: FirstOrder.Sequence₂.inhabited₂
code: instance inhabited₂ [h : Inhabited a₂] : Inhabited (Sequence₂ a₀ a₁ a₂ 2) 
goal: Inhabited (FirstOrder.Sequence₂ a₀ a₁ a₂ 2)

full_name: FirstOrder.Sequence₂.instIsEmptyHAddNatOfNat
code: instance {n : ℕ} : IsEmpty (Sequence₂ a₀ a₁ a₂ (n + 3)) 
goal: IsEmpty (FirstOrder.Sequence₂ a₀ a₁ a₂ (n + 3))

full_name: FirstOrder.Sequence₂.lift_mk
code: @[simp]
theorem lift_mk {i : ℕ} :
    Cardinal.lift.{v,u} #(Sequence₂ a₀ a₁ a₂ i)
      = #(Sequence₂ (ULift.{v,u} a₀) (ULift.{v,u} a₁) (ULift.{v,u} a₂) i) 
goal: Cardinal.lift.{v, u} #(FirstOrder.Sequence₂ a₀ a₁ a₂ i) =
  #(FirstOrder.Sequence₂ (ULift.{v, u} a₀) (ULift.{v, u} a₁) (ULift.{v, u} a₂) i)

full_name: FirstOrder.Sequence₂.sum_card
code: @[simp]
theorem sum_card : Cardinal.sum (fun i => #(Sequence₂ a₀ a₁ a₂ i)) = #a₀ + #a₁ + #a₂ 
goal: (Cardinal.sum fun i => #(FirstOrder.Sequence₂ a₀ a₁ a₂ i)) = #a₀ + #a₁ + #a₂

full_name: FirstOrder.Language.mk₂_Functions
code: /-- A constructor for languages with only constants, unary and binary functions, and
unary and binary relations. -/
@[simps]
protected def mk₂ (c f₁ f₂ : Type u) (r₁ r₂ : Type v) : Language 
goal: ∀ (a : ℕ), (FirstOrder.Language.mk₂ c f₁ f₂ r₁ r₂).Functions a = FirstOrder.Sequence₂ c f₁ f₂ a

full_name: FirstOrder.Language.mk₂_Relations
code: /-- A constructor for languages with only constants, unary and binary functions, and
unary and binary relations. -/
@[simps]
protected def mk₂ (c f₁ f₂ : Type u) (r₁ r₂ : Type v) : Language 
goal: ∀ (a : ℕ), (FirstOrder.Language.mk₂ c f₁ f₂ r₁ r₂).Relations a = FirstOrder.Sequence₂ PEmpty.{v + 1} r₁ r₂ a

full_name: FirstOrder.Language.mk₂
code: /-- A constructor for languages with only constants, unary and binary functions, and
unary and binary relations. -/
@[simps]
protected def mk₂ (c f₁ f₂ : Type u) (r₁ r₂ : Type v) : Language 
goal: FirstOrder.Language

full_name: FirstOrder.Language.empty
code: /-- The empty language has no symbols. -/
protected def empty : Language 
goal: FirstOrder.Language

full_name: FirstOrder.Language.instInhabited
code: instance : Inhabited Language 
goal: Inhabited FirstOrder.Language

full_name: FirstOrder.Language.sum
code: /-- The sum of two languages consists of the disjoint union of their symbols. -/
protected def sum (L : Language.{u, v}) (L' : Language.{u', v'}) : Language 
goal: FirstOrder.Language

full_name: FirstOrder.Language.Constants
code: /-- The type of constants in a given language. -/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
protected def Constants 
goal: Type u

full_name: FirstOrder.Language.constants_mk₂
code: @[simp]
theorem constants_mk₂ (c f₁ f₂ : Type u) (r₁ r₂ : Type v) :
    (Language.mk₂ c f₁ f₂ r₁ r₂).Constants = c 
goal: (FirstOrder.Language.mk₂ c f₁ f₂ r₁ r₂).Constants = c

full_name: FirstOrder.Language.Symbols
code: /-- The type of symbols in a given language. -/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
def Symbols 
goal: Type (max u v)

full_name: FirstOrder.Language.card
code: /-- The cardinality of a language is the cardinality of its type of symbols. -/
def card : Cardinal 
goal: Cardinal.{max u v}

full_name: FirstOrder.Language.IsRelational
code: /-- A language is relational when it has no function symbols. -/
class IsRelational : Prop where
  /-- There are no function symbols in the language. -/
  empty_functions : ∀ n, IsEmpty (L.Functions n)
goal: Prop

full_name: FirstOrder.Language.IsRelational.empty_functions
code: /-- A language is relational when it has no function symbols. -/
class IsRelational : Prop where
  /-- There are no function symbols in the language. -/
  empty_functions : ∀ n, IsEmpty (L.Functions n)
goal: IsEmpty (L.Functions n)

full_name: FirstOrder.Language.IsAlgebraic
code: /-- A language is algebraic when it has no relation symbols. -/
class IsAlgebraic : Prop where
  /-- There are no relation symbols in the language. -/
  empty_relations : ∀ n, IsEmpty (L.Relations n)
goal: Prop

full_name: FirstOrder.Language.IsAlgebraic.empty_relations
code: /-- A language is algebraic when it has no relation symbols. -/
class IsAlgebraic : Prop where
  /-- There are no relation symbols in the language. -/
  empty_relations : ∀ n, IsEmpty (L.Relations n)
goal: IsEmpty (L.Relations n)

full_name: FirstOrder.Language.card_eq_card_functions_add_card_relations
code: theorem card_eq_card_functions_add_card_relations :
    L.card =
      (Cardinal.sum fun l => Cardinal.lift.{v} #(L.Functions l)) +
        Cardinal.sum fun l => Cardinal.lift.{u} #(L.Relations l) 
goal: L.card =
  (Cardinal.sum fun l => Cardinal.lift.{v, u} #(L.Functions l)) +
    Cardinal.sum fun l => Cardinal.lift.{u, v} #(L.Relations l)

full_name: FirstOrder.Language.instIsEmptyFunctionsOfIsRelational
code: instance [L.IsRelational] {n : ℕ} : IsEmpty (L.Functions n) 
goal: IsEmpty (L.Functions n)

full_name: FirstOrder.Language.instIsEmptyRelationsOfIsAlgebraic
code: instance [L.IsAlgebraic] {n : ℕ} : IsEmpty (L.Relations n) 
goal: IsEmpty (L.Relations n)

full_name: FirstOrder.Language.isRelational_of_empty_functions
code: instance isRelational_of_empty_functions {symb : ℕ → Type*} :
    IsRelational ⟨fun _ => Empty, symb⟩ 
goal: { Functions := fun x => Empty, Relations := symb }.IsRelational

full_name: FirstOrder.Language.isAlgebraic_of_empty_relations
code: instance isAlgebraic_of_empty_relations {symb : ℕ → Type*} : IsAlgebraic ⟨symb, fun _ => Empty⟩ 
goal: { Functions := symb, Relations := fun x => Empty }.IsAlgebraic

full_name: FirstOrder.Language.isRelational_empty
code: instance isRelational_empty : IsRelational Language.empty 
goal: FirstOrder.Language.empty.IsRelational

full_name: FirstOrder.Language.isAlgebraic_empty
code: instance isAlgebraic_empty : IsAlgebraic Language.empty 
goal: FirstOrder.Language.empty.IsAlgebraic

full_name: FirstOrder.Language.isRelational_sum
code: instance isRelational_sum [L.IsRelational] [L'.IsRelational] : IsRelational (L.sum L') 
goal: (L.sum L').IsRelational

full_name: FirstOrder.Language.isAlgebraic_sum
code: instance isAlgebraic_sum [L.IsAlgebraic] [L'.IsAlgebraic] : IsAlgebraic (L.sum L') 
goal: (L.sum L').IsAlgebraic

full_name: FirstOrder.Language.isRelational_mk₂
code: instance isRelational_mk₂ {c f₁ f₂ : Type u} {r₁ r₂ : Type v} [h0 : IsEmpty c] [h1 : IsEmpty f₁]
    [h2 : IsEmpty f₂] : IsRelational (Language.mk₂ c f₁ f₂ r₁ r₂) 
goal: (FirstOrder.Language.mk₂ c f₁ f₂ r₁ r₂).IsRelational

full_name: FirstOrder.Language.isAlgebraic_mk₂
code: instance isAlgebraic_mk₂ {c f₁ f₂ : Type u} {r₁ r₂ : Type v} [h1 : IsEmpty r₁] [h2 : IsEmpty r₂] :
    IsAlgebraic (Language.mk₂ c f₁ f₂ r₁ r₂) 
goal: (FirstOrder.Language.mk₂ c f₁ f₂ r₁ r₂).IsAlgebraic

full_name: FirstOrder.Language.subsingleton_mk₂_functions
code: instance subsingleton_mk₂_functions {c f₁ f₂ : Type u} {r₁ r₂ : Type v} [h0 : Subsingleton c]
    [h1 : Subsingleton f₁] [h2 : Subsingleton f₂] {n : ℕ} :
    Subsingleton ((Language.mk₂ c f₁ f₂ r₁ r₂).Functions n) 
goal: Subsingleton ((FirstOrder.Language.mk₂ c f₁ f₂ r₁ r₂).Functions n)

full_name: FirstOrder.Language.subsingleton_mk₂_relations
code: instance subsingleton_mk₂_relations {c f₁ f₂ : Type u} {r₁ r₂ : Type v} [h1 : Subsingleton r₁]
    [h2 : Subsingleton r₂] {n : ℕ} : Subsingleton ((Language.mk₂ c f₁ f₂ r₁ r₂).Relations n) 
goal: Subsingleton ((FirstOrder.Language.mk₂ c f₁ f₂ r₁ r₂).Relations n)

full_name: FirstOrder.Language.empty_card
code: @[simp]
theorem empty_card : Language.empty.card = 0 
goal: FirstOrder.Language.empty.card = 0

full_name: FirstOrder.Language.isEmpty_empty
code: instance isEmpty_empty : IsEmpty Language.empty.Symbols 
goal: IsEmpty FirstOrder.Language.empty.Symbols

full_name: FirstOrder.Language.Countable.countable_functions
code: instance Countable.countable_functions [h : Countable L.Symbols] : Countable (Σl, L.Functions l) 
goal: Countable ((l : ℕ) × L.Functions l)

full_name: FirstOrder.Language.card_functions_sum
code: @[simp]
theorem card_functions_sum (i : ℕ) :
    #((L.sum L').Functions i)
      = (Cardinal.lift.{u'} #(L.Functions i) + Cardinal.lift.{u} #(L'.Functions i) : Cardinal) 
goal: #((L.sum L').Functions i) = Cardinal.lift.{u', u} #(L.Functions i) + Cardinal.lift.{u, u'} #(L'.Functions i)

full_name: FirstOrder.Language.card_relations_sum
code: @[simp]
theorem card_relations_sum (i : ℕ) :
    #((L.sum L').Relations i) =
      Cardinal.lift.{v'} #(L.Relations i) + Cardinal.lift.{v} #(L'.Relations i) 
goal: #((L.sum L').Relations i) = Cardinal.lift.{v', v} #(L.Relations i) + Cardinal.lift.{v, v'} #(L'.Relations i)

full_name: FirstOrder.Language.card_sum
code: @[simp]
theorem card_sum :
    (L.sum L').card = Cardinal.lift.{max u' v'} L.card + Cardinal.lift.{max u v} L'.card 
goal: (L.sum L').card = Cardinal.lift.{max u' v', max u v} L.card + Cardinal.lift.{max u v, max u' v'} L'.card

full_name: FirstOrder.Language.card_mk₂
code: @[simp]
theorem card_mk₂ (c f₁ f₂ : Type u) (r₁ r₂ : Type v) :
    (Language.mk₂ c f₁ f₂ r₁ r₂).card =
      Cardinal.lift.{v} #c + Cardinal.lift.{v} #f₁ + Cardinal.lift.{v} #f₂ +
          Cardinal.lift.{u} #r₁ + Cardinal.lift.{u} #r₂ 
goal: (FirstOrder.Language.mk₂ c f₁ f₂ r₁ r₂).card =
  Cardinal.lift.{v, u} #c + Cardinal.lift.{v, u} #f₁ + Cardinal.lift.{v, u} #f₂ + Cardinal.lift.{u, v} #r₁ +
    Cardinal.lift.{u, v} #r₂

full_name: FirstOrder.Language.Structure
code: /-- A first-order structure on a type `M` consists of interpretations of all the symbols in a given
  language. Each function of arity `n` is interpreted as a function sending tuples of length `n`
  (modeled as `(Fin n → M)`) to `M`, and a relation of arity `n` is a function from tuples of length
  `n` to `Prop`. -/
@[ext]
class Structure where
  /-- Interpretation of the function symbols -/
  funMap : ∀ {n}, L.Functions n → (Fin n → M) → M
  /-- Interpretation of the relation symbols -/
  RelMap : ∀ {n}, L.Relations n → (Fin n → M) → Prop
goal: Type (max (max u v) w)

full_name: FirstOrder.Language.Structure.funMap
code: /-- A first-order structure on a type `M` consists of interpretations of all the symbols in a given
  language. Each function of arity `n` is interpreted as a function sending tuples of length `n`
  (modeled as `(Fin n → M)`) to `M`, and a relation of arity `n` is a function from tuples of length
  `n` to `Prop`. -/
@[ext]
class Structure where
  /-- Interpretation of the function symbols -/
  funMap : ∀ {n}, L.Functions n → (Fin n → M) → M
  /-- Interpretation of the relation symbols -/
  RelMap : ∀ {n}, L.Relations n → (Fin n → M) → Prop
goal: L.Functions n → (Fin n → M) → M

full_name: FirstOrder.Language.Structure.RelMap
code: /-- A first-order structure on a type `M` consists of interpretations of all the symbols in a given
  language. Each function of arity `n` is interpreted as a function sending tuples of length `n`
  (modeled as `(Fin n → M)`) to `M`, and a relation of arity `n` is a function from tuples of length
  `n` to `Prop`. -/
@[ext]
class Structure where
  /-- Interpretation of the function symbols -/
  funMap : ∀ {n}, L.Functions n → (Fin n → M) → M
  /-- Interpretation of the relation symbols -/
  RelMap : ∀ {n}, L.Relations n → (Fin n → M) → Prop
goal: L.Relations n → (Fin n → M) → Prop

full_name: FirstOrder.Language.Inhabited.trivialStructure
code: /-- Used for defining `FirstOrder.Language.Theory.ModelType.instInhabited`. -/
def Inhabited.trivialStructure {α : Type*} [Inhabited α] : L.Structure α 
goal: L.Structure α

full_name: FirstOrder.Language.Hom.map_fun'
code: /-- A homomorphism between first-order structures is a function that commutes with the
  interpretations of functions and maps tuples in one structure where a given relation is true to
  tuples in the second structure where that relation is still true. -/
structure Hom where
  /-- The underlying function of a homomorphism of structures -/
  toFun : M → N
  /-- The homomorphism commutes with the interpretations of the function symbols -/
  -- Porting note:
  -- The autoparam here used to be `obviously`. We would like to replace it with `aesop`
  -- but that isn't currently sufficient.
  -- See https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Aesop.20and.20cases
  -- If that can be improved, we should change this to `by aesop` and remove the proofs below.
  map_fun' : ∀ {n} (f : L.Functions n) (x), toFun (funMap f x) = funMap f (toFun ∘ x) := by
    intros; trivial
  /-- The homomorphism sends related elements to related elements -/
  map_rel' : ∀ {n} (r : L.Relations n) (x), RelMap r x → RelMap r (toFun ∘ x) := by
    -- Porting note: see porting note on `Hom.map_fun'`
    intros; trivial
goal: self.toFun (FirstOrder.Language.Structure.funMap f x) = FirstOrder.Language.Structure.funMap f (self.toFun ∘ x)

full_name: FirstOrder.Language.Hom.map_rel'
code: /-- A homomorphism between first-order structures is a function that commutes with the
  interpretations of functions and maps tuples in one structure where a given relation is true to
  tuples in the second structure where that relation is still true. -/
structure Hom where
  /-- The underlying function of a homomorphism of structures -/
  toFun : M → N
  /-- The homomorphism commutes with the interpretations of the function symbols -/
  -- Porting note:
  -- The autoparam here used to be `obviously`. We would like to replace it with `aesop`
  -- but that isn't currently sufficient.
  -- See https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Aesop.20and.20cases
  -- If that can be improved, we should change this to `by aesop` and remove the proofs below.
  map_fun' : ∀ {n} (f : L.Functions n) (x), toFun (funMap f x) = funMap f (toFun ∘ x) := by
    intros; trivial
  /-- The homomorphism sends related elements to related elements -/
  map_rel' : ∀ {n} (r : L.Relations n) (x), RelMap r x → RelMap r (toFun ∘ x) := by
    -- Porting note: see porting note on `Hom.map_fun'`
    intros; trivial
goal: FirstOrder.Language.Structure.RelMap r x → FirstOrder.Language.Structure.RelMap r (self.toFun ∘ x)

full_name: FirstOrder.Language.Hom
code: /-- A homomorphism between first-order structures is a function that commutes with the
  interpretations of functions and maps tuples in one structure where a given relation is true to
  tuples in the second structure where that relation is still true. -/
structure Hom where
  /-- The underlying function of a homomorphism of structures -/
  toFun : M → N
  /-- The homomorphism commutes with the interpretations of the function symbols -/
  -- Porting note:
  -- The autoparam here used to be `obviously`. We would like to replace it with `aesop`
  -- but that isn't currently sufficient.
  -- See https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Aesop.20and.20cases
  -- If that can be improved, we should change this to `by aesop` and remove the proofs below.
  map_fun' : ∀ {n} (f : L.Functions n) (x), toFun (funMap f x) = funMap f (toFun ∘ x) := by
    intros; trivial
  /-- The homomorphism sends related elements to related elements -/
  map_rel' : ∀ {n} (r : L.Relations n) (x), RelMap r x → RelMap r (toFun ∘ x) := by
    -- Porting note: see porting note on `Hom.map_fun'`
    intros; trivial
goal: Type (max w w')

full_name: FirstOrder.Language.Hom.toFun
code: /-- A homomorphism between first-order structures is a function that commutes with the
  interpretations of functions and maps tuples in one structure where a given relation is true to
  tuples in the second structure where that relation is still true. -/
structure Hom where
  /-- The underlying function of a homomorphism of structures -/
  toFun : M → N
  /-- The homomorphism commutes with the interpretations of the function symbols -/
  -- Porting note:
  -- The autoparam here used to be `obviously`. We would like to replace it with `aesop`
  -- but that isn't currently sufficient.
  -- See https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Aesop.20and.20cases
  -- If that can be improved, we should change this to `by aesop` and remove the proofs below.
  map_fun' : ∀ {n} (f : L.Functions n) (x), toFun (funMap f x) = funMap f (toFun ∘ x) := by
    intros; trivial
  /-- The homomorphism sends related elements to related elements -/
  map_rel' : ∀ {n} (r : L.Relations n) (x), RelMap r x → RelMap r (toFun ∘ x) := by
    -- Porting note: see porting note on `Hom.map_fun'`
    intros; trivial
goal: M → N

full_name: FirstOrder.«_aux_Mathlib_ModelTheory_Basic___macroRules_FirstOrder_term_→[_]__1»
code: @[inherit_doc]
scoped[FirstOrder] notation:25 A " →[" L "] " B => FirstOrder.Language.Hom L A B
goal: Lean.Macro

full_name: FirstOrder._aux_Mathlib_ModelTheory_Basic___unexpand_FirstOrder_Language_Hom_1
code: @[inherit_doc]
scoped[FirstOrder] notation:25 A " →[" L "] " B => FirstOrder.Language.Hom L A B
goal: Lean.PrettyPrinter.Unexpander

full_name: FirstOrder.Language.Embedding.map_rel'
code: /-- An embedding of first-order structures is an embedding that commutes with the
  interpretations of functions and relations. -/
structure Embedding extends M ↪ N where
  map_fun' : ∀ {n} (f : L.Functions n) (x), toFun (funMap f x) = funMap f (toFun ∘ x) := by
    -- Porting note: see porting note on `Hom.map_fun'`
    intros; trivial
  map_rel' : ∀ {n} (r : L.Relations n) (x), RelMap r (toFun ∘ x) ↔ RelMap r x := by
    -- Porting note: see porting note on `Hom.map_fun'`
    intros; trivial
goal: FirstOrder.Language.Structure.RelMap r (self.toFun ∘ x) ↔ FirstOrder.Language.Structure.RelMap r x

full_name: FirstOrder.Language.Embedding.map_fun'
code: /-- An embedding of first-order structures is an embedding that commutes with the
  interpretations of functions and relations. -/
structure Embedding extends M ↪ N where
  map_fun' : ∀ {n} (f : L.Functions n) (x), toFun (funMap f x) = funMap f (toFun ∘ x) := by
    -- Porting note: see porting note on `Hom.map_fun'`
    intros; trivial
  map_rel' : ∀ {n} (r : L.Relations n) (x), RelMap r (toFun ∘ x) ↔ RelMap r x := by
    -- Porting note: see porting note on `Hom.map_fun'`
    intros; trivial
goal: self.toFun (FirstOrder.Language.Structure.funMap f x) = FirstOrder.Language.Structure.funMap f (self.toFun ∘ x)

full_name: FirstOrder.Language.Embedding
code: /-- An embedding of first-order structures is an embedding that commutes with the
  interpretations of functions and relations. -/
structure Embedding extends M ↪ N where
  map_fun' : ∀ {n} (f : L.Functions n) (x), toFun (funMap f x) = funMap f (toFun ∘ x) := by
    -- Porting note: see porting note on `Hom.map_fun'`
    intros; trivial
  map_rel' : ∀ {n} (r : L.Relations n) (x), RelMap r (toFun ∘ x) ↔ RelMap r x := by
    -- Porting note: see porting note on `Hom.map_fun'`
    intros; trivial
goal: Type (max w w')

full_name: FirstOrder._aux_Mathlib_ModelTheory_Basic___unexpand_FirstOrder_Language_Embedding_1
code: @[inherit_doc]
scoped[FirstOrder] notation:25 A " ↪[" L "] " B => FirstOrder.Language.Embedding L A B
goal: Lean.PrettyPrinter.Unexpander

full_name: FirstOrder.«_aux_Mathlib_ModelTheory_Basic___macroRules_FirstOrder_term_↪[_]__1»
code: @[inherit_doc]
scoped[FirstOrder] notation:25 A " ↪[" L "] " B => FirstOrder.Language.Embedding L A B
goal: Lean.Macro

full_name: FirstOrder.Language.Equiv
code: /-- An equivalence of first-order structures is an equivalence that commutes with the
  interpretations of functions and relations. -/
structure Equiv extends M ≃ N where
  map_fun' : ∀ {n} (f : L.Functions n) (x), toFun (funMap f x) = funMap f (toFun ∘ x) := by
    -- Porting note: see porting note on `Hom.map_fun'`
    intros; trivial
  map_rel' : ∀ {n} (r : L.Relations n) (x), RelMap r (toFun ∘ x) ↔ RelMap r x := by
    -- Porting note: see porting note on `Hom.map_fun'`
    intros; trivial
goal: Type (max w w')

full_name: FirstOrder.Language.Equiv.map_fun'
code: /-- An equivalence of first-order structures is an equivalence that commutes with the
  interpretations of functions and relations. -/
structure Equiv extends M ≃ N where
  map_fun' : ∀ {n} (f : L.Functions n) (x), toFun (funMap f x) = funMap f (toFun ∘ x) := by
    -- Porting note: see porting note on `Hom.map_fun'`
    intros; trivial
  map_rel' : ∀ {n} (r : L.Relations n) (x), RelMap r (toFun ∘ x) ↔ RelMap r x := by
    -- Porting note: see porting note on `Hom.map_fun'`
    intros; trivial
goal: self.toFun (FirstOrder.Language.Structure.funMap f x) = FirstOrder.Language.Structure.funMap f (self.toFun ∘ x)

full_name: FirstOrder.Language.Equiv.map_rel'
code: /-- An equivalence of first-order structures is an equivalence that commutes with the
  interpretations of functions and relations. -/
structure Equiv extends M ≃ N where
  map_fun' : ∀ {n} (f : L.Functions n) (x), toFun (funMap f x) = funMap f (toFun ∘ x) := by
    -- Porting note: see porting note on `Hom.map_fun'`
    intros; trivial
  map_rel' : ∀ {n} (r : L.Relations n) (x), RelMap r (toFun ∘ x) ↔ RelMap r x := by
    -- Porting note: see porting note on `Hom.map_fun'`
    intros; trivial
goal: FirstOrder.Language.Structure.RelMap r (self.toFun ∘ x) ↔ FirstOrder.Language.Structure.RelMap r x

full_name: FirstOrder.«_aux_Mathlib_ModelTheory_Basic___macroRules_FirstOrder_term_≃[_]__1»
code: @[inherit_doc]
scoped[FirstOrder] notation:25 A " ≃[" L "] " B => FirstOrder.Language.Equiv L A B
goal: Lean.Macro

full_name: FirstOrder._aux_Mathlib_ModelTheory_Basic___unexpand_FirstOrder_Language_Equiv_1
code: @[inherit_doc]
scoped[FirstOrder] notation:25 A " ≃[" L "] " B => FirstOrder.Language.Equiv L A B
goal: Lean.PrettyPrinter.Unexpander

full_name: FirstOrder.Language.constantMap
code: /-- Interpretation of a constant symbol -/
@[coe]
def constantMap (c : L.Constants) : M 
goal: M

full_name: FirstOrder.Language.instCoeTCConstants
code: instance : CoeTC L.Constants M 
goal: CoeTC L.Constants M

full_name: FirstOrder.Language.funMap_eq_coe_constants
code: theorem funMap_eq_coe_constants {c : L.Constants} {x : Fin 0 → M} : funMap c x = c 
goal: FirstOrder.Language.Structure.funMap c x = ↑c

full_name: FirstOrder.Language.nonempty_of_nonempty_constants
code: /-- Given a language with a nonempty type of constants, any structure will be nonempty. This cannot
  be a global instance, because `L` becomes a metavariable. -/
theorem nonempty_of_nonempty_constants [h : Nonempty L.Constants] : Nonempty M 
goal: Nonempty M

full_name: FirstOrder.Language.funMap₂
code: /-- The function map for `FirstOrder.Language.Structure₂`. -/
def funMap₂ {c f₁ f₂ : Type u} {r₁ r₂ : Type v} (c' : c → M) (f₁' : f₁ → M → M)
    (f₂' : f₂ → M → M → M) : ∀ {n}, (Language.mk₂ c f₁ f₂ r₁ r₂).Functions n → (Fin n → M) → M
  
goal: (FirstOrder.Language.mk₂ c f₁ f₂ r₁ r₂).Functions n → (Fin n → M) → M

full_name: FirstOrder.Language.RelMap₂
code: /-- The relation map for `FirstOrder.Language.Structure₂`. -/
def RelMap₂ {c f₁ f₂ : Type u} {r₁ r₂ : Type v} (r₁' : r₁ → Set M) (r₂' : r₂ → M → M → Prop) :
    ∀ {n}, (Language.mk₂ c f₁ f₂ r₁ r₂).Relations n → (Fin n → M) → Prop
  
goal: (FirstOrder.Language.mk₂ c f₁ f₂ r₁ r₂).Relations n → (Fin n → M) → Prop

full_name: FirstOrder.Language.Structure.mk₂
code: /-- A structure constructor to match `FirstOrder.Language₂`. -/
protected def Structure.mk₂ {c f₁ f₂ : Type u} {r₁ r₂ : Type v} (c' : c → M) (f₁' : f₁ → M → M)
    (f₂' : f₂ → M → M → M) (r₁' : r₁ → Set M) (r₂' : r₂ → M → M → Prop) :
    (Language.mk₂ c f₁ f₂ r₁ r₂).Structure M 
goal: (FirstOrder.Language.mk₂ c f₁ f₂ r₁ r₂).Structure M

full_name: FirstOrder.Language.Structure.funMap_apply₀
code: @[simp]
theorem funMap_apply₀ (c₀ : c) {x : Fin 0 → M} :
    @Structure.funMap _ M (Structure.mk₂ c' f₁' f₂' r₁' r₂') 0 c₀ x = c' c₀ 
goal: FirstOrder.Language.Structure.funMap c₀ x = c' c₀

full_name: FirstOrder.Language.Structure.funMap_apply₁
code: @[simp]
theorem funMap_apply₁ (f : f₁) (x : M) :
    @Structure.funMap _ M (Structure.mk₂ c' f₁' f₂' r₁' r₂') 1 f ![x] = f₁' f x 
goal: FirstOrder.Language.Structure.funMap f ![x] = f₁' f x

full_name: FirstOrder.Language.Structure.funMap_apply₂
code: @[simp]
theorem funMap_apply₂ (f : f₂) (x y : M) :
    @Structure.funMap _ M (Structure.mk₂ c' f₁' f₂' r₁' r₂') 2 f ![x, y] = f₂' f x y 
goal: FirstOrder.Language.Structure.funMap f ![x, y] = f₂' f x y

full_name: FirstOrder.Language.Structure.relMap_apply₁
code: @[simp]
theorem relMap_apply₁ (r : r₁) (x : M) :
    @Structure.RelMap _ M (Structure.mk₂ c' f₁' f₂' r₁' r₂') 1 r ![x] = (x ∈ r₁' r) 
goal: FirstOrder.Language.Structure.RelMap r ![x] = (x ∈ r₁' r)

full_name: FirstOrder.Language.Structure.relMap_apply₂
code: @[simp]
theorem relMap_apply₂ (r : r₂) (x y : M) :
    @Structure.RelMap _ M (Structure.mk₂ c' f₁' f₂' r₁' r₂') 2 r ![x, y] = r₂' r x y 
goal: FirstOrder.Language.Structure.RelMap r ![x, y] = r₂' r x y

full_name: FirstOrder.Language.HomClass
code: /-- `HomClass L F M N` states that `F` is a type of `L`-homomorphisms. You should extend this
  typeclass when you extend `FirstOrder.Language.Hom`. -/
class HomClass (L : outParam Language) (F M N : Type*)
  [FunLike F M N] [L.Structure M] [L.Structure N] : Prop where
  map_fun : ∀ (φ : F) {n} (f : L.Functions n) (x), φ (funMap f x) = funMap f (φ ∘ x)
  map_rel : ∀ (φ : F) {n} (r : L.Relations n) (x), RelMap r x → RelMap r (φ ∘ x)
goal: Prop

full_name: FirstOrder.Language.HomClass.map_fun
code: /-- `HomClass L F M N` states that `F` is a type of `L`-homomorphisms. You should extend this
  typeclass when you extend `FirstOrder.Language.Hom`. -/
class HomClass (L : outParam Language) (F M N : Type*)
  [FunLike F M N] [L.Structure M] [L.Structure N] : Prop where
  map_fun : ∀ (φ : F) {n} (f : L.Functions n) (x), φ (funMap f x) = funMap f (φ ∘ x)
  map_rel : ∀ (φ : F) {n} (r : L.Relations n) (x), RelMap r x → RelMap r (φ ∘ x)
goal: φ (FirstOrder.Language.Structure.funMap f x) = FirstOrder.Language.Structure.funMap f (⇑φ ∘ x)

full_name: FirstOrder.Language.HomClass.map_rel
code: /-- `HomClass L F M N` states that `F` is a type of `L`-homomorphisms. You should extend this
  typeclass when you extend `FirstOrder.Language.Hom`. -/
class HomClass (L : outParam Language) (F M N : Type*)
  [FunLike F M N] [L.Structure M] [L.Structure N] : Prop where
  map_fun : ∀ (φ : F) {n} (f : L.Functions n) (x), φ (funMap f x) = funMap f (φ ∘ x)
  map_rel : ∀ (φ : F) {n} (r : L.Relations n) (x), RelMap r x → RelMap r (φ ∘ x)
goal: FirstOrder.Language.Structure.RelMap r x → FirstOrder.Language.Structure.RelMap r (⇑φ ∘ x)

full_name: FirstOrder.Language.StrongHomClass.map_fun
code: /-- `StrongHomClass L F M N` states that `F` is a type of `L`-homomorphisms which preserve
  relations in both directions. -/
class StrongHomClass (L : outParam Language) (F M N : Type*)
  [FunLike F M N] [L.Structure M] [L.Structure N] : Prop where
  map_fun : ∀ (φ : F) {n} (f : L.Functions n) (x), φ (funMap f x) = funMap f (φ ∘ x)
  map_rel : ∀ (φ : F) {n} (r : L.Relations n) (x), RelMap r (φ ∘ x) ↔ RelMap r x
goal: φ (FirstOrder.Language.Structure.funMap f x) = FirstOrder.Language.Structure.funMap f (⇑φ ∘ x)

full_name: FirstOrder.Language.StrongHomClass
code: /-- `StrongHomClass L F M N` states that `F` is a type of `L`-homomorphisms which preserve
  relations in both directions. -/
class StrongHomClass (L : outParam Language) (F M N : Type*)
  [FunLike F M N] [L.Structure M] [L.Structure N] : Prop where
  map_fun : ∀ (φ : F) {n} (f : L.Functions n) (x), φ (funMap f x) = funMap f (φ ∘ x)
  map_rel : ∀ (φ : F) {n} (r : L.Relations n) (x), RelMap r (φ ∘ x) ↔ RelMap r x
goal: Prop

full_name: FirstOrder.Language.StrongHomClass.map_rel
code: /-- `StrongHomClass L F M N` states that `F` is a type of `L`-homomorphisms which preserve
  relations in both directions. -/
class StrongHomClass (L : outParam Language) (F M N : Type*)
  [FunLike F M N] [L.Structure M] [L.Structure N] : Prop where
  map_fun : ∀ (φ : F) {n} (f : L.Functions n) (x), φ (funMap f x) = funMap f (φ ∘ x)
  map_rel : ∀ (φ : F) {n} (r : L.Relations n) (x), RelMap r (φ ∘ x) ↔ RelMap r x
goal: FirstOrder.Language.Structure.RelMap r (⇑φ ∘ x) ↔ FirstOrder.Language.Structure.RelMap r x

full_name: FirstOrder.Language.StrongHomClass.homClass
code: instance (priority := 100) StrongHomClass.homClass {F : Type*} [L.Structure M]
    [L.Structure N] [FunLike F M N] [StrongHomClass L F M N] : HomClass L F M N 
goal: L.HomClass F M N

full_name: FirstOrder.Language.HomClass.strongHomClassOfIsAlgebraic
code: /-- Not an instance to avoid a loop. -/
theorem HomClass.strongHomClassOfIsAlgebraic [L.IsAlgebraic] {F M N} [L.Structure M] [L.Structure N]
    [FunLike F M N] [HomClass L F M N] : StrongHomClass L F M N 
goal: L.StrongHomClass F M N

full_name: FirstOrder.Language.HomClass.map_constants
code: theorem HomClass.map_constants {F M N} [L.Structure M] [L.Structure N] [FunLike F M N]
    [HomClass L F M N] (φ : F) (c : L.Constants) : φ c = c 
goal: φ ↑c = ↑c

full_name: FirstOrder.Language.Hom.instFunLike
code: instance instFunLike : FunLike (M →[L] N) M N 
goal: FunLike (L.Hom M N) M N

full_name: FirstOrder.Language.Hom.homClass
code: instance homClass : HomClass L (M →[L] N) M N 
goal: L.HomClass (L.Hom M N) M N

full_name: FirstOrder.Language.Hom.instStrongHomClassOfIsAlgebraic
code: instance [L.IsAlgebraic] : StrongHomClass L (M →[L] N) M N 
goal: L.StrongHomClass (L.Hom M N) M N

full_name: FirstOrder.Language.Hom.hasCoeToFun
code: instance hasCoeToFun : CoeFun (M →[L] N) fun _ => M → N 
goal: CoeFun (L.Hom M N) fun x => M → N

full_name: FirstOrder.Language.Hom.toFun_eq_coe
code: @[simp]
theorem toFun_eq_coe {f : M →[L] N} : f.toFun = (f : M → N) 
goal: f.toFun = ⇑f

full_name: FirstOrder.Language.Hom.ext
code: @[ext]
theorem ext ⦃f g : M →[L] N⦄ (h : ∀ x, f x = g x) : f = g 
goal: f = g

full_name: FirstOrder.Language.Hom.ext_iff
code: theorem ext_iff {f g : M →[L] N} : f = g ↔ ∀ x, f x = g x 
goal: f = g ↔ ∀ (x : M), f x = g x

full_name: FirstOrder.Language.Hom.map_fun
code: @[simp]
theorem map_fun (φ : M →[L] N) {n : ℕ} (f : L.Functions n) (x : Fin n → M) :
    φ (funMap f x) = funMap f (φ ∘ x) 
goal: φ (FirstOrder.Language.Structure.funMap f x) = FirstOrder.Language.Structure.funMap f (⇑φ ∘ x)

full_name: FirstOrder.Language.Hom.map_constants
code: @[simp]
theorem map_constants (φ : M →[L] N) (c : L.Constants) : φ c = c 
goal: φ ↑c = ↑c

full_name: FirstOrder.Language.Hom.map_rel
code: @[simp]
theorem map_rel (φ : M →[L] N) {n : ℕ} (r : L.Relations n) (x : Fin n → M) :
    RelMap r x → RelMap r (φ ∘ x) 
goal: FirstOrder.Language.Structure.RelMap r x → FirstOrder.Language.Structure.RelMap r (⇑φ ∘ x)

full_name: FirstOrder.Language.Hom.id
code: /-- The identity map from a structure to itself. -/
@[refl]
def id : M →[L] M 
goal: L.Hom M M

full_name: FirstOrder.Language.Hom.instInhabited
code: instance : Inhabited (M →[L] M) 
goal: Inhabited (L.Hom M M)

full_name: FirstOrder.Language.Hom.id_apply
code: @[simp]
theorem id_apply (x : M) : id L M x = x 
goal: (FirstOrder.Language.Hom.id L M) x = x

full_name: FirstOrder.Language.Hom.comp
code: /-- Composition of first-order homomorphisms. -/
@[trans]
def comp (hnp : N →[L] P) (hmn : M →[L] N) : M →[L] P 
goal: L.Hom M P

full_name: FirstOrder.Language.Hom.comp_apply
code: @[simp]
theorem comp_apply (g : N →[L] P) (f : M →[L] N) (x : M) : g.comp f x = g (f x) 
goal: (g.comp f) x = g (f x)

full_name: FirstOrder.Language.Hom.comp_assoc
code: /-- Composition of first-order homomorphisms is associative. -/
theorem comp_assoc (f : M →[L] N) (g : N →[L] P) (h : P →[L] Q) :
    (h.comp g).comp f = h.comp (g.comp f) 
goal: (h.comp g).comp f = h.comp (g.comp f)

full_name: FirstOrder.Language.Hom.comp_id
code: @[simp]
theorem comp_id (f : M →[L] N) : f.comp (id L M) = f 
goal: f.comp (FirstOrder.Language.Hom.id L M) = f

full_name: FirstOrder.Language.Hom.id_comp
code: @[simp]
theorem id_comp (f : M →[L] N) : (id L N).comp f = f 
goal: (FirstOrder.Language.Hom.id L N).comp f = f

full_name: FirstOrder.Language.HomClass.toHom
code: /-- Any element of a `HomClass` can be realized as a first_order homomorphism. -/
def HomClass.toHom {F M N} [L.Structure M] [L.Structure N] [FunLike F M N]
    [HomClass L F M N] : F → M →[L] N 
goal: F → L.Hom M N

full_name: FirstOrder.Language.Embedding.funLike
code: instance funLike : FunLike (M ↪[L] N) M N 
goal: FunLike (L.Embedding M N) M N

full_name: FirstOrder.Language.Embedding.embeddingLike
code: instance embeddingLike : EmbeddingLike (M ↪[L] N) M N 
goal: EmbeddingLike (L.Embedding M N) M N

full_name: FirstOrder.Language.Embedding.strongHomClass
code: instance strongHomClass : StrongHomClass L (M ↪[L] N) M N 
goal: L.StrongHomClass (L.Embedding M N) M N

full_name: FirstOrder.Language.Embedding.map_fun
code: @[simp]
theorem map_fun (φ : M ↪[L] N) {n : ℕ} (f : L.Functions n) (x : Fin n → M) :
    φ (funMap f x) = funMap f (φ ∘ x) 
goal: φ (FirstOrder.Language.Structure.funMap f x) = FirstOrder.Language.Structure.funMap f (⇑φ ∘ x)

full_name: FirstOrder.Language.Embedding.map_constants
code: @[simp]
theorem map_constants (φ : M ↪[L] N) (c : L.Constants) : φ c = c 
goal: φ ↑c = ↑c

full_name: FirstOrder.Language.Embedding.map_rel
code: @[simp]
theorem map_rel (φ : M ↪[L] N) {n : ℕ} (r : L.Relations n) (x : Fin n → M) :
    RelMap r (φ ∘ x) ↔ RelMap r x 
goal: FirstOrder.Language.Structure.RelMap r (⇑φ ∘ x) ↔ FirstOrder.Language.Structure.RelMap r x

full_name: FirstOrder.Language.Embedding.toHom
code: /-- A first-order embedding is also a first-order homomorphism. -/
def toHom : (M ↪[L] N) → M →[L] N 
goal: L.Embedding M N → L.Hom M N

full_name: FirstOrder.Language.Embedding.coe_toHom
code: @[simp]
theorem coe_toHom {f : M ↪[L] N} : (f.toHom : M → N) = f 
goal: ⇑f.toHom = ⇑f

full_name: FirstOrder.Language.Embedding.coe_injective
code: theorem coe_injective : @Function.Injective (M ↪[L] N) (M → N) (↑)
  
goal: Function.Injective DFunLike.coe

full_name: FirstOrder.Language.Embedding.ext
code: @[ext]
theorem ext ⦃f g : M ↪[L] N⦄ (h : ∀ x, f x = g x) : f = g 
goal: f = g

full_name: FirstOrder.Language.Embedding.ext_iff
code: theorem ext_iff {f g : M ↪[L] N} : f = g ↔ ∀ x, f x = g x 
goal: f = g ↔ ∀ (x : M), f x = g x

full_name: FirstOrder.Language.Embedding.toHom_injective
code: theorem toHom_injective : @Function.Injective (M ↪[L] N) (M →[L] N) (·.toHom) 
goal: Function.Injective fun x => x.toHom

full_name: FirstOrder.Language.Embedding.toHom_inj
code: @[simp]
theorem toHom_inj {f g : M ↪[L] N} : f.toHom = g.toHom ↔ f = g 
goal: f.toHom = g.toHom ↔ f = g

full_name: FirstOrder.Language.Embedding.injective
code: theorem injective (f : M ↪[L] N) : Function.Injective f 
goal: Function.Injective ⇑f

full_name: FirstOrder.Language.Embedding.ofInjective_toFun
code: /-- In an algebraic language, any injective homomorphism is an embedding. -/
@[simps!]
def ofInjective [L.IsAlgebraic] {f : M →[L] N} (hf : Function.Injective f) : M ↪[L] N 
goal: ∀ (a : M), (FirstOrder.Language.Embedding.ofInjective hf) a = f a

full_name: FirstOrder.Language.Embedding.ofInjective
code: /-- In an algebraic language, any injective homomorphism is an embedding. -/
@[simps!]
def ofInjective [L.IsAlgebraic] {f : M →[L] N} (hf : Function.Injective f) : M ↪[L] N 
goal: L.Embedding M N

full_name: FirstOrder.Language.Embedding.coeFn_ofInjective
code: @[simp]
theorem coeFn_ofInjective [L.IsAlgebraic] {f : M →[L] N} (hf : Function.Injective f) :
    (ofInjective hf : M → N) = f 
goal: ⇑(FirstOrder.Language.Embedding.ofInjective hf) = ⇑f

full_name: FirstOrder.Language.Embedding.ofInjective_toHom
code: @[simp]
theorem ofInjective_toHom [L.IsAlgebraic] {f : M →[L] N} (hf : Function.Injective f) :
    (ofInjective hf).toHom = f 
goal: (FirstOrder.Language.Embedding.ofInjective hf).toHom = f

full_name: FirstOrder.Language.Embedding.refl
code: /-- The identity embedding from a structure to itself. -/
@[refl]
def refl : M ↪[L] M 
goal: L.Embedding M M

full_name: FirstOrder.Language.Embedding.instInhabited
code: instance : Inhabited (M ↪[L] M) 
goal: Inhabited (L.Embedding M M)

full_name: FirstOrder.Language.Embedding.refl_apply
code: @[simp]
theorem refl_apply (x : M) : refl L M x = x 
goal: (FirstOrder.Language.Embedding.refl L M) x = x

full_name: FirstOrder.Language.Embedding.comp
code: /-- Composition of first-order embeddings. -/
@[trans]
def comp (hnp : N ↪[L] P) (hmn : M ↪[L] N) : M ↪[L] P 
goal: L.Embedding M P

full_name: FirstOrder.Language.Embedding.comp_apply
code: @[simp]
theorem comp_apply (g : N ↪[L] P) (f : M ↪[L] N) (x : M) : g.comp f x = g (f x) 
goal: (g.comp f) x = g (f x)

full_name: FirstOrder.Language.Embedding.comp_assoc
code: /-- Composition of first-order embeddings is associative. -/
theorem comp_assoc (f : M ↪[L] N) (g : N ↪[L] P) (h : P ↪[L] Q) :
    (h.comp g).comp f = h.comp (g.comp f) 
goal: (h.comp g).comp f = h.comp (g.comp f)

full_name: FirstOrder.Language.Embedding.comp_injective
code: theorem comp_injective (h : N ↪[L] P) :
    Function.Injective (h.comp : (M ↪[L] N) →  (M ↪[L] P)) 
goal: Function.Injective h.comp

full_name: FirstOrder.Language.Embedding.comp_inj
code: @[simp]
theorem comp_inj (h : N ↪[L] P) (f g : M ↪[L] N) : h.comp f = h.comp g ↔ f = g 
goal: h.comp f = h.comp g ↔ f = g

full_name: FirstOrder.Language.Embedding.toHom_comp_injective
code: theorem toHom_comp_injective (h : N ↪[L] P) :
    Function.Injective (h.toHom.comp : (M →[L] N) →  (M →[L] P)) 
goal: Function.Injective h.toHom.comp

full_name: FirstOrder.Language.Embedding.toHom_comp_inj
code: @[simp]
theorem toHom_comp_inj (h : N ↪[L] P) (f g : M →[L] N) : h.toHom.comp f = h.toHom.comp g ↔ f = g 
goal: h.toHom.comp f = h.toHom.comp g ↔ f = g

full_name: FirstOrder.Language.Embedding.comp_toHom
code: @[simp]
theorem comp_toHom (hnp : N ↪[L] P) (hmn : M ↪[L] N) :
    (hnp.comp hmn).toHom = hnp.toHom.comp hmn.toHom 
goal: (hnp.comp hmn).toHom = hnp.toHom.comp hmn.toHom

full_name: FirstOrder.Language.Embedding.comp_refl
code: @[simp]
theorem comp_refl (f : M ↪[L] N) : f.comp (refl L M) = f 
goal: f.comp (FirstOrder.Language.Embedding.refl L M) = f

full_name: FirstOrder.Language.Embedding.refl_comp
code: @[simp]
theorem refl_comp (f : M ↪[L] N) : (refl L N).comp f = f 
goal: (FirstOrder.Language.Embedding.refl L N).comp f = f

full_name: FirstOrder.Language.Embedding.refl_toHom
code: @[simp]
theorem refl_toHom : (refl L M).toHom = Hom.id L M 
goal: (FirstOrder.Language.Embedding.refl L M).toHom = FirstOrder.Language.Hom.id L M

full_name: FirstOrder.Language.StrongHomClass.toEmbedding
code: /-- Any element of an injective `StrongHomClass` can be realized as a first_order embedding. -/
def StrongHomClass.toEmbedding {F M N} [L.Structure M] [L.Structure N] [FunLike F M N]
    [EmbeddingLike F M N] [StrongHomClass L F M N] : F → M ↪[L] N 
goal: F → L.Embedding M N

full_name: FirstOrder.Language.Equiv.instEquivLike
code: instance : EquivLike (M ≃[L] N) M N 
goal: EquivLike (L.Equiv M N) M N

full_name: FirstOrder.Language.Equiv.instStrongHomClass
code: instance : StrongHomClass L (M ≃[L] N) M N 
goal: L.StrongHomClass (L.Equiv M N) M N

full_name: FirstOrder.Language.Equiv.symm
code: /-- The inverse of a first-order equivalence is a first-order equivalence. -/
@[symm]
def symm (f : M ≃[L] N) : N ≃[L] M 
goal: L.Equiv N M

full_name: FirstOrder.Language.Equiv.hasCoeToFun
code: instance hasCoeToFun : CoeFun (M ≃[L] N) fun _ => M → N 
goal: CoeFun (L.Equiv M N) fun x => M → N

full_name: FirstOrder.Language.Equiv.symm_symm
code: @[simp]
theorem symm_symm (f : M ≃[L] N) :
    f.symm.symm = f 
goal: f.symm.symm = f

full_name: FirstOrder.Language.Equiv.apply_symm_apply
code: @[simp]
theorem apply_symm_apply (f : M ≃[L] N) (a : N) : f (f.symm a) = a 
goal: f (f.symm a) = a

full_name: FirstOrder.Language.Equiv.symm_apply_apply
code: @[simp]
theorem symm_apply_apply (f : M ≃[L] N) (a : M) : f.symm (f a) = a 
goal: f.symm (f a) = a

full_name: FirstOrder.Language.Equiv.map_fun
code: @[simp]
theorem map_fun (φ : M ≃[L] N) {n : ℕ} (f : L.Functions n) (x : Fin n → M) :
    φ (funMap f x) = funMap f (φ ∘ x) 
goal: φ (FirstOrder.Language.Structure.funMap f x) = FirstOrder.Language.Structure.funMap f (⇑φ ∘ x)

full_name: FirstOrder.Language.Equiv.map_constants
code: @[simp]
theorem map_constants (φ : M ≃[L] N) (c : L.Constants) : φ c = c 
goal: φ ↑c = ↑c

full_name: FirstOrder.Language.Equiv.map_rel
code: @[simp]
theorem map_rel (φ : M ≃[L] N) {n : ℕ} (r : L.Relations n) (x : Fin n → M) :
    RelMap r (φ ∘ x) ↔ RelMap r x 
goal: FirstOrder.Language.Structure.RelMap r (⇑φ ∘ x) ↔ FirstOrder.Language.Structure.RelMap r x

full_name: FirstOrder.Language.Equiv.toEmbedding
code: /-- A first-order equivalence is also a first-order embedding. -/
def toEmbedding : (M ≃[L] N) → M ↪[L] N 
goal: L.Equiv M N → L.Embedding M N

full_name: FirstOrder.Language.Equiv.toHom
code: /-- A first-order equivalence is also a first-order homomorphism. -/
def toHom : (M ≃[L] N) → M →[L] N 
goal: L.Equiv M N → L.Hom M N

full_name: FirstOrder.Language.Equiv.toEmbedding_toHom
code: @[simp]
theorem toEmbedding_toHom (f : M ≃[L] N) : f.toEmbedding.toHom = f.toHom 
goal: f.toEmbedding.toHom = f.toHom

full_name: FirstOrder.Language.Equiv.coe_toHom
code: @[simp]
theorem coe_toHom {f : M ≃[L] N} : (f.toHom : M → N) = (f : M → N) 
goal: ⇑f.toHom = ⇑f

full_name: FirstOrder.Language.Equiv.coe_toEmbedding
code: @[simp]
theorem coe_toEmbedding (f : M ≃[L] N) : (f.toEmbedding : M → N) = (f : M → N) 
goal: ⇑f.toEmbedding = ⇑f

full_name: FirstOrder.Language.Equiv.injective_toEmbedding
code: theorem injective_toEmbedding : Function.Injective (toEmbedding : (M ≃[L] N) → M ↪[L] N) 
goal: Function.Injective FirstOrder.Language.Equiv.toEmbedding

full_name: FirstOrder.Language.Equiv.coe_injective
code: theorem coe_injective : @Function.Injective (M ≃[L] N) (M → N) (↑) 
goal: Function.Injective DFunLike.coe

full_name: FirstOrder.Language.Equiv.ext
code: @[ext]
theorem ext ⦃f g : M ≃[L] N⦄ (h : ∀ x, f x = g x) : f = g 
goal: f = g

full_name: FirstOrder.Language.Equiv.ext_iff
code: theorem ext_iff {f g : M ≃[L] N} : f = g ↔ ∀ x, f x = g x 
goal: f = g ↔ ∀ (x : M), f x = g x

full_name: FirstOrder.Language.Equiv.bijective
code: theorem bijective (f : M ≃[L] N) : Function.Bijective f 
goal: Function.Bijective ⇑f

full_name: FirstOrder.Language.Equiv.injective
code: theorem injective (f : M ≃[L] N) : Function.Injective f 
goal: Function.Injective ⇑f

full_name: FirstOrder.Language.Equiv.surjective
code: theorem surjective (f : M ≃[L] N) : Function.Surjective f 
goal: Function.Surjective ⇑f

full_name: FirstOrder.Language.Equiv.refl
code: /-- The identity equivalence from a structure to itself. -/
@[refl]
def refl : M ≃[L] M 
goal: L.Equiv M M

full_name: FirstOrder.Language.Equiv.instInhabited
code: instance : Inhabited (M ≃[L] M) 
goal: Inhabited (L.Equiv M M)

full_name: FirstOrder.Language.Equiv.refl_apply
code: @[simp]
theorem refl_apply (x : M) : refl L M x = x 
goal: (FirstOrder.Language.Equiv.refl L M) x = x

full_name: FirstOrder.Language.Equiv.comp
code: /-- Composition of first-order equivalences. -/
@[trans]
def comp (hnp : N ≃[L] P) (hmn : M ≃[L] N) : M ≃[L] P 
goal: L.Equiv M P

full_name: FirstOrder.Language.Equiv.comp_apply
code: @[simp]
theorem comp_apply (g : N ≃[L] P) (f : M ≃[L] N) (x : M) : g.comp f x = g (f x) 
goal: (g.comp f) x = g (f x)

full_name: FirstOrder.Language.Equiv.comp_refl
code: @[simp]
theorem comp_refl (g : M ≃[L] N) : g.comp (refl L M) = g 
goal: g.comp (FirstOrder.Language.Equiv.refl L M) = g

full_name: FirstOrder.Language.Equiv.refl_comp
code: @[simp]
theorem refl_comp (g : M ≃[L] N) : (refl L N).comp g = g 
goal: (FirstOrder.Language.Equiv.refl L N).comp g = g

full_name: FirstOrder.Language.Equiv.refl_toEmbedding
code: @[simp]
theorem refl_toEmbedding : (refl L M).toEmbedding = Embedding.refl L M 
goal: (FirstOrder.Language.Equiv.refl L M).toEmbedding = FirstOrder.Language.Embedding.refl L M

full_name: FirstOrder.Language.Equiv.refl_toHom
code: @[simp]
theorem refl_toHom : (refl L M).toHom = Hom.id L M 
goal: (FirstOrder.Language.Equiv.refl L M).toHom = FirstOrder.Language.Hom.id L M

full_name: FirstOrder.Language.Equiv.comp_assoc
code: /-- Composition of first-order homomorphisms is associative. -/
theorem comp_assoc (f : M ≃[L] N) (g : N ≃[L] P) (h : P ≃[L] Q) :
    (h.comp g).comp f = h.comp (g.comp f) 
goal: (h.comp g).comp f = h.comp (g.comp f)

full_name: FirstOrder.Language.Equiv.injective_comp
code: theorem injective_comp (h : N ≃[L] P) :
    Function.Injective (h.comp : (M ≃[L] N) →  (M ≃[L] P)) 
goal: Function.Injective h.comp

full_name: FirstOrder.Language.Equiv.comp_toHom
code: @[simp]
theorem comp_toHom (hnp : N ≃[L] P) (hmn : M ≃[L] N) :
    (hnp.comp hmn).toHom = hnp.toHom.comp hmn.toHom 
goal: (hnp.comp hmn).toHom = hnp.toHom.comp hmn.toHom

full_name: FirstOrder.Language.Equiv.comp_toEmbedding
code: @[simp]
theorem comp_toEmbedding (hnp : N ≃[L] P) (hmn : M ≃[L] N) :
    (hnp.comp hmn).toEmbedding = hnp.toEmbedding.comp hmn.toEmbedding 
goal: (hnp.comp hmn).toEmbedding = hnp.toEmbedding.comp hmn.toEmbedding

full_name: FirstOrder.Language.Equiv.self_comp_symm
code: @[simp]
theorem self_comp_symm (f : M ≃[L] N) : f.comp f.symm = refl L N 
goal: f.comp f.symm = FirstOrder.Language.Equiv.refl L N

full_name: FirstOrder.Language.Equiv.symm_comp_self
code: @[simp]
theorem symm_comp_self (f : M ≃[L] N) : f.symm.comp f = refl L M 
goal: f.symm.comp f = FirstOrder.Language.Equiv.refl L M

full_name: FirstOrder.Language.Equiv.symm_comp_self_toEmbedding
code: @[simp]
theorem symm_comp_self_toEmbedding (f : M ≃[L] N) :
    f.symm.toEmbedding.comp f.toEmbedding = Embedding.refl L M 
goal: f.symm.toEmbedding.comp f.toEmbedding = FirstOrder.Language.Embedding.refl L M

full_name: FirstOrder.Language.Equiv.self_comp_symm_toEmbedding
code: @[simp]
theorem self_comp_symm_toEmbedding (f : M ≃[L] N) :
    f.toEmbedding.comp f.symm.toEmbedding = Embedding.refl L N 
goal: f.toEmbedding.comp f.symm.toEmbedding = FirstOrder.Language.Embedding.refl L N

full_name: FirstOrder.Language.Equiv.symm_comp_self_toHom
code: @[simp]
theorem symm_comp_self_toHom (f : M ≃[L] N) :
    f.symm.toHom.comp f.toHom = Hom.id L M 
goal: f.symm.toHom.comp f.toHom = FirstOrder.Language.Hom.id L M

full_name: FirstOrder.Language.Equiv.self_comp_symm_toHom
code: @[simp]
theorem self_comp_symm_toHom (f : M ≃[L] N) :
    f.toHom.comp f.symm.toHom = Hom.id L N 
goal: f.toHom.comp f.symm.toHom = FirstOrder.Language.Hom.id L N

full_name: FirstOrder.Language.Equiv.comp_symm
code: @[simp]
theorem comp_symm (f : M ≃[L] N) (g : N ≃[L] P) : (g.comp f).symm = f.symm.comp g.symm 
goal: (g.comp f).symm = f.symm.comp g.symm

full_name: FirstOrder.Language.Equiv.comp_right_injective
code: theorem comp_right_injective (h : M ≃[L] N) :
    Function.Injective (fun f ↦ f.comp h : (N ≃[L] P) → (M ≃[L] P)) 
goal: Function.Injective fun f => f.comp h

full_name: FirstOrder.Language.Equiv.comp_right_inj
code: @[simp]
theorem comp_right_inj (h : M ≃[L] N) (f g : N ≃[L] P) : f.comp h = g.comp h ↔ f = g 
goal: f.comp h = g.comp h ↔ f = g

full_name: FirstOrder.Language.StrongHomClass.toEquiv
code: /-- Any element of a bijective `StrongHomClass` can be realized as a first_order isomorphism. -/
def StrongHomClass.toEquiv {F M N} [L.Structure M] [L.Structure N] [EquivLike F M N]
    [StrongHomClass L F M N] : F → M ≃[L] N 
goal: F → L.Equiv M N

full_name: FirstOrder.Language.sumStructure
code: instance sumStructure : (L₁.sum L₂).Structure S 
goal: (L₁.sum L₂).Structure S

full_name: FirstOrder.Language.funMap_sum_inl
code: @[simp]
theorem funMap_sum_inl {n : ℕ} (f : L₁.Functions n) :
    @funMap (L₁.sum L₂) S _ n (Sum.inl f) = funMap f 
goal: FirstOrder.Language.Structure.funMap (Sum.inl f) = FirstOrder.Language.Structure.funMap f

full_name: FirstOrder.Language.funMap_sum_inr
code: @[simp]
theorem funMap_sum_inr {n : ℕ} (f : L₂.Functions n) :
    @funMap (L₁.sum L₂) S _ n (Sum.inr f) = funMap f 
goal: FirstOrder.Language.Structure.funMap (Sum.inr f) = FirstOrder.Language.Structure.funMap f

full_name: FirstOrder.Language.relMap_sum_inl
code: @[simp]
theorem relMap_sum_inl {n : ℕ} (R : L₁.Relations n) :
    @RelMap (L₁.sum L₂) S _ n (Sum.inl R) = RelMap R 
goal: FirstOrder.Language.Structure.RelMap (Sum.inl R) = FirstOrder.Language.Structure.RelMap R

full_name: FirstOrder.Language.relMap_sum_inr
code: @[simp]
theorem relMap_sum_inr {n : ℕ} (R : L₂.Relations n) :
    @RelMap (L₁.sum L₂) S _ n (Sum.inr R) = RelMap R 
goal: FirstOrder.Language.Structure.RelMap (Sum.inr R) = FirstOrder.Language.Structure.RelMap R

full_name: FirstOrder.Language.empty.nonempty_embedding_iff
code: @[simp]
theorem empty.nonempty_embedding_iff :
    Nonempty (M ↪[Language.empty] N) ↔ Cardinal.lift.{w'} #M ≤ Cardinal.lift.{w} #N 
goal: Nonempty (FirstOrder.Language.empty.Embedding M N) ↔ Cardinal.lift.{w', w} #M ≤ Cardinal.lift.{w, w'} #N

full_name: FirstOrder.Language.empty.nonempty_equiv_iff
code: @[simp]
theorem empty.nonempty_equiv_iff :
    Nonempty (M ≃[Language.empty] N) ↔ Cardinal.lift.{w'} #M = Cardinal.lift.{w} #N 
goal: Nonempty (FirstOrder.Language.empty.Equiv M N) ↔ Cardinal.lift.{w', w} #M = Cardinal.lift.{w, w'} #N

full_name: FirstOrder.Language.emptyStructure
code: instance emptyStructure : Language.empty.Structure M 
goal: FirstOrder.Language.empty.Structure M

full_name: FirstOrder.Language.instUniqueStructureEmpty
code: instance : Unique (Language.empty.Structure M) 
goal: Unique (FirstOrder.Language.empty.Structure M)

full_name: FirstOrder.Language.strongHomClassEmpty
code: instance (priority := 100) strongHomClassEmpty {F M N} [FunLike F M N] :
    StrongHomClass Language.empty F M N 
goal: FirstOrder.Language.empty.StrongHomClass F M N

full_name: Function.emptyHom
code: /-- Makes a `Language.empty.Hom` out of any function. -/
@[simps]
def _root_.Function.emptyHom (f : M → N) : M →[Language.empty] N 
goal: FirstOrder.Language.empty.Hom M N

full_name: Function.emptyHom_toFun
code: /-- Makes a `Language.empty.Hom` out of any function. -/
@[simps]
def _root_.Function.emptyHom (f : M → N) : M →[Language.empty] N 
goal: ∀ (a : M), (Function.emptyHom f) a = f a

full_name: Embedding.empty
code: /-- Makes a `Language.empty.Embedding` out of any function. -/
--@[simps] Porting note: commented out and lemmas added manually
def _root_.Embedding.empty (f : M ↪ N) : M ↪[Language.empty] N 
goal: FirstOrder.Language.empty.Embedding M N

full_name: FirstOrder.Language.toFun_embedding_empty
code: @[simp]
theorem toFun_embedding_empty (f : M ↪ N) : (Embedding.empty f : M → N) = f 
goal: ⇑(Embedding.empty f) = ⇑f

full_name: FirstOrder.Language.toEmbedding_embedding_empty
code: @[simp]
theorem toEmbedding_embedding_empty (f : M ↪ N) : (Embedding.empty f).toEmbedding = f 
goal: (Embedding.empty f).toEmbedding = f

full_name: Equiv.empty
code: /-- Makes a `Language.empty.Equiv` out of any function. -/
--@[simps] Porting note: commented out and lemmas added manually
def _root_.Equiv.empty (f : M ≃ N) : M ≃[Language.empty] N 
goal: FirstOrder.Language.empty.Equiv M N

full_name: FirstOrder.Language.toFun_equiv_empty
code: @[simp]
theorem toFun_equiv_empty (f : M ≃ N) : (Equiv.empty f : M → N) = f 
goal: ⇑f.empty = ⇑f

full_name: FirstOrder.Language.toEquiv_equiv_empty
code: @[simp]
theorem toEquiv_equiv_empty (f : M ≃ N) : (Equiv.empty f).toEquiv = f 
goal: f.empty.toEquiv = f

full_name: Equiv.inducedStructure_funMap
code: /-- A structure induced by a bijection. -/
@[simps!]
def inducedStructure (e : M ≃ N) : L.Structure N 
goal: ∀ {n : ℕ} (f : L.Functions n) (x : Fin n → N),
  FirstOrder.Language.Structure.funMap f x = e (FirstOrder.Language.Structure.funMap f (⇑e.symm ∘ x))

full_name: Equiv.inducedStructure_RelMap
code: /-- A structure induced by a bijection. -/
@[simps!]
def inducedStructure (e : M ≃ N) : L.Structure N 
goal: ∀ {n : ℕ} (r : L.Relations n) (x : Fin n → N),
  FirstOrder.Language.Structure.RelMap r x = FirstOrder.Language.Structure.RelMap r (⇑e.symm ∘ x)

full_name: Equiv.inducedStructure
code: /-- A structure induced by a bijection. -/
@[simps!]
def inducedStructure (e : M ≃ N) : L.Structure N 
goal: L.Structure N

full_name: Equiv.inducedStructureEquiv
code: /-- A bijection as a first-order isomorphism with the induced structure on the codomain. -/
--@[simps!] Porting note: commented out and lemmas added manually
def inducedStructureEquiv (e : M ≃ N) : @Language.Equiv L M N _ (inducedStructure e) 
goal: L.Equiv M N

full_name: Equiv.toEquiv_inducedStructureEquiv
code: @[simp]
theorem toEquiv_inducedStructureEquiv (e : M ≃ N) :
    @Language.Equiv.toEquiv L M N _ (inducedStructure e) (inducedStructureEquiv e) = e 
goal: e.inducedStructureEquiv.toEquiv = e

full_name: Equiv.toFun_inducedStructureEquiv
code: @[simp]
theorem toFun_inducedStructureEquiv (e : M ≃ N) :
    DFunLike.coe (@inducedStructureEquiv L M N _ e) = e 
goal: ⇑e.inducedStructureEquiv = ⇑e

full_name: Equiv.toFun_inducedStructureEquiv_Symm
code: @[simp]
theorem toFun_inducedStructureEquiv_Symm (e : M ≃ N) :
    (by
    letI : L.Structure N := inducedStructure e
    exact DFunLike.coe (@inducedStructureEquiv L M N _ e).symm) = (e.symm : N → M) 
goal: ⇑e.inducedStructureEquiv.symm = ⇑e.symm