Skip to content

Commit 14e35a2

Browse files
committed
refactor(LipschitzSmooth): derive const from affine + add ContinuousAffineMap companion
- `lipschitzSmoothWith_const` now derived as a one-liner from `lipschitzSmoothWith_affine` with `ℓ = 0` (was duplicated proof). - Add `lipschitzSmoothWith_continuousAffineMap` in `Algebra.lean` as the bundled `ContinuousAffineMap` companion to the linear+const form in `Basic.lean`. Mathematically cleanest statement, but stays in `Algebra.lean` since it pulls in `ContinuousAffineMap`.
1 parent 3fea2f0 commit 14e35a2

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

Mathlib/Analysis/Calculus/LipschitzSmooth/Algebra.lean

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ variable {F F' : Type*} [NormedAddCommGroup F] [NormedSpace ℝ F]
2727
[NormedAddCommGroup F'] [NormedSpace ℝ F']
2828
variable {K K₁ K₂ : NNReal} {f f₁ f₂ : F → ℝ}
2929

30+
/-- A continuous affine map `A : F →ᴬ[ℝ] ℝ` is `0`-smooth. Bundled form of
31+
`lipschitzSmoothWith_affine` (which splits into linear part + constant). -/
32+
theorem lipschitzSmoothWith_continuousAffineMap (A : F →ᴬ[ℝ] ℝ) :
33+
LipschitzSmoothWith (0 : NNReal) (A : F → ℝ) := by
34+
rw [show (A : F → ℝ) = ⇑A.contLinear + Function.const F (A 0) from A.decomp]
35+
exact lipschitzSmoothWith_affine A.contLinear (A 0)
36+
3037
namespace LipschitzSmoothWith
3138

3239
/-- Sum of `K₁`-smooth and `K₂`-smooth (differentiable) is `(K₁ + K₂)`-smooth. -/

Mathlib/Analysis/Calculus/LipschitzSmooth/Basic.lean

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,6 @@ end LipschitzSmoothWith
124124

125125
/-! ### Algebraic preservation -/
126126

127-
/-- A constant function is `0`-smooth. -/
128-
theorem lipschitzSmoothWith_const (c : ℝ) : LipschitzSmoothWith (0 : NNReal) (fun _ : F => c) :=
129-
lipschitzSmoothWith_iff_lineDeriv.mpr fun x y => by
130-
have h : HasFDerivAt (fun _ : F => c) (0 : F →L[ℝ] ℝ) x := hasFDerivAt_const c x
131-
rw [(h.hasLineDerivAt (y - x)).lineDeriv]
132-
simp
133-
134127
/-- An affine function `y ↦ ℓ y + c` is `0`-smooth. -/
135128
theorem lipschitzSmoothWith_affine (ℓ : F →L[ℝ] ℝ) (c : ℝ) :
136129
LipschitzSmoothWith (0 : NNReal) (fun y => ℓ y + c) :=
@@ -140,3 +133,7 @@ theorem lipschitzSmoothWith_affine (ℓ : F →L[ℝ] ℝ) (c : ℝ) :
140133
push_cast
141134
linarith
142135

136+
/-- A constant function is `0`-smooth. Special case of `lipschitzSmoothWith_affine` with `ℓ = 0`. -/
137+
theorem lipschitzSmoothWith_const (c : ℝ) : LipschitzSmoothWith (0 : NNReal) (fun _ : F => c) := by
138+
simpa using lipschitzSmoothWith_affine (0 : F →L[ℝ] ℝ) c
139+

0 commit comments

Comments
 (0)