awhecmu/canonical-drafter-extract-mathlib huggingface dataset:
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (hypothesis)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
x : 𝕜
hf : AnalyticAt 𝕜 f x
inst_3 : CompleteSpace E
inst_4 : CharZero 𝕜
s : ℕ
hrne : s + 1 ≠ 0
F : 𝕜 → E
hFa : AnalyticAt 𝕜 F x
hFne : F x ≠ 0
hfF : ∀ᶠ (z : 𝕜) in 𝓝 x, f z = (z - x) ^ (s + 1) • F z + f x
U : Set 𝕜
hUf : ∀ y ∈ U, f y = (y - x) ^ (s + 1) • F y + f x ∧ AnalyticAt 𝕜 F y
hUo : IsOpen[PseudoMetricSpace.toUniformSpace.toTopologicalSpace] U
hUx : x ∈ U
this : ∀ y ∈ U, deriv f y = (y - x) ^ (s + 1) • deriv F y + (s + 1) • (y - x) ^ s • F y
⊢ analyticOrderAt.{u_1, u_2} (E := E)
      (fun (x_1 : 𝕜) ↦ (x_1 - x) ^ (s + 1) • deriv F x_1 + (s + 1) • (x_1 - x) ^ s • F x_1) x =
    (↑s : ℕ∞)
have this₁ : analyticOrderAt.{u_1, u_2} (E := E) (fun (y : 𝕜) ↦ (s + 1) • (y - x) ^ s • F y) x = (↑s : ℕ∞)
Tactic: have : analyticOrderAt (fun y ↦ (s + 1) • (y - x) ^ s • F y) x = s := by
      rw [analyticOrderAt_eq_natCast]
      · refine ⟨fun z ↦ (↑(s + 1) : 𝕜) • F z, hFa.fun_const_smul, ?_, .of_forall fun y ↦ ?_⟩
        · simpa using ⟨by norm_cast, hFne⟩
        · simpa only [Nat.cast_smul_eq_nsmul] using smul_comm ..
      · simp_rw [← Nat.cast_smul_eq_nsmul 𝕜]
        fun_prop
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
x : 𝕜
hf : AnalyticAt 𝕜 f x
inst_3 : CompleteSpace E
inst_4 : CharZero 𝕜
s : ℕ
hrne : s + 1 ≠ 0
F : 𝕜 → E
hFa : AnalyticAt 𝕜 F x
hFne : F x ≠ 0
hfF : ∀ᶠ (z : 𝕜) in 𝓝 x, f z = (z - x) ^ (s + 1) • F z + f x
U : Set 𝕜
hUf : ∀ y ∈ U, f y = (y - x) ^ (s + 1) • F y + f x ∧ AnalyticAt 𝕜 F y
hUo : IsOpen[PseudoMetricSpace.toUniformSpace.toTopologicalSpace] U
hUx : x ∈ U
this_1 : ∀ y ∈ U, deriv f y = (y - x) ^ (s + 1) • deriv F y + (s + 1) • (y - x) ^ s • F y
this : analyticOrderAt.{u_1, u_2} (E := E) (fun (y : 𝕜) ↦ (s + 1) • (y - x) ^ s • F y) x = (↑s : ℕ∞)
⊢ analyticOrderAt.{u_1, u_2} (E := E)
      (fun (x_1 : 𝕜) ↦ (x_1 - x) ^ (s + 1) • deriv F x_1 + (s + 1) • (x_1 - x) ^ s • F x_1) x =
    (↑s : ℕ∞)
have coe : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ (s + 1) • (x_1 - x) ^ s • F x_1) x <
  analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ (x_1 - x) ^ (s + 1) • deriv F x_1) x
