l3lab/ntp-mathlib huggingface dataset:
/-- A version of `WithTop.map` for `MonoidWithZeroHom`s. -/
@[simps (config := .asFn)]
protected def _root_.MonoidWithZeroHom.withTopMap {R S : Type*} [MulZeroOneClass R] [DecidableEq R]
    [Nontrivial R] [MulZeroOneClass S] [DecidableEq S] [Nontrivial S] (f : R →*₀ S)
    (hf : Function.Injective f) : WithTop R →*₀ WithTop S :=
  { f.toZeroHom.withTopMap, f.toMonoidHom.toOneHom.withTopMap with
    toFun := WithTop.map f
    map_mul' := fun x y => by
      have : ∀ z, map f z = 0 ↔ z = 0 := fun z =>
        (Option.map_injective hf).eq_iff' f.toZeroHom.withTopMap.map_zero
      

Proof state:
α : Type u_1
inst✝⁶ : DecidableEq α
R : Type u_2
S : Type u_3
inst✝⁵ : MulZeroOneClass R
inst✝⁴ : DecidableEq R
inst✝³ : Nontrivial R
inst✝² : MulZeroOneClass S
inst✝¹ : DecidableEq S
inst✝ : Nontrivial S
f : R →*₀ S
hf : Function.Injective ⇑f
src✝¹ : ZeroHom (WithTop R) (WithTop S) := ZeroHom.withTopMap ↑f
src✝ : OneHom (WithTop R) (WithTop S) := OneHom.withTopMap ↑↑f
x y : WithTop R
this : ∀ (z : WithTop R), map (⇑f) z = 0 ↔ z = 0
⊢ ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } (x * y) =
    ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } x *
      ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } y

Next tactic:
rcases Decidable.eq_or_ne x 0 with (rfl | hx)
/-- A version of `WithTop.map` for `MonoidWithZeroHom`s. -/
@[simps (config := .asFn)]
protected def _root_.MonoidWithZeroHom.withTopMap {R S : Type*} [MulZeroOneClass R] [DecidableEq R]
    [Nontrivial R] [MulZeroOneClass S] [DecidableEq S] [Nontrivial S] (f : R →*₀ S)
    (hf : Function.Injective f) : WithTop R →*₀ WithTop S :=
  { f.toZeroHom.withTopMap, f.toMonoidHom.toOneHom.withTopMap with
    toFun := WithTop.map f
    map_mul' := fun x y => by
      have : ∀ z, map f z = 0 ↔ z = 0 := fun z =>
        (Option.map_injective hf).eq_iff' f.toZeroHom.withTopMap.map_zero
      rcases Decidable.eq_or_ne x 0 with (rfl | hx)
      · 

Proof state:
case inl
α : Type u_1
inst✝⁶ : DecidableEq α
R : Type u_2
S : Type u_3
inst✝⁵ : MulZeroOneClass R
inst✝⁴ : DecidableEq R
inst✝³ : Nontrivial R
inst✝² : MulZeroOneClass S
inst✝¹ : DecidableEq S
inst✝ : Nontrivial S
f : R →*₀ S
hf : Function.Injective ⇑f
src✝¹ : ZeroHom (WithTop R) (WithTop S) := ZeroHom.withTopMap ↑f
src✝ : OneHom (WithTop R) (WithTop S) := OneHom.withTopMap ↑↑f
y : WithTop R
this : ∀ (z : WithTop R), map (⇑f) z = 0 ↔ z = 0
⊢ ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } (0 * y) =
    ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } 0 *
      ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } y

