l3lab/ntp-mathlib huggingface dataset:
theorem Filter.EventuallyEq.hasLineDerivAt_iff (h : f₀ =ᶠ[𝓝 x] f₁) :
    HasLineDerivAt 𝕜 f₀ f' x v ↔ HasLineDerivAt 𝕜 f₁ f' x v := by
  apply hasDerivAt_iff
  let F := fun (t : 𝕜) ↦ x + t • v
  have B : ContinuousAt F 0 := by apply Continuous.continuousAt; continuity
  have : f₀ =ᶠ[𝓝 (F 0)] f₁ := by convert h; 

Proof state:
case h.e'_3.h.e'_3
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F✝ : Type u_2
inst✝³ : NormedAddCommGroup F✝
inst✝² : NormedSpace 𝕜 F✝
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F✝
f' : F✝
s t : Set E
x v : E
L : E →L[𝕜] F✝
h : f₀ =ᶠ[𝓝 x] f₁
F : 𝕜 → E := fun t => x + t • v
B : ContinuousAt F 0
⊢ F 0 = x

Next tactic:
simp
theorem Filter.EventuallyEq.hasLineDerivAt_iff (h : f₀ =ᶠ[𝓝 x] f₁) :
    HasLineDerivAt 𝕜 f₀ f' x v ↔ HasLineDerivAt 𝕜 f₁ f' x v := by
  apply hasDerivAt_iff
  let F := fun (t : 𝕜) ↦ x + t • v
  have B : ContinuousAt F 0 := by apply Continuous.continuousAt; continuity
  have : f₀ =ᶠ[𝓝 (F 0)] f₁ := by convert h; simp
  

Proof state:
case h
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F✝ : Type u_2
inst✝³ : NormedAddCommGroup F✝
inst✝² : NormedSpace 𝕜 F✝
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F✝
f' : F✝
s t : Set E
x v : E
L : E →L[𝕜] F✝
h : f₀ =ᶠ[𝓝 x] f₁
F : 𝕜 → E := fun t => x + t • v
B : ContinuousAt F 0
this : f₀ =ᶠ[𝓝 (F 0)] f₁
⊢ (fun t => f₀ (x + t • v)) =ᶠ[𝓝 0] fun t => f₁ (x + t • v)

Next tactic:
exact B.preimage_mem_nhds this
theorem Filter.EventuallyEq.hasLineDerivWithinAt_iff (h : f₀ =ᶠ[𝓝[s] x] f₁) (hx : f₀ x = f₁ x) :
    HasLineDerivWithinAt 𝕜 f₀ f' s x v ↔ HasLineDerivWithinAt 𝕜 f₁ f' s x v := by
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
h : f₀ =ᶠ[𝓝[s] x] f₁
hx : f₀ x = f₁ x
⊢ HasLineDerivWithinAt 𝕜 f₀ f' s x v ↔ HasLineDerivWithinAt 𝕜 f₁ f' s x v

Next tactic:
apply hasDerivWithinAt_iff
theorem Filter.EventuallyEq.hasLineDerivWithinAt_iff (h : f₀ =ᶠ[𝓝[s] x] f₁) (hx : f₀ x = f₁ x) :
    HasLineDerivWithinAt 𝕜 f₀ f' s x v ↔ HasLineDerivWithinAt 𝕜 f₁ f' s x v := by
  apply hasDerivWithinAt_iff
  · 