Tactic: rwa [← Pi.add_def, analyticOrderAt_add_eq_right_of_lt]
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
x : 𝕜
hf : AnalyticAt 𝕜 f x
inst_3 : CompleteSpace E
inst_4 : CharZero 𝕜
s : ℕ
hrne : s + 1 ≠ 0
F : 𝕜 → E
hFa : AnalyticAt 𝕜 F x
hFne : F x ≠ 0
hfF : ∀ᶠ (z : 𝕜) in 𝓝 x, f z = (z - x) ^ (s + 1) • F z + f x
U : Set 𝕜
hUf : ∀ y ∈ U, f y = (y - x) ^ (s + 1) • F y + f x ∧ AnalyticAt 𝕜 F y
hUo : IsOpen[PseudoMetricSpace.toUniformSpace.toTopologicalSpace] U
hUx : x ∈ U
this_1 : ∀ y ∈ U, deriv f y = (y - x) ^ (s + 1) • deriv F y + (s + 1) • (y - x) ^ s • F y
this : analyticOrderAt.{u_1, u_2} (E := E) (fun (y : 𝕜) ↦ (s + 1) • (y - x) ^ s • F y) x = (↑s : ℕ∞)
⊢ analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ (s + 1) • (x_1 - x) ^ s • F x_1) x <
    analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ (x_1 - x) ^ (s + 1) • deriv F x_1) x
have coe : ∃ (g : 𝕜 → E), AnalyticAt 𝕜 g x ∧ ∀ᶠ (z : 𝕜) in 𝓝 x, (z - x) ^ (s + 1) • deriv F z = (z - x) ^ (s + 1) • g z
Tactic: rw [this, ← Order.succ_le_iff_of_not_isMax (not_isMax_iff.mpr ⟨⊤, ENat.coe_lt_top s⟩),
      ENat.succ_def, ← Nat.cast_add_one, natCast_le_analyticOrderAt (by fun_prop)]
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
x : 𝕜
hf : AnalyticAt 𝕜 f x
inst_3 : CompleteSpace E
inst_4 : CharZero 𝕜
r : ℕ∞
h : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = r
⊢ analyticOrderAt (deriv f) x + 1 = r
have top : ∀ (h : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = ⊤), analyticOrderAt (deriv f) x + 1 = ⊤
Tactic: cases r with
  | top =>
    suffices analyticOrderAt (deriv f) x = ⊤ by simp_all
    simp only [analyticOrderAt_eq_top, sub_eq_zero] at h ⊢
    obtain ⟨U, hUf, hUo, hUx⟩ := eventually_nhds_iff.mp h
    filter_upwards [hUo.mem_nhds hUx] with y hy
    simp [(eventuallyEq_of_mem (hUo.mem_nhds hy) hUf).deriv_eq]
  | coe r =>
    have hrne : r ≠ 0 := by
      intro hr
      rw [hr, ENat.coe_zero, AnalyticAt.analyticOrderAt_eq_zero (by fun_prop)] at h
      grind
    obtain ⟨s, rfl⟩ := Nat.exists_add_one_eq.mpr (Nat.pos_of_ne_zero hrne)
    rw [Nat.cast_succ]
    congr 1
    rw [analyticOrderAt_eq_natCast (by fun_prop)] at h
    obtain ⟨F, hFa, hFne, hfF⟩ := h
    simp only [sub_eq_iff_eq_add] at hfF
    obtain ⟨U, hUf, hUo, hUx⟩ := eventually_nhds_iff.mp (hfF.and hFa.eventually_analyticAt)
    have : ∀ y ∈ U, deriv f y =
        (y - x) ^ (s + 1) • deriv F y + (s + 1) • (y - x) ^ s • F y := by
      intro y hy
      rw [EventuallyEq.deriv_eq (eventually_of_mem (hUo.mem_nhds hy) (fun u hu ↦ (hUf u hu).1)),
        deriv_add_const, deriv_fun_smul (by fun_prop) (hUf y hy).2.differentiableAt]
      simp [mul_smul, add_smul, Nat.cast_smul_eq_nsmul]
    rw [analyticOrderAt_congr (eventually_of_mem (hUo.mem_nhds hUx) this)]
    have : analyticOrderAt (fun y ↦ (s + 1) • (y - x) ^ s • F y) x = s := by
      rw [analyticOrderAt_eq_natCast]
      · refine ⟨fun z ↦ (↑(s + 1) : 𝕜) • F z, hFa.fun_const_smul, ?_, .of_forall fun y ↦ ?_⟩
        · simpa using ⟨by norm_cast, hFne⟩
        · simpa only [Nat.cast_smul_eq_nsmul] using smul_comm ..
      · simp_rw [← Nat.cast_smul_eq_nsmul 𝕜]
        fun_prop
    rwa [← Pi.add_def, analyticOrderAt_add_eq_right_of_lt]
    rw [this, ← Order.succ_le_iff_of_not_isMax (not_isMax_iff.mpr ⟨⊤, ENat.coe_lt_top s⟩),
      ENat.succ_def, ← Nat.cast_add_one, natCast_le_analyticOrderAt (by fun_prop)]
    exact ⟨deriv F, hFa.deriv, by simp⟩
