Theorem: LipschitzWith.ae_exists_fderiv_of_countable
File: Mathlib/Analysis/Calculus/Rademacher.lean

Proof steps:
state_before: E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
inst✝⁴ : MeasurableSpace E
inst✝³ : BorelSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
C D : ℝ≥0
f g : E → ℝ
s✝ : Set E
μ : Measure E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
s : Set E
hs : s.Countable
⊢ ∀ᵐ (x : E) ∂μ, ∃ L, ∀ v ∈ s, HasLineDerivAt ℝ f (L v) x v
state_after: E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
inst✝⁴ : MeasurableSpace E
inst✝³ : BorelSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
C D : ℝ≥0
f g : E → ℝ
s✝ : Set E
μ : Measure E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
s : Set E
hs : s.Countable
B : Basis ↑(Basis.ofVectorSpaceIndex ℝ E) ℝ E
⊢ ∀ᵐ (x : E) ∂μ, ∃ L, ∀ v ∈ s, HasLineDerivAt ℝ f (L v) x v
tactic: have B := Basis.ofVectorSpace ℝ E
state_before: E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
inst✝⁴ : MeasurableSpace E
inst✝³ : BorelSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
C D : ℝ≥0
f g : E → ℝ
s✝ : Set E
μ : Measure E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
s : Set E
hs : s.Countable
B : Basis ↑(Basis.ofVectorSpaceIndex ℝ E) ℝ E
⊢ ∀ᵐ (x : E) ∂μ, ∃ L, ∀ v ∈ s, HasLineDerivAt ℝ f (L v) x v
state_after: E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
inst✝⁴ : MeasurableSpace E
inst✝³ : BorelSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
C D : ℝ≥0
f g : E → ℝ
s✝ : Set E
μ : Measure E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
s : Set E
hs : s.Countable
B : Basis ↑(Basis.ofVectorSpaceIndex ℝ E) ℝ E
I1 :
  ∀ᵐ (x : E) ∂μ,
    ∀ v ∈ s,
      lineDeriv ℝ f x (∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • B i) =
        ∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • lineDeriv ℝ f x (B i)
⊢ ∀ᵐ (x : E) ∂μ, ∃ L, ∀ v ∈ s, HasLineDerivAt ℝ f (L v) x v
tactic: have I1 : ∀ᵐ (x : E) ∂μ, ∀ v ∈ s, lineDeriv ℝ f x (∑ i, (B.repr v i) • B i) =
                                  ∑ i, B.repr v i • lineDeriv ℝ f x (B i) :=
    (ae_ball_iff hs).2 (fun v _ ↦ hf.ae_lineDeriv_sum_eq _ _ _)
state_before: E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
inst✝⁴ : MeasurableSpace E
inst✝³ : BorelSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
C D : ℝ≥0
f g : E → ℝ
s✝ : Set E
μ : Measure E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
s : Set E
hs : s.Countable
B : Basis ↑(Basis.ofVectorSpaceIndex ℝ E) ℝ E
I1 :
  ∀ᵐ (x : E) ∂μ,
    ∀ v ∈ s,
      lineDeriv ℝ f x (∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • B i) =
        ∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • lineDeriv ℝ f x (B i)
⊢ ∀ᵐ (x : E) ∂μ, ∃ L, ∀ v ∈ s, HasLineDerivAt ℝ f (L v) x v
state_after: E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
inst✝⁴ : MeasurableSpace E
inst✝³ : BorelSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
C D : ℝ≥0
f g : E → ℝ
s✝ : Set E
μ : Measure E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
s : Set E
hs : s.Countable
B : Basis ↑(Basis.ofVectorSpaceIndex ℝ E) ℝ E
I1 :
  ∀ᵐ (x : E) ∂μ,
    ∀ v ∈ s,
      lineDeriv ℝ f x (∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • B i) =
        ∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • lineDeriv ℝ f x (B i)
I2 : ∀ᵐ (x : E) ∂μ, ∀ v ∈ s, LineDifferentiableAt ℝ f x v
⊢ ∀ᵐ (x : E) ∂μ, ∃ L, ∀ v ∈ s, HasLineDerivAt ℝ f (L v) x v
tactic: have I2 : ∀ᵐ (x : E) ∂μ, ∀ v ∈ s, LineDifferentiableAt ℝ f x v :=
    (ae_ball_iff hs).2 (fun v _ ↦ hf.ae_lineDifferentiableAt v)
state_before: E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
inst✝⁴ : MeasurableSpace E
inst✝³ : BorelSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
C D : ℝ≥0
f g : E → ℝ
s✝ : Set E
μ : Measure E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
s : Set E
hs : s.Countable
B : Basis ↑(Basis.ofVectorSpaceIndex ℝ E) ℝ E
I1 :
  ∀ᵐ (x : E) ∂μ,
    ∀ v ∈ s,
      lineDeriv ℝ f x (∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • B i) =
        ∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • lineDeriv ℝ f x (B i)
