l3lab/ntp-mathlib huggingface dataset:
lemma fermatLastTheoremWith_nat_int_rat_tfae (n : ℕ) :
    TFAE [FermatLastTheoremWith ℕ n, FermatLastTheoremWith ℤ n, FermatLastTheoremWith ℚ n] := by
  tfae_have 1 → 2
  · rintro h a b c ha hb hc habc
    obtain hn | hn := n.even_or_odd
    · refine' h a.natAbs b.natAbs c.natAbs (by positivity) (by positivity) (by positivity)
        (Int.coe_nat_inj'.1 _)
      push_cast
      simp only [hn.pow_abs, habc]
    obtain ha | ha := ha.lt_or_lt <;> obtain hb | hb := hb.lt_or_lt <;>
      obtain hc | hc := hc.lt_or_lt
    · refine' h a.natAbs b.natAbs c.natAbs (by positivity) (by positivity) (by positivity)
        (Int.coe_nat_inj'.1 _)
      push_cast
      simp only [abs_of_neg, neg_pow a, neg_pow b, neg_pow c, ← mul_add, habc, *]
    · exact (by positivity : 0 < c ^ n).not_lt $ habc.symm.trans_lt $ add_neg (hn.pow_neg ha) $
        hn.pow_neg hb
    · refine' h b.natAbs c.natAbs a.natAbs (by positivity) (by positivity) (by positivity)
        (Int.coe_nat_inj'.1 _)
      push_cast
      simp only [abs_of_pos, abs_of_neg, hn.neg_pow, habc, add_neg_eq_iff_eq_add,
        eq_neg_add_iff_add_eq, *]
    · refine' h a.natAbs c.natAbs b.natAbs (by positivity) (by positivity) (by positivity)
        (Int.coe_nat_inj'.1 _)
      push_cast
      simp only [abs_of_pos, abs_of_neg, hn.neg_pow, habc, neg_add_eq_iff_eq_add,
        eq_neg_add_iff_add_eq, *]
    · refine' h c.natAbs a.natAbs b.natAbs (by positivity) (by positivity) (by positivity)
        (Int.coe_nat_inj'.1 _)
      push_cast
      simp only [abs_of_pos, abs_of_neg, hn.neg_pow, habc, neg_add_eq_iff_eq_add,
        eq_add_neg_iff_add_eq, *]
    · refine' h c.natAbs b.natAbs a.natAbs (by positivity) (by positivity) (by positivity)
        (Int.coe_nat_inj'.1 _)
      push_cast
      simp only [abs_of_pos, abs_of_neg, hn.neg_pow, habc, add_neg_eq_iff_eq_add,
        eq_add_neg_iff_add_eq, *]
    · exact (by positivity : 0 < a ^ n + b ^ n).not_lt $ habc.trans_lt $ hn.pow_neg hc
    · refine' h a.natAbs b.natAbs c.natAbs (by positivity) (by positivity) (by positivity)
        (Int.coe_nat_inj'.1 _)
      push_cast
      simp only [abs_of_pos, habc, *]
  tfae_have 2 → 3
  · rintro h a b c ha hb hc habc
    rw [← Rat.num_ne_zero] at ha hb hc
    have : a.den ≠ 0 := a.den_pos.ne'
    have : b.den ≠ 0 := b.den_pos.ne'
    have : c.den ≠ 0 := c.den_pos.ne'
    refine' h (a.num * b.den * c.den) (a.den * b.num * c.den) (a.den * b.den * c.num)
      (by positivity) (by positivity) (by positivity) _
    have : (a.den * b.den * c.den : ℚ) ^ n ≠ 0 := by positivity
    refine' Int.cast_injective $ (div_left_inj' this).1 _
    push_cast
    simp only [add_div, ← div_pow, mul_div_mul_comm, div_self (by positivity : (a.den : ℚ) ≠ 0),
      div_self (by positivity : (b.den : ℚ) ≠ 0), div_self (by 

Proof state:
α : Type u_1
inst✝¹ : Semiring α
inst✝ : NoZeroDivisors α
m n✝ n : ℕ
tfae_1_to_2 : FermatLastTheoremWith ℕ n → FermatLastTheoremWith ℤ n
h : FermatLastTheoremWith ℤ n
a b c : ℚ
ha : a.num ≠ 0
hb : b.num ≠ 0
hc : c.num ≠ 0
habc : a ^ n + b ^ n = c ^ n
this✝² : a.den ≠ 0
this✝¹ : b.den ≠ 0
this✝ : c.den ≠ 0
this : (↑a.den * ↑b.den * ↑c.den) ^ n ≠ 0
⊢ ↑c.den ≠ 0

Next tactic:
positivity
lemma fermatLastTheoremWith_nat_int_rat_tfae (n : ℕ) :
    TFAE [FermatLastTheoremWith ℕ n, FermatLastTheoremWith ℤ n, FermatLastTheoremWith ℚ n] := by
  tfae_have 1 → 2
  · rintro h a b c ha hb hc habc
    obtain hn | hn := n.even_or_odd
    · refine' h a.natAbs b.natAbs c.natAbs (by positivity) (by positivity) (by positivity)
        (Int.coe_nat_inj'.1 _)
      push_cast
      simp only [hn.pow_abs, habc]
    obtain ha | ha := ha.lt_or_lt <;> obtain hb | hb := hb.lt_or_lt <;>
      obtain hc | hc := hc.lt_or_lt
    · refine' h a.natAbs b.natAbs c.natAbs (by positivity) (by positivity) (by positivity)
        (Int.coe_nat_inj'.1 _)
      push_cast
      simp only [abs_of_neg, neg_pow a, neg_pow b, neg_pow c, ← mul_add, habc, *]
    · exact (by positivity : 0 < c ^ n).not_lt $ habc.symm.trans_lt $ add_neg (hn.pow_neg ha) $
        hn.pow_neg hb
    · refine' h b.natAbs c.natAbs a.natAbs (by positivity) (by positivity) (by positivity)
        (Int.coe_nat_inj'.1 _)
      push_cast
      simp only [abs_of_pos, abs_of_neg, hn.neg_pow, habc, add_neg_eq_iff_eq_add,
        eq_neg_add_iff_add_eq, *]
    · refine' h a.natAbs c.natAbs b.natAbs (by positivity) (by positivity) (by positivity)
        (Int.coe_nat_inj'.1 _)
      push_cast
      simp only [abs_of_pos, abs_of_neg, hn.neg_pow, habc, neg_add_eq_iff_eq_add,
        eq_neg_add_iff_add_eq, *]
    · refine' h c.natAbs a.natAbs b.natAbs (by positivity) (by positivity) (by positivity)
        (Int.coe_nat_inj'.1 _)
      push_cast
      simp only [abs_of_pos, abs_of_neg, hn.neg_pow, habc, neg_add_eq_iff_eq_add,
        eq_add_neg_iff_add_eq, *]
    · refine' h c.natAbs b.natAbs a.natAbs (by positivity) (by positivity) (by positivity)
        (Int.coe_nat_inj'.1 _)
      push_cast
      simp only [abs_of_pos, abs_of_neg, hn.neg_pow, habc, add_neg_eq_iff_eq_add,
        eq_add_neg_iff_add_eq, *]
    · exact (by positivity : 0 < a ^ n + b ^ n).not_lt $ habc.trans_lt $ hn.pow_neg hc
    · refine' h a.natAbs b.natAbs c.natAbs (by positivity) (by positivity) (by positivity)
        (Int.coe_nat_inj'.1 _)
      push_cast
      simp only [abs_of_pos, habc, *]
  tfae_have 2 → 3
  · rintro h a b c ha hb hc habc
    rw [← Rat.num_ne_zero] at ha hb hc
    have : a.den ≠ 0 := a.den_pos.ne'
    have : b.den ≠ 0 := b.den_pos.ne'
    have : c.den ≠ 0 := c.den_pos.ne'
    refine' h (a.num * b.den * c.den) (a.den * b.num * c.den) (a.den * b.den * c.num)
      (by positivity) (by positivity) (by positivity) _
    have : (a.den * b.den * c.den : ℚ) ^ n ≠ 0 := by positivity
    refine' Int.cast_injective $ (div_left_inj' this).1 _
    push_cast
    simp only [add_div, ← div_pow, mul_div_mul_comm, div_self (by positivity : (a.den : ℚ) ≠ 0),
      div_self (by positivity : (b.den : ℚ) ≠ 0), div_self (by positivity : (c.den : ℚ) ≠ 0),
      one_mul, mul_one, Rat.num_div_den, habc]
  

Proof state:
α : Type u_1
inst✝¹ : Semiring α
inst✝ : NoZeroDivisors α
m n✝ n : ℕ
tfae_1_to_2 : FermatLastTheoremWith ℕ n → FermatLastTheoremWith ℤ n
tfae_2_to_3 : FermatLastTheoremWith ℤ n → FermatLastTheoremWith ℚ n
⊢ TFAE [FermatLastTheoremWith ℕ n, FermatLastTheoremWith ℤ n, FermatLastTheoremWith ℚ n]

Next tactic:
tfae_have 3 → 1
theorem HasDerivWithinAt.smul (hc : HasDerivWithinAt c c' s x) (hf : HasDerivWithinAt f f' s x) :
    HasDerivWithinAt (fun y => c y • f y) (c x • f' + c' • f x) s x := by
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
inst✝³ : NontriviallyNormedField 𝕜'
inst✝² : NormedAlgebra 𝕜 𝕜'
inst✝¹ : NormedSpace 𝕜' F
inst✝ : IsScalarTower 𝕜 𝕜' F
c : 𝕜 → 𝕜'
c' : 𝕜'
hc : HasDerivWithinAt c c' s x
hf : HasDerivWithinAt f f' s x
⊢ HasDerivWithinAt (fun y => c y • f y) (c x • f' + c' • f x) s x

Next tactic:
simpa using (HasFDerivWithinAt.smul hc hf).hasDerivWithinAt
theorem HasDerivAt.smul (hc : HasDerivAt c c' x) (hf : HasDerivAt f f' x) :
    HasDerivAt (fun y => c y • f y) (c x • f' + c' • f x) x := by
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
inst✝³ : NontriviallyNormedField 𝕜'
inst✝² : NormedAlgebra 𝕜 𝕜'
inst✝¹ : NormedSpace 𝕜' F
inst✝ : IsScalarTower 𝕜 𝕜' F
c : 𝕜 → 𝕜'
c' : 𝕜'
hc : HasDerivAt c c' x
hf : HasDerivAt f f' x
⊢ HasDerivAt (fun y => c y • f y) (c x • f' + c' • f x) x

Next tactic:
rw [← hasDerivWithinAt_univ] at *
theorem HasDerivAt.smul (hc : HasDerivAt c c' x) (hf : HasDerivAt f f' x) :
    HasDerivAt (fun y => c y • f y) (c x • f' + c' • f x) x := by
  rw [← hasDerivWithinAt_univ] at *
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
inst✝³ : NontriviallyNormedField 𝕜'
inst✝² : NormedAlgebra 𝕜 𝕜'
inst✝¹ : NormedSpace 𝕜' F
inst✝ : IsScalarTower 𝕜 𝕜' F
c : 𝕜 → 𝕜'
c' : 𝕜'
hc : HasDerivWithinAt c c' univ x
hf : HasDerivWithinAt f f' univ x
⊢ HasDerivWithinAt (fun y => c y • f y) (c x • f' + c' • f x) univ x

Next tactic:
exact hc.smul hf
nonrec theorem HasStrictDerivAt.smul (hc : HasStrictDerivAt c c' x) (hf : HasStrictDerivAt f f' x) :
    HasStrictDerivAt (fun y => c y • f y) (c x • f' + c' • f x) x := by
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
inst✝³ : NontriviallyNormedField 𝕜'
inst✝² : NormedAlgebra 𝕜 𝕜'
inst✝¹ : NormedSpace 𝕜' F
inst✝ : IsScalarTower 𝕜 𝕜' F
c : 𝕜 → 𝕜'
c' : 𝕜'
hc : HasStrictDerivAt c c' x
hf : HasStrictDerivAt f f' x
⊢ HasStrictDerivAt (fun y => c y • f y) (c x • f' + c' • f x) x

Next tactic:
simpa using (hc.smul hf).hasStrictDerivAt
theorem HasStrictDerivAt.smul_const (hc : HasStrictDerivAt c c' x) (f : F) :
    HasStrictDerivAt (fun y => c y • f) (c' • f) x := by
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f✝ f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
inst✝³ : NontriviallyNormedField 𝕜'
inst✝² : NormedAlgebra 𝕜 𝕜'
inst✝¹ : NormedSpace 𝕜' F
inst✝ : IsScalarTower 𝕜 𝕜' F
c : 𝕜 → 𝕜'
c' : 𝕜'
hc : HasStrictDerivAt c c' x
f : F
⊢ HasStrictDerivAt (fun y => c y • f) (c' • f) x

Next tactic:
have := hc.smul (hasStrictDerivAt_const x f)
theorem HasStrictDerivAt.smul_const (hc : HasStrictDerivAt c c' x) (f : F) :
    HasStrictDerivAt (fun y => c y • f) (c' • f) x := by
  have := hc.smul (hasStrictDerivAt_const x f)
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f✝ f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
inst✝³ : NontriviallyNormedField 𝕜'
inst✝² : NormedAlgebra 𝕜 𝕜'
inst✝¹ : NormedSpace 𝕜' F
inst✝ : IsScalarTower 𝕜 𝕜' F
c : 𝕜 → 𝕜'
c' : 𝕜'
hc : HasStrictDerivAt c c' x
f : F
this : HasStrictDerivAt (fun y => c y • f) (c x • 0 + c' • f) x
⊢ HasStrictDerivAt (fun y => c y • f) (c' • f) x

Next tactic:
rwa [smul_zero, zero_add] at this
theorem HasDerivWithinAt.smul_const (hc : HasDerivWithinAt c c' s x) (f : F) :
    HasDerivWithinAt (fun y => c y • f) (c' • f) s x := by
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f✝ f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
inst✝³ : NontriviallyNormedField 𝕜'
inst✝² : NormedAlgebra 𝕜 𝕜'
inst✝¹ : NormedSpace 𝕜' F
inst✝ : IsScalarTower 𝕜 𝕜' F
c : 𝕜 → 𝕜'
c' : 𝕜'
hc : HasDerivWithinAt c c' s x
f : F
⊢ HasDerivWithinAt (fun y => c y • f) (c' • f) s x

Next tactic:
have := hc.smul (hasDerivWithinAt_const x s f)
theorem HasDerivWithinAt.smul_const (hc : HasDerivWithinAt c c' s x) (f : F) :
    HasDerivWithinAt (fun y => c y • f) (c' • f) s x := by
  have := hc.smul (hasDerivWithinAt_const x s f)
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f✝ f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
inst✝³ : NontriviallyNormedField 𝕜'
inst✝² : NormedAlgebra 𝕜 𝕜'
inst✝¹ : NormedSpace 𝕜' F
inst✝ : IsScalarTower 𝕜 𝕜' F
c : 𝕜 → 𝕜'
c' : 𝕜'
hc : HasDerivWithinAt c c' s x
f : F
this : HasDerivWithinAt (fun y => c y • f) (c x • 0 + c' • f) s x
⊢ HasDerivWithinAt (fun y => c y • f) (c' • f) s x

Next tactic:
rwa [smul_zero, zero_add] at this
theorem HasDerivAt.smul_const (hc : HasDerivAt c c' x) (f : F) :
    HasDerivAt (fun y => c y • f) (c' • f) x := by
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f✝ f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
inst✝³ : NontriviallyNormedField 𝕜'
inst✝² : NormedAlgebra 𝕜 𝕜'
inst✝¹ : NormedSpace 𝕜' F
inst✝ : IsScalarTower 𝕜 𝕜' F
c : 𝕜 → 𝕜'
c' : 𝕜'
hc : HasDerivAt c c' x
f : F
⊢ HasDerivAt (fun y => c y • f) (c' • f) x

Next tactic:
rw [← hasDerivWithinAt_univ] at *
theorem HasDerivAt.smul_const (hc : HasDerivAt c c' x) (f : F) :
    HasDerivAt (fun y => c y • f) (c' • f) x := by
  rw [← hasDerivWithinAt_univ] at *
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f✝ f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
inst✝³ : NontriviallyNormedField 𝕜'
inst✝² : NormedAlgebra 𝕜 𝕜'
inst✝¹ : NormedSpace 𝕜' F
inst✝ : IsScalarTower 𝕜 𝕜' F
c : 𝕜 → 𝕜'
c' : 𝕜'
hc : HasDerivWithinAt c c' univ x
f : F
⊢ HasDerivWithinAt (fun y => c y • f) (c' • f) univ x

Next tactic:
exact hc.smul_const f
nonrec theorem HasStrictDerivAt.const_smul (c : R) (hf : HasStrictDerivAt f f' x) :
    HasStrictDerivAt (fun y => c • f y) (c • f') x := by
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
R : Type u_1
inst✝³ : Semiring R
inst✝² : Module R F
inst✝¹ : SMulCommClass 𝕜 R F
inst✝ : ContinuousConstSMul R F
c : R
hf : HasStrictDerivAt f f' x
⊢ HasStrictDerivAt (fun y => c • f y) (c • f') x

Next tactic:
simpa using (hf.const_smul c).hasStrictDerivAt
nonrec theorem HasDerivAtFilter.const_smul (c : R) (hf : HasDerivAtFilter f f' x L) :
    HasDerivAtFilter (fun y => c • f y) (c • f') x L := by
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
R : Type u_1
inst✝³ : Semiring R
inst✝² : Module R F
inst✝¹ : SMulCommClass 𝕜 R F
inst✝ : ContinuousConstSMul R F
c : R
hf : HasDerivAtFilter f f' x L
⊢ HasDerivAtFilter (fun y => c • f y) (c • f') x L

Next tactic:
simpa using (hf.const_smul c).hasDerivAtFilter
theorem HasDerivWithinAt.mul (hc : HasDerivWithinAt c c' s x) (hd : HasDerivWithinAt d d' s x) :
    HasDerivWithinAt (fun y => c y * d y) (c' * d x + c x * d') s x := by
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
𝔸 : Type u_2
inst✝³ : NormedField 𝕜'
inst✝² : NormedRing 𝔸
inst✝¹ : NormedAlgebra 𝕜 𝕜'
inst✝ : NormedAlgebra 𝕜 𝔸
c d : 𝕜 → 𝔸
c' d' : 𝔸
u v : 𝕜 → 𝕜'
hc : HasDerivWithinAt c c' s x
hd : HasDerivWithinAt d d' s x
⊢ HasDerivWithinAt (fun y => c y * d y) (c' * d x + c x * d') s x

Next tactic:
have := (HasFDerivWithinAt.mul' hc hd).hasDerivWithinAt
theorem HasDerivWithinAt.mul (hc : HasDerivWithinAt c c' s x) (hd : HasDerivWithinAt d d' s x) :
    HasDerivWithinAt (fun y => c y * d y) (c' * d x + c x * d') s x := by
  have := (HasFDerivWithinAt.mul' hc hd).hasDerivWithinAt
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
𝔸 : Type u_2
inst✝³ : NormedField 𝕜'
inst✝² : NormedRing 𝔸
inst✝¹ : NormedAlgebra 𝕜 𝕜'
inst✝ : NormedAlgebra 𝕜 𝔸
c d : 𝕜 → 𝔸
c' d' : 𝔸
u v : 𝕜 → 𝕜'
hc : HasDerivWithinAt c c' s x
hd : HasDerivWithinAt d d' s x
this : HasDerivWithinAt (fun y => c y * d y) ((c x • smulRight 1 d' + smulRight (smulRight 1 c') (d x)) 1) s x
⊢ HasDerivWithinAt (fun y => c y * d y) (c' * d x + c x * d') s x

Next tactic:
rwa [ContinuousLinearMap.add_apply, ContinuousLinearMap.smul_apply,
    ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.smulRight_apply,
    ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.one_apply, one_smul, one_smul,
    add_comm] at this
theorem HasDerivAt.mul (hc : HasDerivAt c c' x) (hd : HasDerivAt d d' x) :
    HasDerivAt (fun y => c y * d y) (c' * d x + c x * d') x := by
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
𝔸 : Type u_2
inst✝³ : NormedField 𝕜'
inst✝² : NormedRing 𝔸
inst✝¹ : NormedAlgebra 𝕜 𝕜'
inst✝ : NormedAlgebra 𝕜 𝔸
c d : 𝕜 → 𝔸
c' d' : 𝔸
u v : 𝕜 → 𝕜'
hc : HasDerivAt c c' x
hd : HasDerivAt d d' x
⊢ HasDerivAt (fun y => c y * d y) (c' * d x + c x * d') x

Next tactic:
rw [← hasDerivWithinAt_univ] at *
theorem HasDerivAt.mul (hc : HasDerivAt c c' x) (hd : HasDerivAt d d' x) :
    HasDerivAt (fun y => c y * d y) (c' * d x + c x * d') x := by
  rw [← hasDerivWithinAt_univ] at *
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
𝔸 : Type u_2
inst✝³ : NormedField 𝕜'
inst✝² : NormedRing 𝔸
inst✝¹ : NormedAlgebra 𝕜 𝕜'
inst✝ : NormedAlgebra 𝕜 𝔸
c d : 𝕜 → 𝔸
c' d' : 𝔸
u v : 𝕜 → 𝕜'
hc : HasDerivWithinAt c c' univ x
hd : HasDerivWithinAt d d' univ x
⊢ HasDerivWithinAt (fun y => c y * d y) (c' * d x + c x * d') univ x

Next tactic:
exact hc.mul hd
theorem HasStrictDerivAt.mul (hc : HasStrictDerivAt c c' x) (hd : HasStrictDerivAt d d' x) :
    HasStrictDerivAt (fun y => c y * d y) (c' * d x + c x * d') x := by
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
𝔸 : Type u_2
inst✝³ : NormedField 𝕜'
inst✝² : NormedRing 𝔸
inst✝¹ : NormedAlgebra 𝕜 𝕜'
inst✝ : NormedAlgebra 𝕜 𝔸
c d : 𝕜 → 𝔸
c' d' : 𝔸
u v : 𝕜 → 𝕜'
hc : HasStrictDerivAt c c' x
hd : HasStrictDerivAt d d' x
⊢ HasStrictDerivAt (fun y => c y * d y) (c' * d x + c x * d') x

Next tactic:
have := (HasStrictFDerivAt.mul' hc hd).hasStrictDerivAt
theorem HasStrictDerivAt.mul (hc : HasStrictDerivAt c c' x) (hd : HasStrictDerivAt d d' x) :
    HasStrictDerivAt (fun y => c y * d y) (c' * d x + c x * d') x := by
  have := (HasStrictFDerivAt.mul' hc hd).hasStrictDerivAt
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
𝔸 : Type u_2
inst✝³ : NormedField 𝕜'
inst✝² : NormedRing 𝔸
inst✝¹ : NormedAlgebra 𝕜 𝕜'
inst✝ : NormedAlgebra 𝕜 𝔸
c d : 𝕜 → 𝔸
c' d' : 𝔸
u v : 𝕜 → 𝕜'
hc : HasStrictDerivAt c c' x
hd : HasStrictDerivAt d d' x
this : HasStrictDerivAt (fun y => c y * d y) ((c x • smulRight 1 d' + smulRight (smulRight 1 c') (d x)) 1) x
⊢ HasStrictDerivAt (fun y => c y * d y) (c' * d x + c x * d') x

Next tactic:
rwa [ContinuousLinearMap.add_apply, ContinuousLinearMap.smul_apply,
    ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.smulRight_apply,
    ContinuousLinearMap.smulRight_apply, ContinuousLinearMap.one_apply, one_smul, one_smul,
    add_comm] at this
theorem HasDerivWithinAt.mul_const (hc : HasDerivWithinAt c c' s x) (d : 𝔸) :
    HasDerivWithinAt (fun y => c y * d) (c' * d) s x := by
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
𝔸 : Type u_2
inst✝³ : NormedField 𝕜'
inst✝² : NormedRing 𝔸
inst✝¹ : NormedAlgebra 𝕜 𝕜'
inst✝ : NormedAlgebra 𝕜 𝔸
c d✝ : 𝕜 → 𝔸
c' d' : 𝔸
u v : 𝕜 → 𝕜'
hc : HasDerivWithinAt c c' s x
d : 𝔸
⊢ HasDerivWithinAt (fun y => c y * d) (c' * d) s x

Next tactic:
convert hc.mul (hasDerivWithinAt_const x s d) using 1
theorem HasDerivWithinAt.mul_const (hc : HasDerivWithinAt c c' s x) (d : 𝔸) :
    HasDerivWithinAt (fun y => c y * d) (c' * d) s x := by
  convert hc.mul (hasDerivWithinAt_const x s d) using 1
  

Proof state:
case h.e'_7
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
𝔸 : Type u_2
inst✝³ : NormedField 𝕜'
inst✝² : NormedRing 𝔸
inst✝¹ : NormedAlgebra 𝕜 𝕜'
inst✝ : NormedAlgebra 𝕜 𝔸
c d✝ : 𝕜 → 𝔸
c' d' : 𝔸
u v : 𝕜 → 𝕜'
hc : HasDerivWithinAt c c' s x
d : 𝔸
⊢ c' * d = c' * d + c x * 0

Next tactic:
rw [mul_zero, add_zero]
theorem HasDerivAt.mul_const (hc : HasDerivAt c c' x) (d : 𝔸) :
    HasDerivAt (fun y => c y * d) (c' * d) x := by
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
𝔸 : Type u_2
inst✝³ : NormedField 𝕜'
inst✝² : NormedRing 𝔸
inst✝¹ : NormedAlgebra 𝕜 𝕜'
inst✝ : NormedAlgebra 𝕜 𝔸
c d✝ : 𝕜 → 𝔸
c' d' : 𝔸
u v : 𝕜 → 𝕜'
hc : HasDerivAt c c' x
d : 𝔸
⊢ HasDerivAt (fun y => c y * d) (c' * d) x

Next tactic:
rw [← hasDerivWithinAt_univ] at *
theorem HasDerivAt.mul_const (hc : HasDerivAt c c' x) (d : 𝔸) :
    HasDerivAt (fun y => c y * d) (c' * d) x := by
  rw [← hasDerivWithinAt_univ] at *
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
𝔸 : Type u_2
inst✝³ : NormedField 𝕜'
inst✝² : NormedRing 𝔸
inst✝¹ : NormedAlgebra 𝕜 𝕜'
inst✝ : NormedAlgebra 𝕜 𝔸
c d✝ : 𝕜 → 𝔸
c' d' : 𝔸
u v : 𝕜 → 𝕜'
hc : HasDerivWithinAt c c' univ x
d : 𝔸
⊢ HasDerivWithinAt (fun y => c y * d) (c' * d) univ x

Next tactic:
exact hc.mul_const d
theorem hasDerivAt_mul_const (c : 𝕜) : HasDerivAt (fun x => x * c) c x := by
  

Proof state:
𝕜 : Type u
inst✝⁸ : NontriviallyNormedField 𝕜
F : Type v
inst✝⁷ : NormedAddCommGroup F
inst✝⁶ : NormedSpace 𝕜 F
E : Type w
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace 𝕜 E
f f₀ f₁ g : 𝕜 → F
f' f₀' f₁' g' : F
x : 𝕜
s t : Set 𝕜
L L₁ L₂ : Filter 𝕜
𝕜' : Type u_1
𝔸 : Type u_2
inst✝³ : NormedField 𝕜'
inst✝² : NormedRing 𝔸
inst✝¹ : NormedAlgebra 𝕜 𝕜'
inst✝ : NormedAlgebra 𝕜 𝔸
c✝ d : 𝕜 → 𝔸
c' d' : 𝔸
u v : 𝕜 → 𝕜'
c : 𝕜
⊢ HasDerivAt (fun x => x * c) c x

Next tactic:
simpa only [one_mul] using (hasDerivAt_id' x).mul_const c