Next tactic:
simp
/-- A version of `WithTop.map` for `MonoidWithZeroHom`s. -/
@[simps (config := .asFn)]
protected def _root_.MonoidWithZeroHom.withTopMap {R S : Type*} [MulZeroOneClass R] [DecidableEq R]
    [Nontrivial R] [MulZeroOneClass S] [DecidableEq S] [Nontrivial S] (f : R →*₀ S)
    (hf : Function.Injective f) : WithTop R →*₀ WithTop S :=
  { f.toZeroHom.withTopMap, f.toMonoidHom.toOneHom.withTopMap with
    toFun := WithTop.map f
    map_mul' := fun x y => by
      have : ∀ z, map f z = 0 ↔ z = 0 := fun z =>
        (Option.map_injective hf).eq_iff' f.toZeroHom.withTopMap.map_zero
      rcases Decidable.eq_or_ne x 0 with (rfl | hx)
      · simp
      

Proof state:
case inr
α : Type u_1
inst✝⁶ : DecidableEq α
R : Type u_2
S : Type u_3
inst✝⁵ : MulZeroOneClass R
inst✝⁴ : DecidableEq R
inst✝³ : Nontrivial R
inst✝² : MulZeroOneClass S
inst✝¹ : DecidableEq S
inst✝ : Nontrivial S
f : R →*₀ S
hf : Function.Injective ⇑f
src✝¹ : ZeroHom (WithTop R) (WithTop S) := ZeroHom.withTopMap ↑f
src✝ : OneHom (WithTop R) (WithTop S) := OneHom.withTopMap ↑↑f
x y : WithTop R
this : ∀ (z : WithTop R), map (⇑f) z = 0 ↔ z = 0
hx : x ≠ 0
⊢ ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } (x * y) =
    ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } x *
      ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } y

Next tactic:
rcases Decidable.eq_or_ne y 0 with (rfl | hy)
/-- A version of `WithTop.map` for `MonoidWithZeroHom`s. -/
@[simps (config := .asFn)]
protected def _root_.MonoidWithZeroHom.withTopMap {R S : Type*} [MulZeroOneClass R] [DecidableEq R]
    [Nontrivial R] [MulZeroOneClass S] [DecidableEq S] [Nontrivial S] (f : R →*₀ S)
    (hf : Function.Injective f) : WithTop R →*₀ WithTop S :=
  { f.toZeroHom.withTopMap, f.toMonoidHom.toOneHom.withTopMap with
    toFun := WithTop.map f
    map_mul' := fun x y => by
      have : ∀ z, map f z = 0 ↔ z = 0 := fun z =>
        (Option.map_injective hf).eq_iff' f.toZeroHom.withTopMap.map_zero
      rcases Decidable.eq_or_ne x 0 with (rfl | hx)
      · simp
      rcases Decidable.eq_or_ne y 0 with (rfl | hy)
      · 

Proof state:
case inr.inl
α : Type u_1
inst✝⁶ : DecidableEq α
R : Type u_2
S : Type u_3
inst✝⁵ : MulZeroOneClass R
inst✝⁴ : DecidableEq R
inst✝³ : Nontrivial R
inst✝² : MulZeroOneClass S
inst✝¹ : DecidableEq S
inst✝ : Nontrivial S
f : R →*₀ S
hf : Function.Injective ⇑f
src✝¹ : ZeroHom (WithTop R) (WithTop S) := ZeroHom.withTopMap ↑f
src✝ : OneHom (WithTop R) (WithTop S) := OneHom.withTopMap ↑↑f
x : WithTop R
this : ∀ (z : WithTop R), map (⇑f) z = 0 ↔ z = 0
hx : x ≠ 0
⊢ ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } (x * 0) =
    ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } x *
      ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } 0

