l3lab/ntp-mathlib huggingface dataset:
theorem map_sup [SemilatticeInf β] (hf : AntitoneOn f s) (hx : x ∈ s) (hy : y ∈ s) :
    f (x ⊔ y) = f x ⊓ f y := by
  cases le_total x y <;> have := hf ?_ ?_ ‹_› <;>
    first
    | 

Proof state:
case inr.refine_1
α : Type u
β : Type v
f : α → β
s : Set α
x y : α
inst✝¹ : LinearOrder α
inst✝ : SemilatticeInf β
hf : AntitoneOn f s
hx : x ∈ s
hy : y ∈ s
h✝ : y ≤ x
⊢ y ∈ s

Next tactic:
assumption
theorem map_sup [SemilatticeInf β] (hf : AntitoneOn f s) (hx : x ∈ s) (hy : y ∈ s) :
    f (x ⊔ y) = f x ⊓ f y := by
  cases le_total x y <;> have := hf ?_ ?_ ‹_› <;>
    

Proof state:
case inr.refine_2
α : Type u
β : Type v
f : α → β
s : Set α
x y : α
inst✝¹ : LinearOrder α
inst✝ : SemilatticeInf β
hf : AntitoneOn f s
hx : x ∈ s
hy : y ∈ s
h✝ : y ≤ x
⊢ x ∈ s

Next tactic:
first
    | assumption
    | simp only [*, sup_of_le_left, sup_of_le_right, inf_of_le_left, inf_of_le_right]
theorem map_sup [SemilatticeInf β] (hf : AntitoneOn f s) (hx : x ∈ s) (hy : y ∈ s) :
    f (x ⊔ y) = f x ⊓ f y := by
  cases le_total x y <;> have := hf ?_ ?_ ‹_› <;>
    first
    | 

Proof state:
case inr.refine_2
α : Type u
β : Type v
f : α → β
s : Set α
x y : α
inst✝¹ : LinearOrder α
inst✝ : SemilatticeInf β
hf : AntitoneOn f s
hx : x ∈ s
hy : y ∈ s
h✝ : y ≤ x
⊢ x ∈ s

