-- Mathlib/Analysis/Calculus/Rademacher.lean
theorem ae_lineDifferentiableAt
    (hf : LipschitzWith C f) (v : E) :
    ∀ᵐ p ∂μ, LineDifferentiableAt ℝ f p v

Proof state:
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : MeasurableSpace E
inst✝² : BorelSpace E
C : ℝ≥0
f : E → ℝ
μ : Measure E
inst✝¹ : FiniteDimensional ℝ E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
v : E
L : ℝ →L[ℝ] E := ContinuousLinearMap.smulRight 1 v
p : E
⊢ ∀ᵐ (t : ℝ), LineDifferentiableAt ℝ f (p + t • v) v

Tactic:
have : ∀ᵐ (s : ℝ), DifferentiableAt ℝ (fun t ↦ f (p + t • v)) s :=
  (hf.comp ((LipschitzWith.const p).add L.lipschitz)).ae_differentiableAt_real

Result:
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : MeasurableSpace E
inst✝² : BorelSpace E
C : ℝ≥0
f : E → ℝ
μ : Measure E
inst✝¹ : FiniteDimensional ℝ E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
v : E
L : ℝ →L[ℝ] E := ContinuousLinearMap.smulRight 1 v
p : E
this : ∀ᵐ (s : ℝ), DifferentiableAt ℝ (fun t => f (p + t • v)) s
⊢ ∀ᵐ (t : ℝ), LineDifferentiableAt ℝ f (p + t • v) v

Proof state:
case h
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : MeasurableSpace E
inst✝² : BorelSpace E
C : ℝ≥0
f : E → ℝ
μ : Measure E
inst✝¹ : FiniteDimensional ℝ E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
v : E
L : ℝ →L[ℝ] E := ContinuousLinearMap.smulRight 1 v
p : E
this : ∀ᵐ (s : ℝ), DifferentiableAt ℝ (fun t => f (p + t • v)) s
s : ℝ
hs : DifferentiableAt ℝ (fun t => f (p + t • v)) s
h's : DifferentiableAt ℝ (fun t => f (p + t • v)) (s + 0)
⊢ LineDifferentiableAt ℝ f (p + s • v) v

Tactic:
have : DifferentiableAt ℝ (fun t ↦ s + t) 0 := differentiableAt_id.const_add _

Result:
case h
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : MeasurableSpace E
inst✝² : BorelSpace E
C : ℝ≥0
f : E → ℝ
μ : Measure E
inst✝¹ : FiniteDimensional ℝ E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
v : E
L : ℝ →L[ℝ] E := ContinuousLinearMap.smulRight 1 v
p : E
this✝ : ∀ᵐ (s : ℝ), DifferentiableAt ℝ (fun t => f (p + t • v)) s
s : ℝ
hs : DifferentiableAt ℝ (fun t => f (p + t • v)) s
h's : DifferentiableAt ℝ (fun t => f (p + t • v)) (s + 0)
this : DifferentiableAt ℝ (fun t => s + t) 0
⊢ LineDifferentiableAt ℝ f (p + s • v) v

Proof state:
case h
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : MeasurableSpace E
inst✝² : BorelSpace E
C : ℝ≥0
f : E → ℝ
μ : Measure E
inst✝¹ : FiniteDimensional ℝ E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
v : E
L : ℝ →L[ℝ] E := ContinuousLinearMap.smulRight 1 v
p : E
this✝ : ∀ᵐ (s : ℝ), DifferentiableAt ℝ (fun t => f (p + t • v)) s
s : ℝ
hs : DifferentiableAt ℝ (fun t => f (p + t • v)) s
h's : DifferentiableAt ℝ (fun t => f (p + t • v)) (s + 0)
this : DifferentiableAt ℝ (fun t => s + t) 0
⊢ DifferentiableAt ℝ (fun t => f (p + s • v + t • v)) 0

Tactic:
convert h's.comp 0 this with _ t

Result:
case h.e'_11.h
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : MeasurableSpace E
inst✝² : BorelSpace E
C : ℝ≥0
f : E → ℝ
μ : Measure E
inst✝¹ : FiniteDimensional ℝ E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
v : E
L : ℝ →L[ℝ] E := ContinuousLinearMap.smulRight 1 v
p : E
this✝ : ∀ᵐ (s : ℝ), DifferentiableAt ℝ (fun t => f (p + t • v)) s
s : ℝ
hs : DifferentiableAt ℝ (fun t => f (p + t • v)) s
h's : DifferentiableAt ℝ (fun t => f (p + t • v)) (s + 0)
this : DifferentiableAt ℝ (fun t => s + t) 0
x✝ : ℝ
⊢ f (p + s • v + x✝ • v) = ((fun t => f (p + t • v)) ∘ HAdd.hAdd s) x✝