Cleared hypotheses: r, h
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
x : 𝕜
hf : AnalyticAt 𝕜 f x
inst_3 : CompleteSpace E
inst_4 : CharZero 𝕜
r : ℕ∞
h : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = r
top :
  ∀ (h : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = ⊤), analyticOrderAt (deriv f) x + 1 = ⊤
⊢ analyticOrderAt (deriv f) x + 1 = r
have coe : ∀ (r : ℕ) (h : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = (↑r : ℕ∞)),
  analyticOrderAt (deriv f) x + 1 = (↑r : ℕ∞)
Tactic: cases r with
  | top =>
    suffices analyticOrderAt (deriv f) x = ⊤ by simp_all
    simp only [analyticOrderAt_eq_top, sub_eq_zero] at h ⊢
    obtain ⟨U, hUf, hUo, hUx⟩ := eventually_nhds_iff.mp h
    filter_upwards [hUo.mem_nhds hUx] with y hy
    simp [(eventuallyEq_of_mem (hUo.mem_nhds hy) hUf).deriv_eq]
  | coe r =>
    have hrne : r ≠ 0 := by
      intro hr
      rw [hr, ENat.coe_zero, AnalyticAt.analyticOrderAt_eq_zero (by fun_prop)] at h
      grind
    obtain ⟨s, rfl⟩ := Nat.exists_add_one_eq.mpr (Nat.pos_of_ne_zero hrne)
    rw [Nat.cast_succ]
    congr 1
    rw [analyticOrderAt_eq_natCast (by fun_prop)] at h
    obtain ⟨F, hFa, hFne, hfF⟩ := h
    simp only [sub_eq_iff_eq_add] at hfF
    obtain ⟨U, hUf, hUo, hUx⟩ := eventually_nhds_iff.mp (hfF.and hFa.eventually_analyticAt)
    have : ∀ y ∈ U, deriv f y =
        (y - x) ^ (s + 1) • deriv F y + (s + 1) • (y - x) ^ s • F y := by
      intro y hy
      rw [EventuallyEq.deriv_eq (eventually_of_mem (hUo.mem_nhds hy) (fun u hu ↦ (hUf u hu).1)),
        deriv_add_const, deriv_fun_smul (by fun_prop) (hUf y hy).2.differentiableAt]
      simp [mul_smul, add_smul, Nat.cast_smul_eq_nsmul]
    rw [analyticOrderAt_congr (eventually_of_mem (hUo.mem_nhds hUx) this)]
    have : analyticOrderAt (fun y ↦ (s + 1) • (y - x) ^ s • F y) x = s := by
      rw [analyticOrderAt_eq_natCast]
      · refine ⟨fun z ↦ (↑(s + 1) : 𝕜) • F z, hFa.fun_const_smul, ?_, .of_forall fun y ↦ ?_⟩
        · simpa using ⟨by norm_cast, hFne⟩
        · simpa only [Nat.cast_smul_eq_nsmul] using smul_comm ..
      · simp_rw [← Nat.cast_smul_eq_nsmul 𝕜]
        fun_prop
    rwa [← Pi.add_def, analyticOrderAt_add_eq_right_of_lt]
    rw [this, ← Order.succ_le_iff_of_not_isMax (not_isMax_iff.mpr ⟨⊤, ENat.coe_lt_top s⟩),
      ENat.succ_def, ← Nat.cast_add_one, natCast_le_analyticOrderAt (by fun_prop)]
    exact ⟨deriv F, hFa.deriv, by simp⟩