Next tactic:
simp
/-- A version of `WithTop.map` for `MonoidWithZeroHom`s. -/
@[simps (config := .asFn)]
protected def _root_.MonoidWithZeroHom.withTopMap {R S : Type*} [MulZeroOneClass R] [DecidableEq R]
    [Nontrivial R] [MulZeroOneClass S] [DecidableEq S] [Nontrivial S] (f : R →*₀ S)
    (hf : Function.Injective f) : WithTop R →*₀ WithTop S :=
  { f.toZeroHom.withTopMap, f.toMonoidHom.toOneHom.withTopMap with
    toFun := WithTop.map f
    map_mul' := fun x y => by
      have : ∀ z, map f z = 0 ↔ z = 0 := fun z =>
        (Option.map_injective hf).eq_iff' f.toZeroHom.withTopMap.map_zero
      rcases Decidable.eq_or_ne x 0 with (rfl | hx)
      · simp
      rcases Decidable.eq_or_ne y 0 with (rfl | hy)
      · simp
      

Proof state:
case inr.inr
α : Type u_1
inst✝⁶ : DecidableEq α
R : Type u_2
S : Type u_3
inst✝⁵ : MulZeroOneClass R
inst✝⁴ : DecidableEq R
inst✝³ : Nontrivial R
inst✝² : MulZeroOneClass S
inst✝¹ : DecidableEq S
inst✝ : Nontrivial S
f : R →*₀ S
hf : Function.Injective ⇑f
src✝¹ : ZeroHom (WithTop R) (WithTop S) := ZeroHom.withTopMap ↑f
src✝ : OneHom (WithTop R) (WithTop S) := OneHom.withTopMap ↑↑f
x y : WithTop R
this : ∀ (z : WithTop R), map (⇑f) z = 0 ↔ z = 0
hx : x ≠ 0
hy : y ≠ 0
⊢ ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } (x * y) =
    ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } x *
      ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } y

Next tactic:
induction' x using WithTop.recTopCoe with x
/-- A version of `WithTop.map` for `MonoidWithZeroHom`s. -/
@[simps (config := .asFn)]
protected def _root_.MonoidWithZeroHom.withTopMap {R S : Type*} [MulZeroOneClass R] [DecidableEq R]
    [Nontrivial R] [MulZeroOneClass S] [DecidableEq S] [Nontrivial S] (f : R →*₀ S)
    (hf : Function.Injective f) : WithTop R →*₀ WithTop S :=
  { f.toZeroHom.withTopMap, f.toMonoidHom.toOneHom.withTopMap with
    toFun := WithTop.map f
    map_mul' := fun x y => by
      have : ∀ z, map f z = 0 ↔ z = 0 := fun z =>
        (Option.map_injective hf).eq_iff' f.toZeroHom.withTopMap.map_zero
      rcases Decidable.eq_or_ne x 0 with (rfl | hx)
      · simp
      rcases Decidable.eq_or_ne y 0 with (rfl | hy)
      · simp
      induction' x using WithTop.recTopCoe with x
      · 

Proof state:
case inr.inr.top
α : Type u_1
inst✝⁶ : DecidableEq α
R : Type u_2
S : Type u_3
inst✝⁵ : MulZeroOneClass R
inst✝⁴ : DecidableEq R
inst✝³ : Nontrivial R
inst✝² : MulZeroOneClass S
inst✝¹ : DecidableEq S
inst✝ : Nontrivial S
f : R →*₀ S
hf : Function.Injective ⇑f
src✝¹ : ZeroHom (WithTop R) (WithTop S) := ZeroHom.withTopMap ↑f
src✝ : OneHom (WithTop R) (WithTop S) := OneHom.withTopMap ↑↑f
y : WithTop R
this : ∀ (z : WithTop R), map (⇑f) z = 0 ↔ z = 0
hy : y ≠ 0
hx : ⊤ ≠ 0
⊢ ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } (⊤ * y) =
    ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } ⊤ *
      ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } y

