l3lab/ntp-mathlib huggingface dataset:
/-- The class number is `1` iff the ring of integers is a principal ideal domain. -/
theorem card_classGroup_eq_one_iff [IsDedekindDomain R] [Fintype (ClassGroup R)] :
    Fintype.card (ClassGroup R) = 1 ↔ IsPrincipalIdealRing R := by
  constructor; swap; · intros; convert card_classGroup_eq_one (R := R)
  

Proof state:
case mp
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Field K
inst✝¹⁰ : Field L
inst✝⁹ : DecidableEq L
inst✝⁸ : Algebra R K
inst✝⁷ : IsFractionRing R K
inst✝⁶ : Algebra K L
inst✝⁵ : FiniteDimensional K L
inst✝⁴ : Algebra R L
inst✝³ : IsScalarTower R K L
inst✝² : IsDomain R
inst✝¹ : IsDedekindDomain R
inst✝ : Fintype (ClassGroup R)
⊢ Fintype.card (ClassGroup R) = 1 → IsPrincipalIdealRing R

Next tactic:
rw [Fintype.card_eq_one_iff]
/-- The class number is `1` iff the ring of integers is a principal ideal domain. -/
theorem card_classGroup_eq_one_iff [IsDedekindDomain R] [Fintype (ClassGroup R)] :
    Fintype.card (ClassGroup R) = 1 ↔ IsPrincipalIdealRing R := by
  constructor; swap; · intros; convert card_classGroup_eq_one (R := R)
  rw [Fintype.card_eq_one_iff]
  

Proof state:
case mp
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Field K
inst✝¹⁰ : Field L
inst✝⁹ : DecidableEq L
inst✝⁸ : Algebra R K
inst✝⁷ : IsFractionRing R K
inst✝⁶ : Algebra K L
inst✝⁵ : FiniteDimensional K L
inst✝⁴ : Algebra R L
inst✝³ : IsScalarTower R K L
inst✝² : IsDomain R
inst✝¹ : IsDedekindDomain R
inst✝ : Fintype (ClassGroup R)
⊢ (∃ x, ∀ (y : ClassGroup R), y = x) → IsPrincipalIdealRing R

Next tactic:
rintro ⟨I, hI⟩
/-- The class number is `1` iff the ring of integers is a principal ideal domain. -/
theorem card_classGroup_eq_one_iff [IsDedekindDomain R] [Fintype (ClassGroup R)] :
    Fintype.card (ClassGroup R) = 1 ↔ IsPrincipalIdealRing R := by
  constructor; swap; · intros; convert card_classGroup_eq_one (R := R)
  rw [Fintype.card_eq_one_iff]
  rintro ⟨I, hI⟩
  

Proof state:
case mp.intro
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Field K
inst✝¹⁰ : Field L
inst✝⁹ : DecidableEq L
inst✝⁸ : Algebra R K
inst✝⁷ : IsFractionRing R K
inst✝⁶ : Algebra K L
inst✝⁵ : FiniteDimensional K L
inst✝⁴ : Algebra R L
inst✝³ : IsScalarTower R K L
inst✝² : IsDomain R
inst✝¹ : IsDedekindDomain R
inst✝ : Fintype (ClassGroup R)
I : ClassGroup R
hI : ∀ (y : ClassGroup R), y = I
⊢ IsPrincipalIdealRing R

Next tactic:
have eq_one : ∀ J : ClassGroup R, J = 1 := fun J => (hI J).trans (hI 1).symm
/-- The class number is `1` iff the ring of integers is a principal ideal domain. -/
theorem card_classGroup_eq_one_iff [IsDedekindDomain R] [Fintype (ClassGroup R)] :
    Fintype.card (ClassGroup R) = 1 ↔ IsPrincipalIdealRing R := by
  constructor; swap; · intros; convert card_classGroup_eq_one (R := R)
  rw [Fintype.card_eq_one_iff]
  rintro ⟨I, hI⟩
  have eq_one : ∀ J : ClassGroup R, J = 1 := fun J => (hI J).trans (hI 1).symm
  

