l3lab/ntp-mathlib huggingface dataset:
lemma level_one (χ : DirichletCharacter R 1) : χ = 1 := by
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ✝ : DirichletCharacter R n
χ : DirichletCharacter R 1
⊢ χ = 1

Next tactic:
ext
lemma level_one (χ : DirichletCharacter R 1) : χ = 1 := by
  ext
  

Proof state:
case h
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ✝ : DirichletCharacter R n
χ : DirichletCharacter R 1
a✝ : (ZMod 1)ˣ
⊢ χ ↑a✝ = 1 ↑a✝

Next tactic:
simp [units_eq_one]
lemma level_one' (hn : n = 1) : χ = 1 := by
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
hn : n = 1
⊢ χ = 1

Next tactic:
subst hn
lemma level_one' (hn : n = 1) : χ = 1 := by
  subst hn
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
χ : DirichletCharacter R 1
⊢ χ = 1

Next tactic:
exact level_one _
instance : Subsingleton (DirichletCharacter R 1) := by
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
⊢ Subsingleton (DirichletCharacter R 1)

Next tactic:
refine subsingleton_iff.mpr (fun χ χ' ↦ ?_)
instance : Subsingleton (DirichletCharacter R 1) := by
  refine subsingleton_iff.mpr (fun χ χ' ↦ ?_)
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ✝ : DirichletCharacter R n
χ χ' : DirichletCharacter R 1
⊢ χ = χ'

Next tactic:
simp [level_one]
lemma changeLevel_one {d : ℕ} (h : d ∣ n) :
    changeLevel h (1 : DirichletCharacter R d) = 1 := by
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
d : ℕ
h : d ∣ n
⊢ (changeLevel h) 1 = 1

Next tactic:
simp [changeLevel]
lemma factorsThrough_one_iff : FactorsThrough χ 1 ↔ χ = 1 := by
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
⊢ FactorsThrough χ 1 ↔ χ = 1

Next tactic:
refine ⟨fun ⟨_, χ₀, hχ₀⟩ ↦ ?_,
          fun h ↦ ⟨one_dvd n, 1, by rw [h, changeLevel_one]⟩⟩
lemma factorsThrough_one_iff : FactorsThrough χ 1 ↔ χ = 1 := by
  refine ⟨fun ⟨_, χ₀, hχ₀⟩ ↦ ?_,
          fun h ↦ ⟨one_dvd n, 1, by 

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
h : χ = 1
⊢ χ = (changeLevel (_ : 1 ∣ n)) 1

Next tactic:
rw [h, changeLevel_one]
lemma factorsThrough_one_iff : FactorsThrough χ 1 ↔ χ = 1 := by
  refine ⟨fun ⟨_, χ₀, hχ₀⟩ ↦ ?_,
          fun h ↦ ⟨one_dvd n, 1, by rw [h, changeLevel_one]⟩⟩
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
x✝ : FactorsThrough χ 1
w✝ : 1 ∣ n
χ₀ : DirichletCharacter R 1
hχ₀ : χ = (changeLevel w✝) χ₀
⊢ χ = 1

Next tactic:
rwa [level_one χ₀, changeLevel_one] at hχ₀
lemma conductor_one (hn : n ≠ 0) : conductor (1 : DirichletCharacter R n) = 1 := by
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
hn : n ≠ 0
⊢ conductor 1 = 1

Next tactic:
suffices : FactorsThrough (1 : DirichletCharacter R n) 1
lemma conductor_one (hn : n ≠ 0) : conductor (1 : DirichletCharacter R n) = 1 := by
  suffices : FactorsThrough (1 : DirichletCharacter R n) 1
  · 

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
hn : n ≠ 0
this : FactorsThrough 1 1
⊢ conductor 1 = 1

Next tactic:
have h : conductor (1 : DirichletCharacter R n) ≤ 1 :=
      Nat.sInf_le <| (mem_conductorSet_iff _).mpr this
lemma conductor_one (hn : n ≠ 0) : conductor (1 : DirichletCharacter R n) = 1 := by
  suffices : FactorsThrough (1 : DirichletCharacter R n) 1
  · have h : conductor (1 : DirichletCharacter R n) ≤ 1 :=
      Nat.sInf_le <| (mem_conductorSet_iff _).mpr this
    

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
hn : n ≠ 0
this : FactorsThrough 1 1
h : conductor 1 ≤ 1
⊢ conductor 1 = 1

Next tactic:
exact Nat.le_antisymm h (Nat.pos_of_ne_zero <| conductor_ne_zero _ hn)
lemma conductor_one (hn : n ≠ 0) : conductor (1 : DirichletCharacter R n) = 1 := by
  suffices : FactorsThrough (1 : DirichletCharacter R n) 1
  · have h : conductor (1 : DirichletCharacter R n) ≤ 1 :=
      Nat.sInf_le <| (mem_conductorSet_iff _).mpr this
    exact Nat.le_antisymm h (Nat.pos_of_ne_zero <| conductor_ne_zero _ hn)
  · 

Proof state:
case this
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
hn : n ≠ 0
⊢ FactorsThrough 1 1

Next tactic:
exact (factorsThrough_one_iff _).mpr rfl
lemma eq_one_iff_conductor_eq_one (hn : n ≠ 0) : χ = 1 ↔ conductor χ = 1 := by
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
hn : n ≠ 0
⊢ χ = 1 ↔ conductor χ = 1

Next tactic:
refine ⟨fun h ↦ h ▸ conductor_one hn, fun hχ ↦ ?_⟩
lemma eq_one_iff_conductor_eq_one (hn : n ≠ 0) : χ = 1 ↔ conductor χ = 1 := by
  refine ⟨fun h ↦ h ▸ conductor_one hn, fun hχ ↦ ?_⟩
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
hn : n ≠ 0
hχ : conductor χ = 1
⊢ χ = 1

Next tactic:
obtain ⟨h', χ₀, h⟩ := factorsThrough_conductor χ
lemma eq_one_iff_conductor_eq_one (hn : n ≠ 0) : χ = 1 ↔ conductor χ = 1 := by
  refine ⟨fun h ↦ h ▸ conductor_one hn, fun hχ ↦ ?_⟩
  obtain ⟨h', χ₀, h⟩ := factorsThrough_conductor χ
  

Proof state:
case intro.intro
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
hn : n ≠ 0
hχ : conductor χ = 1
h' : conductor χ ∣ n
χ₀ : DirichletCharacter R (conductor χ)
h : χ = (changeLevel h') χ₀
⊢ χ = 1

Next tactic:
exact (level_one' χ₀ hχ ▸ h).trans <| changeLevel_one h'
lemma conductor_eq_zero_iff_level_eq_zero : conductor χ = 0 ↔ n = 0 := by
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
⊢ conductor χ = 0 ↔ n = 0

Next tactic:
refine ⟨(conductor_ne_zero χ).mtr, ?_⟩
lemma conductor_eq_zero_iff_level_eq_zero : conductor χ = 0 ↔ n = 0 := by
  refine ⟨(conductor_ne_zero χ).mtr, ?_⟩
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
⊢ n = 0 → conductor χ = 0

Next tactic:
rintro rfl
lemma conductor_eq_zero_iff_level_eq_zero : conductor χ = 0 ↔ n = 0 := by
  refine ⟨(conductor_ne_zero χ).mtr, ?_⟩
  rintro rfl
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
χ : DirichletCharacter R 0
⊢ conductor χ = 0

Next tactic:
exact Nat.sInf_eq_zero.mpr <| Or.inl <| level_mem_conductorSet χ
lemma conductor_le_conductor_mem_conductorSet {d : ℕ} (hd : d ∈ conductorSet χ) :
    χ.conductor ≤ (Classical.choose hd.2).conductor := by
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
d : ℕ
hd : d ∈ conductorSet χ
⊢ conductor χ ≤ conductor (Classical.choose (_ : ∃ χ₀, χ = (changeLevel (_ : d ∣ n)) χ₀))

Next tactic:
refine Nat.sInf_le <| (mem_conductorSet_iff χ).mpr <|
    ⟨dvd_trans (conductor_dvd_level _) hd.1,
     (factorsThrough_conductor (Classical.choose hd.2)).2.choose, ?_⟩
lemma conductor_le_conductor_mem_conductorSet {d : ℕ} (hd : d ∈ conductorSet χ) :
    χ.conductor ≤ (Classical.choose hd.2).conductor := by
  refine Nat.sInf_le <| (mem_conductorSet_iff χ).mpr <|
    ⟨dvd_trans (conductor_dvd_level _) hd.1,
     (factorsThrough_conductor (Classical.choose hd.2)).2.choose, ?_⟩
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
d : ℕ
hd : d ∈ conductorSet χ
⊢ χ =
    (changeLevel (_ : conductor (Classical.choose (_ : ∃ χ₀, χ = (changeLevel (_ : d ∣ n)) χ₀)) ∣ n))
      (Exists.choose
        (_ :
          ∃ χ₀,
            Classical.choose (_ : ∃ χ₀, χ = (changeLevel (_ : d ∣ n)) χ₀) =
              (changeLevel (_ : conductor (Classical.choose (_ : ∃ χ₀, χ = (changeLevel (_ : d ∣ n)) χ₀)) ∣ d)) χ₀))

Next tactic:
rw [changeLevel_trans _ (conductor_dvd_level _) (FactorsThrough.dvd _ hd),
      ← (factorsThrough_conductor (Classical.choose hd.2)).2.choose_spec]
lemma conductor_le_conductor_mem_conductorSet {d : ℕ} (hd : d ∈ conductorSet χ) :
    χ.conductor ≤ (Classical.choose hd.2).conductor := by
  refine Nat.sInf_le <| (mem_conductorSet_iff χ).mpr <|
    ⟨dvd_trans (conductor_dvd_level _) hd.1,
     (factorsThrough_conductor (Classical.choose hd.2)).2.choose, ?_⟩
  rw [changeLevel_trans _ (conductor_dvd_level _) (FactorsThrough.dvd _ hd),
      ← (factorsThrough_conductor (Classical.choose hd.2)).2.choose_spec]
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
d : ℕ
hd : d ∈ conductorSet χ
⊢ χ = (changeLevel (_ : d ∣ n)) (Classical.choose (_ : ∃ χ₀, χ = (changeLevel (_ : d ∣ n)) χ₀))

Next tactic:
exact FactorsThrough.eq_changeLevel χ hd
lemma conductor_one_dvd (n : ℕ) : conductor (1 : DirichletCharacter R 1) ∣ n := by
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n✝ : ℕ
χ : DirichletCharacter R n✝
n : ℕ
⊢ conductor 1 ∣ n

Next tactic:
rw [(isPrimitive_def _).mp isPrimitive_one_level_one]
lemma conductor_one_dvd (n : ℕ) : conductor (1 : DirichletCharacter R 1) ∣ n := by
  rw [(isPrimitive_def _).mp isPrimitive_one_level_one]
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n✝ : ℕ
χ : DirichletCharacter R n✝
n : ℕ
⊢ 1 ∣ n

Next tactic:
apply one_dvd _
lemma primitiveCharacter_isPrimitive : isPrimitive (χ.primitiveCharacter) := by
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
⊢ isPrimitive (primitiveCharacter χ)

Next tactic:
by_cases h : χ.conductor = 0
lemma primitiveCharacter_isPrimitive : isPrimitive (χ.primitiveCharacter) := by
  by_cases h : χ.conductor = 0
  · 

Proof state:
case pos
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
h : conductor χ = 0
⊢ isPrimitive (primitiveCharacter χ)

Next tactic:
rw [isPrimitive_def]
lemma primitiveCharacter_isPrimitive : isPrimitive (χ.primitiveCharacter) := by
  by_cases h : χ.conductor = 0
  · rw [isPrimitive_def]
    

Proof state:
case pos
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
h : conductor χ = 0
⊢ conductor (primitiveCharacter χ) = conductor χ

Next tactic:
convert conductor_eq_zero_iff_level_eq_zero.mpr h
lemma primitiveCharacter_isPrimitive : isPrimitive (χ.primitiveCharacter) := by
  by_cases h : χ.conductor = 0
  · rw [isPrimitive_def]
    convert conductor_eq_zero_iff_level_eq_zero.mpr h
  · 

Proof state:
case neg
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
h : ¬conductor χ = 0
⊢ isPrimitive (primitiveCharacter χ)

Next tactic:
exact le_antisymm (Nat.le_of_dvd (Nat.pos_of_ne_zero h) (conductor_dvd_level _)) <|
      conductor_le_conductor_mem_conductorSet <| conductor_mem_conductorSet χ
lemma primitiveCharacter_one (hn : n ≠ 0) :
    (1 : DirichletCharacter R n).primitiveCharacter = 1 := by
  

Proof state:
R : Type u_1
inst✝ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
hn : n ≠ 0
⊢ primitiveCharacter 1 = 1

Next tactic:
rw [eq_one_iff_conductor_eq_one <| (@conductor_one R _ _ hn) ▸ Nat.one_ne_zero,
      (isPrimitive_def _).1 (1 : DirichletCharacter R n).primitiveCharacter_isPrimitive,
      conductor_one hn]
lemma even_or_odd [NoZeroDivisors S] : ψ.Even ∨ ψ.Odd := by
  

Proof state:
R : Type u_1
inst✝² : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
S : Type
inst✝¹ : CommRing S
m : ℕ
ψ : DirichletCharacter S m
inst✝ : NoZeroDivisors S
⊢ Even ψ ∨ Odd ψ

Next tactic:
suffices : ψ (-1) ^ 2 = 1
lemma even_or_odd [NoZeroDivisors S] : ψ.Even ∨ ψ.Odd := by
  suffices : ψ (-1) ^ 2 = 1
  · 

Proof state:
R : Type u_1
inst✝² : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
S : Type
inst✝¹ : CommRing S
m : ℕ
ψ : DirichletCharacter S m
inst✝ : NoZeroDivisors S
this : ψ (-1) ^ 2 = 1
⊢ Even ψ ∨ Odd ψ

Next tactic:
convert sq_eq_one_iff.mp this
lemma even_or_odd [NoZeroDivisors S] : ψ.Even ∨ ψ.Odd := by
  suffices : ψ (-1) ^ 2 = 1
  · convert sq_eq_one_iff.mp this
  · 

Proof state:
case this
R : Type u_1
inst✝² : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
S : Type
inst✝¹ : CommRing S
m : ℕ
ψ : DirichletCharacter S m
inst✝ : NoZeroDivisors S
⊢ ψ (-1) ^ 2 = 1

Next tactic:
rw [← map_pow _, neg_one_sq, map_one]
lemma Odd.toUnitHom_eval_neg_one (hψ : ψ.Odd) : ψ.toUnitHom (-1) = -1 := by
  

Proof state:
R : Type u_1
inst✝¹ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
S : Type
inst✝ : CommRing S
m : ℕ
ψ : DirichletCharacter S m
hψ : Odd ψ
⊢ (toUnitHom ψ) (-1) = -1

Next tactic:
rw [← Units.eq_iff, MulChar.coe_toUnitHom]
lemma Odd.toUnitHom_eval_neg_one (hψ : ψ.Odd) : ψ.toUnitHom (-1) = -1 := by
  rw [← Units.eq_iff, MulChar.coe_toUnitHom]
  

Proof state:
R : Type u_1
inst✝¹ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
S : Type
inst✝ : CommRing S
m : ℕ
ψ : DirichletCharacter S m
hψ : Odd ψ
⊢ ψ ↑(-1) = ↑(-1)

Next tactic:
exact hψ
lemma Even.toUnitHom_eval_neg_one (hψ : ψ.Even) : ψ.toUnitHom (-1) = 1 := by
  

Proof state:
R : Type u_1
inst✝¹ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
S : Type
inst✝ : CommRing S
m : ℕ
ψ : DirichletCharacter S m
hψ : Even ψ
⊢ (toUnitHom ψ) (-1) = 1

Next tactic:
rw [← Units.eq_iff, MulChar.coe_toUnitHom]
lemma Even.toUnitHom_eval_neg_one (hψ : ψ.Even) : ψ.toUnitHom (-1) = 1 := by
  rw [← Units.eq_iff, MulChar.coe_toUnitHom]
  

Proof state:
R : Type u_1
inst✝¹ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
S : Type
inst✝ : CommRing S
m : ℕ
ψ : DirichletCharacter S m
hψ : Even ψ
⊢ ψ ↑(-1) = ↑1

Next tactic:
exact hψ
lemma Odd.eval_neg (x : ZMod m) (hψ : ψ.Odd) : ψ (- x) = - ψ x := by
  

Proof state:
R : Type u_1
inst✝¹ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
S : Type
inst✝ : CommRing S
m : ℕ
ψ : DirichletCharacter S m
x : ZMod m
hψ : Odd ψ
⊢ ψ (-x) = -ψ x

Next tactic:
rw [Odd] at hψ
lemma Odd.eval_neg (x : ZMod m) (hψ : ψ.Odd) : ψ (- x) = - ψ x := by
  rw [Odd] at hψ
  

Proof state:
R : Type u_1
inst✝¹ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
S : Type
inst✝ : CommRing S
m : ℕ
ψ : DirichletCharacter S m
x : ZMod m
hψ : ψ (-1) = -1
⊢ ψ (-x) = -ψ x

Next tactic:
rw [← neg_one_mul, map_mul]
lemma Odd.eval_neg (x : ZMod m) (hψ : ψ.Odd) : ψ (- x) = - ψ x := by
  rw [Odd] at hψ
  rw [← neg_one_mul, map_mul]
  

Proof state:
R : Type u_1
inst✝¹ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
S : Type
inst✝ : CommRing S
m : ℕ
ψ : DirichletCharacter S m
x : ZMod m
hψ : ψ (-1) = -1
⊢ ψ (-1) * ψ x = -ψ x

Next tactic:
simp [hψ]
lemma Even.eval_neg (x : ZMod m) (hψ : ψ.Even) : ψ (- x) = ψ x := by
  

Proof state:
R : Type u_1
inst✝¹ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
S : Type
inst✝ : CommRing S
m : ℕ
ψ : DirichletCharacter S m
x : ZMod m
hψ : Even ψ
⊢ ψ (-x) = ψ x

Next tactic:
rw [Even] at hψ
lemma Even.eval_neg (x : ZMod m) (hψ : ψ.Even) : ψ (- x) = ψ x := by
  rw [Even] at hψ
  

Proof state:
R : Type u_1
inst✝¹ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
S : Type
inst✝ : CommRing S
m : ℕ
ψ : DirichletCharacter S m
x : ZMod m
hψ : ψ (-1) = 1
⊢ ψ (-x) = ψ x

Next tactic:
rw [← neg_one_mul, map_mul]
lemma Even.eval_neg (x : ZMod m) (hψ : ψ.Even) : ψ (- x) = ψ x := by
  rw [Even] at hψ
  rw [← neg_one_mul, map_mul]
  

Proof state:
R : Type u_1
inst✝¹ : CommMonoidWithZero R
n : ℕ
χ : DirichletCharacter R n
S : Type
inst✝ : CommRing S
m : ℕ
ψ : DirichletCharacter S m
x : ZMod m
hψ : ψ (-1) = 1
⊢ ψ (-1) * ψ x = ψ x

Next tactic:
simp [hψ]
@[simp]
theorem inl_mul [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A] (r₁ r₂ : R) :
    (inl (r₁ * r₂) : Unitization R A) = inl r₁ * inl r₂ :=
  ext rfl <|
    show (0 : A) = r₁ • (0 : A) + r₂ • (0 : A) + 0 * 0 by
      

Proof state:
R : Type u_1
A : Type u_2
inst✝² : Monoid R
inst✝¹ : NonUnitalNonAssocSemiring A
inst✝ : DistribMulAction R A
r₁ r₂ : R
⊢ 0 = r₁ • 0 + r₂ • 0 + 0 * 0

Next tactic:
simp only [smul_zero, add_zero, mul_zero]
@[simp]
theorem inr_mul [Semiring R] [AddCommMonoid A] [Mul A] [SMulWithZero R A] (a₁ a₂ : A) :
    (↑(a₁ * a₂) : Unitization R A) = a₁ * a₂ :=
  ext (mul_zero _).symm <|
    show a₁ * a₂ = (0 : R) • a₂ + (0 : R) • a₁ + a₁ * a₂ by 

Proof state:
R : Type u_1
A : Type u_2
inst✝³ : Semiring R
inst✝² : AddCommMonoid A
inst✝¹ : Mul A
inst✝ : SMulWithZero R A
a₁ a₂ : A
⊢ a₁ * a₂ = 0 • a₂ + 0 • a₁ + a₁ * a₂

Next tactic:
simp only [zero_smul, zero_add]
theorem inl_mul_inr [Semiring R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A] (r : R)
    (a : A) : ((inl r : Unitization R A) * a) = ↑(r • a) :=
  ext (mul_zero r) <|
    show r • a + (0 : R) • (0 : A) + 0 * a = r • a by
      

Proof state:
R : Type u_1
A : Type u_2
inst✝² : Semiring R
inst✝¹ : NonUnitalNonAssocSemiring A
inst✝ : DistribMulAction R A
r : R
a : A
⊢ r • a + 0 • 0 + 0 * a = r • a

Next tactic:
rw [smul_zero, add_zero, zero_mul, add_zero]
theorem inr_mul_inl [Semiring R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A] (r : R)
    (a : A) : a * (inl r : Unitization R A) = ↑(r • a) :=
  ext (zero_mul r) <|
    show (0 : R) • (0 : A) + r • a + a * 0 = r • a by
      

Proof state:
R : Type u_1
A : Type u_2
inst✝² : Semiring R
inst✝¹ : NonUnitalNonAssocSemiring A
inst✝ : DistribMulAction R A
r : R
a : A
⊢ 0 • 0 + r • a + a * 0 = r • a

Next tactic:
rw [smul_zero, zero_add, mul_zero, add_zero]
instance instMulOneClass [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A] :
    MulOneClass (Unitization R A) :=
  { Unitization.instOne, Unitization.instMul with
    one_mul := fun x =>
      ext (one_mul x.1) <|
        show (1 : R) • x.2 + x.1 • (0 : A) + 0 * x.2 = x.2 by
          

Proof state:
R : Type u_1
A : Type u_2
inst✝² : Monoid R
inst✝¹ : NonUnitalNonAssocSemiring A
inst✝ : DistribMulAction R A
src✝¹ : One (Unitization R A) := instOne
src✝ : Mul (Unitization R A) := instMul
x : Unitization R A
⊢ 1 • x.2 + x.1 • 0 + 0 * x.2 = x.2

Next tactic:
rw [one_smul, smul_zero, add_zero, zero_mul, add_zero]
instance instMulOneClass [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A] :
    MulOneClass (Unitization R A) :=
  { Unitization.instOne, Unitization.instMul with
    one_mul := fun x =>
      ext (one_mul x.1) <|
        show (1 : R) • x.2 + x.1 • (0 : A) + 0 * x.2 = x.2 by
          rw [one_smul, smul_zero, add_zero, zero_mul, add_zero]
    mul_one := fun x =>
      ext (mul_one x.1) <|
        show (x.1 • (0 : A)) + (1 : R) • x.2 + x.2 * (0 : A) = x.2 by
          

Proof state:
R : Type u_1
A : Type u_2
inst✝² : Monoid R
inst✝¹ : NonUnitalNonAssocSemiring A
inst✝ : DistribMulAction R A
src✝¹ : One (Unitization R A) := instOne
src✝ : Mul (Unitization R A) := instMul
x : Unitization R A
⊢ x.1 • 0 + 1 • x.2 + x.2 * 0 = x.2

Next tactic:
rw [smul_zero, zero_add, one_smul, mul_zero, add_zero]
instance instNonAssocSemiring [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A] :
    NonAssocSemiring (Unitization R A) :=
  { Unitization.instMulOneClass,
    Unitization.instAddCommMonoid with
    zero_mul := fun x =>
      ext (zero_mul x.1) <|
        show (0 : R) • x.2 + x.1 • (0 : A) + 0 * x.2 = 0 by
          rw [zero_smul, zero_add, smul_zero, zero_mul, add_zero]
    mul_zero := fun x =>
      ext (mul_zero x.1) <|
        show x.1 • (0 : A) + (0 : R) • x.2 + x.2 * 0 = 0 by
          rw [smul_zero, zero_add, zero_smul, mul_zero, add_zero]
    left_distrib := fun x₁ x₂ x₃ =>
      ext (mul_add x₁.1 x₂.1 x₃.1) <|
        show x₁.1 • (x₂.2 + x₃.2) + (x₂.1 + x₃.1) • x₁.2 + x₁.2 * (x₂.2 + x₃.2) =
            x₁.1 • x₂.2 + x₂.1 • x₁.2 + x₁.2 * x₂.2 + (x₁.1 • x₃.2 + x₃.1 • x₁.2 + x₁.2 * x₃.2) by
          

Proof state:
R : Type u_1
A : Type u_2
inst✝² : Semiring R
inst✝¹ : NonUnitalNonAssocSemiring A
inst✝ : Module R A
src✝¹ : MulOneClass (Unitization R A) := instMulOneClass
src✝ : AddCommMonoid (Unitization R A) := instAddCommMonoid
x₁ x₂ x₃ : Unitization R A
⊢ x₁.1 • (x₂.2 + x₃.2) + (x₂.1 + x₃.1) • x₁.2 + x₁.2 * (x₂.2 + x₃.2) =
    x₁.1 • x₂.2 + x₂.1 • x₁.2 + x₁.2 * x₂.2 + (x₁.1 • x₃.2 + x₃.1 • x₁.2 + x₁.2 * x₃.2)

Next tactic:
simp only [smul_add, add_smul, mul_add]
instance instNonAssocSemiring [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A] :
    NonAssocSemiring (Unitization R A) :=
  { Unitization.instMulOneClass,
    Unitization.instAddCommMonoid with
    zero_mul := fun x =>
      ext (zero_mul x.1) <|
        show (0 : R) • x.2 + x.1 • (0 : A) + 0 * x.2 = 0 by
          rw [zero_smul, zero_add, smul_zero, zero_mul, add_zero]
    mul_zero := fun x =>
      ext (mul_zero x.1) <|
        show x.1 • (0 : A) + (0 : R) • x.2 + x.2 * 0 = 0 by
          rw [smul_zero, zero_add, zero_smul, mul_zero, add_zero]
    left_distrib := fun x₁ x₂ x₃ =>
      ext (mul_add x₁.1 x₂.1 x₃.1) <|
        show x₁.1 • (x₂.2 + x₃.2) + (x₂.1 + x₃.1) • x₁.2 + x₁.2 * (x₂.2 + x₃.2) =
            x₁.1 • x₂.2 + x₂.1 • x₁.2 + x₁.2 * x₂.2 + (x₁.1 • x₃.2 + x₃.1 • x₁.2 + x₁.2 * x₃.2) by
          simp only [smul_add, add_smul, mul_add]
          

Proof state:
R : Type u_1
A : Type u_2
inst✝² : Semiring R
inst✝¹ : NonUnitalNonAssocSemiring A
inst✝ : Module R A
src✝¹ : MulOneClass (Unitization R A) := instMulOneClass
src✝ : AddCommMonoid (Unitization R A) := instAddCommMonoid
x₁ x₂ x₃ : Unitization R A
⊢ x₁.1 • x₂.2 + x₁.1 • x₃.2 + (x₂.1 • x₁.2 + x₃.1 • x₁.2) + (x₁.2 * x₂.2 + x₁.2 * x₃.2) =
    x₁.1 • x₂.2 + x₂.1 • x₁.2 + x₁.2 * x₂.2 + (x₁.1 • x₃.2 + x₃.1 • x₁.2 + x₁.2 * x₃.2)

Next tactic:
abel
instance instNonAssocSemiring [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A] :
    NonAssocSemiring (Unitization R A) :=
  { Unitization.instMulOneClass,
    Unitization.instAddCommMonoid with
    zero_mul := fun x =>
      ext (zero_mul x.1) <|
        show (0 : R) • x.2 + x.1 • (0 : A) + 0 * x.2 = 0 by
          rw [zero_smul, zero_add, smul_zero, zero_mul, add_zero]
    mul_zero := fun x =>
      ext (mul_zero x.1) <|
        show x.1 • (0 : A) + (0 : R) • x.2 + x.2 * 0 = 0 by
          rw [smul_zero, zero_add, zero_smul, mul_zero, add_zero]
    left_distrib := fun x₁ x₂ x₃ =>
      ext (mul_add x₁.1 x₂.1 x₃.1) <|
        show x₁.1 • (x₂.2 + x₃.2) + (x₂.1 + x₃.1) • x₁.2 + x₁.2 * (x₂.2 + x₃.2) =
            x₁.1 • x₂.2 + x₂.1 • x₁.2 + x₁.2 * x₂.2 + (x₁.1 • x₃.2 + x₃.1 • x₁.2 + x₁.2 * x₃.2) by
          simp only [smul_add, add_smul, mul_add]
          abel
    right_distrib := fun x₁ x₂ x₃ =>
      ext (add_mul x₁.1 x₂.1 x₃.1) <|
        show (x₁.1 + x₂.1) • x₃.2 + x₃.1 • (x₁.2 + x₂.2) + (x₁.2 + x₂.2) * x₃.2 =
            x₁.1 • x₃.2 + x₃.1 • x₁.2 + x₁.2 * x₃.2 + (x₂.1 • x₃.2 + x₃.1 • x₂.2 + x₂.2 * x₃.2) by
          

Proof state:
R : Type u_1
A : Type u_2
inst✝² : Semiring R
inst✝¹ : NonUnitalNonAssocSemiring A
inst✝ : Module R A
src✝¹ : MulOneClass (Unitization R A) := instMulOneClass
src✝ : AddCommMonoid (Unitization R A) := instAddCommMonoid
x₁ x₂ x₃ : Unitization R A
⊢ (x₁.1 + x₂.1) • x₃.2 + x₃.1 • (x₁.2 + x₂.2) + (x₁.2 + x₂.2) * x₃.2 =
    x₁.1 • x₃.2 + x₃.1 • x₁.2 + x₁.2 * x₃.2 + (x₂.1 • x₃.2 + x₃.1 • x₂.2 + x₂.2 * x₃.2)

Next tactic:
simp only [add_smul, smul_add, add_mul]
instance instNonAssocSemiring [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A] :
    NonAssocSemiring (Unitization R A) :=
  { Unitization.instMulOneClass,
    Unitization.instAddCommMonoid with
    zero_mul := fun x =>
      ext (zero_mul x.1) <|
        show (0 : R) • x.2 + x.1 • (0 : A) + 0 * x.2 = 0 by
          rw [zero_smul, zero_add, smul_zero, zero_mul, add_zero]
    mul_zero := fun x =>
      ext (mul_zero x.1) <|
        show x.1 • (0 : A) + (0 : R) • x.2 + x.2 * 0 = 0 by
          rw [smul_zero, zero_add, zero_smul, mul_zero, add_zero]
    left_distrib := fun x₁ x₂ x₃ =>
      ext (mul_add x₁.1 x₂.1 x₃.1) <|
        show x₁.1 • (x₂.2 + x₃.2) + (x₂.1 + x₃.1) • x₁.2 + x₁.2 * (x₂.2 + x₃.2) =
            x₁.1 • x₂.2 + x₂.1 • x₁.2 + x₁.2 * x₂.2 + (x₁.1 • x₃.2 + x₃.1 • x₁.2 + x₁.2 * x₃.2) by
          simp only [smul_add, add_smul, mul_add]
          abel
    right_distrib := fun x₁ x₂ x₃ =>
      ext (add_mul x₁.1 x₂.1 x₃.1) <|
        show (x₁.1 + x₂.1) • x₃.2 + x₃.1 • (x₁.2 + x₂.2) + (x₁.2 + x₂.2) * x₃.2 =
            x₁.1 • x₃.2 + x₃.1 • x₁.2 + x₁.2 * x₃.2 + (x₂.1 • x₃.2 + x₃.1 • x₂.2 + x₂.2 * x₃.2) by
          simp only [add_smul, smul_add, add_mul]
          

Proof state:
R : Type u_1
A : Type u_2
inst✝² : Semiring R
inst✝¹ : NonUnitalNonAssocSemiring A
inst✝ : Module R A
src✝¹ : MulOneClass (Unitization R A) := instMulOneClass
src✝ : AddCommMonoid (Unitization R A) := instAddCommMonoid
x₁ x₂ x₃ : Unitization R A
⊢ x₁.1 • x₃.2 + x₂.1 • x₃.2 + (x₃.1 • x₁.2 + x₃.1 • x₂.2) + (x₁.2 * x₃.2 + x₂.2 * x₃.2) =
    x₁.1 • x₃.2 + x₃.1 • x₁.2 + x₁.2 * x₃.2 + (x₂.1 • x₃.2 + x₃.1 • x₂.2 + x₂.2 * x₃.2)

Next tactic:
abel