Next tactic:
simp [hy, this]
/-- A version of `WithTop.map` for `MonoidWithZeroHom`s. -/
@[simps (config := .asFn)]
protected def _root_.MonoidWithZeroHom.withTopMap {R S : Type*} [MulZeroOneClass R] [DecidableEq R]
    [Nontrivial R] [MulZeroOneClass S] [DecidableEq S] [Nontrivial S] (f : R →*₀ S)
    (hf : Function.Injective f) : WithTop R →*₀ WithTop S :=
  { f.toZeroHom.withTopMap, f.toMonoidHom.toOneHom.withTopMap with
    toFun := WithTop.map f
    map_mul' := fun x y => by
      have : ∀ z, map f z = 0 ↔ z = 0 := fun z =>
        (Option.map_injective hf).eq_iff' f.toZeroHom.withTopMap.map_zero
      rcases Decidable.eq_or_ne x 0 with (rfl | hx)
      · simp
      rcases Decidable.eq_or_ne y 0 with (rfl | hy)
      · simp
      induction' x using WithTop.recTopCoe with x
      · simp [hy, this]
      

Proof state:
case inr.inr.coe
α : Type u_1
inst✝⁶ : DecidableEq α
R : Type u_2
S : Type u_3
inst✝⁵ : MulZeroOneClass R
inst✝⁴ : DecidableEq R
inst✝³ : Nontrivial R
inst✝² : MulZeroOneClass S
inst✝¹ : DecidableEq S
inst✝ : Nontrivial S
f : R →*₀ S
hf : Function.Injective ⇑f
src✝¹ : ZeroHom (WithTop R) (WithTop S) := ZeroHom.withTopMap ↑f
src✝ : OneHom (WithTop R) (WithTop S) := OneHom.withTopMap ↑↑f
y : WithTop R
this : ∀ (z : WithTop R), map (⇑f) z = 0 ↔ z = 0
hy : y ≠ 0
x : R
hx : ↑x ≠ 0
⊢ ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } (↑x * y) =
    ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } ↑x *
      ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } y

Next tactic:
induction' y using WithTop.recTopCoe with y
/-- A version of `WithTop.map` for `MonoidWithZeroHom`s. -/
@[simps (config := .asFn)]
protected def _root_.MonoidWithZeroHom.withTopMap {R S : Type*} [MulZeroOneClass R] [DecidableEq R]
    [Nontrivial R] [MulZeroOneClass S] [DecidableEq S] [Nontrivial S] (f : R →*₀ S)
    (hf : Function.Injective f) : WithTop R →*₀ WithTop S :=
  { f.toZeroHom.withTopMap, f.toMonoidHom.toOneHom.withTopMap with
    toFun := WithTop.map f
    map_mul' := fun x y => by
      have : ∀ z, map f z = 0 ↔ z = 0 := fun z =>
        (Option.map_injective hf).eq_iff' f.toZeroHom.withTopMap.map_zero
      rcases Decidable.eq_or_ne x 0 with (rfl | hx)
      · simp
      rcases Decidable.eq_or_ne y 0 with (rfl | hy)
      · simp
      induction' x using WithTop.recTopCoe with x
      · simp [hy, this]
      induction' y using WithTop.recTopCoe with y
      · 

Proof state:
case inr.inr.coe.top
α : Type u_1
inst✝⁶ : DecidableEq α
R : Type u_2
S : Type u_3
inst✝⁵ : MulZeroOneClass R
inst✝⁴ : DecidableEq R
inst✝³ : Nontrivial R
inst✝² : MulZeroOneClass S
inst✝¹ : DecidableEq S
inst✝ : Nontrivial S
f : R →*₀ S
hf : Function.Injective ⇑f
src✝¹ : ZeroHom (WithTop R) (WithTop S) := ZeroHom.withTopMap ↑f
src✝ : OneHom (WithTop R) (WithTop S) := OneHom.withTopMap ↑↑f
this : ∀ (z : WithTop R), map (⇑f) z = 0 ↔ z = 0
x : R
hx : ↑x ≠ 0
hy : ⊤ ≠ 0
⊢ ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } (↑x * ⊤) =
    ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } ↑x *
      ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } ⊤