Proof state:
case mp.intro
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Field K
inst✝¹⁰ : Field L
inst✝⁹ : DecidableEq L
inst✝⁸ : Algebra R K
inst✝⁷ : IsFractionRing R K
inst✝⁶ : Algebra K L
inst✝⁵ : FiniteDimensional K L
inst✝⁴ : Algebra R L
inst✝³ : IsScalarTower R K L
inst✝² : IsDomain R
inst✝¹ : IsDedekindDomain R
inst✝ : Fintype (ClassGroup R)
I : ClassGroup R
hI : ∀ (y : ClassGroup R), y = I
eq_one : ∀ (J : ClassGroup R), J = 1
⊢ IsPrincipalIdealRing R

Next tactic:
refine ⟨fun I => ?_⟩
/-- The class number is `1` iff the ring of integers is a principal ideal domain. -/
theorem card_classGroup_eq_one_iff [IsDedekindDomain R] [Fintype (ClassGroup R)] :
    Fintype.card (ClassGroup R) = 1 ↔ IsPrincipalIdealRing R := by
  constructor; swap; · intros; convert card_classGroup_eq_one (R := R)
  rw [Fintype.card_eq_one_iff]
  rintro ⟨I, hI⟩
  have eq_one : ∀ J : ClassGroup R, J = 1 := fun J => (hI J).trans (hI 1).symm
  refine ⟨fun I => ?_⟩
  

Proof state:
case mp.intro
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Field K
inst✝¹⁰ : Field L
inst✝⁹ : DecidableEq L
inst✝⁸ : Algebra R K
inst✝⁷ : IsFractionRing R K
inst✝⁶ : Algebra K L
inst✝⁵ : FiniteDimensional K L
inst✝⁴ : Algebra R L
inst✝³ : IsScalarTower R K L
inst✝² : IsDomain R
inst✝¹ : IsDedekindDomain R
inst✝ : Fintype (ClassGroup R)
I✝ : ClassGroup R
hI : ∀ (y : ClassGroup R), y = I✝
eq_one : ∀ (J : ClassGroup R), J = 1
I : Ideal R
⊢ Submodule.IsPrincipal I

Next tactic:
by_cases hI : I = ⊥
/-- The class number is `1` iff the ring of integers is a principal ideal domain. -/
theorem card_classGroup_eq_one_iff [IsDedekindDomain R] [Fintype (ClassGroup R)] :
    Fintype.card (ClassGroup R) = 1 ↔ IsPrincipalIdealRing R := by
  constructor; swap; · intros; convert card_classGroup_eq_one (R := R)
  rw [Fintype.card_eq_one_iff]
  rintro ⟨I, hI⟩
  have eq_one : ∀ J : ClassGroup R, J = 1 := fun J => (hI J).trans (hI 1).symm
  refine ⟨fun I => ?_⟩
  by_cases hI : I = ⊥
  · 

Proof state:
case pos
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Field K
inst✝¹⁰ : Field L
inst✝⁹ : DecidableEq L
inst✝⁸ : Algebra R K
inst✝⁷ : IsFractionRing R K
inst✝⁶ : Algebra K L
inst✝⁵ : FiniteDimensional K L
inst✝⁴ : Algebra R L
inst✝³ : IsScalarTower R K L
inst✝² : IsDomain R
inst✝¹ : IsDedekindDomain R
inst✝ : Fintype (ClassGroup R)
I✝ : ClassGroup R
hI✝ : ∀ (y : ClassGroup R), y = I✝
eq_one : ∀ (J : ClassGroup R), J = 1
I : Ideal R
hI : I = ⊥
⊢ Submodule.IsPrincipal I

Next tactic:
rw [hI]
/-- The class number is `1` iff the ring of integers is a principal ideal domain. -/
theorem card_classGroup_eq_one_iff [IsDedekindDomain R] [Fintype (ClassGroup R)] :
    Fintype.card (ClassGroup R) = 1 ↔ IsPrincipalIdealRing R := by
  constructor; swap; · intros; convert card_classGroup_eq_one (R := R)
  rw [Fintype.card_eq_one_iff]
  rintro ⟨I, hI⟩
  have eq_one : ∀ J : ClassGroup R, J = 1 := fun J => (hI J).trans (hI 1).symm
  refine ⟨fun I => ?_⟩
  by_cases hI : I = ⊥
  · rw [hI]; 

