Skip to content

Commit 1ca9eb0

Browse files
PatrickMassotgrunweg
authored andcommitted
chore: fix differentiability of sums of sections lemmas (leanprover-community#41315)
They were assuming unnecessarily strong hypotheses: weaken them to what was inteded. Co-authored-by: Michael Rothgang <rothgang@math.uni-bonn.de>
1 parent 86052f9 commit 1ca9eb0

3 files changed

Lines changed: 18 additions & 16 deletions

File tree

Mathlib/Geometry/Manifold/VectorBundle/LocalFrame.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ lemma mdifferentiableOn_of_coeff [FiniteDimensional 𝕜 F]
297297
have this (i) : MDiff[u] (T% ((LinearMap.piApply (hs.coeff i)) t • s i)) :=
298298
(h i).smul_section ((hs.contMDiffOn i).mdifferentiableOn one_ne_zero)
299299
have almost : MDiff[u] (T% (fun x ↦ ∑ i, hs.coeff i x (t x) • s i x)) :=
300-
.sum_section (fun i _ hx ↦ this i _ hx)
300+
.sum_section (fun i _ _ hx ↦ this i _ hx)
301301
apply almost.congr
302302
intro y hy
303303
simpa using congrArg (TotalSpace.mk' F y) (hs.coeff_sum_eq t hy)
@@ -309,7 +309,7 @@ lemma mdifferentiableAt_of_coeff [FiniteDimensional 𝕜 F]
309309
MDiffAt (T% t) x := by
310310
have := fintypeOfFiniteDimensional hs (mem_of_mem_nhds hu)
311311
have almost : MDiffAt (T% (fun x ↦ ∑ i, hs.coeff i x (t x) • s i x)) x :=
312-
.sum_section (fun i ↦ (h i).smul_section <|
312+
.sum_section (fun i _ ↦ (h i).smul_section <|
313313
((hs.contMDiffOn i).mdifferentiableOn one_ne_zero).mdifferentiableAt hu)
314314
exact almost.congr_of_eventuallyEq <| (hs.eventually_eq_sum_coeff_smul t hu).mono (by simp)
315315

Mathlib/Geometry/Manifold/VectorBundle/MDifferentiable.lean

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -455,29 +455,30 @@ lemma mdifferentiable_smul_const_section
455455
fun x₀ ↦ (hs x₀).smul_const_section
456456

457457
lemma MDifferentiableWithinAt.sum_section {ι : Type*} {s : Finset ι} {t : ι → (x : B) → E x}
458-
(hs : ∀ i, MDiffAt[u] (T% (t i ·)) x₀) :
458+
(hs : ∀ i ∈ s, MDiffAt[u] (T% (t i ·)) x₀) :
459459
MDiffAt[u] (T% (fun x ↦ ∑ i ∈ s, (t i x))) x₀ := by
460460
classical
461461
induction s using Finset.induction_on with
462462
| empty => simpa using! (contMDiffWithinAt_zeroSection 𝕜 E).mdifferentiableWithinAt one_ne_zero
463463
| insert i s hi h =>
464-
simpa [Finset.sum_insert hi] using! mdifferentiableWithinAt_add_section (hs i) h
464+
simp only [Finset.mem_insert, forall_eq_or_imp] at hs
465+
simpa [Finset.sum_insert hi] using mdifferentiableWithinAt_add_section (hs.1) (h hs.2)
465466

466467
lemma MDifferentiableAt.sum_section {ι : Type*} {s : Finset ι} {t : ι → (x : B) → E x} {x₀ : B}
467-
(hs : ∀ i, MDiffAt (T% (t i ·)) x₀) :
468+
(hs : ∀ i ∈ s, MDiffAt (T% (t i ·)) x₀) :
468469
MDiffAt (T% (fun x ↦ ∑ i ∈ s, (t i x))) x₀ := by
469470
simp_rw [← mdifferentiableWithinAt_univ] at hs ⊢
470471
exact MDifferentiableWithinAt.sum_section hs
471472

472473
lemma MDifferentiableOn.sum_section {ι : Type*} {s : Finset ι} {t : ι → (x : B) → E x}
473-
(hs : ∀ i, MDiff[u] (T% (t i ·))) :
474+
(hs : ∀ i ∈ s, MDiff[u] (T% (t i ·))) :
474475
MDiff[u] (T% (fun x ↦ ∑ i ∈ s, (t i x))) :=
475-
fun x₀ hx₀ ↦ .sum_section fun i ↦ hs i x₀ hx₀
476+
fun x₀ hx₀ ↦ .sum_section fun i hi ↦ hs i hi x₀ hx₀
476477

477478
lemma MDifferentiable.sum_section {ι : Type*} {s : Finset ι} {t : ι → (x : B) → E x}
478-
(hs : ∀ i, MDiff (T% (t i ·))) :
479+
(hs : ∀ i ∈ s, MDiff (T% (t i ·))) :
479480
MDiff (T% (fun x ↦ ∑ i ∈ s, (t i x))) :=
480-
fun x₀ ↦ .sum_section fun i ↦ (hs i) x₀
481+
fun x₀ ↦ .sum_section fun i hi ↦ (hs i) hi x₀
481482

482483
/-- The scalar product `ψ • s` of a differentiable function `ψ : M → 𝕜` and a section `s` of a
483484
vector bundle `V → M` is differentiable once `s` is differentiable on an open set containing
@@ -510,7 +511,7 @@ lemma MDifferentiableWithinAt.sum_section_of_locallyFinite
510511
let s := {i | ((fun i ↦ {x | t i x ≠ 0}) i ∩ u').Nonempty}
511512
have := hfin.fintype
512513
have : MDiffAt[u ∩ u'] (T% (fun x ↦ ∑ i ∈ s, (t i x))) x₀ :=
513-
.sum_section fun i ↦ ((ht' i).mono inter_subset_left)
514+
.sum_section fun i _ ↦ ((ht' i).mono inter_subset_left)
514515
apply (mdifferentiableWithinAt_inter hu').mp
515516
apply this.congr' (fun y hy ↦ ?_) inter_subset_right (mem_of_mem_nhds hu')
516517
rw [TotalSpace.mk_inj, tsum_eq_sum']

Mathlib/Geometry/Manifold/VectorBundle/Tensoriality.lean

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,17 @@ theorem zero (hΦ : TensorialAt I F Φ x) : Φ 0 = 0 := by
110110
/-- A tensorial operation on sections of a vector bundle respects sums (since it respects binary
111111
addition). -/
112112
theorem sum (hΦ : TensorialAt I F Φ x) {ι : Type*} {s : Finset ι} (σ : ι → Π x : M, V x)
113-
(hσ : ∀ i, MDiffAt (T% (σ i)) x) :
113+
(hσ : ∀ i ∈ s, MDiffAt (T% (σ i)) x) :
114114
Φ (fun x' ↦ ∑ i ∈ s, σ i x') = ∑ i ∈ s, Φ (σ i) := by
115115
classical
116116
induction s using Finset.induction_on with
117117
| empty =>
118118
rw [Finset.sum_empty]
119119
exact hΦ.zero
120120
| insert a s ha h =>
121-
simp only [Finset.sum_insert ha, ← h]
122-
exact hΦ.add (hσ a) (.sum_section hσ)
121+
simp only [Finset.mem_insert, forall_eq_or_imp] at hσ
122+
simp only [Finset.sum_insert ha, ← h hσ.2]
123+
exact hΦ.add (hσ.1) (.sum_section hσ.2)
123124

124125
variable [CompleteSpace 𝕜] [FiniteDimensional 𝕜 F] [FiniteDimensional 𝕜 F']
125126
[ContMDiffVectorBundle 1 F V I] [ContMDiffVectorBundle 1 F' V' I]
@@ -147,7 +148,7 @@ lemma pointwise (hΦ : TensorialAt I F Φ x) {σ σ' : Π x : M, V x}
147148
have hΦ_eq {σ : (x : M) → V x} (hσ : MDiffAt (T% σ) x) :
148149
Φ σ = Φ (fun x' ↦ ∑ i, c i x' (σ x') • s i x') :=
149150
hΦ.local hσ
150-
(.sum_section fun i ↦ (hc hσ i).smul_section (hs i))
151+
(.sum_section fun i _ ↦ (hc hσ i).smul_section (hs i))
151152
(t.eventually_eq_localFrame_sum_coeff_smul b x_mem)
152153
-- Now evaluate using the tensoriality properties.
153154
rw [hΦ_eq hσ, hΦ_eq hσ', hΦ.sum, hΦ.sum]
@@ -157,8 +158,8 @@ lemma pointwise (hΦ : TensorialAt I F Φ x) {σ σ' : Π x : M, V x}
157158
_ = c i x (σ' x) • Φ (s i) := by rw [hσσ']
158159
_ = Φ ((LinearMap.piApply (c i) σ') • (s i)) :=
159160
hΦ.smul (hc hσ' i) (hs i) |>.symm
160-
· exact fun i ↦ (hc hσ' i).smul_section (hs i)
161-
· exact fun i ↦ (hc hσ i).smul_section (hs i)
161+
· exact fun i _ ↦ (hc hσ' i).smul_section (hs i)
162+
· exact fun i _ ↦ (hc hσ i).smul_section (hs i)
162163

163164
/-- If the operation `Φ` on sections of vector bundles `V` and `V'` is tensorial at `x` in each
164165
argument, then it depends only on the value of the sections at `x`. -/

0 commit comments

Comments
 (0)