Next tactic:
have : (f x : WithTop S) ≠ 0 := by simpa [hf.eq_iff' (map_zero f)] using hx
/-- A version of `WithTop.map` for `MonoidWithZeroHom`s. -/
@[simps (config := .asFn)]
protected def _root_.MonoidWithZeroHom.withTopMap {R S : Type*} [MulZeroOneClass R] [DecidableEq R]
    [Nontrivial R] [MulZeroOneClass S] [DecidableEq S] [Nontrivial S] (f : R →*₀ S)
    (hf : Function.Injective f) : WithTop R →*₀ WithTop S :=
  { f.toZeroHom.withTopMap, f.toMonoidHom.toOneHom.withTopMap with
    toFun := WithTop.map f
    map_mul' := fun x y => by
      have : ∀ z, map f z = 0 ↔ z = 0 := fun z =>
        (Option.map_injective hf).eq_iff' f.toZeroHom.withTopMap.map_zero
      rcases Decidable.eq_or_ne x 0 with (rfl | hx)
      · simp
      rcases Decidable.eq_or_ne y 0 with (rfl | hy)
      · simp
      induction' x using WithTop.recTopCoe with x
      · simp [hy, this]
      induction' y using WithTop.recTopCoe with y
      · have : (f x : WithTop S) ≠ 0 := by 

Proof state:
α : Type u_1
inst✝⁶ : DecidableEq α
R : Type u_2
S : Type u_3
inst✝⁵ : MulZeroOneClass R
inst✝⁴ : DecidableEq R
inst✝³ : Nontrivial R
inst✝² : MulZeroOneClass S
inst✝¹ : DecidableEq S
inst✝ : Nontrivial S
f : R →*₀ S
hf : Function.Injective ⇑f
src✝¹ : ZeroHom (WithTop R) (WithTop S) := ZeroHom.withTopMap ↑f
src✝ : OneHom (WithTop R) (WithTop S) := OneHom.withTopMap ↑↑f
this : ∀ (z : WithTop R), map (⇑f) z = 0 ↔ z = 0
x : R
hx : ↑x ≠ 0
hy : ⊤ ≠ 0
⊢ ↑(f x) ≠ 0

Next tactic:
simpa [hf.eq_iff' (map_zero f)] using hx
/-- A version of `WithTop.map` for `MonoidWithZeroHom`s. -/
@[simps (config := .asFn)]
protected def _root_.MonoidWithZeroHom.withTopMap {R S : Type*} [MulZeroOneClass R] [DecidableEq R]
    [Nontrivial R] [MulZeroOneClass S] [DecidableEq S] [Nontrivial S] (f : R →*₀ S)
    (hf : Function.Injective f) : WithTop R →*₀ WithTop S :=
  { f.toZeroHom.withTopMap, f.toMonoidHom.toOneHom.withTopMap with
    toFun := WithTop.map f
    map_mul' := fun x y => by
      have : ∀ z, map f z = 0 ↔ z = 0 := fun z =>
        (Option.map_injective hf).eq_iff' f.toZeroHom.withTopMap.map_zero
      rcases Decidable.eq_or_ne x 0 with (rfl | hx)
      · simp
      rcases Decidable.eq_or_ne y 0 with (rfl | hy)
      · simp
      induction' x using WithTop.recTopCoe with x
      · simp [hy, this]
      induction' y using WithTop.recTopCoe with y
      · have : (f x : WithTop S) ≠ 0 := by simpa [hf.eq_iff' (map_zero f)] using hx
        

Proof state:
case inr.inr.coe.top
α : Type u_1
inst✝⁶ : DecidableEq α
R : Type u_2
S : Type u_3
inst✝⁵ : MulZeroOneClass R
inst✝⁴ : DecidableEq R
inst✝³ : Nontrivial R
inst✝² : MulZeroOneClass S
inst✝¹ : DecidableEq S
inst✝ : Nontrivial S
f : R →*₀ S
hf : Function.Injective ⇑f
src✝¹ : ZeroHom (WithTop R) (WithTop S) := ZeroHom.withTopMap ↑f
src✝ : OneHom (WithTop R) (WithTop S) := OneHom.withTopMap ↑↑f
this✝ : ∀ (z : WithTop R), map (⇑f) z = 0 ↔ z = 0
x : R
hx : ↑x ≠ 0
hy : ⊤ ≠ 0
this : ↑(f x) ≠ 0
⊢ ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } (↑x * ⊤) =
    ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } ↑x *
      ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } ⊤

Next tactic:
simp [mul_top hx, mul_top this]
/-- A version of `WithTop.map` for `MonoidWithZeroHom`s. -/
@[simps (config := .asFn)]
protected def _root_.MonoidWithZeroHom.withTopMap {R S : Type*} [MulZeroOneClass R] [DecidableEq R]
    [Nontrivial R] [MulZeroOneClass S] [DecidableEq S] [Nontrivial S] (f : R →*₀ S)
    (hf : Function.Injective f) : WithTop R →*₀ WithTop S :=
  { f.toZeroHom.withTopMap, f.toMonoidHom.toOneHom.withTopMap with
    toFun := WithTop.map f
    map_mul' := fun x y => by
      have : ∀ z, map f z = 0 ↔ z = 0 := fun z =>
        (Option.map_injective hf).eq_iff' f.toZeroHom.withTopMap.map_zero
      rcases Decidable.eq_or_ne x 0 with (rfl | hx)
      · simp
      rcases Decidable.eq_or_ne y 0 with (rfl | hy)
      · simp
      induction' x using WithTop.recTopCoe with x
      · simp [hy, this]
      induction' y using WithTop.recTopCoe with y
      · have : (f x : WithTop S) ≠ 0 := by simpa [hf.eq_iff' (map_zero f)] using hx
        simp [mul_top hx, mul_top this]
      · -- porting note: todo: `simp [← coe_mul]` times out
        

Proof state:
case inr.inr.coe.coe
α : Type u_1
inst✝⁶ : DecidableEq α
R : Type u_2
S : Type u_3
inst✝⁵ : MulZeroOneClass R
inst✝⁴ : DecidableEq R
inst✝³ : Nontrivial R
inst✝² : MulZeroOneClass S
inst✝¹ : DecidableEq S
inst✝ : Nontrivial S
f : R →*₀ S
hf : Function.Injective ⇑f
src✝¹ : ZeroHom (WithTop R) (WithTop S) := ZeroHom.withTopMap ↑f
src✝ : OneHom (WithTop R) (WithTop S) := OneHom.withTopMap ↑↑f
this : ∀ (z : WithTop R), map (⇑f) z = 0 ↔ z = 0
x : R
hx : ↑x ≠ 0
y : R
hy : ↑y ≠ 0
⊢ ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } (↑x * ↑y) =
    ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } ↑x *
      ZeroHom.toFun { toFun := map ⇑f, map_zero' := (_ : ZeroHom.toFun src✝¹ 0 = 0) } ↑y

Next tactic:
simp only [map_coe, ← coe_mul, map_mul]
instance instSemigroupWithZeroWithTop [SemigroupWithZero α] [NoZeroDivisors α] :
    SemigroupWithZero (WithTop α) :=
  { WithTop.instMulZeroClassWithTop with
    mul_assoc := fun a b c => by
      

Proof state:
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : SemigroupWithZero α
inst✝ : NoZeroDivisors α
src✝ : MulZeroClass (WithTop α) := instMulZeroClassWithTop
a b c : WithTop α
⊢ a * b * c = a * (b * c)

Next tactic:
rcases eq_or_ne a 0 with (rfl | ha)
instance instSemigroupWithZeroWithTop [SemigroupWithZero α] [NoZeroDivisors α] :
    SemigroupWithZero (WithTop α) :=
  { WithTop.instMulZeroClassWithTop with
    mul_assoc := fun a b c => by
      rcases eq_or_ne a 0 with (rfl | ha); · 

Proof state:
case inl
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : SemigroupWithZero α
inst✝ : NoZeroDivisors α
src✝ : MulZeroClass (WithTop α) := instMulZeroClassWithTop
b c : WithTop α
⊢ 0 * b * c = 0 * (b * c)

Next tactic:
simp only [zero_mul]
instance instSemigroupWithZeroWithTop [SemigroupWithZero α] [NoZeroDivisors α] :
    SemigroupWithZero (WithTop α) :=
  { WithTop.instMulZeroClassWithTop with
    mul_assoc := fun a b c => by
      rcases eq_or_ne a 0 with (rfl | ha); · simp only [zero_mul]
      

Proof state:
case inr
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : SemigroupWithZero α
inst✝ : NoZeroDivisors α
src✝ : MulZeroClass (WithTop α) := instMulZeroClassWithTop
a b c : WithTop α
ha : a ≠ 0
⊢ a * b * c = a * (b * c)

Next tactic:
rcases eq_or_ne b 0 with (rfl | hb)
instance instSemigroupWithZeroWithTop [SemigroupWithZero α] [NoZeroDivisors α] :
    SemigroupWithZero (WithTop α) :=
  { WithTop.instMulZeroClassWithTop with
    mul_assoc := fun a b c => by
      rcases eq_or_ne a 0 with (rfl | ha); · simp only [zero_mul]
      rcases eq_or_ne b 0 with (rfl | hb); · 

Proof state:
case inr.inl
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : SemigroupWithZero α
inst✝ : NoZeroDivisors α
src✝ : MulZeroClass (WithTop α) := instMulZeroClassWithTop
a c : WithTop α
ha : a ≠ 0
⊢ a * 0 * c = a * (0 * c)

Next tactic:
simp only [zero_mul, mul_zero]
instance instSemigroupWithZeroWithTop [SemigroupWithZero α] [NoZeroDivisors α] :
    SemigroupWithZero (WithTop α) :=
  { WithTop.instMulZeroClassWithTop with
    mul_assoc := fun a b c => by
      rcases eq_or_ne a 0 with (rfl | ha); · simp only [zero_mul]
      rcases eq_or_ne b 0 with (rfl | hb); · simp only [zero_mul, mul_zero]
      

Proof state:
case inr.inr
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : SemigroupWithZero α
inst✝ : NoZeroDivisors α
src✝ : MulZeroClass (WithTop α) := instMulZeroClassWithTop
a b c : WithTop α
ha : a ≠ 0
hb : b ≠ 0
⊢ a * b * c = a * (b * c)

Next tactic:
rcases eq_or_ne c 0 with (rfl | hc)
instance instSemigroupWithZeroWithTop [SemigroupWithZero α] [NoZeroDivisors α] :
    SemigroupWithZero (WithTop α) :=
  { WithTop.instMulZeroClassWithTop with
    mul_assoc := fun a b c => by
      rcases eq_or_ne a 0 with (rfl | ha); · simp only [zero_mul]
      rcases eq_or_ne b 0 with (rfl | hb); · simp only [zero_mul, mul_zero]
      rcases eq_or_ne c 0 with (rfl | hc); · 

Proof state:
case inr.inr.inl
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : SemigroupWithZero α
inst✝ : NoZeroDivisors α
src✝ : MulZeroClass (WithTop α) := instMulZeroClassWithTop
a b : WithTop α
ha : a ≠ 0
hb : b ≠ 0
⊢ a * b * 0 = a * (b * 0)

Next tactic:
simp only [mul_zero]
instance instSemigroupWithZeroWithTop [SemigroupWithZero α] [NoZeroDivisors α] :
    SemigroupWithZero (WithTop α) :=
  { WithTop.instMulZeroClassWithTop with
    mul_assoc := fun a b c => by
      rcases eq_or_ne a 0 with (rfl | ha); · simp only [zero_mul]
      rcases eq_or_ne b 0 with (rfl | hb); · simp only [zero_mul, mul_zero]
      rcases eq_or_ne c 0 with (rfl | hc); · simp only [mul_zero]
    -- Porting note: below needed to be rewritten due to changed `simp` behaviour for `coe`
      

Proof state:
case inr.inr.inr
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : SemigroupWithZero α
inst✝ : NoZeroDivisors α
src✝ : MulZeroClass (WithTop α) := instMulZeroClassWithTop
a b c : WithTop α
ha : a ≠ 0
hb : b ≠ 0
hc : c ≠ 0
⊢ a * b * c = a * (b * c)

Next tactic:
induction' a using WithTop.recTopCoe with a
instance instSemigroupWithZeroWithTop [SemigroupWithZero α] [NoZeroDivisors α] :
    SemigroupWithZero (WithTop α) :=
  { WithTop.instMulZeroClassWithTop with
    mul_assoc := fun a b c => by
      rcases eq_or_ne a 0 with (rfl | ha); · simp only [zero_mul]
      rcases eq_or_ne b 0 with (rfl | hb); · simp only [zero_mul, mul_zero]
      rcases eq_or_ne c 0 with (rfl | hc); · simp only [mul_zero]
    -- Porting note: below needed to be rewritten due to changed `simp` behaviour for `coe`
      induction' a using WithTop.recTopCoe with a; · 

Proof state:
case inr.inr.inr.top
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : SemigroupWithZero α
inst✝ : NoZeroDivisors α
src✝ : MulZeroClass (WithTop α) := instMulZeroClassWithTop
b c : WithTop α
hb : b ≠ 0
hc : c ≠ 0
ha : ⊤ ≠ 0
⊢ ⊤ * b * c = ⊤ * (b * c)

Next tactic:
simp [hb, hc]
instance instSemigroupWithZeroWithTop [SemigroupWithZero α] [NoZeroDivisors α] :
    SemigroupWithZero (WithTop α) :=
  { WithTop.instMulZeroClassWithTop with
    mul_assoc := fun a b c => by
      rcases eq_or_ne a 0 with (rfl | ha); · simp only [zero_mul]
      rcases eq_or_ne b 0 with (rfl | hb); · simp only [zero_mul, mul_zero]
      rcases eq_or_ne c 0 with (rfl | hc); · simp only [mul_zero]
    -- Porting note: below needed to be rewritten due to changed `simp` behaviour for `coe`
      induction' a using WithTop.recTopCoe with a; · simp [hb, hc]
      

Proof state:
case inr.inr.inr.coe
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : SemigroupWithZero α
inst✝ : NoZeroDivisors α
src✝ : MulZeroClass (WithTop α) := instMulZeroClassWithTop
b c : WithTop α
hb : b ≠ 0
hc : c ≠ 0
a : α
ha : ↑a ≠ 0
⊢ ↑a * b * c = ↑a * (b * c)

Next tactic:
induction' b using WithTop.recTopCoe with b
instance instSemigroupWithZeroWithTop [SemigroupWithZero α] [NoZeroDivisors α] :
    SemigroupWithZero (WithTop α) :=
  { WithTop.instMulZeroClassWithTop with
    mul_assoc := fun a b c => by
      rcases eq_or_ne a 0 with (rfl | ha); · simp only [zero_mul]
      rcases eq_or_ne b 0 with (rfl | hb); · simp only [zero_mul, mul_zero]
      rcases eq_or_ne c 0 with (rfl | hc); · simp only [mul_zero]
    -- Porting note: below needed to be rewritten due to changed `simp` behaviour for `coe`
      induction' a using WithTop.recTopCoe with a; · simp [hb, hc]
      induction' b using WithTop.recTopCoe with b; · 

Proof state:
case inr.inr.inr.coe.top
α : Type u_1
inst✝² : DecidableEq α
inst✝¹ : SemigroupWithZero α
inst✝ : NoZeroDivisors α
src✝ : MulZeroClass (WithTop α) := instMulZeroClassWithTop
c : WithTop α
hc : c ≠ 0
a : α
ha : ↑a ≠ 0
hb : ⊤ ≠ 0
⊢ ↑a * ⊤ * c = ↑a * (⊤ * c)

Next tactic:
simp [mul_top ha, top_mul hc]