Proof state:
case pos
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Field K
inst✝¹⁰ : Field L
inst✝⁹ : DecidableEq L
inst✝⁸ : Algebra R K
inst✝⁷ : IsFractionRing R K
inst✝⁶ : Algebra K L
inst✝⁵ : FiniteDimensional K L
inst✝⁴ : Algebra R L
inst✝³ : IsScalarTower R K L
inst✝² : IsDomain R
inst✝¹ : IsDedekindDomain R
inst✝ : Fintype (ClassGroup R)
I✝ : ClassGroup R
hI✝ : ∀ (y : ClassGroup R), y = I✝
eq_one : ∀ (J : ClassGroup R), J = 1
I : Ideal R
hI : I = ⊥
⊢ Submodule.IsPrincipal ⊥

Next tactic:
exact bot_isPrincipal
/-- The class number is `1` iff the ring of integers is a principal ideal domain. -/
theorem card_classGroup_eq_one_iff [IsDedekindDomain R] [Fintype (ClassGroup R)] :
    Fintype.card (ClassGroup R) = 1 ↔ IsPrincipalIdealRing R := by
  constructor; swap; · intros; convert card_classGroup_eq_one (R := R)
  rw [Fintype.card_eq_one_iff]
  rintro ⟨I, hI⟩
  have eq_one : ∀ J : ClassGroup R, J = 1 := fun J => (hI J).trans (hI 1).symm
  refine ⟨fun I => ?_⟩
  by_cases hI : I = ⊥
  · rw [hI]; exact bot_isPrincipal
  · 

Proof state:
case neg
R : Type u_1
K : Type u_2
L : Type u_3
inst✝¹² : CommRing R
inst✝¹¹ : Field K
inst✝¹⁰ : Field L
inst✝⁹ : DecidableEq L
inst✝⁸ : Algebra R K
inst✝⁷ : IsFractionRing R K
inst✝⁶ : Algebra K L
inst✝⁵ : FiniteDimensional K L
inst✝⁴ : Algebra R L
inst✝³ : IsScalarTower R K L
inst✝² : IsDomain R
inst✝¹ : IsDedekindDomain R
inst✝ : Fintype (ClassGroup R)
I✝ : ClassGroup R
hI✝ : ∀ (y : ClassGroup R), y = I✝
eq_one : ∀ (J : ClassGroup R), J = 1
I : Ideal R
hI : ¬I = ⊥
⊢ Submodule.IsPrincipal I