Cleared hypotheses: r, h
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
x : 𝕜
hf : AnalyticAt 𝕜 f x
hf' : deriv f x ≠ 0
⊢ analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = 1
have generalize : ∀ (r : ℕ∞) (h : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = r), r = 1
Tactic: generalize h : analyticOrderAt (f · - f x) x = r
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (hypothesis)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
x : 𝕜
hf : AnalyticAt 𝕜 f x
hf' : deriv f x ≠ 0
h : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = ⊤
⊢ Eq (α := ℕ∞) ⊤ 1
have h₁ : ∀ᶠ (z : 𝕜) in 𝓝 x, f z = f x
Tactic: simp_rw [analyticOrderAt_eq_top, sub_eq_zero] at h
Cleared hypotheses: h
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
x : 𝕜
hf : AnalyticAt 𝕜 f x
hf' : deriv f x ≠ 0
h : ∀ᶠ (z : 𝕜) in 𝓝 x, f z = f x
⊢ Eq (α := ℕ∞) ⊤ 1
have top : deriv f x = 0
Tactic: refine (hf' ?_).elim
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
x : 𝕜
hf : AnalyticAt 𝕜 f x
hf' : deriv f x ≠ 0
h : ∀ᶠ (z : 𝕜) in 𝓝 x, f z = f x
⊢ deriv f x = 0
have top : Eq.{u_2 + 1} (α := E) (deriv (fun (x_1 : 𝕜) ↦ f x) x) 0
Tactic: rw [EventuallyEq.deriv_eq h, deriv_const]
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
x : 𝕜
hf : AnalyticAt 𝕜 f x
hf' : deriv f x ≠ 0
h : ∀ᶠ (z : 𝕜) in 𝓝 x, f z = f x
top : Eq.{u_2 + 1} (α := E) (deriv (fun (x_1 : 𝕜) ↦ f x) x) 0
⊢ deriv f x = 0
have top₁ : Eq.{u_2 + 1} (α := E) 0 0
Tactic: rw [EventuallyEq.deriv_eq h, deriv_const]
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
x : 𝕜
hf : AnalyticAt 𝕜 f x
hf' : deriv f x ≠ 0
r : ℕ
h : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = (↑r : ℕ∞)
⊢ Eq (α := ℕ∞) (↑r : ℕ∞) 1
have coe : r = 1
Tactic: norm_cast
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
x : 𝕜
hf : AnalyticAt 𝕜 f x
hf' : deriv f x ≠ 0
r : ℕ
h : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = (↑r : ℕ∞)
⊢ r = 1
have coe : ∀ (F : 𝕜 → E) (hFa : AnalyticAt 𝕜 F x) (hFne : F x ≠ 0) (hfF : ∀ᶠ (z : 𝕜) in 𝓝 x, f z - f x = (z - x) ^ r • F z), r = 1
Tactic: obtain ⟨F, hFa, hFne, hfF⟩ := (analyticOrderAt_eq_natCast (by fun_prop)).mp h
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
x : 𝕜
hf : AnalyticAt 𝕜 f x
hf' : deriv f x ≠ 0
r : ℕ
h : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = (↑r : ℕ∞)
F : 𝕜 → E
hFa : AnalyticAt 𝕜 F x
hFne : F x ≠ 0
hfF : ∀ᶠ (z : 𝕜) in 𝓝 x, f z - f x = (z - x) ^ r • F z
⊢ r = 1
have coe : 1 ≤ r
Tactic: apply eq_of_ge_of_le
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
x : 𝕜
hf : AnalyticAt 𝕜 f x
hf' : deriv f x ≠ 0
r : ℕ
h : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = (↑r : ℕ∞)
F : 𝕜 → E
hFa : AnalyticAt 𝕜 F x
hFne : F x ≠ 0
hfF : ∀ᶠ (z : 𝕜) in 𝓝 x, f z - f x = (z - x) ^ r • F z
coe : 1 ≤ r
⊢ r = 1
have coe₁ : r ≤ 1
Tactic: apply eq_of_ge_of_le
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
x : 𝕜
hf : AnalyticAt 𝕜 f x
hf' : deriv f x ≠ 0
r : ℕ
h : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = (↑r : ℕ∞)
F : 𝕜 → E
hFa : AnalyticAt 𝕜 F x
hFne : F x ≠ 0
hfF : ∀ᶠ (z : 𝕜) in 𝓝 x, f z - f x = (z - x) ^ r • F z
⊢ 1 ≤ r
have coe : ∀ (hr : r < 1), False
Tactic: by_contra! hr
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (hypothesis)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
x : 𝕜
hf : AnalyticAt 𝕜 f x
hf' : deriv f x ≠ 0
r : ℕ
h : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = (↑r : ℕ∞)
F : 𝕜 → E
hFa : AnalyticAt 𝕜 F x
hFne : F x ≠ 0
hfF : ∀ᶠ (z : 𝕜) in 𝓝 x, f z - f x = (z - x) ^ r • F z
hr : r < 1
⊢ False
have this : f x - f x = (x - x) ^ r • F x
Tactic: have := hfF.self_of_nhds
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
x : 𝕜
hf : AnalyticAt 𝕜 f x
hf' : deriv f x ≠ 0
r : ℕ
h : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = (↑r : ℕ∞)
F : 𝕜 → E
hFa : AnalyticAt 𝕜 F x
hFne : F x ≠ 0
hfF : ∀ᶠ (z : 𝕜) in 𝓝 x, f z - f x = (z - x) ^ r • F z
⊢ r ≤ 1
have coe : ∀ (hf' : 1 < r), deriv f x = 0
Tactic: contrapose! hf'
Cleared hypotheses: hf'
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (hypothesis)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
x : 𝕜
hf : AnalyticAt 𝕜 f x
r : ℕ
h : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = (↑r : ℕ∞)
F : 𝕜 → E
hFa : AnalyticAt 𝕜 F x
hFne : F x ≠ 0
hfF : ∀ᶠ (z : 𝕜) in 𝓝 x, f z - f x = (z - x) ^ r • F z
hf' : 1 < r
⊢ deriv f x = 0
have hfF₁ : ∀ᶠ (z : 𝕜) in 𝓝 x, f z = (z - x) ^ r • F z + f x
Tactic: simp_rw [sub_eq_iff_eq_add] at hfF
Cleared hypotheses: hfF
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
x : 𝕜
hf : AnalyticAt 𝕜 f x
r : ℕ
h : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = (↑r : ℕ∞)
F : 𝕜 → E
hFa : AnalyticAt 𝕜 F x
hFne : F x ≠ 0
hf' : 1 < r
hfF : ∀ᶠ (z : 𝕜) in 𝓝 x, f z = (z - x) ^ r • F z + f x
⊢ DifferentiableAt 𝕜 F x
have funProp : IsBoundedLinearMap.{u_1, u_1, u_2} 𝕜 (F := E) fun (a : 𝕜) ↦ F a
Tactic: fun_prop
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
x : 𝕜
hf : AnalyticAt 𝕜 f x
hf' : deriv f x ≠ 0
r : ℕ∞
h : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = r
⊢ r = 1
have top : ∀ (h : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = ⊤), Eq (α := ℕ∞) ⊤ 1
Tactic: cases r with
  | top =>
    simp_rw [analyticOrderAt_eq_top, sub_eq_zero] at h
    refine (hf' ?_).elim
    rw [EventuallyEq.deriv_eq h, deriv_const]
  | coe r =>
    norm_cast
    obtain ⟨F, hFa, hFne, hfF⟩ := (analyticOrderAt_eq_natCast (by fun_prop)).mp h
    apply eq_of_ge_of_le
    · by_contra! hr
      have := hfF.self_of_nhds
      simp_all
    · contrapose! hf'
      simp_rw [sub_eq_iff_eq_add] at hfF
      rw [EventuallyEq.deriv_eq hfF, deriv_add_const, deriv_fun_smul (by fun_prop) (by fun_prop),
        deriv_fun_pow (by fun_prop), sub_self, zero_pow (by lia), zero_pow (by lia),
        mul_zero, zero_mul, zero_smul, zero_smul, add_zero]
Cleared hypotheses: r, h
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
x : 𝕜
hf : AnalyticAt 𝕜 f x
hf' : deriv f x ≠ 0
r : ℕ∞
h : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = r
top : ∀ (h : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = ⊤), Eq (α := ℕ∞) ⊤ 1
⊢ r = 1
have coe : ∀ (r : ℕ) (h : analyticOrderAt.{u_1, u_2} (E := E) (fun (x_1 : 𝕜) ↦ f x_1 - f x) x = (↑r : ℕ∞)),
  Eq (α := ℕ∞) (↑r : ℕ∞) 1
Tactic: cases r with
  | top =>
    simp_rw [analyticOrderAt_eq_top, sub_eq_zero] at h
    refine (hf' ?_).elim
    rw [EventuallyEq.deriv_eq h, deriv_const]
  | coe r =>
    norm_cast
    obtain ⟨F, hFa, hFne, hfF⟩ := (analyticOrderAt_eq_natCast (by fun_prop)).mp h
    apply eq_of_ge_of_le
    · by_contra! hr
      have := hfF.self_of_nhds
      simp_all
    · contrapose! hf'
      simp_rw [sub_eq_iff_eq_add] at hfF
      rw [EventuallyEq.deriv_eq hfF, deriv_add_const, deriv_fun_smul (by fun_prop) (by fun_prop),
        deriv_fun_pow (by fun_prop), sub_self, zero_pow (by lia), zero_pow (by lia),
        mul_zero, zero_mul, zero_smul, zero_smul, add_zero]
Cleared hypotheses: r, h
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
z₀ : 𝕜
inst_3 : CharZero 𝕜
inst_4 : CompleteSpace E
n : ℕ
IH : ∀ {f : 𝕜 → E} (hf : AnalyticAt 𝕜 f z₀), (↑n : ℕ∞) ≤ analyticOrderAt f z₀ ↔ ∀ i < n, iteratedDeriv i f z₀ = 0
f : 𝕜 → E
hf : AnalyticAt 𝕜 f z₀
⊢ (↑(n + 1) : ℕ∞) ≤ analyticOrderAt f z₀ ↔ ∀ i < n + 1, iteratedDeriv i f z₀ = 0
have pos : ∀ (hfz : f z₀ = 0), (↑(n + 1) : ℕ∞) ≤ analyticOrderAt f z₀ ↔ ∀ i < n + 1, iteratedDeriv i f z₀ = 0
Tactic: by_cases hfz : f z₀ = 0
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
z₀ : 𝕜
inst_3 : CharZero 𝕜
inst_4 : CompleteSpace E
n : ℕ
IH : ∀ {f : 𝕜 → E} (hf : AnalyticAt 𝕜 f z₀), (↑n : ℕ∞) ≤ analyticOrderAt f z₀ ↔ ∀ i < n, iteratedDeriv i f z₀ = 0
f : 𝕜 → E
hf : AnalyticAt 𝕜 f z₀
pos : ∀ (hfz : f z₀ = 0), (↑(n + 1) : ℕ∞) ≤ analyticOrderAt f z₀ ↔ ∀ i < n + 1, iteratedDeriv i f z₀ = 0
⊢ (↑(n + 1) : ℕ∞) ≤ analyticOrderAt f z₀ ↔ ∀ i < n + 1, iteratedDeriv i f z₀ = 0
have neg : ∀ (hfz : ¬f z₀ = 0), (↑(n + 1) : ℕ∞) ≤ analyticOrderAt f z₀ ↔ ∀ i < n + 1, iteratedDeriv i f z₀ = 0
Tactic: by_cases hfz : f z₀ = 0
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (hypothesis)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
z₀ : 𝕜
inst_3 : CharZero 𝕜
inst_4 : CompleteSpace E
n : ℕ
IH : ∀ {f : 𝕜 → E} (hf : AnalyticAt 𝕜 f z₀), (↑n : ℕ∞) ≤ analyticOrderAt f z₀ ↔ ∀ i < n, iteratedDeriv i f z₀ = 0
f : 𝕜 → E
hf : AnalyticAt 𝕜 f z₀
hfz : f z₀ = 0
⊢ (↑(n + 1) : ℕ∞) ≤ analyticOrderAt f z₀ ↔ ∀ i < n + 1, iteratedDeriv i f z₀ = 0
have this : analyticOrderAt (deriv f) z₀ + 1 = analyticOrderAt f z₀
Tactic: have : analyticOrderAt (deriv f) z₀ + 1 = analyticOrderAt f z₀ := by
      simpa [hfz] using hf.analyticOrderAt_deriv_add_one
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
n : ℕ
z₀ : 𝕜
inst_3 : CharZero 𝕜
inst_4 : CompleteSpace E
hf : AnalyticAt 𝕜 f z₀
⊢ (↑n : ℕ∞) ≤ analyticOrderAt f z₀ ↔ ∀ i < n, iteratedDeriv i f z₀ = 0
have zero : ∀ {f : 𝕜 → E} (hf : AnalyticAt 𝕜 f z₀), (↑0 : ℕ∞) ≤ analyticOrderAt f z₀ ↔ ∀ i < 0, iteratedDeriv i f z₀ = 0
Tactic: induction n generalizing f with
  | zero => simp
  | succ n IH =>
    by_cases hfz : f z₀ = 0; swap
    · simpa [analyticOrderAt_eq_zero.mpr (.inr hfz)] using ⟨0, by simp, by simpa⟩
    have : analyticOrderAt (deriv f) z₀ + 1 = analyticOrderAt f z₀ := by
      simpa [hfz] using hf.analyticOrderAt_deriv_add_one
    simp [← this, IH hf.deriv, iteratedDeriv_succ',
      -Order.lt_add_one_iff, Nat.forall_lt_succ_left, hfz]
Cleared hypotheses: f, n, hf
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_1
E : Type u_2
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
f : 𝕜 → E
n : ℕ
z₀ : 𝕜
inst_3 : CharZero 𝕜
inst_4 : CompleteSpace E
hf : AnalyticAt 𝕜 f z₀
zero : ∀ {f : 𝕜 → E} (hf : AnalyticAt 𝕜 f z₀), (↑0 : ℕ∞) ≤ analyticOrderAt f z₀ ↔ ∀ i < 0, iteratedDeriv i f z₀ = 0
⊢ (↑n : ℕ∞) ≤ analyticOrderAt f z₀ ↔ ∀ i < n, iteratedDeriv i f z₀ = 0
have succ : ∀ (n : ℕ)
  (IH : ∀ {f : 𝕜 → E} (hf : AnalyticAt 𝕜 f z₀), (↑n : ℕ∞) ≤ analyticOrderAt f z₀ ↔ ∀ i < n, iteratedDeriv i f z₀ = 0)
  {f : 𝕜 → E} (hf : AnalyticAt 𝕜 f z₀), (↑(n + 1) : ℕ∞) ≤ analyticOrderAt f z₀ ↔ ∀ i < n + 1, iteratedDeriv i f z₀ = 0
Tactic: induction n generalizing f with
  | zero => simp
  | succ n IH =>
    by_cases hfz : f z₀ = 0; swap
    · simpa [analyticOrderAt_eq_zero.mpr (.inr hfz)] using ⟨0, by simp, by simpa⟩
    have : analyticOrderAt (deriv f) z₀ + 1 = analyticOrderAt f z₀ := by
      simpa [hfz] using hf.analyticOrderAt_deriv_add_one
    simp [← this, IH hf.deriv, iteratedDeriv_succ',
      -Order.lt_add_one_iff, Nat.forall_lt_succ_left, hfz]
Cleared hypotheses: f, n, hf
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_3
E : Type u_4
inst : NontriviallyNormedField 𝕜
inst_1 : CharZero 𝕜
inst_2 : NormedAddCommGroup E
inst_3 : NormedSpace 𝕜 E
inst_4 : CompleteSpace E
f : 𝕜 → E
z₀ : 𝕜
hf : AnalyticAt 𝕜 f z₀
n : ℕ
horder : analyticOrderAt f z₀ = HAdd.hAdd (α := ℕ∞) (↑n : ℕ∞) 1
⊢ analyticOrderAt (deriv f) z₀ = (↑n : ℕ∞)
have have : ∀ (g : 𝕜 → E) (hg : AnalyticAt 𝕜 g z₀) (hg₀ : g z₀ ≠ 0)
  (hfg : ∀ᶠ (z : 𝕜) in 𝓝 z₀, f z = HPow.hPow (β := ℕ) (z - z₀) ((fun (x1 x2 : ℕ) ↦ x1 + x2) n 1) • g z),
  analyticOrderAt (deriv f) z₀ = (↑n : ℕ∞)
Tactic: have ⟨g, hg, hg₀, hfg⟩ := (AnalyticAt.analyticOrderAt_eq_natCast hf).1 horder
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (hypothesis)
Goal:
𝕜 : Type u_3
E : Type u_4
inst : NontriviallyNormedField 𝕜
inst_1 : CharZero 𝕜
inst_2 : NormedAddCommGroup E
inst_3 : NormedSpace 𝕜 E
inst_4 : CompleteSpace E
f : 𝕜 → E
z₀ : 𝕜
hf : AnalyticAt 𝕜 f z₀
n : ℕ
horder : analyticOrderAt f z₀ = HAdd.hAdd (α := ℕ∞) (↑n : ℕ∞) 1
g : 𝕜 → E
hg : AnalyticAt 𝕜 g z₀
hg₀ : g z₀ ≠ 0
hfg : ∀ᶠ (z : 𝕜) in 𝓝 z₀, f z = HPow.hPow (β := ℕ) (z - z₀) ((fun (x1 x2 : ℕ) ↦ x1 + x2) n 1) • g z
⊢ analyticOrderAt (deriv f) z₀ = (↑n : ℕ∞)
have hz₀ : f z₀ = 0
Tactic: have hz₀ : f z₀ = 0 := by
    simpa [sub_self, zero_pow, zero_smul] using Filter.Eventually.self_of_nhds hfg
-- Lean 4 proof step from Mathlib.Analysis.Analytic.Order (goal)
Goal:
𝕜 : Type u_3
E : Type u_4
inst : NontriviallyNormedField 𝕜
inst_1 : NormedAddCommGroup E
inst_2 : NormedSpace 𝕜 E
inst_3 : CompleteSpace E
f : 𝕜 → E
z₀ : 𝕜
hf : AnalyticAt 𝕜 f z₀
inst_4 : CharZero 𝕜
n' : ℕ
hk : ∀ {n : ℕ}, (↑n : ℕ∞) = analyticOrderAt f z₀ → n ≠ 0 → n' ≤ n → analyticOrderAt (deriv^[n'] f) z₀ = (↑(n - n') : ℕ∞)
n : ℕ
Hn : (↑n : ℕ∞) = analyticOrderAt f z₀
Hpos : n ≠ 0
Hk : n' + 1 ≤ n
⊢ analyticOrderAt (deriv^[n' + 1] f) z₀ = (↑(n - (n' + 1)) : ℕ∞)
have succ : analyticOrderAt ((deriv ∘ deriv^[n']) f) z₀ = (↑(n - (n' + 1)) : ℕ∞)
Tactic: rw [Function.iterate_succ']