Proof state:
case h₁
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
h : f₀ =ᶠ[𝓝[s] x] f₁
hx : f₀ x = f₁ x
⊢ (fun t => f₀ (x + t • v)) =ᶠ[𝓝[(fun t => x + t • v) ⁻¹' s] 0] fun t => f₁ (x + t • v)

Next tactic:
have A : Continuous (fun (t : 𝕜) ↦ x + t • v) := by continuity
theorem Filter.EventuallyEq.hasLineDerivWithinAt_iff (h : f₀ =ᶠ[𝓝[s] x] f₁) (hx : f₀ x = f₁ x) :
    HasLineDerivWithinAt 𝕜 f₀ f' s x v ↔ HasLineDerivWithinAt 𝕜 f₁ f' s x v := by
  apply hasDerivWithinAt_iff
  · have A : Continuous (fun (t : 𝕜) ↦ x + t • v) := by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
h : f₀ =ᶠ[𝓝[s] x] f₁
hx : f₀ x = f₁ x
⊢ Continuous fun t => x + t • v

Next tactic:
continuity
theorem Filter.EventuallyEq.hasLineDerivWithinAt_iff (h : f₀ =ᶠ[𝓝[s] x] f₁) (hx : f₀ x = f₁ x) :
    HasLineDerivWithinAt 𝕜 f₀ f' s x v ↔ HasLineDerivWithinAt 𝕜 f₁ f' s x v := by
  apply hasDerivWithinAt_iff
  · have A : Continuous (fun (t : 𝕜) ↦ x + t • v) := by continuity
    

Proof state:
case h₁
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
h : f₀ =ᶠ[𝓝[s] x] f₁
hx : f₀ x = f₁ x
A : Continuous fun t => x + t • v
⊢ (fun t => f₀ (x + t • v)) =ᶠ[𝓝[(fun t => x + t • v) ⁻¹' s] 0] fun t => f₁ (x + t • v)

Next tactic:
exact A.continuousWithinAt.preimage_mem_nhdsWithin'' h (by simp)
theorem Filter.EventuallyEq.hasLineDerivWithinAt_iff (h : f₀ =ᶠ[𝓝[s] x] f₁) (hx : f₀ x = f₁ x) :
    HasLineDerivWithinAt 𝕜 f₀ f' s x v ↔ HasLineDerivWithinAt 𝕜 f₁ f' s x v := by
  apply hasDerivWithinAt_iff
  · have A : Continuous (fun (t : 𝕜) ↦ x + t • v) := by continuity
    exact A.continuousWithinAt.preimage_mem_nhdsWithin'' h (by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
h : f₀ =ᶠ[𝓝[s] x] f₁
hx : f₀ x = f₁ x
A : Continuous fun t => x + t • v
⊢ x = x + 0 • v

Next tactic:
simp
theorem Filter.EventuallyEq.hasLineDerivWithinAt_iff (h : f₀ =ᶠ[𝓝[s] x] f₁) (hx : f₀ x = f₁ x) :
    HasLineDerivWithinAt 𝕜 f₀ f' s x v ↔ HasLineDerivWithinAt 𝕜 f₁ f' s x v := by
  apply hasDerivWithinAt_iff
  · have A : Continuous (fun (t : 𝕜) ↦ x + t • v) := by continuity
    exact A.continuousWithinAt.preimage_mem_nhdsWithin'' h (by simp)
  · 

Proof state:
case hx
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
h : f₀ =ᶠ[𝓝[s] x] f₁
hx : f₀ x = f₁ x
⊢ f₀ (x + 0 • v) = f₁ (x + 0 • v)

Next tactic:
simpa using hx
lemma HasLineDerivWithinAt.congr_of_eventuallyEq (hf : HasLineDerivWithinAt 𝕜 f f' s x v)
    (h'f : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) : HasLineDerivWithinAt 𝕜 f₁ f' s x v := by
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
hf : HasLineDerivWithinAt 𝕜 f f' s x v
h'f : f₁ =ᶠ[𝓝[s] x] f
hx : f₁ x = f x
⊢ HasLineDerivWithinAt 𝕜 f₁ f' s x v

Next tactic:
apply HasDerivWithinAt.congr_of_eventuallyEq hf _ (by simp [hx])
lemma HasLineDerivWithinAt.congr_of_eventuallyEq (hf : HasLineDerivWithinAt 𝕜 f f' s x v)
    (h'f : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) : HasLineDerivWithinAt 𝕜 f₁ f' s x v := by
  apply HasDerivWithinAt.congr_of_eventuallyEq hf _ (by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
hf : HasLineDerivWithinAt 𝕜 f f' s x v
h'f : f₁ =ᶠ[𝓝[s] x] f
hx : f₁ x = f x
⊢ f₁ (x + 0 • v) = f (x + 0 • v)

Next tactic:
simp [hx]
lemma HasLineDerivWithinAt.congr_of_eventuallyEq (hf : HasLineDerivWithinAt 𝕜 f f' s x v)
    (h'f : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) : HasLineDerivWithinAt 𝕜 f₁ f' s x v := by
  apply HasDerivWithinAt.congr_of_eventuallyEq hf _ (by simp [hx])
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
hf : HasLineDerivWithinAt 𝕜 f f' s x v
h'f : f₁ =ᶠ[𝓝[s] x] f
hx : f₁ x = f x
⊢ (fun t => f₁ (x + t • v)) =ᶠ[𝓝[(fun t => x + t • v) ⁻¹' s] 0] fun t => f (x + t • v)

Next tactic:
have A : Continuous (fun (t : 𝕜) ↦ x + t • v) := by continuity
lemma HasLineDerivWithinAt.congr_of_eventuallyEq (hf : HasLineDerivWithinAt 𝕜 f f' s x v)
    (h'f : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) : HasLineDerivWithinAt 𝕜 f₁ f' s x v := by
  apply HasDerivWithinAt.congr_of_eventuallyEq hf _ (by simp [hx])
  have A : Continuous (fun (t : 𝕜) ↦ x + t • v) := by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
hf : HasLineDerivWithinAt 𝕜 f f' s x v
h'f : f₁ =ᶠ[𝓝[s] x] f
hx : f₁ x = f x
⊢ Continuous fun t => x + t • v

Next tactic:
continuity
lemma HasLineDerivWithinAt.congr_of_eventuallyEq (hf : HasLineDerivWithinAt 𝕜 f f' s x v)
    (h'f : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) : HasLineDerivWithinAt 𝕜 f₁ f' s x v := by
  apply HasDerivWithinAt.congr_of_eventuallyEq hf _ (by simp [hx])
  have A : Continuous (fun (t : 𝕜) ↦ x + t • v) := by continuity
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
hf : HasLineDerivWithinAt 𝕜 f f' s x v
h'f : f₁ =ᶠ[𝓝[s] x] f
hx : f₁ x = f x
A : Continuous fun t => x + t • v
⊢ (fun t => f₁ (x + t • v)) =ᶠ[𝓝[(fun t => x + t • v) ⁻¹' s] 0] fun t => f (x + t • v)

Next tactic:
exact A.continuousWithinAt.preimage_mem_nhdsWithin'' h'f (by simp)
lemma HasLineDerivWithinAt.congr_of_eventuallyEq (hf : HasLineDerivWithinAt 𝕜 f f' s x v)
    (h'f : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) : HasLineDerivWithinAt 𝕜 f₁ f' s x v := by
  apply HasDerivWithinAt.congr_of_eventuallyEq hf _ (by simp [hx])
  have A : Continuous (fun (t : 𝕜) ↦ x + t • v) := by continuity
  exact A.continuousWithinAt.preimage_mem_nhdsWithin'' h'f (by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
hf : HasLineDerivWithinAt 𝕜 f f' s x v
h'f : f₁ =ᶠ[𝓝[s] x] f
hx : f₁ x = f x
A : Continuous fun t => x + t • v
⊢ x = x + 0 • v

Next tactic:
simp
theorem HasLineDerivAt.congr_of_eventuallyEq (h : HasLineDerivAt 𝕜 f f' x v) (h₁ : f₁ =ᶠ[𝓝 x] f) :
    HasLineDerivAt 𝕜 f₁ f' x v := by
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
h : HasLineDerivAt 𝕜 f f' x v
h₁ : f₁ =ᶠ[𝓝 x] f
⊢ HasLineDerivAt 𝕜 f₁ f' x v

Next tactic:
apply HasDerivAt.congr_of_eventuallyEq h
theorem HasLineDerivAt.congr_of_eventuallyEq (h : HasLineDerivAt 𝕜 f f' x v) (h₁ : f₁ =ᶠ[𝓝 x] f) :
    HasLineDerivAt 𝕜 f₁ f' x v := by
  apply HasDerivAt.congr_of_eventuallyEq h
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
h : HasLineDerivAt 𝕜 f f' x v
h₁ : f₁ =ᶠ[𝓝 x] f
⊢ (fun t => f₁ (x + t • v)) =ᶠ[𝓝 0] fun t => f (x + t • v)

Next tactic:
let F := fun (t : 𝕜) ↦ x + t • v
theorem HasLineDerivAt.congr_of_eventuallyEq (h : HasLineDerivAt 𝕜 f f' x v) (h₁ : f₁ =ᶠ[𝓝 x] f) :
    HasLineDerivAt 𝕜 f₁ f' x v := by
  apply HasDerivAt.congr_of_eventuallyEq h
  let F := fun (t : 𝕜) ↦ x + t • v
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F✝ : Type u_2
inst✝³ : NormedAddCommGroup F✝
inst✝² : NormedSpace 𝕜 F✝
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F✝
f' : F✝
s t : Set E
x v : E
L : E →L[𝕜] F✝
h : HasLineDerivAt 𝕜 f f' x v
h₁ : f₁ =ᶠ[𝓝 x] f
F : 𝕜 → E := fun t => x + t • v
⊢ (fun t => f₁ (x + t • v)) =ᶠ[𝓝 0] fun t => f (x + t • v)

Next tactic:
rw [show x = F 0 by simp] at h₁
theorem HasLineDerivAt.congr_of_eventuallyEq (h : HasLineDerivAt 𝕜 f f' x v) (h₁ : f₁ =ᶠ[𝓝 x] f) :
    HasLineDerivAt 𝕜 f₁ f' x v := by
  apply HasDerivAt.congr_of_eventuallyEq h
  let F := fun (t : 𝕜) ↦ x + t • v
  rw [show x = F 0 by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F✝ : Type u_2
inst✝³ : NormedAddCommGroup F✝
inst✝² : NormedSpace 𝕜 F✝
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F✝
f' : F✝
s t : Set E
x v : E
L : E →L[𝕜] F✝
h : HasLineDerivAt 𝕜 f f' x v
h₁ : f₁ =ᶠ[𝓝 x] f
F : 𝕜 → E := fun t => x + t • v
⊢ x = F 0

Next tactic:
simp
theorem HasLineDerivAt.congr_of_eventuallyEq (h : HasLineDerivAt 𝕜 f f' x v) (h₁ : f₁ =ᶠ[𝓝 x] f) :
    HasLineDerivAt 𝕜 f₁ f' x v := by
  apply HasDerivAt.congr_of_eventuallyEq h
  let F := fun (t : 𝕜) ↦ x + t • v
  rw [show x = F 0 by simp] at h₁
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F✝ : Type u_2
inst✝³ : NormedAddCommGroup F✝
inst✝² : NormedSpace 𝕜 F✝
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F✝
f' : F✝
s t : Set E
x v : E
L : E →L[𝕜] F✝
h : HasLineDerivAt 𝕜 f f' x v
F : 𝕜 → E := fun t => x + t • v
h₁ : f₁ =ᶠ[𝓝 (F 0)] f
⊢ (fun t => f₁ (x + t • v)) =ᶠ[𝓝 0] fun t => f (x + t • v)

Next tactic:
exact (Continuous.continuousAt (by continuity)).preimage_mem_nhds h₁
theorem HasLineDerivAt.congr_of_eventuallyEq (h : HasLineDerivAt 𝕜 f f' x v) (h₁ : f₁ =ᶠ[𝓝 x] f) :
    HasLineDerivAt 𝕜 f₁ f' x v := by
  apply HasDerivAt.congr_of_eventuallyEq h
  let F := fun (t : 𝕜) ↦ x + t • v
  rw [show x = F 0 by simp] at h₁
  exact (Continuous.continuousAt (by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F✝ : Type u_2
inst✝³ : NormedAddCommGroup F✝
inst✝² : NormedSpace 𝕜 F✝
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F✝
f' : F✝
s t : Set E
x v : E
L : E →L[𝕜] F✝
h : HasLineDerivAt 𝕜 f f' x v
F : 𝕜 → E := fun t => x + t • v
h₁ : f₁ =ᶠ[𝓝 (F 0)] f
⊢ Continuous F

Next tactic:
continuity
theorem LineDifferentiableAt.congr_of_eventuallyEq
    (h : LineDifferentiableAt 𝕜 f x v) (hL : f₁ =ᶠ[𝓝 x] f) :
    LineDifferentiableAt 𝕜 f₁ x v := by
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
h : LineDifferentiableAt 𝕜 f x v
hL : f₁ =ᶠ[𝓝 x] f
⊢ LineDifferentiableAt 𝕜 f₁ x v

Next tactic:
apply DifferentiableAt.congr_of_eventuallyEq h
theorem LineDifferentiableAt.congr_of_eventuallyEq
    (h : LineDifferentiableAt 𝕜 f x v) (hL : f₁ =ᶠ[𝓝 x] f) :
    LineDifferentiableAt 𝕜 f₁ x v := by
  apply DifferentiableAt.congr_of_eventuallyEq h
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
h : LineDifferentiableAt 𝕜 f x v
hL : f₁ =ᶠ[𝓝 x] f
⊢ (fun t => f₁ (x + t • v)) =ᶠ[𝓝 0] fun t => f (x + t • v)

Next tactic:
let F := fun (t : 𝕜) ↦ x + t • v
theorem LineDifferentiableAt.congr_of_eventuallyEq
    (h : LineDifferentiableAt 𝕜 f x v) (hL : f₁ =ᶠ[𝓝 x] f) :
    LineDifferentiableAt 𝕜 f₁ x v := by
  apply DifferentiableAt.congr_of_eventuallyEq h
  let F := fun (t : 𝕜) ↦ x + t • v
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F✝ : Type u_2
inst✝³ : NormedAddCommGroup F✝
inst✝² : NormedSpace 𝕜 F✝
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F✝
f' : F✝
s t : Set E
x v : E
L : E →L[𝕜] F✝
h : LineDifferentiableAt 𝕜 f x v
hL : f₁ =ᶠ[𝓝 x] f
F : 𝕜 → E := fun t => x + t • v
⊢ (fun t => f₁ (x + t • v)) =ᶠ[𝓝 0] fun t => f (x + t • v)

Next tactic:
rw [show x = F 0 by simp] at hL
theorem LineDifferentiableAt.congr_of_eventuallyEq
    (h : LineDifferentiableAt 𝕜 f x v) (hL : f₁ =ᶠ[𝓝 x] f) :
    LineDifferentiableAt 𝕜 f₁ x v := by
  apply DifferentiableAt.congr_of_eventuallyEq h
  let F := fun (t : 𝕜) ↦ x + t • v
  rw [show x = F 0 by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F✝ : Type u_2
inst✝³ : NormedAddCommGroup F✝
inst✝² : NormedSpace 𝕜 F✝
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F✝
f' : F✝
s t : Set E
x v : E
L : E →L[𝕜] F✝
h : LineDifferentiableAt 𝕜 f x v
hL : f₁ =ᶠ[𝓝 x] f
F : 𝕜 → E := fun t => x + t • v
⊢ x = F 0

Next tactic:
simp
theorem LineDifferentiableAt.congr_of_eventuallyEq
    (h : LineDifferentiableAt 𝕜 f x v) (hL : f₁ =ᶠ[𝓝 x] f) :
    LineDifferentiableAt 𝕜 f₁ x v := by
  apply DifferentiableAt.congr_of_eventuallyEq h
  let F := fun (t : 𝕜) ↦ x + t • v
  rw [show x = F 0 by simp] at hL
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F✝ : Type u_2
inst✝³ : NormedAddCommGroup F✝
inst✝² : NormedSpace 𝕜 F✝
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F✝
f' : F✝
s t : Set E
x v : E
L : E →L[𝕜] F✝
h : LineDifferentiableAt 𝕜 f x v
F : 𝕜 → E := fun t => x + t • v
hL : f₁ =ᶠ[𝓝 (F 0)] f
⊢ (fun t => f₁ (x + t • v)) =ᶠ[𝓝 0] fun t => f (x + t • v)

Next tactic:
exact (Continuous.continuousAt (by continuity)).preimage_mem_nhds hL
theorem LineDifferentiableAt.congr_of_eventuallyEq
    (h : LineDifferentiableAt 𝕜 f x v) (hL : f₁ =ᶠ[𝓝 x] f) :
    LineDifferentiableAt 𝕜 f₁ x v := by
  apply DifferentiableAt.congr_of_eventuallyEq h
  let F := fun (t : 𝕜) ↦ x + t • v
  rw [show x = F 0 by simp] at hL
  exact (Continuous.continuousAt (by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F✝ : Type u_2
inst✝³ : NormedAddCommGroup F✝
inst✝² : NormedSpace 𝕜 F✝
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F✝
f' : F✝
s t : Set E
x v : E
L : E →L[𝕜] F✝
h : LineDifferentiableAt 𝕜 f x v
F : 𝕜 → E := fun t => x + t • v
hL : f₁ =ᶠ[𝓝 (F 0)] f
⊢ Continuous F

Next tactic:
continuity
theorem Filter.EventuallyEq.lineDerivWithin_eq (hs : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) :
    lineDerivWithin 𝕜 f₁ s x v = lineDerivWithin 𝕜 f s x v := by
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
hs : f₁ =ᶠ[𝓝[s] x] f
hx : f₁ x = f x
⊢ lineDerivWithin 𝕜 f₁ s x v = lineDerivWithin 𝕜 f s x v

Next tactic:
apply derivWithin_eq ?_ (by simpa using hx)
theorem Filter.EventuallyEq.lineDerivWithin_eq (hs : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) :
    lineDerivWithin 𝕜 f₁ s x v = lineDerivWithin 𝕜 f s x v := by
  apply derivWithin_eq ?_ (by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
hs : f₁ =ᶠ[𝓝[s] x] f
hx : f₁ x = f x
⊢ f₁ (x + 0 • v) = f (x + 0 • v)

Next tactic:
simpa using hx
theorem Filter.EventuallyEq.lineDerivWithin_eq (hs : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) :
    lineDerivWithin 𝕜 f₁ s x v = lineDerivWithin 𝕜 f s x v := by
  apply derivWithin_eq ?_ (by simpa using hx)
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
hs : f₁ =ᶠ[𝓝[s] x] f
hx : f₁ x = f x
⊢ (fun t => f₁ (x + t • v)) =ᶠ[𝓝[(fun t => x + t • v) ⁻¹' s] 0] fun t => f (x + t • v)

Next tactic:
have A : Continuous (fun (t : 𝕜) ↦ x + t • v) := by continuity
theorem Filter.EventuallyEq.lineDerivWithin_eq (hs : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) :
    lineDerivWithin 𝕜 f₁ s x v = lineDerivWithin 𝕜 f s x v := by
  apply derivWithin_eq ?_ (by simpa using hx)
  have A : Continuous (fun (t : 𝕜) ↦ x + t • v) := by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
hs : f₁ =ᶠ[𝓝[s] x] f
hx : f₁ x = f x
⊢ Continuous fun t => x + t • v

Next tactic:
continuity
theorem Filter.EventuallyEq.lineDerivWithin_eq (hs : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) :
    lineDerivWithin 𝕜 f₁ s x v = lineDerivWithin 𝕜 f s x v := by
  apply derivWithin_eq ?_ (by simpa using hx)
  have A : Continuous (fun (t : 𝕜) ↦ x + t • v) := by continuity
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
hs : f₁ =ᶠ[𝓝[s] x] f
hx : f₁ x = f x
A : Continuous fun t => x + t • v
⊢ (fun t => f₁ (x + t • v)) =ᶠ[𝓝[(fun t => x + t • v) ⁻¹' s] 0] fun t => f (x + t • v)

Next tactic:
exact A.continuousWithinAt.preimage_mem_nhdsWithin'' hs (by simp)
theorem Filter.EventuallyEq.lineDerivWithin_eq (hs : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) :
    lineDerivWithin 𝕜 f₁ s x v = lineDerivWithin 𝕜 f s x v := by
  apply derivWithin_eq ?_ (by simpa using hx)
  have A : Continuous (fun (t : 𝕜) ↦ x + t • v) := by continuity
  exact A.continuousWithinAt.preimage_mem_nhdsWithin'' hs (by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
hs : f₁ =ᶠ[𝓝[s] x] f
hx : f₁ x = f x
A : Continuous fun t => x + t • v
⊢ x = x + 0 • v

Next tactic:
simp
theorem Filter.EventuallyEq.lineDeriv_eq (h : f₁ =ᶠ[𝓝 x] f) :
    lineDeriv 𝕜 f₁ x v = lineDeriv 𝕜 f x v := by
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f f₀ f₁ : E → F
f' : F
s t : Set E
x v : E
L : E →L[𝕜] F
h : f₁ =ᶠ[𝓝 x] f
⊢ lineDeriv 𝕜 f₁ x v = lineDeriv 𝕜 f x v

Next tactic:
rw [← lineDerivWithin_univ, ← lineDerivWithin_univ, h.lineDerivWithin_eq_nhds]
/-- Converse to the mean value inequality: if `f` is line differentiable at `x₀` and `C`-lipschitz
on a neighborhood of `x₀` then its line derivative at `x₀` in the direction `v` has norm
bounded by `C * ‖v‖`. This version only assumes that `‖f x - f x₀‖ ≤ C * ‖x - x₀‖` in a
neighborhood of `x`. -/
theorem HasLineDerivAt.le_of_lip' {f : E → F} {f' : F} {x₀ : E} (hf : HasLineDerivAt 𝕜 f f' x₀ v)
    {C : ℝ} (hC₀ : 0 ≤ C) (hlip : ∀ᶠ x in 𝓝 x₀, ‖f x - f x₀‖ ≤ C * ‖x - x₀‖) :
    ‖f'‖ ≤ C * ‖v‖ := by
  

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f✝ f₀ f₁ : E → F
f'✝ : F
s t : Set E
x v : E
L : E →L[𝕜] F
f : E → F
f' : F
x₀ : E
hf : HasLineDerivAt 𝕜 f f' x₀ v
C : ℝ
hC₀ : 0 ≤ C
hlip : ∀ᶠ (x : E) in 𝓝 x₀, ‖f x - f x₀‖ ≤ C * ‖x - x₀‖
⊢ ‖f'‖ ≤ C * ‖v‖

Next tactic:
apply HasDerivAt.le_of_lip' hf (by positivity)
/-- Converse to the mean value inequality: if `f` is line differentiable at `x₀` and `C`-lipschitz
on a neighborhood of `x₀` then its line derivative at `x₀` in the direction `v` has norm
bounded by `C * ‖v‖`. This version only assumes that `‖f x - f x₀‖ ≤ C * ‖x - x₀‖` in a
neighborhood of `x`. -/
theorem HasLineDerivAt.le_of_lip' {f : E → F} {f' : F} {x₀ : E} (hf : HasLineDerivAt 𝕜 f f' x₀ v)
    {C : ℝ} (hC₀ : 0 ≤ C) (hlip : ∀ᶠ x in 𝓝 x₀, ‖f x - f x₀‖ ≤ C * ‖x - x₀‖) :
    ‖f'‖ ≤ C * ‖v‖ := by
  apply HasDerivAt.le_of_lip' hf (by 

Proof state:
𝕜 : Type u_1
inst✝⁴ : NontriviallyNormedField 𝕜
F : Type u_2
inst✝³ : NormedAddCommGroup F
inst✝² : NormedSpace 𝕜 F
E : Type u_3
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace 𝕜 E
f✝ f₀ f₁ : E → F
f'✝ : F
s t : Set E
x v : E
L : E →L[𝕜] F
f : E → F
f' : F
x₀ : E
hf : HasLineDerivAt 𝕜 f f' x₀ v
C : ℝ
hC₀ : 0 ≤ C
hlip : ∀ᶠ (x : E) in 𝓝 x₀, ‖f x - f x₀‖ ≤ C * ‖x - x₀‖
⊢ 0 ≤ C * ‖v‖

Next tactic:
positivity