Next tactic:
exact (ClassGroup.mk0_eq_one_iff (mem_nonZeroDivisors_iff_ne_zero.mpr hI)).mp (eq_one _)
instance invOneClass [InvOneClass α] : InvOneClass (WithZero α) :=
  { WithZero.one, WithZero.inv with inv_one := show ((1⁻¹ : α) : WithZero α) = 1 by 

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝ : InvOneClass α
src✝¹ : One (WithZero α) := one
src✝ : Inv (WithZero α) := inv
⊢ ↑1⁻¹ = 1

Next tactic:
simp
/-- if `G` is a group then `WithZero G` is a group with zero. -/
instance groupWithZero : GroupWithZero (WithZero α) :=
  { WithZero.monoidWithZero, WithZero.divInvMonoid, WithZero.nontrivial with
    inv_zero := inv_zero,
    mul_inv_cancel := fun a ha ↦ by
      

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝ : Group α
src✝² : MonoidWithZero (WithZero α) := monoidWithZero
src✝¹ : DivInvMonoid (WithZero α) := divInvMonoid
src✝ : Nontrivial (WithZero α) := nontrivial
a : WithZero α
ha : a ≠ 0
⊢ a * a⁻¹ = 1

Next tactic:
lift a to α using ha
/-- if `G` is a group then `WithZero G` is a group with zero. -/
instance groupWithZero : GroupWithZero (WithZero α) :=
  { WithZero.monoidWithZero, WithZero.divInvMonoid, WithZero.nontrivial with
    inv_zero := inv_zero,
    mul_inv_cancel := fun a ha ↦ by
      lift a to α using ha
      

Proof state:
case intro
α : Type u
β : Type v
γ : Type w
inst✝ : Group α
src✝² : MonoidWithZero (WithZero α) := monoidWithZero
src✝¹ : DivInvMonoid (WithZero α) := divInvMonoid
src✝ : Nontrivial (WithZero α) := nontrivial
a : α
⊢ ↑a * (↑a)⁻¹ = 1

Next tactic:
norm_cast
/-- if `G` is a group then `WithZero G` is a group with zero. -/
instance groupWithZero : GroupWithZero (WithZero α) :=
  { WithZero.monoidWithZero, WithZero.divInvMonoid, WithZero.nontrivial with
    inv_zero := inv_zero,
    mul_inv_cancel := fun a ha ↦ by
      lift a to α using ha
      norm_cast
      

Proof state:
case intro
α : Type u
β : Type v
γ : Type w
inst✝ : Group α
src✝² : MonoidWithZero (WithZero α) := monoidWithZero
src✝¹ : DivInvMonoid (WithZero α) := divInvMonoid
src✝ : Nontrivial (WithZero α) := nontrivial
a : α
⊢ a * a⁻¹ = 1

Next tactic:
apply mul_right_inv
instance addMonoidWithOne [AddMonoidWithOne α] : AddMonoidWithOne (WithZero α) :=
  { WithZero.addMonoid, WithZero.one with
    natCast := fun n => if n = 0 then 0 else (n.cast : α),
    natCast_zero := rfl,
    natCast_succ := fun n => by
      

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝ : AddMonoidWithOne α
src✝¹ : AddMonoid (WithZero α) := addMonoid
src✝ : One (WithZero α) := one
n : ℕ
⊢ NatCast.natCast (n + 1) = NatCast.natCast n + 1

Next tactic:
cases n with
      | zero => show (((1 : ℕ) : α) : WithZero α) = 0 + 1; · rw [Nat.cast_one, coe_one, zero_add]
      | succ n =>
          show (((n + 2 : ℕ) : α) : WithZero α) = ((n + 1 : ℕ) : α) + 1
          rw [Nat.cast_succ, coe_add, coe_one]
instance addMonoidWithOne [AddMonoidWithOne α] : AddMonoidWithOne (WithZero α) :=
  { WithZero.addMonoid, WithZero.one with
    natCast := fun n => if n = 0 then 0 else (n.cast : α),
    natCast_zero := rfl,
    natCast_succ := fun n => by
      cases n with
      

Proof state:
case zero
α : Type u
β : Type v
γ : Type w
inst✝ : AddMonoidWithOne α
src✝¹ : AddMonoid (WithZero α) := addMonoid
src✝ : One (WithZero α) := one
⊢ NatCast.natCast (Nat.zero + 1) = NatCast.natCast Nat.zero + 1

Next tactic:
| zero => show (((1 : ℕ) : α) : WithZero α) = 0 + 1; · rw [Nat.cast_one, coe_one, zero_add]
instance addMonoidWithOne [AddMonoidWithOne α] : AddMonoidWithOne (WithZero α) :=
  { WithZero.addMonoid, WithZero.one with
    natCast := fun n => if n = 0 then 0 else (n.cast : α),
    natCast_zero := rfl,
    natCast_succ := fun n => by
      cases n with
      | zero => 

Proof state:
case zero
α : Type u
β : Type v
γ : Type w
inst✝ : AddMonoidWithOne α
src✝¹ : AddMonoid (WithZero α) := addMonoid
src✝ : One (WithZero α) := one
⊢ NatCast.natCast (Nat.zero + 1) = NatCast.natCast Nat.zero + 1

Next tactic:
show (((1 : ℕ) : α) : WithZero α) = 0 + 1
instance addMonoidWithOne [AddMonoidWithOne α] : AddMonoidWithOne (WithZero α) :=
  { WithZero.addMonoid, WithZero.one with
    natCast := fun n => if n = 0 then 0 else (n.cast : α),
    natCast_zero := rfl,
    natCast_succ := fun n => by
      cases n with
      | zero => show (((1 : ℕ) : α) : WithZero α) = 0 + 1; · 

Proof state:
case zero
α : Type u
β : Type v
γ : Type w
inst✝ : AddMonoidWithOne α
src✝¹ : AddMonoid (WithZero α) := addMonoid
src✝ : One (WithZero α) := one
⊢ ↑↑1 = 0 + 1

Next tactic:
rw [Nat.cast_one, coe_one, zero_add]
instance addMonoidWithOne [AddMonoidWithOne α] : AddMonoidWithOne (WithZero α) :=
  { WithZero.addMonoid, WithZero.one with
    natCast := fun n => if n = 0 then 0 else (n.cast : α),
    natCast_zero := rfl,
    natCast_succ := fun n => by
      cases n with
      | zero => show (((1 : ℕ) : α) : WithZero α) = 0 + 1; · rw [Nat.cast_one, coe_one, zero_add]
      

Proof state:
case succ
α : Type u
β : Type v
γ : Type w
inst✝ : AddMonoidWithOne α
src✝¹ : AddMonoid (WithZero α) := addMonoid
src✝ : One (WithZero α) := one
n : ℕ
⊢ NatCast.natCast (Nat.succ n + 1) = NatCast.natCast (Nat.succ n) + 1

Next tactic:
| succ n =>
          show (((n + 2 : ℕ) : α) : WithZero α) = ((n + 1 : ℕ) : α) + 1
          rw [Nat.cast_succ, coe_add, coe_one]
instance addMonoidWithOne [AddMonoidWithOne α] : AddMonoidWithOne (WithZero α) :=
  { WithZero.addMonoid, WithZero.one with
    natCast := fun n => if n = 0 then 0 else (n.cast : α),
    natCast_zero := rfl,
    natCast_succ := fun n => by
      cases n with
      | zero => show (((1 : ℕ) : α) : WithZero α) = 0 + 1; · rw [Nat.cast_one, coe_one, zero_add]
      | succ n =>
          

Proof state:
case succ
α : Type u
β : Type v
γ : Type w
inst✝ : AddMonoidWithOne α
src✝¹ : AddMonoid (WithZero α) := addMonoid
src✝ : One (WithZero α) := one
n : ℕ
⊢ NatCast.natCast (Nat.succ n + 1) = NatCast.natCast (Nat.succ n) + 1

Next tactic:
show (((n + 2 : ℕ) : α) : WithZero α) = ((n + 1 : ℕ) : α) + 1
instance addMonoidWithOne [AddMonoidWithOne α] : AddMonoidWithOne (WithZero α) :=
  { WithZero.addMonoid, WithZero.one with
    natCast := fun n => if n = 0 then 0 else (n.cast : α),
    natCast_zero := rfl,
    natCast_succ := fun n => by
      cases n with
      | zero => show (((1 : ℕ) : α) : WithZero α) = 0 + 1; · rw [Nat.cast_one, coe_one, zero_add]
      | succ n =>
          show (((n + 2 : ℕ) : α) : WithZero α) = ((n + 1 : ℕ) : α) + 1
          

Proof state:
case succ
α : Type u
β : Type v
γ : Type w
inst✝ : AddMonoidWithOne α
src✝¹ : AddMonoid (WithZero α) := addMonoid
src✝ : One (WithZero α) := one
n : ℕ
⊢ ↑↑(n + 2) = ↑↑(n + 1) + 1

Next tactic:
rw [Nat.cast_succ, coe_add, coe_one]
instance instLeftDistribClass [Mul α] [Add α] [LeftDistribClass α] :
    LeftDistribClass (WithZero α) where
  left_distrib a b c := by
    

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : LeftDistribClass α
a b c : WithZero α
⊢ a * (b + c) = a * b + a * c

Next tactic:
cases' a with a
instance instLeftDistribClass [Mul α] [Add α] [LeftDistribClass α] :
    LeftDistribClass (WithZero α) where
  left_distrib a b c := by
    cases' a with a; · 

Proof state:
case none
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : LeftDistribClass α
b c : WithZero α
⊢ none * (b + c) = none * b + none * c

Next tactic:
rfl
instance instLeftDistribClass [Mul α] [Add α] [LeftDistribClass α] :
    LeftDistribClass (WithZero α) where
  left_distrib a b c := by
    cases' a with a; · rfl
    

Proof state:
case some
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : LeftDistribClass α
b c : WithZero α
a : α
⊢ some a * (b + c) = some a * b + some a * c

Next tactic:
cases' b with b
instance instLeftDistribClass [Mul α] [Add α] [LeftDistribClass α] :
    LeftDistribClass (WithZero α) where
  left_distrib a b c := by
    cases' a with a; · rfl
    cases' b with b <;> 

Proof state:
case some.none
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : LeftDistribClass α
c : WithZero α
a : α
⊢ some a * (none + c) = some a * none + some a * c

Next tactic:
cases' c with c
instance instLeftDistribClass [Mul α] [Add α] [LeftDistribClass α] :
    LeftDistribClass (WithZero α) where
  left_distrib a b c := by
    cases' a with a; · rfl
    cases' b with b <;> 

Proof state:
case some.some
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : LeftDistribClass α
c : WithZero α
a b : α
⊢ some a * (some b + c) = some a * some b + some a * c

Next tactic:
cases' c with c
instance instLeftDistribClass [Mul α] [Add α] [LeftDistribClass α] :
    LeftDistribClass (WithZero α) where
  left_distrib a b c := by
    cases' a with a; · rfl
    cases' b with b <;> cases' c with c <;> 

Proof state:
case some.none.none
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : LeftDistribClass α
a : α
⊢ some a * (none + none) = some a * none + some a * none

Next tactic:
try rfl
instance instLeftDistribClass [Mul α] [Add α] [LeftDistribClass α] :
    LeftDistribClass (WithZero α) where
  left_distrib a b c := by
    cases' a with a; · rfl
    cases' b with b <;> cases' c with c <;> try 

Proof state:
case some.none.none
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : LeftDistribClass α
a : α
⊢ some a * (none + none) = some a * none + some a * none

Next tactic:
rfl
instance instLeftDistribClass [Mul α] [Add α] [LeftDistribClass α] :
    LeftDistribClass (WithZero α) where
  left_distrib a b c := by
    cases' a with a; · rfl
    cases' b with b <;> cases' c with c <;> 

Proof state:
case some.none.some
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : LeftDistribClass α
a c : α
⊢ some a * (none + some c) = some a * none + some a * some c

Next tactic:
try rfl
instance instLeftDistribClass [Mul α] [Add α] [LeftDistribClass α] :
    LeftDistribClass (WithZero α) where
  left_distrib a b c := by
    cases' a with a; · rfl
    cases' b with b <;> cases' c with c <;> try 

Proof state:
case some.none.some
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : LeftDistribClass α
a c : α
⊢ some a * (none + some c) = some a * none + some a * some c

Next tactic:
rfl
instance instLeftDistribClass [Mul α] [Add α] [LeftDistribClass α] :
    LeftDistribClass (WithZero α) where
  left_distrib a b c := by
    cases' a with a; · rfl
    cases' b with b <;> cases' c with c <;> 

Proof state:
case some.some.none
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : LeftDistribClass α
a b : α
⊢ some a * (some b + none) = some a * some b + some a * none

Next tactic:
try rfl
instance instLeftDistribClass [Mul α] [Add α] [LeftDistribClass α] :
    LeftDistribClass (WithZero α) where
  left_distrib a b c := by
    cases' a with a; · rfl
    cases' b with b <;> cases' c with c <;> try 

Proof state:
case some.some.none
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : LeftDistribClass α
a b : α
⊢ some a * (some b + none) = some a * some b + some a * none

Next tactic:
rfl
instance instLeftDistribClass [Mul α] [Add α] [LeftDistribClass α] :
    LeftDistribClass (WithZero α) where
  left_distrib a b c := by
    cases' a with a; · rfl
    cases' b with b <;> cases' c with c <;> 

Proof state:
case some.some.some
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : LeftDistribClass α
a b c : α
⊢ some a * (some b + some c) = some a * some b + some a * some c

Next tactic:
try rfl
instance instLeftDistribClass [Mul α] [Add α] [LeftDistribClass α] :
    LeftDistribClass (WithZero α) where
  left_distrib a b c := by
    cases' a with a; · rfl
    cases' b with b <;> cases' c with c <;> try 

Proof state:
case some.some.some
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : LeftDistribClass α
a b c : α
⊢ some a * (some b + some c) = some a * some b + some a * some c

Next tactic:
rfl
instance instLeftDistribClass [Mul α] [Add α] [LeftDistribClass α] :
    LeftDistribClass (WithZero α) where
  left_distrib a b c := by
    cases' a with a; · rfl
    cases' b with b <;> cases' c with c <;> try rfl
    

Proof state:
case some.some.some
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : LeftDistribClass α
a b c : α
⊢ some a * (some b + some c) = some a * some b + some a * some c

Next tactic:
exact congr_arg some (left_distrib _ _ _)
instance instRightDistribClass [Mul α] [Add α] [RightDistribClass α] :
    RightDistribClass (WithZero α) where
  right_distrib a b c := by
    

Proof state:
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : RightDistribClass α
a b c : WithZero α
⊢ (a + b) * c = a * c + b * c

Next tactic:
cases' c with c
instance instRightDistribClass [Mul α] [Add α] [RightDistribClass α] :
    RightDistribClass (WithZero α) where
  right_distrib a b c := by
    cases' c with c
    · 

Proof state:
case none
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : RightDistribClass α
a b : WithZero α
⊢ (a + b) * none = a * none + b * none

Next tactic:
change (a + b) * 0 = a * 0 + b * 0
instance instRightDistribClass [Mul α] [Add α] [RightDistribClass α] :
    RightDistribClass (WithZero α) where
  right_distrib a b c := by
    cases' c with c
    · change (a + b) * 0 = a * 0 + b * 0
      

Proof state:
case none
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : RightDistribClass α
a b : WithZero α
⊢ (a + b) * 0 = a * 0 + b * 0

Next tactic:
simp
instance instRightDistribClass [Mul α] [Add α] [RightDistribClass α] :
    RightDistribClass (WithZero α) where
  right_distrib a b c := by
    cases' c with c
    · change (a + b) * 0 = a * 0 + b * 0
      simp
    

Proof state:
case some
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : RightDistribClass α
a b : WithZero α
c : α
⊢ (a + b) * some c = a * some c + b * some c

Next tactic:
cases' a with a
instance instRightDistribClass [Mul α] [Add α] [RightDistribClass α] :
    RightDistribClass (WithZero α) where
  right_distrib a b c := by
    cases' c with c
    · change (a + b) * 0 = a * 0 + b * 0
      simp
    cases' a with a <;> 

Proof state:
case some.none
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : RightDistribClass α
b : WithZero α
c : α
⊢ (none + b) * some c = none * some c + b * some c

Next tactic:
cases' b with b
instance instRightDistribClass [Mul α] [Add α] [RightDistribClass α] :
    RightDistribClass (WithZero α) where
  right_distrib a b c := by
    cases' c with c
    · change (a + b) * 0 = a * 0 + b * 0
      simp
    cases' a with a <;> 

Proof state:
case some.some
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : RightDistribClass α
b : WithZero α
c a : α
⊢ (some a + b) * some c = some a * some c + b * some c

Next tactic:
cases' b with b
instance instRightDistribClass [Mul α] [Add α] [RightDistribClass α] :
    RightDistribClass (WithZero α) where
  right_distrib a b c := by
    cases' c with c
    · change (a + b) * 0 = a * 0 + b * 0
      simp
    cases' a with a <;> cases' b with b <;> 

Proof state:
case some.none.none
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : RightDistribClass α
c : α
⊢ (none + none) * some c = none * some c + none * some c

Next tactic:
try rfl
instance instRightDistribClass [Mul α] [Add α] [RightDistribClass α] :
    RightDistribClass (WithZero α) where
  right_distrib a b c := by
    cases' c with c
    · change (a + b) * 0 = a * 0 + b * 0
      simp
    cases' a with a <;> cases' b with b <;> try 

Proof state:
case some.none.none
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : RightDistribClass α
c : α
⊢ (none + none) * some c = none * some c + none * some c

Next tactic:
rfl
instance instRightDistribClass [Mul α] [Add α] [RightDistribClass α] :
    RightDistribClass (WithZero α) where
  right_distrib a b c := by
    cases' c with c
    · change (a + b) * 0 = a * 0 + b * 0
      simp
    cases' a with a <;> cases' b with b <;> 

Proof state:
case some.none.some
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : RightDistribClass α
c b : α
⊢ (none + some b) * some c = none * some c + some b * some c

Next tactic:
try rfl
instance instRightDistribClass [Mul α] [Add α] [RightDistribClass α] :
    RightDistribClass (WithZero α) where
  right_distrib a b c := by
    cases' c with c
    · change (a + b) * 0 = a * 0 + b * 0
      simp
    cases' a with a <;> cases' b with b <;> try 

Proof state:
case some.none.some
α : Type u
β : Type v
γ : Type w
inst✝² : Mul α
inst✝¹ : Add α
inst✝ : RightDistribClass α
c b : α
⊢ (none + some b) * some c = none * some c + some b * some c

Next tactic:
rfl