From 9034383c6ee06378879d4584d318de81cdd98c47 Mon Sep 17 00:00:00 2001 From: Christoph Spiegel Date: Mon, 11 May 2026 15:19:57 +0200 Subject: [PATCH 1/2] feat(Analysis/Calculus/AddTorsor/AffineMap): add AffineMap.lineMap_contDiff --- .../Analysis/Calculus/AddTorsor/AffineMap.lean | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Mathlib/Analysis/Calculus/AddTorsor/AffineMap.lean b/Mathlib/Analysis/Calculus/AddTorsor/AffineMap.lean index 28e8e0571eb140..35c4fe78717019 100644 --- a/Mathlib/Analysis/Calculus/AddTorsor/AffineMap.lean +++ b/Mathlib/Analysis/Calculus/AddTorsor/AffineMap.lean @@ -34,3 +34,18 @@ theorem contDiff {n : WithTop โ„•โˆž} (f : V โ†’แดฌ[๐•œ] W) : ContDiff ๐•œ n f exact contDiff_const end ContinuousAffineMap + +namespace AffineMap + +variable {๐•œ V : Type*} [NontriviallyNormedField ๐•œ] +variable [NormedAddCommGroup V] [NormedSpace ๐•œ V] + +/-- `AffineMap.lineMap` is smooth as a function `๐•œ โ†’ V`. -/ +theorem lineMap_contDiff (pโ‚€ pโ‚ : V) {n : WithTop โ„•โˆž} : + ContDiff ๐•œ n (AffineMap.lineMap pโ‚€ pโ‚ : ๐•œ โ†’ V) := by + have : (AffineMap.lineMap pโ‚€ pโ‚ : ๐•œ โ†’ V) = fun c => c โ€ข (pโ‚ - pโ‚€) + pโ‚€ := + funext fun c => AffineMap.lineMap_apply_module' pโ‚€ pโ‚ c + rw [this] + fun_prop + +end AffineMap From 9b71b1a659a80bb3ae048b5b49cf848eb352d71c Mon Sep 17 00:00:00 2001 From: Christoph Spiegel Date: Mon, 11 May 2026 15:20:35 +0200 Subject: [PATCH 2/2] feat(CurveIntegral): segment-level lemmas and FTC along a line segment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Splits the existing `PathOperations` section into a dedicated `Segment` section with `[NormedSpace โ„ E]` hoisted to the variable block, and adds: - `curveIntegrable_segment_const` - `ContinuousOn.curveIntegrable_of_contDiffOn` - `Path.segment_contDiffOn` - `ContinuousOn.curveIntegrable_segment`, `Continuous.curveIntegrable_segment` - `curveIntegral_fderiv_segment` โ€” FTC along a line segment `curveIntegrable_segment` is renamed to `curveIntegrable_segment_iff` (deprecated alias retained). --- .../Integral/CurveIntegral/Basic.lean | 84 ++++++++++++++----- 1 file changed, 62 insertions(+), 22 deletions(-) diff --git a/Mathlib/MeasureTheory/Integral/CurveIntegral/Basic.lean b/Mathlib/MeasureTheory/Integral/CurveIntegral/Basic.lean index 75b8d7e351cd73..2315488e3368e8 100644 --- a/Mathlib/MeasureTheory/Integral/CurveIntegral/Basic.lean +++ b/Mathlib/MeasureTheory/Integral/CurveIntegral/Basic.lean @@ -6,11 +6,12 @@ Authors: Yury Kudryashov module public import Mathlib.Algebra.Order.Field.Pointwise +public import Mathlib.Analysis.Calculus.AddTorsor.AffineMap public import Mathlib.Analysis.Calculus.ContDiff.Deriv public import Mathlib.Analysis.Calculus.Deriv.AffineMap public import Mathlib.Analysis.Calculus.Deriv.Shift public import Mathlib.Analysis.Normed.Module.Convex -public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic +public import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus /-! # Integral of a 1-form along a path @@ -287,20 +288,59 @@ theorem curveIntegral_trans (hโ‚ : CurveIntegrable ฯ‰ ฮณab) (hโ‚‚ : CurveIntegr simp only [curveIntegral_def] norm_num -theorem curveIntegralFun_segment [NormedSpace โ„ E] (ฯ‰ : E โ†’ E โ†’L[๐•œ] F) (a b : E) - {t : โ„} (ht : t โˆˆ I) : curveIntegralFun ฯ‰ (.segment a b) t = ฯ‰ (lineMap a b t) (b - a) := by +end PathOperations + +section Segment + +variable {๐•œ E F : Type*} [RCLike ๐•œ] [NormedAddCommGroup E] [NormedSpace ๐•œ E] [NormedSpace โ„ E] + [NormedAddCommGroup F] [NormedSpace ๐•œ F] {a b c d : E} {ฯ‰ : E โ†’ E โ†’L[๐•œ] F} + {ฮณ ฮณab : Path a b} {ฮณbc : Path b c} {t : โ„} + +theorem curveIntegralFun_segment (ฯ‰ : E โ†’ E โ†’L[๐•œ] F) (a b : E) {t : โ„} (ht : t โˆˆ I) : + curveIntegralFun ฯ‰ (.segment a b) t = ฯ‰ (lineMap a b t) (b - a) := by have := Path.eqOn_extend_segment a b simp only [curveIntegralFun_def, this ht, derivWithin_congr this (this ht), (hasDerivWithinAt_lineMap ..).derivWithin (uniqueDiffOn_Icc_zero_one t ht)] -theorem curveIntegrable_segment [NormedSpace โ„ E] : - CurveIntegrable ฯ‰ (.segment a b) โ†” +theorem curveIntegrable_segment_iff : CurveIntegrable ฯ‰ (.segment a b) โ†” IntervalIntegrable (fun t โ†ฆ ฯ‰ (lineMap a b t) (b - a)) volume 0 1 := by rw [CurveIntegrable, intervalIntegrable_congr] rw [uIoc_of_le zero_le_one] exact .mono Ioc_subset_Icc_self fun _t โ†ฆ curveIntegralFun_segment ฯ‰ a b -theorem curveIntegral_segment [NormedSpace โ„ E] [NormedSpace โ„ F] (ฯ‰ : E โ†’ E โ†’L[๐•œ] F) (a b : E) : +@[deprecated (since := "2026-05-11")] alias curveIntegrable_segment := curveIntegrable_segment_iff + +@[simp] theorem curveIntegrable_segment_const (ฯ‰ : E โ†’L[๐•œ] F) (a b : E) : + CurveIntegrable (fun _ : E => ฯ‰) (.segment a b) := + curveIntegrable_segment_iff.mpr intervalIntegrable_const + +/-- If a 1-form `ฯ‰` is continuous on a set `s`, +then it is curve integrable along any $C^1$ path in this set. -/ +theorem ContinuousOn.curveIntegrable_of_contDiffOn {s : Set E} (hฯ‰ : ContinuousOn ฯ‰ s) + (hฮณ : ContDiffOn โ„ 1 ฮณ.extend I) (hฮณs : โˆ€ t, ฮณ t โˆˆ s) : CurveIntegrable ฯ‰ ฮณ := by + apply ContinuousOn.intervalIntegrable_of_Icc zero_le_one + simp only [funext (curveIntegralFun_def ฯ‰ ฮณ)] + apply ContinuousOn.clm_apply + ยท exact hฯ‰.comp (by fun_prop) fun _ _ โ†ฆ hฮณs _ + ยท exact hฮณ.continuousOn_derivWithin uniqueDiffOn_Icc_zero_one le_rfl + +/-- The straight-line path `Path.segment a b` is `Cยน` (in fact smooth) on the unit interval. -/ +theorem Path.segment_contDiffOn (a b : E) : + ContDiffOn โ„ 1 (Path.segment a b).extend I := + (AffineMap.lineMap_contDiff a b).contDiffOn.congr (Path.eqOn_extend_segment a b) + +/-- If a 1-form `ฯ‰` is continuous on the segment `[a -[โ„] b]`, +then it is curve integrable along the segment from `a` to `b`. -/ +theorem ContinuousOn.curveIntegrable_segment (hฯ‰ : ContinuousOn ฯ‰ [a -[โ„] b]) : + CurveIntegrable ฯ‰ (.segment a b) := + hฯ‰.curveIntegrable_of_contDiffOn (Path.segment_contDiffOn a b) + fun t => Path.range_segment a b โ–ธ Set.mem_range_self t + +/-- If a 1-form `ฯ‰` is continuous, then it is curve integrable along any segment. -/ +theorem Continuous.curveIntegrable_segment (hฯ‰ : Continuous ฯ‰) (a b : E) : + CurveIntegrable ฯ‰ (.segment a b) := hฯ‰.continuousOn.curveIntegrable_segment + +theorem curveIntegral_segment [NormedSpace โ„ F] (ฯ‰ : E โ†’ E โ†’L[๐•œ] F) (a b : E) : โˆซแถœ x in .segment a b, ฯ‰ x = โˆซ t in 0..1, ฯ‰ (lineMap a b t) (b - a) := by rw [curveIntegral_def] refine intervalIntegral.integral_congr fun t ht โ†ฆ ?_ @@ -308,14 +348,14 @@ theorem curveIntegral_segment [NormedSpace โ„ E] [NormedSpace โ„ F] (ฯ‰ : E exact curveIntegralFun_segment ฯ‰ a b ht @[simp] -theorem curveIntegral_segment_const [NormedSpace โ„ E] [CompleteSpace F] (ฯ‰ : E โ†’L[๐•œ] F) (a b : E) : +theorem curveIntegral_segment_const [CompleteSpace F] (ฯ‰ : E โ†’L[๐•œ] F) (a b : E) : โˆซแถœ _ in .segment a b, ฯ‰ = ฯ‰ (b - a) := by letI : NormedSpace โ„ F := .restrictScalars โ„ ๐•œ F simp [curveIntegral_segment] /-- If `โ€–ฯ‰ zโ€– โ‰ค C` at all points of the segment `[a -[โ„] b]`, then the curve integral `โˆซแถœ x in .segment a b, ฯ‰ x` has norm at most `C * โ€–b - aโ€–`. -/ -theorem norm_curveIntegral_segment_le [NormedSpace โ„ E] {C : โ„} (h : โˆ€ z โˆˆ [a -[โ„] b], โ€–ฯ‰ zโ€– โ‰ค C) : +theorem norm_curveIntegral_segment_le {C : โ„} (h : โˆ€ z โˆˆ [a -[โ„] b], โ€–ฯ‰ zโ€– โ‰ค C) : โ€–โˆซแถœ x in .segment a b, ฯ‰ xโ€– โ‰ค C * โ€–b - aโ€– := calc โ€–โˆซแถœ x in .segment a b, ฯ‰ xโ€– โ‰ค C * โ€–b - aโ€– * |1 - 0| := by letI : NormedSpace โ„ F := .restrictScalars โ„ ๐•œ F @@ -326,18 +366,7 @@ theorem norm_curveIntegral_segment_le [NormedSpace โ„ E] {C : โ„} (h : โˆ€ z apply_rules [(ฯ‰ _).le_of_opNorm_le, mem_image_of_mem, Ioc_subset_Icc_self] _ = C * โ€–b - aโ€– := by simp -/-- If a 1-form `ฯ‰` is continuous on a set `s`, -then it is curve integrable along any $C^1$ path in this set. -/ -theorem ContinuousOn.curveIntegrable_of_contDiffOn [NormedSpace โ„ E] {s : Set E} - (hฯ‰ : ContinuousOn ฯ‰ s) (hฮณ : ContDiffOn โ„ 1 ฮณ.extend I) (hฮณs : โˆ€ t, ฮณ t โˆˆ s) : - CurveIntegrable ฯ‰ ฮณ := by - apply ContinuousOn.intervalIntegrable_of_Icc zero_le_one - simp only [funext (curveIntegralFun_def ฯ‰ ฮณ)] - apply ContinuousOn.clm_apply - ยท exact hฯ‰.comp (by fun_prop) fun _ _ โ†ฆ hฮณs _ - ยท exact hฮณ.continuousOn_derivWithin uniqueDiffOn_Icc_zero_one le_rfl - -end PathOperations +end Segment /-! ### Algebraic operations on the 1-form @@ -529,13 +558,13 @@ theorem HasFDerivWithinAt.curveIntegral_segment_source' (hs : Convex โ„ s) rw [โ† curveIntegral_segment_const, โ† curveIntegral_fun_sub] ยท refine norm_curveIntegral_segment_le fun z hz โ†ฆ ?_ simpa [dist_eq_norm] using (hฮด (hsub hz)).2 - ยท rw [curveIntegrable_segment] + ยท rw [curveIntegrable_segment_iff] refine ContinuousOn.intervalIntegrable_of_Icc zero_le_one fun t ht โ†ฆ ?_ refine ((hฮด ?_).1.eval_const _).comp AffineMap.lineMap_continuous.continuousWithinAt ?_ ยท refine hsub <| segment_eq_image_lineMap โ„ a b โ–ธ mem_image_of_mem _ ht ยท rw [mapsTo_iff_image_subset, โ† segment_eq_image_lineMap] exact hs.segment_subset ha hbs - ยท rw [curveIntegrable_segment] + ยท rw [curveIntegrable_segment_iff] exact intervalIntegrable_const /-- The integral of `ฯ‰` along `[a -[โ„] b]`, as a function of `b`, has derivative `ฯ‰ a` at `b = a`. @@ -557,4 +586,15 @@ theorem HasFDerivAt.curveIntegral_segment_source (hฯ‰ : Continuous ฯ‰) : HasFDerivAt (โˆซแถœ x in .segment a ยท, ฯ‰ x) (ฯ‰ a) a := .curveIntegral_segment_source' <| .of_forall fun _ โ†ฆ hฯ‰.continuousAt +/-- **Fundamental theorem of calculus along a line segment.** If `f : E โ†’ F` is differentiable +with continuous derivative `fderiv โ„ f` on the segment `[a -[โ„] b]`, then the curve integral of +`fderiv โ„ f` along the segment equals `f b - f a`. -/ +theorem curveIntegral_fderiv_segment [NormedSpace โ„ F] {f : E โ†’ F} + (hf : Differentiable โ„ f) (hcont : Continuous (fderiv โ„ f)) (a b : E) : + โˆซแถœ z in .segment a b, fderiv โ„ f z = f b - f a := by + rw [curveIntegral_segment] + simpa using intervalIntegral.integral_eq_sub_of_hasDerivAt + (fun t _ => (hf _).hasFDerivAt.comp_hasDerivAt t AffineMap.hasDerivAt_lineMap) + (((hcont.comp (by fun_prop)).clm_apply continuous_const).intervalIntegrable 0 1) + end FDeriv