Proof state:
case h
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : MeasurableSpace E
inst✝² : BorelSpace E
C : ℝ≥0
f : E → ℝ
μ : Measure E
inst✝¹ : FiniteDimensional ℝ E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
v : E
L : ℝ →L[ℝ] E := ContinuousLinearMap.smulRight 1 v
p : E
this : ∀ᵐ (s : ℝ), DifferentiableAt ℝ (fun t => f (p + t • v)) s
s : ℝ
hs : DifferentiableAt ℝ (fun t => f (p + t • v)) s
⊢ LineDifferentiableAt ℝ f (p + s • v) v

Tactic:
have h's : DifferentiableAt ℝ (fun t ↦ f (p + t • v)) (s + 0) := by simpa using hs

Result:
case h
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : MeasurableSpace E
inst✝² : BorelSpace E
C : ℝ≥0
f : E → ℝ
μ : Measure E
inst✝¹ : FiniteDimensional ℝ E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
v : E
L : ℝ →L[ℝ] E := ContinuousLinearMap.smulRight 1 v
p : E
this : ∀ᵐ (s : ℝ), DifferentiableAt ℝ (fun t => f (p + t • v)) s
s : ℝ
hs : DifferentiableAt ℝ (fun t => f (p + t • v)) s
h's : DifferentiableAt ℝ (fun t => f (p + t • v)) (s + 0)
⊢ LineDifferentiableAt ℝ f (p + s • v) v

Proof state:
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : MeasurableSpace E
inst✝² : BorelSpace E
C : ℝ≥0
f : E → ℝ
μ : Measure E
inst✝¹ : FiniteDimensional ℝ E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
v : E
L : ℝ →L[ℝ] E := ContinuousLinearMap.smulRight 1 v
p : E
this : ∀ᵐ (s : ℝ), DifferentiableAt ℝ (fun t => f (p + t • v)) s
⊢ ∀ᵐ (t : ℝ), LineDifferentiableAt ℝ f (p + t • v) v

Tactic:
filter_upwards [this] with s hs

Result:
case h
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : MeasurableSpace E
inst✝² : BorelSpace E
C : ℝ≥0
f : E → ℝ
μ : Measure E
inst✝¹ : FiniteDimensional ℝ E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
v : E
L : ℝ →L[ℝ] E := ContinuousLinearMap.smulRight 1 v
p : E
this : ∀ᵐ (s : ℝ), DifferentiableAt ℝ (fun t => f (p + t • v)) s
s : ℝ
hs : DifferentiableAt ℝ (fun t => f (p + t • v)) s
⊢ LineDifferentiableAt ℝ f (p + s • v) v

Proof state:
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : MeasurableSpace E
inst✝² : BorelSpace E
C : ℝ≥0
f : E → ℝ
μ : Measure E
inst✝¹ : FiniteDimensional ℝ E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
v : E
⊢ ∀ᵐ (p : E) ∂μ, LineDifferentiableAt ℝ f p v

Tactic:
let L : ℝ →L[ℝ] E := ContinuousLinearMap.smulRight (1 : ℝ →L[ℝ] ℝ) v

Result:
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : MeasurableSpace E
inst✝² : BorelSpace E
C : ℝ≥0
f : E → ℝ
μ : Measure E
inst✝¹ : FiniteDimensional ℝ E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
v : E
L : ℝ →L[ℝ] E := ContinuousLinearMap.smulRight 1 v
⊢ ∀ᵐ (p : E) ∂μ, LineDifferentiableAt ℝ f p v

Proof state:
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : MeasurableSpace E
inst✝² : BorelSpace E
C : ℝ≥0
f : E → ℝ
μ : Measure E
inst✝¹ : FiniteDimensional ℝ E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
v : E
L : ℝ →L[ℝ] E := ContinuousLinearMap.smulRight 1 v
⊢ ∀ (p : E), ∀ᵐ (t : ℝ), LineDifferentiableAt ℝ f (p + t • v) v

Tactic:
intro p

Result:
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : MeasurableSpace E
inst✝² : BorelSpace E
C : ℝ≥0
f : E → ℝ
μ : Measure E
inst✝¹ : FiniteDimensional ℝ E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
v : E
L : ℝ →L[ℝ] E := ContinuousLinearMap.smulRight 1 v
p : E
⊢ ∀ᵐ (t : ℝ), LineDifferentiableAt ℝ f (p + t • v) v

Proof state:
E : Type u_1
inst✝⁵ : NormedAddCommGroup E
inst✝⁴ : NormedSpace ℝ E
inst✝³ : MeasurableSpace E
inst✝² : BorelSpace E
C : ℝ≥0
f : E → ℝ
μ : Measure E
inst✝¹ : FiniteDimensional ℝ E
inst✝ : μ.IsAddHaarMeasure
hf : LipschitzWith C f
v : E
L : ℝ →L[ℝ] E := ContinuousLinearMap.smulRight 1 v
p : E
this : ∀ᵐ (s : ℝ), DifferentiableAt ℝ (fun t => f (p + t • v)) s
s : ℝ
hs : DifferentiableAt ℝ (fun t => f (p + t • v)) s
⊢ DifferentiableAt ℝ (fun t => f (p + t • v)) (s + 0)

Tactic:
simpa using hs

Result:
no goals