Next tactic:
assumption
/-- A type endowed with `⊔` is a `SemilatticeSup`, if it admits an injective map that
preserves `⊔` to a `SemilatticeSup`.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Injective.semilatticeSup [Sup α] [SemilatticeSup β] (f : α → β)
    (hf_inj : Function.Injective f) (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) : SemilatticeSup α :=
  { PartialOrder.lift f hf_inj with
    sup := Sup.sup,
    le_sup_left := fun a b => by
      

Proof state:
α : Type u
β : Type v
inst✝¹ : Sup α
inst✝ : SemilatticeSup β
f : α → β
hf_inj : Injective f
map_sup : ∀ (a b : α), f (a ⊔ b) = f a ⊔ f b
src✝ : PartialOrder α := PartialOrder.lift f hf_inj
a b : α
⊢ a ≤ a ⊔ b

Next tactic:
change f a ≤ f (a ⊔ b)
/-- A type endowed with `⊔` is a `SemilatticeSup`, if it admits an injective map that
preserves `⊔` to a `SemilatticeSup`.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Injective.semilatticeSup [Sup α] [SemilatticeSup β] (f : α → β)
    (hf_inj : Function.Injective f) (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) : SemilatticeSup α :=
  { PartialOrder.lift f hf_inj with
    sup := Sup.sup,
    le_sup_left := fun a b => by
      change f a ≤ f (a ⊔ b)
      

Proof state:
α : Type u
β : Type v
inst✝¹ : Sup α
inst✝ : SemilatticeSup β
f : α → β
hf_inj : Injective f
map_sup : ∀ (a b : α), f (a ⊔ b) = f a ⊔ f b
src✝ : PartialOrder α := PartialOrder.lift f hf_inj
a b : α
⊢ f a ≤ f (a ⊔ b)

Next tactic:
rw [map_sup]
/-- A type endowed with `⊔` is a `SemilatticeSup`, if it admits an injective map that
preserves `⊔` to a `SemilatticeSup`.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Injective.semilatticeSup [Sup α] [SemilatticeSup β] (f : α → β)
    (hf_inj : Function.Injective f) (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) : SemilatticeSup α :=
  { PartialOrder.lift f hf_inj with
    sup := Sup.sup,
    le_sup_left := fun a b => by
      change f a ≤ f (a ⊔ b)
      rw [map_sup]
      

Proof state:
α : Type u
β : Type v
inst✝¹ : Sup α
inst✝ : SemilatticeSup β
f : α → β
hf_inj : Injective f
map_sup : ∀ (a b : α), f (a ⊔ b) = f a ⊔ f b
src✝ : PartialOrder α := PartialOrder.lift f hf_inj
a b : α
⊢ f a ≤ f a ⊔ f b

Next tactic:
exact le_sup_left
/-- A type endowed with `⊔` is a `SemilatticeSup`, if it admits an injective map that
preserves `⊔` to a `SemilatticeSup`.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Injective.semilatticeSup [Sup α] [SemilatticeSup β] (f : α → β)
    (hf_inj : Function.Injective f) (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) : SemilatticeSup α :=
  { PartialOrder.lift f hf_inj with
    sup := Sup.sup,
    le_sup_left := fun a b => by
      change f a ≤ f (a ⊔ b)
      rw [map_sup]
      exact le_sup_left,
    le_sup_right := fun a b => by
      

Proof state:
α : Type u
β : Type v
inst✝¹ : Sup α
inst✝ : SemilatticeSup β
f : α → β
hf_inj : Injective f
map_sup : ∀ (a b : α), f (a ⊔ b) = f a ⊔ f b
src✝ : PartialOrder α := PartialOrder.lift f hf_inj
a b : α
⊢ b ≤ a ⊔ b

Next tactic:
change f b ≤ f (a ⊔ b)
/-- A type endowed with `⊔` is a `SemilatticeSup`, if it admits an injective map that
preserves `⊔` to a `SemilatticeSup`.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Injective.semilatticeSup [Sup α] [SemilatticeSup β] (f : α → β)
    (hf_inj : Function.Injective f) (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) : SemilatticeSup α :=
  { PartialOrder.lift f hf_inj with
    sup := Sup.sup,
    le_sup_left := fun a b => by
      change f a ≤ f (a ⊔ b)
      rw [map_sup]
      exact le_sup_left,
    le_sup_right := fun a b => by
      change f b ≤ f (a ⊔ b)
      

Proof state:
α : Type u
β : Type v
inst✝¹ : Sup α
inst✝ : SemilatticeSup β
f : α → β
hf_inj : Injective f
map_sup : ∀ (a b : α), f (a ⊔ b) = f a ⊔ f b
src✝ : PartialOrder α := PartialOrder.lift f hf_inj
a b : α
⊢ f b ≤ f (a ⊔ b)

Next tactic:
rw [map_sup]
/-- A type endowed with `⊔` is a `SemilatticeSup`, if it admits an injective map that
preserves `⊔` to a `SemilatticeSup`.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Injective.semilatticeSup [Sup α] [SemilatticeSup β] (f : α → β)
    (hf_inj : Function.Injective f) (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) : SemilatticeSup α :=
  { PartialOrder.lift f hf_inj with
    sup := Sup.sup,
    le_sup_left := fun a b => by
      change f a ≤ f (a ⊔ b)
      rw [map_sup]
      exact le_sup_left,
    le_sup_right := fun a b => by
      change f b ≤ f (a ⊔ b)
      rw [map_sup]
      

Proof state:
α : Type u
β : Type v
inst✝¹ : Sup α
inst✝ : SemilatticeSup β
f : α → β
hf_inj : Injective f
map_sup : ∀ (a b : α), f (a ⊔ b) = f a ⊔ f b
src✝ : PartialOrder α := PartialOrder.lift f hf_inj
a b : α
⊢ f b ≤ f a ⊔ f b

Next tactic:
exact le_sup_right
/-- A type endowed with `⊔` is a `SemilatticeSup`, if it admits an injective map that
preserves `⊔` to a `SemilatticeSup`.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Injective.semilatticeSup [Sup α] [SemilatticeSup β] (f : α → β)
    (hf_inj : Function.Injective f) (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) : SemilatticeSup α :=
  { PartialOrder.lift f hf_inj with
    sup := Sup.sup,
    le_sup_left := fun a b => by
      change f a ≤ f (a ⊔ b)
      rw [map_sup]
      exact le_sup_left,
    le_sup_right := fun a b => by
      change f b ≤ f (a ⊔ b)
      rw [map_sup]
      exact le_sup_right,
    sup_le := fun a b c ha hb => by
      

Proof state:
α : Type u
β : Type v
inst✝¹ : Sup α
inst✝ : SemilatticeSup β
f : α → β
hf_inj : Injective f
map_sup : ∀ (a b : α), f (a ⊔ b) = f a ⊔ f b
src✝ : PartialOrder α := PartialOrder.lift f hf_inj
a b c : α
ha : a ≤ c
hb : b ≤ c
⊢ a ⊔ b ≤ c

Next tactic:
change f (a ⊔ b) ≤ f c
/-- A type endowed with `⊔` is a `SemilatticeSup`, if it admits an injective map that
preserves `⊔` to a `SemilatticeSup`.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Injective.semilatticeSup [Sup α] [SemilatticeSup β] (f : α → β)
    (hf_inj : Function.Injective f) (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) : SemilatticeSup α :=
  { PartialOrder.lift f hf_inj with
    sup := Sup.sup,
    le_sup_left := fun a b => by
      change f a ≤ f (a ⊔ b)
      rw [map_sup]
      exact le_sup_left,
    le_sup_right := fun a b => by
      change f b ≤ f (a ⊔ b)
      rw [map_sup]
      exact le_sup_right,
    sup_le := fun a b c ha hb => by
      change f (a ⊔ b) ≤ f c
      

Proof state:
α : Type u
β : Type v
inst✝¹ : Sup α
inst✝ : SemilatticeSup β
f : α → β
hf_inj : Injective f
map_sup : ∀ (a b : α), f (a ⊔ b) = f a ⊔ f b
src✝ : PartialOrder α := PartialOrder.lift f hf_inj
a b c : α
ha : a ≤ c
hb : b ≤ c
⊢ f (a ⊔ b) ≤ f c

Next tactic:
rw [map_sup]
/-- A type endowed with `⊔` is a `SemilatticeSup`, if it admits an injective map that
preserves `⊔` to a `SemilatticeSup`.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Injective.semilatticeSup [Sup α] [SemilatticeSup β] (f : α → β)
    (hf_inj : Function.Injective f) (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b) : SemilatticeSup α :=
  { PartialOrder.lift f hf_inj with
    sup := Sup.sup,
    le_sup_left := fun a b => by
      change f a ≤ f (a ⊔ b)
      rw [map_sup]
      exact le_sup_left,
    le_sup_right := fun a b => by
      change f b ≤ f (a ⊔ b)
      rw [map_sup]
      exact le_sup_right,
    sup_le := fun a b c ha hb => by
      change f (a ⊔ b) ≤ f c
      rw [map_sup]
      

Proof state:
α : Type u
β : Type v
inst✝¹ : Sup α
inst✝ : SemilatticeSup β
f : α → β
hf_inj : Injective f
map_sup : ∀ (a b : α), f (a ⊔ b) = f a ⊔ f b
src✝ : PartialOrder α := PartialOrder.lift f hf_inj
a b c : α
ha : a ≤ c
hb : b ≤ c
⊢ f a ⊔ f b ≤ f c

Next tactic:
exact sup_le ha hb
/-- A type endowed with `⊓` is a `SemilatticeInf`, if it admits an injective map that
preserves `⊓` to a `SemilatticeInf`.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Injective.semilatticeInf [Inf α] [SemilatticeInf β] (f : α → β)
    (hf_inj : Function.Injective f) (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b) : SemilatticeInf α :=
  { PartialOrder.lift f hf_inj with
    inf := Inf.inf,
    inf_le_left := fun a b => by
      

Proof state:
α : Type u
β : Type v
inst✝¹ : Inf α
inst✝ : SemilatticeInf β
f : α → β
hf_inj : Injective f
map_inf : ∀ (a b : α), f (a ⊓ b) = f a ⊓ f b
src✝ : PartialOrder α := PartialOrder.lift f hf_inj
a b : α
⊢ a ⊓ b ≤ a

Next tactic:
change f (a ⊓ b) ≤ f a
/-- A type endowed with `⊓` is a `SemilatticeInf`, if it admits an injective map that
preserves `⊓` to a `SemilatticeInf`.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Injective.semilatticeInf [Inf α] [SemilatticeInf β] (f : α → β)
    (hf_inj : Function.Injective f) (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b) : SemilatticeInf α :=
  { PartialOrder.lift f hf_inj with
    inf := Inf.inf,
    inf_le_left := fun a b => by
      change f (a ⊓ b) ≤ f a
      

Proof state:
α : Type u
β : Type v
inst✝¹ : Inf α
inst✝ : SemilatticeInf β
f : α → β
hf_inj : Injective f
map_inf : ∀ (a b : α), f (a ⊓ b) = f a ⊓ f b
src✝ : PartialOrder α := PartialOrder.lift f hf_inj
a b : α
⊢ f (a ⊓ b) ≤ f a

Next tactic:
rw [map_inf]
/-- A type endowed with `⊓` is a `SemilatticeInf`, if it admits an injective map that
preserves `⊓` to a `SemilatticeInf`.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Injective.semilatticeInf [Inf α] [SemilatticeInf β] (f : α → β)
    (hf_inj : Function.Injective f) (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b) : SemilatticeInf α :=
  { PartialOrder.lift f hf_inj with
    inf := Inf.inf,
    inf_le_left := fun a b => by
      change f (a ⊓ b) ≤ f a
      rw [map_inf]
      

Proof state:
α : Type u
β : Type v
inst✝¹ : Inf α
inst✝ : SemilatticeInf β
f : α → β
hf_inj : Injective f
map_inf : ∀ (a b : α), f (a ⊓ b) = f a ⊓ f b
src✝ : PartialOrder α := PartialOrder.lift f hf_inj
a b : α
⊢ f a ⊓ f b ≤ f a

Next tactic:
exact inf_le_left
/-- A type endowed with `⊓` is a `SemilatticeInf`, if it admits an injective map that
preserves `⊓` to a `SemilatticeInf`.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Injective.semilatticeInf [Inf α] [SemilatticeInf β] (f : α → β)
    (hf_inj : Function.Injective f) (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b) : SemilatticeInf α :=
  { PartialOrder.lift f hf_inj with
    inf := Inf.inf,
    inf_le_left := fun a b => by
      change f (a ⊓ b) ≤ f a
      rw [map_inf]
      exact inf_le_left,
    inf_le_right := fun a b => by
      

Proof state:
α : Type u
β : Type v
inst✝¹ : Inf α
inst✝ : SemilatticeInf β
f : α → β
hf_inj : Injective f
map_inf : ∀ (a b : α), f (a ⊓ b) = f a ⊓ f b
src✝ : PartialOrder α := PartialOrder.lift f hf_inj
a b : α
⊢ a ⊓ b ≤ b

Next tactic:
change f (a ⊓ b) ≤ f b
/-- A type endowed with `⊓` is a `SemilatticeInf`, if it admits an injective map that
preserves `⊓` to a `SemilatticeInf`.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Injective.semilatticeInf [Inf α] [SemilatticeInf β] (f : α → β)
    (hf_inj : Function.Injective f) (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b) : SemilatticeInf α :=
  { PartialOrder.lift f hf_inj with
    inf := Inf.inf,
    inf_le_left := fun a b => by
      change f (a ⊓ b) ≤ f a
      rw [map_inf]
      exact inf_le_left,
    inf_le_right := fun a b => by
      change f (a ⊓ b) ≤ f b
      

Proof state:
α : Type u
β : Type v
inst✝¹ : Inf α
inst✝ : SemilatticeInf β
f : α → β
hf_inj : Injective f
map_inf : ∀ (a b : α), f (a ⊓ b) = f a ⊓ f b
src✝ : PartialOrder α := PartialOrder.lift f hf_inj
a b : α
⊢ f (a ⊓ b) ≤ f b

Next tactic:
rw [map_inf]
/-- A type endowed with `⊓` is a `SemilatticeInf`, if it admits an injective map that
preserves `⊓` to a `SemilatticeInf`.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Injective.semilatticeInf [Inf α] [SemilatticeInf β] (f : α → β)
    (hf_inj : Function.Injective f) (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b) : SemilatticeInf α :=
  { PartialOrder.lift f hf_inj with
    inf := Inf.inf,
    inf_le_left := fun a b => by
      change f (a ⊓ b) ≤ f a
      rw [map_inf]
      exact inf_le_left,
    inf_le_right := fun a b => by
      change f (a ⊓ b) ≤ f b
      rw [map_inf]
      

Proof state:
α : Type u
β : Type v
inst✝¹ : Inf α
inst✝ : SemilatticeInf β
f : α → β
hf_inj : Injective f
map_inf : ∀ (a b : α), f (a ⊓ b) = f a ⊓ f b
src✝ : PartialOrder α := PartialOrder.lift f hf_inj
a b : α
⊢ f a ⊓ f b ≤ f b

Next tactic:
exact inf_le_right
/-- A type endowed with `⊓` is a `SemilatticeInf`, if it admits an injective map that
preserves `⊓` to a `SemilatticeInf`.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Injective.semilatticeInf [Inf α] [SemilatticeInf β] (f : α → β)
    (hf_inj : Function.Injective f) (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b) : SemilatticeInf α :=
  { PartialOrder.lift f hf_inj with
    inf := Inf.inf,
    inf_le_left := fun a b => by
      change f (a ⊓ b) ≤ f a
      rw [map_inf]
      exact inf_le_left,
    inf_le_right := fun a b => by
      change f (a ⊓ b) ≤ f b
      rw [map_inf]
      exact inf_le_right,
    le_inf := fun a b c ha hb => by
      

Proof state:
α : Type u
β : Type v
inst✝¹ : Inf α
inst✝ : SemilatticeInf β
f : α → β
hf_inj : Injective f
map_inf : ∀ (a b : α), f (a ⊓ b) = f a ⊓ f b
src✝ : PartialOrder α := PartialOrder.lift f hf_inj
a b c : α
ha : a ≤ b
hb : a ≤ c
⊢ a ≤ b ⊓ c

Next tactic:
change f a ≤ f (b ⊓ c)
/-- A type endowed with `⊓` is a `SemilatticeInf`, if it admits an injective map that
preserves `⊓` to a `SemilatticeInf`.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Injective.semilatticeInf [Inf α] [SemilatticeInf β] (f : α → β)
    (hf_inj : Function.Injective f) (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b) : SemilatticeInf α :=
  { PartialOrder.lift f hf_inj with
    inf := Inf.inf,
    inf_le_left := fun a b => by
      change f (a ⊓ b) ≤ f a
      rw [map_inf]
      exact inf_le_left,
    inf_le_right := fun a b => by
      change f (a ⊓ b) ≤ f b
      rw [map_inf]
      exact inf_le_right,
    le_inf := fun a b c ha hb => by
      change f a ≤ f (b ⊓ c)
      

Proof state:
α : Type u
β : Type v
inst✝¹ : Inf α
inst✝ : SemilatticeInf β
f : α → β
hf_inj : Injective f
map_inf : ∀ (a b : α), f (a ⊓ b) = f a ⊓ f b
src✝ : PartialOrder α := PartialOrder.lift f hf_inj
a b c : α
ha : a ≤ b
hb : a ≤ c
⊢ f a ≤ f (b ⊓ c)

Next tactic:
rw [map_inf]
/-- A type endowed with `⊓` is a `SemilatticeInf`, if it admits an injective map that
preserves `⊓` to a `SemilatticeInf`.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Injective.semilatticeInf [Inf α] [SemilatticeInf β] (f : α → β)
    (hf_inj : Function.Injective f) (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b) : SemilatticeInf α :=
  { PartialOrder.lift f hf_inj with
    inf := Inf.inf,
    inf_le_left := fun a b => by
      change f (a ⊓ b) ≤ f a
      rw [map_inf]
      exact inf_le_left,
    inf_le_right := fun a b => by
      change f (a ⊓ b) ≤ f b
      rw [map_inf]
      exact inf_le_right,
    le_inf := fun a b c ha hb => by
      change f a ≤ f (b ⊓ c)
      rw [map_inf]
      

Proof state:
α : Type u
β : Type v
inst✝¹ : Inf α
inst✝ : SemilatticeInf β
f : α → β
hf_inj : Injective f
map_inf : ∀ (a b : α), f (a ⊓ b) = f a ⊓ f b
src✝ : PartialOrder α := PartialOrder.lift f hf_inj
a b c : α
ha : a ≤ b
hb : a ≤ c
⊢ f a ≤ f b ⊓ f c

Next tactic:
exact le_inf ha hb
/-- A type endowed with `⊔` and `⊓` is a `DistribLattice`, if it admits an injective map that
preserves `⊔` and `⊓` to a `DistribLattice`.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Injective.distribLattice [Sup α] [Inf α] [DistribLattice β] (f : α → β)
    (hf_inj : Function.Injective f) (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b)
    (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b) :
    DistribLattice α :=
  { hf_inj.lattice f map_sup map_inf with
    le_sup_inf := fun a b c => by
      

Proof state:
α : Type u
β : Type v
inst✝² : Sup α
inst✝¹ : Inf α
inst✝ : DistribLattice β
f : α → β
hf_inj : Injective f
map_sup : ∀ (a b : α), f (a ⊔ b) = f a ⊔ f b
map_inf : ∀ (a b : α), f (a ⊓ b) = f a ⊓ f b
src✝ : Lattice α := Injective.lattice f hf_inj map_sup map_inf
a b c : α
⊢ (a ⊔ b) ⊓ (a ⊔ c) ≤ a ⊔ b ⊓ c

Next tactic:
change f ((a ⊔ b) ⊓ (a ⊔ c)) ≤ f (a ⊔ b ⊓ c)
/-- A type endowed with `⊔` and `⊓` is a `DistribLattice`, if it admits an injective map that
preserves `⊔` and `⊓` to a `DistribLattice`.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Injective.distribLattice [Sup α] [Inf α] [DistribLattice β] (f : α → β)
    (hf_inj : Function.Injective f) (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b)
    (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b) :
    DistribLattice α :=
  { hf_inj.lattice f map_sup map_inf with
    le_sup_inf := fun a b c => by
      change f ((a ⊔ b) ⊓ (a ⊔ c)) ≤ f (a ⊔ b ⊓ c)
      

Proof state:
α : Type u
β : Type v
inst✝² : Sup α
inst✝¹ : Inf α
inst✝ : DistribLattice β
f : α → β
hf_inj : Injective f
map_sup : ∀ (a b : α), f (a ⊔ b) = f a ⊔ f b
map_inf : ∀ (a b : α), f (a ⊓ b) = f a ⊓ f b
src✝ : Lattice α := Injective.lattice f hf_inj map_sup map_inf
a b c : α
⊢ f ((a ⊔ b) ⊓ (a ⊔ c)) ≤ f (a ⊔ b ⊓ c)

Next tactic:
rw [map_inf, map_sup, map_sup, map_sup, map_inf]
/-- A type endowed with `⊔` and `⊓` is a `DistribLattice`, if it admits an injective map that
preserves `⊔` and `⊓` to a `DistribLattice`.
See note [reducible non-instances]. -/
@[reducible]
protected def Function.Injective.distribLattice [Sup α] [Inf α] [DistribLattice β] (f : α → β)
    (hf_inj : Function.Injective f) (map_sup : ∀ a b, f (a ⊔ b) = f a ⊔ f b)
    (map_inf : ∀ a b, f (a ⊓ b) = f a ⊓ f b) :
    DistribLattice α :=
  { hf_inj.lattice f map_sup map_inf with
    le_sup_inf := fun a b c => by
      change f ((a ⊔ b) ⊓ (a ⊔ c)) ≤ f (a ⊔ b ⊓ c)
      rw [map_inf, map_sup, map_sup, map_sup, map_inf]
      

Proof state:
α : Type u
β : Type v
inst✝² : Sup α
inst✝¹ : Inf α
inst✝ : DistribLattice β
f : α → β
hf_inj : Injective f
map_sup : ∀ (a b : α), f (a ⊔ b) = f a ⊔ f b
map_inf : ∀ (a b : α), f (a ⊓ b) = f a ⊓ f b
src✝ : Lattice α := Injective.lattice f hf_inj map_sup map_inf
a b c : α
⊢ (f a ⊔ f b) ⊓ (f a ⊔ f c) ≤ f a ⊔ f b ⊓ f c

Next tactic:
exact le_sup_inf
theorem map_rename (f : R →+* S) (g : σ → τ) (p : MvPolynomial σ R) :
    map f (rename g p) = rename g (map f p) := by
  

Proof state:
σ : Type u_1
τ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
f : R →+* S
g : σ → τ
p : MvPolynomial σ R
⊢ (map f) ((rename g) p) = (rename g) ((map f) p)

Next tactic:
apply MvPolynomial.induction_on p
    (fun a => by simp only [map_C, rename_C])
    (fun p q hp hq => by simp only [hp, hq, AlgHom.map_add, RingHom.map_add]) fun p n hp => by
    simp only [hp, rename_X, map_X, RingHom.map_mul, AlgHom.map_mul]
theorem map_rename (f : R →+* S) (g : σ → τ) (p : MvPolynomial σ R) :
    map f (rename g p) = rename g (map f p) := by
  apply MvPolynomial.induction_on p
    (fun a => by 

Proof state:
σ : Type u_1
τ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
f : R →+* S
g : σ → τ
p : MvPolynomial σ R
a : R
⊢ (map f) ((rename g) (C a)) = (rename g) ((map f) (C a))

Next tactic:
simp only [map_C, rename_C]
theorem map_rename (f : R →+* S) (g : σ → τ) (p : MvPolynomial σ R) :
    map f (rename g p) = rename g (map f p) := by
  apply MvPolynomial.induction_on p
    (fun a => by simp only [map_C, rename_C])
    (fun p q hp hq => by 

Proof state:
σ : Type u_1
τ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
f : R →+* S
g : σ → τ
p✝ p q : MvPolynomial σ R
hp : (map f) ((rename g) p) = (rename g) ((map f) p)
hq : (map f) ((rename g) q) = (rename g) ((map f) q)
⊢ (map f) ((rename g) (p + q)) = (rename g) ((map f) (p + q))

Next tactic:
simp only [hp, hq, AlgHom.map_add, RingHom.map_add]
theorem map_rename (f : R →+* S) (g : σ → τ) (p : MvPolynomial σ R) :
    map f (rename g p) = rename g (map f p) := by
  apply MvPolynomial.induction_on p
    (fun a => by simp only [map_C, rename_C])
    (fun p q hp hq => by simp only [hp, hq, AlgHom.map_add, RingHom.map_add]) fun p n hp => by
    

Proof state:
σ : Type u_1
τ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
f : R →+* S
g : σ → τ
p✝ p : MvPolynomial σ R
n : σ
hp : (map f) ((rename g) p) = (rename g) ((map f) p)
⊢ (map f) ((rename g) (p * X n)) = (rename g) ((map f) (p * X n))

Next tactic:
simp only [hp, rename_X, map_X, RingHom.map_mul, AlgHom.map_mul]
@[simp]
theorem rename_rename (f : σ → τ) (g : τ → α) (p : MvPolynomial σ R) :
    rename g (rename f p) = rename (g ∘ f) p :=
  show rename g (eval₂ C (X ∘ f) p) = _ by
    

Proof state:
σ : Type u_1
τ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
f : σ → τ
g : τ → α
p : MvPolynomial σ R
⊢ (rename g) (eval₂ C (X ∘ f) p) = (rename (g ∘ f)) p

Next tactic:
simp only [rename, aeval_eq_eval₂Hom]
@[simp]
theorem rename_rename (f : σ → τ) (g : τ → α) (p : MvPolynomial σ R) :
    rename g (rename f p) = rename (g ∘ f) p :=
  show rename g (eval₂ C (X ∘ f) p) = _ by
    simp only [rename, aeval_eq_eval₂Hom]
    -- porting note: the Lean 3 proof of this was very fragile and included a nonterminal `simp`.
    -- Hopefully this is less prone to breaking
    

Proof state:
σ : Type u_1
τ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
f : σ → τ
g : τ → α
p : MvPolynomial σ R
⊢ (eval₂Hom (algebraMap R (MvPolynomial α R)) (X ∘ g)) (eval₂ C (X ∘ f) p) =
    (eval₂Hom (algebraMap R (MvPolynomial α R)) (X ∘ g ∘ f)) p

Next tactic:
rw [eval₂_comp_left (eval₂Hom (algebraMap R (MvPolynomial α R)) (X ∘ g)) C (X ∘ f) p]
@[simp]
theorem rename_rename (f : σ → τ) (g : τ → α) (p : MvPolynomial σ R) :
    rename g (rename f p) = rename (g ∘ f) p :=
  show rename g (eval₂ C (X ∘ f) p) = _ by
    simp only [rename, aeval_eq_eval₂Hom]
    -- porting note: the Lean 3 proof of this was very fragile and included a nonterminal `simp`.
    -- Hopefully this is less prone to breaking
    rw [eval₂_comp_left (eval₂Hom (algebraMap R (MvPolynomial α R)) (X ∘ g)) C (X ∘ f) p]
    

Proof state:
σ : Type u_1
τ : Type u_2
α : Type u_3
R : Type u_4
S : Type u_5
inst✝¹ : CommSemiring R
inst✝ : CommSemiring S
f : σ → τ
g : τ → α
p : MvPolynomial σ R
⊢ eval₂ (RingHom.comp (eval₂Hom (algebraMap R (MvPolynomial α R)) (X ∘ g)) C)
      (⇑(eval₂Hom (algebraMap R (MvPolynomial α R)) (X ∘ g)) ∘ X ∘ f) p =
    (eval₂Hom (algebraMap R (MvPolynomial α R)) (X ∘ g ∘ f)) p

Next tactic:
simp only [(· ∘ ·), eval₂Hom_X']