Skip to content

Commit 9437e2a

Browse files
committed
feat(LipschitzSmooth): prove hasLineDerivAt
Fill in `LipschitzSmoothWith.hasLineDerivAt`: a `K`-smooth function is line-differentiable everywhere, and the `lineDeriv` value at every direction is the actual line derivative. The predicate bound |f(x + t·v) - f x - t · lineDeriv f x v| ≤ K/2 · t² · ‖v‖² (obtained by applying the abs-bound at `(x, x + t • v)` and factoring `t` via `lineDeriv_smul`) is `o(t)`, which is the `IsLittleO` form of `HasDerivAt` at `0` for the 1D restriction. The `continuous` field remains `sorry` pending a separate argument.
1 parent a7c6fe2 commit 9437e2a

1 file changed

Lines changed: 21 additions & 5 deletions

File tree

  • Mathlib/Analysis/Calculus/LipschitzSmooth

Mathlib/Analysis/Calculus/LipschitzSmooth/Basic.lean

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,28 @@ theorem lineDeriv_sub_apply_le (h : LipschitzSmoothWith K f) (x y : F) :
8888
Pi.sub_apply (lineDeriv ℝ f _) _ _ ▸ h.lineDeriv_apply_sub_le x y
8989

9090
/-- `K`-smoothness implies line-differentiability: the actual line derivative
91-
exists at every `x, v` and equals `lineDeriv ℝ f x v`. Proof: the predicate
92-
bound `|f(x + tv) - f x - t · L| ≤ K/2 · t² ‖v‖²` (via `lineDeriv_smul` to
93-
factor `t`) is `o(t)`. -/
91+
exists at every `x, v` and equals `lineDeriv ℝ f x v`. The predicate bound
92+
`|f(x + tv) - f x - t · L| ≤ K/2 · t² ‖v‖²` (via `lineDeriv_smul` to factor `t`)
93+
is `o(t)`. -/
9494
theorem hasLineDerivAt (h : LipschitzSmoothWith K f) (x v : F) :
95-
HasLineDerivAt ℝ f (lineDeriv ℝ f x v) x v :=
96-
sorry
95+
HasLineDerivAt ℝ f (lineDeriv ℝ f x v) x v := by
96+
set L := lineDeriv ℝ f x v
97+
change HasDerivAt (fun t : ℝ => f (x + t • v)) L 0
98+
rw [hasDerivAt_iff_isLittleO_nhds_zero, Asymptotics.isLittleO_iff]
99+
intro ε hε
100+
have hsum_pos : (0:ℝ) < ↑K * ‖v‖^2 / 2 + 1 := by positivity
101+
filter_upwards [Metric.ball_mem_nhds (0 : ℝ) (div_pos hε hsum_pos)] with t ht
102+
simp only [Metric.mem_ball, Real.dist_eq, sub_zero] at ht
103+
simp only [zero_add, zero_smul, add_zero, smul_eq_mul, Real.norm_eq_abs]
104+
have hpred := h x (x + t • v)
105+
rw [show (x + t • v) - x = t • v from by abel, lineDeriv_smul, smul_eq_mul,
106+
dist_self_add_right, norm_smul, Real.norm_eq_abs, mul_pow, sq_abs] at hpred
107+
refine hpred.trans ?_
108+
have ht' : |t| * (↑K * ‖v‖^2 / 2 + 1) < ε := (lt_div_iff₀ hsum_pos).mp ht
109+
have ht'' : ↑K * ‖v‖^2 / 2 * |t| ≤ ε := by nlinarith [abs_nonneg t]
110+
calc ↑K / 2 * (t ^ 2 * ‖v‖ ^ 2)
111+
= ↑K * ‖v‖^2 / 2 * |t| * |t| := by rw [← sq_abs t]; ring
112+
_ ≤ ε * |t| := mul_le_mul_of_nonneg_right ht'' (abs_nonneg t)
97113

98114
/-- A `K`-smooth function is line-differentiable everywhere. -/
99115
theorem lineDifferentiableAt (h : LipschitzSmoothWith K f) (x v : F) :

0 commit comments

Comments
 (0)