Skip to content

Commit 5698328

Browse files
committed
chore(FDeriv/Pi): golf (leanprover-community#35663)
Also drop an unneeded assumption `[Finite ι]`.
1 parent 699a55a commit 5698328

1 file changed

Lines changed: 7 additions & 15 deletions

File tree

  • Mathlib/Analysis/Calculus/FDeriv

Mathlib/Analysis/Calculus/FDeriv/Pi.lean

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Authors: Floris van Doorn, Heather Macbeth
55
-/
66
module
77

8-
public import Mathlib.Analysis.Calculus.FDeriv.Add
8+
public import Mathlib.Analysis.Calculus.FDeriv.Prod
99
public import Mathlib.Analysis.Calculus.FDeriv.Const
1010

1111
/-!
@@ -14,24 +14,17 @@ public import Mathlib.Analysis.Calculus.FDeriv.Const
1414

1515
public section
1616

17-
variable {𝕜 ι : Type*} [DecidableEq ι] [Finite ι] [NontriviallyNormedField 𝕜]
17+
variable {𝕜 ι : Type*} [DecidableEq ι] [NontriviallyNormedField 𝕜]
1818
variable {E : ι → Type*} [∀ i, NormedAddCommGroup (E i)] [∀ i, NormedSpace 𝕜 (E i)]
1919

2020
@[fun_prop]
2121
theorem hasFDerivAt_update (x : ∀ i, E i) {i : ι} (y : E i) :
2222
HasFDerivAt (Function.update x i) (.pi (Pi.single i (.id 𝕜 (E i)))) y := by
23-
set l := (ContinuousLinearMap.pi (Pi.single i (.id 𝕜 (E i))))
24-
have update_eq : Function.update x i = (fun _ ↦ x) + l ∘ (· - x i) := by
25-
ext t j
26-
dsimp [l, Pi.single, Function.update]
27-
split_ifs with hji
28-
· subst hji
29-
simp
30-
· simp
31-
rw [update_eq]
32-
have := Fintype.ofFinite ι
33-
convert (hasFDerivAt_const _ _).add (l.hasFDerivAt.comp y (hasFDerivAt_sub_const (x i)))
34-
rw [zero_add, ContinuousLinearMap.comp_id]
23+
rw [hasFDerivAt_pi]
24+
intro j
25+
rcases eq_or_ne j i with rfl | hij
26+
· simpa using hasFDerivAt_id _
27+
· simpa [hij] using hasFDerivAt_const _ _
3528

3629
@[fun_prop]
3730
theorem hasFDerivAt_single {i : ι} (y : E i) :
@@ -40,7 +33,6 @@ theorem hasFDerivAt_single {i : ι} (y : E i) :
4033

4134
theorem fderiv_update (x : ∀ i, E i) {i : ι} (y : E i) :
4235
fderiv 𝕜 (Function.update x i) y = .pi (Pi.single i (.id 𝕜 (E i))) :=
43-
have := Fintype.ofFinite ι
4436
(hasFDerivAt_update x y).fderiv
4537

4638
theorem fderiv_single {i : ι} (y : E i) :

0 commit comments

Comments
 (0)