Theorem: WithTop.distrib'
File: Mathlib/Algebra/Order/Ring/WithTop.lean

tactic: induction' c with c
state_before: α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
a b c : WithTop α
⊢ (a + b) * c = a * c + b * c
state_after: case top
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
a b : WithTop α
⊢ (a + b) * ⊤ = a * ⊤ + b * ⊤

case coe
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
a b : WithTop α
c : α
⊢ (a + b) * ↑c = a * ↑c + b * ↑c

tactic: by_cases ha : a = 0 <;> simp [ha]
state_before: case top
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
a b : WithTop α
⊢ (a + b) * ⊤ = a * ⊤ + b * ⊤
state_after: no goals

tactic: by_cases hc : c = 0
state_before: case coe
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
a b : WithTop α
c : α
⊢ (a + b) * ↑c = a * ↑c + b * ↑c
state_after: case pos
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
a b : WithTop α
c : α
hc : c = 0
⊢ (a + b) * ↑c = a * ↑c + b * ↑c

case neg
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
a b : WithTop α
c : α
hc : ¬c = 0
⊢ (a + b) * ↑c = a * ↑c + b * ↑c

tactic: simp only [mul_coe_eq_bind hc]
state_before: case neg
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
a b : WithTop α
c : α
hc : ¬c = 0
⊢ (a + b) * ↑c = a * ↑c + b * ↑c
state_after: case neg
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
a b : WithTop α
c : α
hc : ¬c = 0
⊢ (Option.bind (a + b) fun a => Option.some (a * c)) =
    (Option.bind a fun a => Option.some (a * c)) + Option.bind b fun a => Option.some (a * c)

tactic: cases a <;> cases b
state_before: case neg
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
a b : WithTop α
c : α
hc : ¬c = 0
⊢ (Option.bind (a + b) fun a => Option.some (a * c)) =
    (Option.bind a fun a => Option.some (a * c)) + Option.bind b fun a => Option.some (a * c)
state_after: case neg.top.top
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
c : α
hc : ¬c = 0
⊢ (Option.bind (⊤ + ⊤) fun a => Option.some (a * c)) =
    (Option.bind ⊤ fun a => Option.some (a * c)) + Option.bind ⊤ fun a => Option.some (a * c)

case neg.top.coe
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
c : α
hc : ¬c = 0
a✝ : α
⊢ (Option.bind (⊤ + ↑a✝) fun a => Option.some (a * c)) =
    (Option.bind ⊤ fun a => Option.some (a * c)) + Option.bind ↑a✝ fun a => Option.some (a * c)

case neg.coe.top
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
c : α
hc : ¬c = 0
a✝ : α
⊢ (Option.bind (↑a✝ + ⊤) fun a => Option.some (a * c)) =
    (Option.bind ↑a✝ fun a => Option.some (a * c)) + Option.bind ⊤ fun a => Option.some (a * c)

case neg.coe.coe
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
c : α
hc : ¬c = 0
a✝¹ a✝ : α
⊢ (Option.bind (↑a✝¹ + ↑a✝) fun a => Option.some (a * c)) =
    (Option.bind ↑a✝¹ fun a => Option.some (a * c)) + Option.bind ↑a✝ fun a => Option.some (a * c)

tactic: repeat' first | rfl |exact congr_arg some (add_mul _ _ _)
state_before: case neg.top.top
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
c : α
hc : ¬c = 0
⊢ (Option.bind (⊤ + ⊤) fun a => Option.some (a * c)) =
    (Option.bind ⊤ fun a => Option.some (a * c)) + Option.bind ⊤ fun a => Option.some (a * c)

case neg.top.coe
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
c : α
hc : ¬c = 0
a✝ : α
⊢ (Option.bind (⊤ + ↑a✝) fun a => Option.some (a * c)) =
    (Option.bind ⊤ fun a => Option.some (a * c)) + Option.bind ↑a✝ fun a => Option.some (a * c)

case neg.coe.top
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
c : α
hc : ¬c = 0
a✝ : α
⊢ (Option.bind (↑a✝ + ⊤) fun a => Option.some (a * c)) =
    (Option.bind ↑a✝ fun a => Option.some (a * c)) + Option.bind ⊤ fun a => Option.some (a * c)

case neg.coe.coe
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
c : α
hc : ¬c = 0
a✝¹ a✝ : α
⊢ (Option.bind (↑a✝¹ + ↑a✝) fun a => Option.some (a * c)) =
    (Option.bind ↑a✝¹ fun a => Option.some (a * c)) + Option.bind ↑a✝ fun a => Option.some (a * c)
state_after: no goals

tactic: simp [hc]
state_before: case pos
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
a b : WithTop α
c : α
hc : c = 0
⊢ (a + b) * ↑c = a * ↑c + b * ↑c
state_after: no goals

tactic: first | rfl |exact congr_arg some (add_mul _ _ _)
state_before: case neg.coe.coe
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
c : α
hc : ¬c = 0
a✝¹ a✝ : α
⊢ (Option.bind (↑a✝¹ + ↑a✝) fun a => Option.some (a * c)) =
    (Option.bind ↑a✝¹ fun a => Option.some (a * c)) + Option.bind ↑a✝ fun a => Option.some (a * c)
state_after: no goals

tactic: rfl
state_before: case neg.coe.top
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
c : α
hc : ¬c = 0
a✝ : α
⊢ (Option.bind (↑a✝ + ⊤) fun a => Option.some (a * c)) =
    (Option.bind ↑a✝ fun a => Option.some (a * c)) + Option.bind ⊤ fun a => Option.some (a * c)
state_after: no goals

tactic: exact congr_arg some (add_mul _ _ _)
state_before: case neg.coe.coe
α : Type u_1
inst✝¹ : DecidableEq α
inst✝ : CanonicallyOrderedCommSemiring α
c : α
hc : ¬c = 0
a✝¹ a✝ : α
⊢ (Option.bind (↑a✝¹ + ↑a✝) fun a => Option.some (a * c)) =
    (Option.bind ↑a✝¹ fun a => Option.some (a * c)) + Option.bind ↑a✝ fun a => Option.some (a * c)
state_after: no goals