I2 : ∀ᵐ (x : E) ∂μ, ∀ v ∈ s, LineDifferentiableAt ℝ f x v
⊢ ∀ᵐ (x : E) ∂μ, ∃ L, ∀ v ∈ s, HasLineDerivAt ℝ f (L v) x v
state_after: case h
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
inst✝⁴ : MeasurableSpace E
inst✝³ : BorelSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
C D : ℝ≥0
f g : E → ℝ
s✝ : Set E
μ : Measure E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
s : Set E
hs : s.Countable
B : Basis ↑(Basis.ofVectorSpaceIndex ℝ E) ℝ E
I1 :
  ∀ᵐ (x : E) ∂μ,
    ∀ v ∈ s,
      lineDeriv ℝ f x (∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • B i) =
        ∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • lineDeriv ℝ f x (B i)
I2 : ∀ᵐ (x : E) ∂μ, ∀ v ∈ s, LineDifferentiableAt ℝ f x v
x : E
hx :
  ∀ v ∈ s,
    lineDeriv ℝ f x (∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • B i) =
      ∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • lineDeriv ℝ f x (B i)
h'x : ∀ v ∈ s, LineDifferentiableAt ℝ f x v
⊢ ∃ L, ∀ v ∈ s, HasLineDerivAt ℝ f (L v) x v
tactic: filter_upwards [I1, I2] with x hx h'x
state_before: case h
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
inst✝⁴ : MeasurableSpace E
inst✝³ : BorelSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
C D : ℝ≥0
f g : E → ℝ
s✝ : Set E
μ : Measure E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
s : Set E
hs : s.Countable
B : Basis ↑(Basis.ofVectorSpaceIndex ℝ E) ℝ E
I1 :
  ∀ᵐ (x : E) ∂μ,
    ∀ v ∈ s,
      lineDeriv ℝ f x (∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • B i) =
        ∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • lineDeriv ℝ f x (B i)
I2 : ∀ᵐ (x : E) ∂μ, ∀ v ∈ s, LineDifferentiableAt ℝ f x v
x : E
hx :
  ∀ v ∈ s,
    lineDeriv ℝ f x (∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • B i) =
      ∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • lineDeriv ℝ f x (B i)
h'x : ∀ v ∈ s, LineDifferentiableAt ℝ f x v
⊢ ∃ L, ∀ v ∈ s, HasLineDerivAt ℝ f (L v) x v
state_after: case h
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
inst✝⁴ : MeasurableSpace E
inst✝³ : BorelSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
C D : ℝ≥0
f g : E → ℝ
s✝ : Set E
μ : Measure E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
s : Set E
hs : s.Countable
B : Basis ↑(Basis.ofVectorSpaceIndex ℝ E) ℝ E
I1 :
  ∀ᵐ (x : E) ∂μ,
    ∀ v ∈ s,
      lineDeriv ℝ f x (∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • B i) =
        ∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • lineDeriv ℝ f x (B i)
I2 : ∀ᵐ (x : E) ∂μ, ∀ v ∈ s, LineDifferentiableAt ℝ f x v
x : E
hx :
  ∀ v ∈ s,
    lineDeriv ℝ f x (∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • B i) =
      ∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • lineDeriv ℝ f x (B i)
h'x : ∀ v ∈ s, LineDifferentiableAt ℝ f x v
L : E →L[ℝ] ℝ := LinearMap.toContinuousLinearMap ((B.constr ℝ) fun i => lineDeriv ℝ f x (B i))
⊢ ∃ L, ∀ v ∈ s, HasLineDerivAt ℝ f (L v) x v
tactic: let L : E →L[ℝ] ℝ :=
    LinearMap.toContinuousLinearMap (B.constr ℝ (fun i ↦ lineDeriv ℝ f x (B i)))
state_before: case h
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
inst✝⁴ : MeasurableSpace E
inst✝³ : BorelSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
C D : ℝ≥0
f g : E → ℝ
s✝ : Set E
μ : Measure E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
s : Set E
hs : s.Countable
B : Basis ↑(Basis.ofVectorSpaceIndex ℝ E) ℝ E
I1 :
  ∀ᵐ (x : E) ∂μ,
    ∀ v ∈ s,
      lineDeriv ℝ f x (∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • B i) =
        ∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • lineDeriv ℝ f x (B i)
I2 : ∀ᵐ (x : E) ∂μ, ∀ v ∈ s, LineDifferentiableAt ℝ f x v
x : E
hx :
  ∀ v ∈ s,
    lineDeriv ℝ f x (∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • B i) =
      ∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • lineDeriv ℝ f x (B i)
h'x : ∀ v ∈ s, LineDifferentiableAt ℝ f x v
L : E →L[ℝ] ℝ := LinearMap.toContinuousLinearMap ((B.constr ℝ) fun i => lineDeriv ℝ f x (B i))
⊢ ∃ L, ∀ v ∈ s, HasLineDerivAt ℝ f (L v) x v
state_after: case h
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
inst✝⁴ : MeasurableSpace E
inst✝³ : BorelSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
C D : ℝ≥0
f g : E → ℝ
s✝ : Set E
μ : Measure E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
s : Set E
hs : s.Countable
B : Basis ↑(Basis.ofVectorSpaceIndex ℝ E) ℝ E
I1 :
  ∀ᵐ (x : E) ∂μ,
    ∀ v ∈ s,
      lineDeriv ℝ f x (∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • B i) =
        ∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • lineDeriv ℝ f x (B i)
I2 : ∀ᵐ (x : E) ∂μ, ∀ v ∈ s, LineDifferentiableAt ℝ f x v
x : E
hx :
  ∀ v ∈ s,
    lineDeriv ℝ f x (∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • B i) =
      ∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • lineDeriv ℝ f x (B i)
h'x : ∀ v ∈ s, LineDifferentiableAt ℝ f x v
L : E →L[ℝ] ℝ := LinearMap.toContinuousLinearMap ((B.constr ℝ) fun i => lineDeriv ℝ f x (B i))
v : E
hv : v ∈ s
⊢ HasLineDerivAt ℝ f (L v) x v
tactic: refine ⟨L, fun v hv ↦ ?_⟩
state_before: case h
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
inst✝⁴ : MeasurableSpace E
inst✝³ : BorelSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
C D : ℝ≥0
f g : E → ℝ
s✝ : Set E
μ : Measure E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
s : Set E
hs : s.Countable
B : Basis ↑(Basis.ofVectorSpaceIndex ℝ E) ℝ E
I1 :
  ∀ᵐ (x : E) ∂μ,
    ∀ v ∈ s,
      lineDeriv ℝ f x (∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • B i) =
        ∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • lineDeriv ℝ f x (B i)
I2 : ∀ᵐ (x : E) ∂μ, ∀ v ∈ s, LineDifferentiableAt ℝ f x v
x : E
hx :
  ∀ v ∈ s,
    lineDeriv ℝ f x (∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • B i) =
      ∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • lineDeriv ℝ f x (B i)
h'x : ∀ v ∈ s, LineDifferentiableAt ℝ f x v
L : E →L[ℝ] ℝ := LinearMap.toContinuousLinearMap ((B.constr ℝ) fun i => lineDeriv ℝ f x (B i))
v : E
hv : v ∈ s
⊢ HasLineDerivAt ℝ f (L v) x v
state_after: case h
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
inst✝⁴ : MeasurableSpace E
inst✝³ : BorelSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
C D : ℝ≥0
f g : E → ℝ
s✝ : Set E
μ : Measure E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
s : Set E
hs : s.Countable
B : Basis ↑(Basis.ofVectorSpaceIndex ℝ E) ℝ E
I1 :
  ∀ᵐ (x : E) ∂μ,
    ∀ v ∈ s,
      lineDeriv ℝ f x (∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • B i) =
        ∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • lineDeriv ℝ f x (B i)
I2 : ∀ᵐ (x : E) ∂μ, ∀ v ∈ s, LineDifferentiableAt ℝ f x v
x : E
hx :
  ∀ v ∈ s,
    lineDeriv ℝ f x (∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • B i) =
      ∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • lineDeriv ℝ f x (B i)
h'x : ∀ v ∈ s, LineDifferentiableAt ℝ f x v
L : E →L[ℝ] ℝ := LinearMap.toContinuousLinearMap ((B.constr ℝ) fun i => lineDeriv ℝ f x (B i))
v : E
hv : v ∈ s
J : L v = lineDeriv ℝ f x v
⊢ HasLineDerivAt ℝ f (L v) x v
tactic: have J : L v = lineDeriv ℝ f x v := by convert (hx v hv).symm <;> simp [L, B.sum_repr v]
state_before: case h
E : Type u_1
inst✝⁷ : NormedAddCommGroup E
inst✝⁶ : NormedSpace ℝ E
inst✝⁵ : FiniteDimensional ℝ E
inst✝⁴ : MeasurableSpace E
inst✝³ : BorelSpace E
F : Type u_2
inst✝² : NormedAddCommGroup F
inst✝¹ : NormedSpace ℝ F
C D : ℝ≥0
f g : E → ℝ
s✝ : Set E
μ : Measure E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
s : Set E
hs : s.Countable
B : Basis ↑(Basis.ofVectorSpaceIndex ℝ E) ℝ E
I1 :
  ∀ᵐ (x : E) ∂μ,
    ∀ v ∈ s,
      lineDeriv ℝ f x (∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • B i) =
        ∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • lineDeriv ℝ f x (B i)
I2 : ∀ᵐ (x : E) ∂μ, ∀ v ∈ s, LineDifferentiableAt ℝ f x v
x : E
hx :
  ∀ v ∈ s,
    lineDeriv ℝ f x (∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • B i) =
      ∑ i : ↑(Basis.ofVectorSpaceIndex ℝ E), (B.repr v) i • lineDeriv ℝ f x (B i)
h'x : ∀ v ∈ s, LineDifferentiableAt ℝ f x v
L : E →L[ℝ] ℝ := LinearMap.toContinuousLinearMap ((B.constr ℝ) fun i => lineDeriv ℝ f x (B i))
v : E
hv : v ∈ s
J : L v = lineDeriv ℝ f x v
⊢ HasLineDerivAt ℝ f (L v) x v
state_after: no goals
tactic: simpa [J] using (h'x v hv).hasLineDerivAt