l3lab/ntp-mathlib huggingface dataset:
/-- Each curve in `PicardLindelof.FunSpace` is continuous. -/
def toContinuousMap : v.FunSpace ↪ C(Icc v.tMin v.tMax, E) :=
  ⟨fun f => ⟨f, f.continuous⟩, fun f g h => by cases f; cases g; 

Proof state:
case mk.mk
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
toFun✝¹ : ↑(Icc v.tMin v.tMax) → E
map_t₀'✝¹ : toFun✝¹ v.t₀ = v.x₀
lipschitz'✝¹ : LipschitzWith v.C toFun✝¹
toFun✝ : ↑(Icc v.tMin v.tMax) → E
map_t₀'✝ : toFun✝ v.t₀ = v.x₀
lipschitz'✝ : LipschitzWith v.C toFun✝
h :
  (fun f => ContinuousMap.mk f.toFun) { toFun := toFun✝¹, map_t₀' := map_t₀'✝¹, lipschitz' := lipschitz'✝¹ } =
    (fun f => ContinuousMap.mk f.toFun) { toFun := toFun✝, map_t₀' := map_t₀'✝, lipschitz' := lipschitz'✝ }
⊢ { toFun := toFun✝¹, map_t₀' := map_t₀'✝¹, lipschitz' := lipschitz'✝¹ } =
    { toFun := toFun✝, map_t₀' := map_t₀'✝, lipschitz' := lipschitz'✝ }

Next tactic:
simpa using h
theorem range_toContinuousMap :
    range toContinuousMap =
      {f : C(Icc v.tMin v.tMax, E) | f v.t₀ = v.x₀ ∧ LipschitzWith v.C f} := by
  

Proof state:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
⊢ range ⇑toContinuousMap = {f | f v.t₀ = v.x₀ ∧ LipschitzWith v.C ⇑f}

Next tactic:
ext f
theorem range_toContinuousMap :
    range toContinuousMap =
      {f : C(Icc v.tMin v.tMax, E) | f v.t₀ = v.x₀ ∧ LipschitzWith v.C f} := by
  ext f; 

Proof state:
case h
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
v : PicardLindelof E
f✝ : FunSpace v
f : C(↑(Icc v.tMin v.tMax), E)
⊢ f ∈ range ⇑toContinuousMap ↔ f ∈ {f | f v.t₀ = v.x₀ ∧ LipschitzWith v.C ⇑f}

Next tactic:
constructor
theorem range_toContinuousMap :
    range toContinuousMap =
      {f : C(Icc v.tMin v.tMax, E) | f v.t₀ = v.x₀ ∧ LipschitzWith v.C f} := by
  ext f; constructor
  · 

Proof state:
case h.mp
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
v : PicardLindelof E
f✝ : FunSpace v
f : C(↑(Icc v.tMin v.tMax), E)
⊢ f ∈ range ⇑toContinuousMap → f ∈ {f | f v.t₀ = v.x₀ ∧ LipschitzWith v.C ⇑f}

Next tactic:
rintro ⟨⟨f, hf₀, hf_lip⟩, rfl⟩
theorem range_toContinuousMap :
    range toContinuousMap =
      {f : C(Icc v.tMin v.tMax, E) | f v.t₀ = v.x₀ ∧ LipschitzWith v.C f} := by
  ext f; constructor
  · rintro ⟨⟨f, hf₀, hf_lip⟩, rfl⟩; 

Proof state:
case h.mp.intro.mk
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
v : PicardLindelof E
f✝ : FunSpace v
f : ↑(Icc v.tMin v.tMax) → E
hf₀ : f v.t₀ = v.x₀
hf_lip : LipschitzWith v.C f
⊢ toContinuousMap { toFun := f, map_t₀' := hf₀, lipschitz' := hf_lip } ∈ {f | f v.t₀ = v.x₀ ∧ LipschitzWith v.C ⇑f}

Next tactic:
exact ⟨hf₀, hf_lip⟩
theorem range_toContinuousMap :
    range toContinuousMap =
      {f : C(Icc v.tMin v.tMax, E) | f v.t₀ = v.x₀ ∧ LipschitzWith v.C f} := by
  ext f; constructor
  · rintro ⟨⟨f, hf₀, hf_lip⟩, rfl⟩; exact ⟨hf₀, hf_lip⟩
  · 

Proof state:
case h.mpr
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
v : PicardLindelof E
f✝ : FunSpace v
f : C(↑(Icc v.tMin v.tMax), E)
⊢ f ∈ {f | f v.t₀ = v.x₀ ∧ LipschitzWith v.C ⇑f} → f ∈ range ⇑toContinuousMap

Next tactic:
rcases f with ⟨f, hf⟩
theorem range_toContinuousMap :
    range toContinuousMap =
      {f : C(Icc v.tMin v.tMax, E) | f v.t₀ = v.x₀ ∧ LipschitzWith v.C f} := by
  ext f; constructor
  · rintro ⟨⟨f, hf₀, hf_lip⟩, rfl⟩; exact ⟨hf₀, hf_lip⟩
  · rcases f with ⟨f, hf⟩; 

Proof state:
case h.mpr.mk
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
v : PicardLindelof E
f✝ : FunSpace v
f : ↑(Icc v.tMin v.tMax) → E
hf : Continuous f
⊢ ContinuousMap.mk f ∈ {f | f v.t₀ = v.x₀ ∧ LipschitzWith v.C ⇑f} → ContinuousMap.mk f ∈ range ⇑toContinuousMap

Next tactic:
rintro ⟨hf₀, hf_lip⟩
theorem range_toContinuousMap :
    range toContinuousMap =
      {f : C(Icc v.tMin v.tMax, E) | f v.t₀ = v.x₀ ∧ LipschitzWith v.C f} := by
  ext f; constructor
  · rintro ⟨⟨f, hf₀, hf_lip⟩, rfl⟩; exact ⟨hf₀, hf_lip⟩
  · rcases f with ⟨f, hf⟩; rintro ⟨hf₀, hf_lip⟩; 

Proof state:
case h.mpr.mk.intro
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
v : PicardLindelof E
f✝ : FunSpace v
f : ↑(Icc v.tMin v.tMax) → E
hf : Continuous f
hf₀ : (ContinuousMap.mk f) v.t₀ = v.x₀
hf_lip : LipschitzWith v.C ⇑(ContinuousMap.mk f)
⊢ ContinuousMap.mk f ∈ range ⇑toContinuousMap

Next tactic:
exact ⟨⟨f, hf₀, hf_lip⟩, rfl⟩
protected theorem mem_closedBall (t : Icc v.tMin v.tMax) : f t ∈ closedBall v.x₀ v.R :=
  calc
    dist (f t) v.x₀ = dist (f t) (f.toFun v.t₀) := by 

Proof state:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
t : ↑(Icc v.tMin v.tMax)
⊢ dist (toFun f t) v.x₀ = dist (toFun f t) (toFun f v.t₀)

Next tactic:
rw [f.map_t₀']
theorem vComp_apply_coe (t : Icc v.tMin v.tMax) : f.vComp t = v t (f t) := by
  

Proof state:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
t : ↑(Icc v.tMin v.tMax)
⊢ vComp f ↑t = PicardLindelof.toFun v (↑t) (toFun f t)

Next tactic:
simp only [vComp, proj_coe]
theorem continuous_vComp : Continuous f.vComp := by
  

Proof state:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
⊢ Continuous (vComp f)

Next tactic:
have := (continuous_subtype_val.prod_mk f.continuous).comp v.continuous_proj
theorem continuous_vComp : Continuous f.vComp := by
  have := (continuous_subtype_val.prod_mk f.continuous).comp v.continuous_proj
  

Proof state:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
this : Continuous ((fun x => (↑x, toFun f x)) ∘ proj v)
⊢ Continuous (vComp f)

Next tactic:
refine' ContinuousOn.comp_continuous v.continuousOn this fun x => _
theorem continuous_vComp : Continuous f.vComp := by
  have := (continuous_subtype_val.prod_mk f.continuous).comp v.continuous_proj
  refine' ContinuousOn.comp_continuous v.continuousOn this fun x => _
  

Proof state:
E : Type u_1
inst✝¹ : NormedAddCommGroup E
inst✝ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
this : Continuous ((fun x => (↑x, toFun f x)) ∘ proj v)
x : ℝ
⊢ ((fun x => (↑x, toFun f x)) ∘ proj v) x ∈ Icc v.tMin v.tMax ×ˢ closedBall v.x₀ ↑v.R

Next tactic:
exact ⟨(v.proj x).2, f.mem_closedBall _⟩
instance [CompleteSpace E] : CompleteSpace v.FunSpace := by
  

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
inst✝ : CompleteSpace E
⊢ CompleteSpace (FunSpace v)

Next tactic:
refine' (completeSpace_iff_isComplete_range uniformInducing_toContinuousMap).2
      (IsClosed.isComplete _)
instance [CompleteSpace E] : CompleteSpace v.FunSpace := by
  refine' (completeSpace_iff_isComplete_range uniformInducing_toContinuousMap).2
      (IsClosed.isComplete _)
  

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
inst✝ : CompleteSpace E
⊢ IsClosed (range ⇑toContinuousMap)

Next tactic:
rw [range_toContinuousMap, setOf_and]
instance [CompleteSpace E] : CompleteSpace v.FunSpace := by
  refine' (completeSpace_iff_isComplete_range uniformInducing_toContinuousMap).2
      (IsClosed.isComplete _)
  rw [range_toContinuousMap, setOf_and]
  

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
inst✝ : CompleteSpace E
⊢ IsClosed ({a | a v.t₀ = v.x₀} ∩ {a | LipschitzWith v.C ⇑a})

Next tactic:
refine' (isClosed_eq (ContinuousMap.continuous_eval_const _) continuous_const).inter _
instance [CompleteSpace E] : CompleteSpace v.FunSpace := by
  refine' (completeSpace_iff_isComplete_range uniformInducing_toContinuousMap).2
      (IsClosed.isComplete _)
  rw [range_toContinuousMap, setOf_and]
  refine' (isClosed_eq (ContinuousMap.continuous_eval_const _) continuous_const).inter _
  

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
inst✝ : CompleteSpace E
⊢ IsClosed {a | LipschitzWith v.C ⇑a}

Next tactic:
have : IsClosed {f : Icc v.tMin v.tMax → E | LipschitzWith v.C f} :=
    isClosed_setOf_lipschitzWith v.C
instance [CompleteSpace E] : CompleteSpace v.FunSpace := by
  refine' (completeSpace_iff_isComplete_range uniformInducing_toContinuousMap).2
      (IsClosed.isComplete _)
  rw [range_toContinuousMap, setOf_and]
  refine' (isClosed_eq (ContinuousMap.continuous_eval_const _) continuous_const).inter _
  have : IsClosed {f : Icc v.tMin v.tMax → E | LipschitzWith v.C f} :=
    isClosed_setOf_lipschitzWith v.C
  

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
inst✝ : CompleteSpace E
this : IsClosed {f | LipschitzWith v.C f}
⊢ IsClosed {a | LipschitzWith v.C ⇑a}

Next tactic:
exact this.preimage ContinuousMap.continuous_coe
/-- The Picard-Lindelöf operator. This is a contracting map on `PicardLindelof.FunSpace v` such
that the fixed point of this map is the solution of the corresponding ODE.

More precisely, some iteration of this map is a contracting map. -/
def next (f : FunSpace v) : FunSpace v where
  toFun t := v.x₀ + ∫ τ : ℝ in v.t₀..t, f.vComp τ
  map_t₀' := by 

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
v : PicardLindelof E
f✝ : FunSpace v
inst✝ : CompleteSpace E
f : FunSpace v
⊢ (fun t => v.x₀ + ∫ (τ : ℝ) in ↑v.t₀..↑t, vComp f τ) v.t₀ = v.x₀

Next tactic:
simp only [integral_same, add_zero]
/-- The Picard-Lindelöf operator. This is a contracting map on `PicardLindelof.FunSpace v` such
that the fixed point of this map is the solution of the corresponding ODE.

More precisely, some iteration of this map is a contracting map. -/
def next (f : FunSpace v) : FunSpace v where
  toFun t := v.x₀ + ∫ τ : ℝ in v.t₀..t, f.vComp τ
  map_t₀' := by simp only [integral_same, add_zero]
  lipschitz' := LipschitzWith.of_dist_le_mul fun t₁ t₂ => by
    

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
v : PicardLindelof E
f✝ : FunSpace v
inst✝ : CompleteSpace E
f : FunSpace v
t₁ t₂ : ↑(Icc v.tMin v.tMax)
⊢ dist (v.x₀ + ∫ (τ : ℝ) in ↑v.t₀..↑t₁, vComp f τ) (v.x₀ + ∫ (τ : ℝ) in ↑v.t₀..↑t₂, vComp f τ) ≤ ↑v.C * dist t₁ t₂

Next tactic:
rw [dist_add_left, dist_eq_norm,
      integral_interval_sub_left (f.intervalIntegrable_vComp _ _) (f.intervalIntegrable_vComp _ _)]
/-- The Picard-Lindelöf operator. This is a contracting map on `PicardLindelof.FunSpace v` such
that the fixed point of this map is the solution of the corresponding ODE.

More precisely, some iteration of this map is a contracting map. -/
def next (f : FunSpace v) : FunSpace v where
  toFun t := v.x₀ + ∫ τ : ℝ in v.t₀..t, f.vComp τ
  map_t₀' := by simp only [integral_same, add_zero]
  lipschitz' := LipschitzWith.of_dist_le_mul fun t₁ t₂ => by
    rw [dist_add_left, dist_eq_norm,
      integral_interval_sub_left (f.intervalIntegrable_vComp _ _) (f.intervalIntegrable_vComp _ _)]
    

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
v : PicardLindelof E
f✝ : FunSpace v
inst✝ : CompleteSpace E
f : FunSpace v
t₁ t₂ : ↑(Icc v.tMin v.tMax)
⊢ ‖∫ (x : ℝ) in ↑t₂..↑t₁, vComp f x‖ ≤ ↑v.C * dist t₁ t₂

Next tactic:
exact norm_integral_le_of_norm_le_const fun t _ => f.norm_vComp_le _
theorem hasDerivWithinAt_next (t : Icc v.tMin v.tMax) :
    HasDerivWithinAt (f.next ∘ v.proj) (v t (f t)) (Icc v.tMin v.tMax) t := by
  

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
inst✝ : CompleteSpace E
t : ↑(Icc v.tMin v.tMax)
⊢ HasDerivWithinAt ((next f).toFun ∘ proj v) (PicardLindelof.toFun v (↑t) (toFun f t)) (Icc v.tMin v.tMax) ↑t

Next tactic:
haveI : Fact ((t : ℝ) ∈ Icc v.tMin v.tMax) := ⟨t.2⟩
theorem hasDerivWithinAt_next (t : Icc v.tMin v.tMax) :
    HasDerivWithinAt (f.next ∘ v.proj) (v t (f t)) (Icc v.tMin v.tMax) t := by
  haveI : Fact ((t : ℝ) ∈ Icc v.tMin v.tMax) := ⟨t.2⟩
  

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
inst✝ : CompleteSpace E
t : ↑(Icc v.tMin v.tMax)
this : Fact (↑t ∈ Icc v.tMin v.tMax)
⊢ HasDerivWithinAt ((next f).toFun ∘ proj v) (PicardLindelof.toFun v (↑t) (toFun f t)) (Icc v.tMin v.tMax) ↑t

Next tactic:
simp only [(· ∘ ·), next_apply]
theorem hasDerivWithinAt_next (t : Icc v.tMin v.tMax) :
    HasDerivWithinAt (f.next ∘ v.proj) (v t (f t)) (Icc v.tMin v.tMax) t := by
  haveI : Fact ((t : ℝ) ∈ Icc v.tMin v.tMax) := ⟨t.2⟩
  simp only [(· ∘ ·), next_apply]
  

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
inst✝ : CompleteSpace E
t : ↑(Icc v.tMin v.tMax)
this : Fact (↑t ∈ Icc v.tMin v.tMax)
⊢ HasDerivWithinAt (fun x => v.x₀ + ∫ (τ : ℝ) in ↑v.t₀..↑(proj v x), vComp f τ)
    (PicardLindelof.toFun v (↑t) (toFun f t)) (Icc v.tMin v.tMax) ↑t

Next tactic:
refine' HasDerivWithinAt.const_add _ _
theorem hasDerivWithinAt_next (t : Icc v.tMin v.tMax) :
    HasDerivWithinAt (f.next ∘ v.proj) (v t (f t)) (Icc v.tMin v.tMax) t := by
  haveI : Fact ((t : ℝ) ∈ Icc v.tMin v.tMax) := ⟨t.2⟩
  simp only [(· ∘ ·), next_apply]
  refine' HasDerivWithinAt.const_add _ _
  

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
inst✝ : CompleteSpace E
t : ↑(Icc v.tMin v.tMax)
this : Fact (↑t ∈ Icc v.tMin v.tMax)
⊢ HasDerivWithinAt (fun x => ∫ (τ : ℝ) in ↑v.t₀..↑(proj v x), vComp f τ) (PicardLindelof.toFun v (↑t) (toFun f t))
    (Icc v.tMin v.tMax) ↑t

Next tactic:
have : HasDerivWithinAt (∫ τ in v.t₀..·, f.vComp τ) (f.vComp t) (Icc v.tMin v.tMax) t :=
    integral_hasDerivWithinAt_right (f.intervalIntegrable_vComp _ _)
      (f.continuous_vComp.stronglyMeasurableAtFilter _ _)
      f.continuous_vComp.continuousWithinAt
theorem hasDerivWithinAt_next (t : Icc v.tMin v.tMax) :
    HasDerivWithinAt (f.next ∘ v.proj) (v t (f t)) (Icc v.tMin v.tMax) t := by
  haveI : Fact ((t : ℝ) ∈ Icc v.tMin v.tMax) := ⟨t.2⟩
  simp only [(· ∘ ·), next_apply]
  refine' HasDerivWithinAt.const_add _ _
  have : HasDerivWithinAt (∫ τ in v.t₀..·, f.vComp τ) (f.vComp t) (Icc v.tMin v.tMax) t :=
    integral_hasDerivWithinAt_right (f.intervalIntegrable_vComp _ _)
      (f.continuous_vComp.stronglyMeasurableAtFilter _ _)
      f.continuous_vComp.continuousWithinAt
  

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
inst✝ : CompleteSpace E
t : ↑(Icc v.tMin v.tMax)
this✝ : Fact (↑t ∈ Icc v.tMin v.tMax)
this : HasDerivWithinAt (fun x => ∫ (τ : ℝ) in ↑v.t₀..x, vComp f τ) (vComp f ↑t) (Icc v.tMin v.tMax) ↑t
⊢ HasDerivWithinAt (fun x => ∫ (τ : ℝ) in ↑v.t₀..↑(proj v x), vComp f τ) (PicardLindelof.toFun v (↑t) (toFun f t))
    (Icc v.tMin v.tMax) ↑t

Next tactic:
rw [vComp_apply_coe] at this
theorem hasDerivWithinAt_next (t : Icc v.tMin v.tMax) :
    HasDerivWithinAt (f.next ∘ v.proj) (v t (f t)) (Icc v.tMin v.tMax) t := by
  haveI : Fact ((t : ℝ) ∈ Icc v.tMin v.tMax) := ⟨t.2⟩
  simp only [(· ∘ ·), next_apply]
  refine' HasDerivWithinAt.const_add _ _
  have : HasDerivWithinAt (∫ τ in v.t₀..·, f.vComp τ) (f.vComp t) (Icc v.tMin v.tMax) t :=
    integral_hasDerivWithinAt_right (f.intervalIntegrable_vComp _ _)
      (f.continuous_vComp.stronglyMeasurableAtFilter _ _)
      f.continuous_vComp.continuousWithinAt
  rw [vComp_apply_coe] at this
  

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
inst✝ : CompleteSpace E
t : ↑(Icc v.tMin v.tMax)
this✝ : Fact (↑t ∈ Icc v.tMin v.tMax)
this :
  HasDerivWithinAt (fun x => ∫ (τ : ℝ) in ↑v.t₀..x, vComp f τ) (PicardLindelof.toFun v (↑t) (toFun f t))
    (Icc v.tMin v.tMax) ↑t
⊢ HasDerivWithinAt (fun x => ∫ (τ : ℝ) in ↑v.t₀..↑(proj v x), vComp f τ) (PicardLindelof.toFun v (↑t) (toFun f t))
    (Icc v.tMin v.tMax) ↑t

Next tactic:
refine' this.congr_of_eventuallyEq_of_mem _ t.coe_prop
theorem hasDerivWithinAt_next (t : Icc v.tMin v.tMax) :
    HasDerivWithinAt (f.next ∘ v.proj) (v t (f t)) (Icc v.tMin v.tMax) t := by
  haveI : Fact ((t : ℝ) ∈ Icc v.tMin v.tMax) := ⟨t.2⟩
  simp only [(· ∘ ·), next_apply]
  refine' HasDerivWithinAt.const_add _ _
  have : HasDerivWithinAt (∫ τ in v.t₀..·, f.vComp τ) (f.vComp t) (Icc v.tMin v.tMax) t :=
    integral_hasDerivWithinAt_right (f.intervalIntegrable_vComp _ _)
      (f.continuous_vComp.stronglyMeasurableAtFilter _ _)
      f.continuous_vComp.continuousWithinAt
  rw [vComp_apply_coe] at this
  refine' this.congr_of_eventuallyEq_of_mem _ t.coe_prop
  

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
inst✝ : CompleteSpace E
t : ↑(Icc v.tMin v.tMax)
this✝ : Fact (↑t ∈ Icc v.tMin v.tMax)
this :
  HasDerivWithinAt (fun x => ∫ (τ : ℝ) in ↑v.t₀..x, vComp f τ) (PicardLindelof.toFun v (↑t) (toFun f t))
    (Icc v.tMin v.tMax) ↑t
⊢ (fun x => ∫ (τ : ℝ) in ↑v.t₀..↑(proj v x), vComp f τ) =ᶠ[𝓝[Icc v.tMin v.tMax] ↑t] fun x =>
    ∫ (τ : ℝ) in ↑v.t₀..x, vComp f τ

Next tactic:
filter_upwards [self_mem_nhdsWithin] with _ ht'
theorem hasDerivWithinAt_next (t : Icc v.tMin v.tMax) :
    HasDerivWithinAt (f.next ∘ v.proj) (v t (f t)) (Icc v.tMin v.tMax) t := by
  haveI : Fact ((t : ℝ) ∈ Icc v.tMin v.tMax) := ⟨t.2⟩
  simp only [(· ∘ ·), next_apply]
  refine' HasDerivWithinAt.const_add _ _
  have : HasDerivWithinAt (∫ τ in v.t₀..·, f.vComp τ) (f.vComp t) (Icc v.tMin v.tMax) t :=
    integral_hasDerivWithinAt_right (f.intervalIntegrable_vComp _ _)
      (f.continuous_vComp.stronglyMeasurableAtFilter _ _)
      f.continuous_vComp.continuousWithinAt
  rw [vComp_apply_coe] at this
  refine' this.congr_of_eventuallyEq_of_mem _ t.coe_prop
  filter_upwards [self_mem_nhdsWithin] with _ ht'
  

Proof state:
case h
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
inst✝ : CompleteSpace E
t : ↑(Icc v.tMin v.tMax)
this✝ : Fact (↑t ∈ Icc v.tMin v.tMax)
this :
  HasDerivWithinAt (fun x => ∫ (τ : ℝ) in ↑v.t₀..x, vComp f τ) (PicardLindelof.toFun v (↑t) (toFun f t))
    (Icc v.tMin v.tMax) ↑t
a✝ : ℝ
ht' : a✝ ∈ Icc v.tMin v.tMax
⊢ ∫ (τ : ℝ) in ↑v.t₀..↑(proj v a✝), vComp f τ = ∫ (τ : ℝ) in ↑v.t₀..a✝, vComp f τ

Next tactic:
rw [v.proj_of_mem ht']
theorem dist_next_apply_le_of_le {f₁ f₂ : FunSpace v} {n : ℕ} {d : ℝ}
    (h : ∀ t, dist (f₁ t) (f₂ t) ≤ (v.L * |t.1 - v.t₀|) ^ n / n ! * d) (t : Icc v.tMin v.tMax) :
    dist (next f₁ t) (next f₂ t) ≤ (v.L * |t.1 - v.t₀|) ^ (n + 1) / (n + 1)! * d := by
  

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
inst✝ : CompleteSpace E
f₁ f₂ : FunSpace v
n : ℕ
d : ℝ
h : ∀ (t : ↑(Icc v.tMin v.tMax)), dist (toFun f₁ t) (toFun f₂ t) ≤ (↑v.L * |↑t - ↑v.t₀|) ^ n / ↑n ! * d
t : ↑(Icc v.tMin v.tMax)
⊢ dist (toFun (next f₁) t) (toFun (next f₂) t) ≤ (↑v.L * |↑t - ↑v.t₀|) ^ (n + 1) / ↑(n + 1)! * d

Next tactic:
simp only [dist_eq_norm, next_apply, add_sub_add_left_eq_sub, ←
    intervalIntegral.integral_sub (intervalIntegrable_vComp _ _ _)
      (intervalIntegrable_vComp _ _ _),
    norm_integral_eq_norm_integral_Ioc] at *
theorem dist_next_apply_le_of_le {f₁ f₂ : FunSpace v} {n : ℕ} {d : ℝ}
    (h : ∀ t, dist (f₁ t) (f₂ t) ≤ (v.L * |t.1 - v.t₀|) ^ n / n ! * d) (t : Icc v.tMin v.tMax) :
    dist (next f₁ t) (next f₂ t) ≤ (v.L * |t.1 - v.t₀|) ^ (n + 1) / (n + 1)! * d := by
  simp only [dist_eq_norm, next_apply, add_sub_add_left_eq_sub, ←
    intervalIntegral.integral_sub (intervalIntegrable_vComp _ _ _)
      (intervalIntegrable_vComp _ _ _),
    norm_integral_eq_norm_integral_Ioc] at *
  

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
inst✝ : CompleteSpace E
f₁ f₂ : FunSpace v
n : ℕ
d : ℝ
t : ↑(Icc v.tMin v.tMax)
h : ∀ (t : ↑(Icc v.tMin v.tMax)), ‖toFun f₁ t - toFun f₂ t‖ ≤ (↑v.L * |↑t - ↑v.t₀|) ^ n / ↑n ! * d
⊢ ‖∫ (x : ℝ) in Ι ↑v.t₀ ↑t, vComp f₁ x - vComp f₂ x ∂volume‖ ≤ (↑v.L * |↑t - ↑v.t₀|) ^ (n + 1) / ↑(n + 1)! * d

Next tactic:
calc
    ‖∫ τ in Ι (v.t₀ : ℝ) t, f₁.vComp τ - f₂.vComp τ‖ ≤
        ∫ τ in Ι (v.t₀ : ℝ) t, v.L * ((v.L * |τ - v.t₀|) ^ n / n ! * d) := by
      refine' norm_integral_le_of_norm_le (Continuous.integrableOn_uIoc _) _
      · -- porting note: was `continuity`
        refine .mul continuous_const <| .mul (.div_const ?_ _) continuous_const
        refine .pow (.mul continuous_const <| .abs <| ?_) _
        exact .sub continuous_id continuous_const
      · refine' (ae_restrict_mem measurableSet_Ioc).mono fun τ hτ => _
        refine' (v.lipschitzOnWith (v.proj τ).2).norm_sub_le_of_le (f₁.mem_closedBall _)
            (f₂.mem_closedBall _) ((h _).trans_eq _)
        rw [v.proj_of_mem]
        exact uIcc_subset_Icc v.t₀.2 t.2 <| Ioc_subset_Icc_self hτ
    _ = (v.L * |t.1 - v.t₀|) ^ (n + 1) / (n + 1)! * d := by
      simp_rw [mul_pow, div_eq_mul_inv, mul_assoc, MeasureTheory.integral_mul_left,
        MeasureTheory.integral_mul_right, integral_pow_abs_sub_uIoc, div_eq_mul_inv,
        pow_succ (v.L : ℝ), Nat.factorial_succ, Nat.cast_mul, Nat.cast_succ, mul_inv, mul_assoc]
theorem dist_next_apply_le_of_le {f₁ f₂ : FunSpace v} {n : ℕ} {d : ℝ}
    (h : ∀ t, dist (f₁ t) (f₂ t) ≤ (v.L * |t.1 - v.t₀|) ^ n / n ! * d) (t : Icc v.tMin v.tMax) :
    dist (next f₁ t) (next f₂ t) ≤ (v.L * |t.1 - v.t₀|) ^ (n + 1) / (n + 1)! * d := by
  simp only [dist_eq_norm, next_apply, add_sub_add_left_eq_sub, ←
    intervalIntegral.integral_sub (intervalIntegrable_vComp _ _ _)
      (intervalIntegrable_vComp _ _ _),
    norm_integral_eq_norm_integral_Ioc] at *
  calc
    ‖∫ τ in Ι (v.t₀ : ℝ) t, f₁.vComp τ - f₂.vComp τ‖ ≤
        ∫ τ in Ι (v.t₀ : ℝ) t, v.L * ((v.L * |τ - v.t₀|) ^ n / n ! * d) := by
      

Proof state:
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
inst✝ : CompleteSpace E
f₁ f₂ : FunSpace v
n : ℕ
d : ℝ
t : ↑(Icc v.tMin v.tMax)
h : ∀ (t : ↑(Icc v.tMin v.tMax)), ‖toFun f₁ t - toFun f₂ t‖ ≤ (↑v.L * |↑t - ↑v.t₀|) ^ n / ↑n ! * d
⊢ ‖∫ (τ : ℝ) in Ι ↑v.t₀ ↑t, vComp f₁ τ - vComp f₂ τ‖ ≤
    ∫ (τ : ℝ) in Ι ↑v.t₀ ↑t, ↑v.L * ((↑v.L * |τ - ↑v.t₀|) ^ n / ↑n ! * d)

Next tactic:
refine' norm_integral_le_of_norm_le (Continuous.integrableOn_uIoc _) _
theorem dist_next_apply_le_of_le {f₁ f₂ : FunSpace v} {n : ℕ} {d : ℝ}
    (h : ∀ t, dist (f₁ t) (f₂ t) ≤ (v.L * |t.1 - v.t₀|) ^ n / n ! * d) (t : Icc v.tMin v.tMax) :
    dist (next f₁ t) (next f₂ t) ≤ (v.L * |t.1 - v.t₀|) ^ (n + 1) / (n + 1)! * d := by
  simp only [dist_eq_norm, next_apply, add_sub_add_left_eq_sub, ←
    intervalIntegral.integral_sub (intervalIntegrable_vComp _ _ _)
      (intervalIntegrable_vComp _ _ _),
    norm_integral_eq_norm_integral_Ioc] at *
  calc
    ‖∫ τ in Ι (v.t₀ : ℝ) t, f₁.vComp τ - f₂.vComp τ‖ ≤
        ∫ τ in Ι (v.t₀ : ℝ) t, v.L * ((v.L * |τ - v.t₀|) ^ n / n ! * d) := by
      refine' norm_integral_le_of_norm_le (Continuous.integrableOn_uIoc _) _
      · -- porting note: was `continuity`
        

Proof state:
case refine'_1
E : Type u_1
inst✝² : NormedAddCommGroup E
inst✝¹ : NormedSpace ℝ E
v : PicardLindelof E
f : FunSpace v
inst✝ : CompleteSpace E
f₁ f₂ : FunSpace v
n : ℕ
d : ℝ
t : ↑(Icc v.tMin v.tMax)
h : ∀ (t : ↑(Icc v.tMin v.tMax)), ‖toFun f₁ t - toFun f₂ t‖ ≤ (↑v.L * |↑t - ↑v.t₀|) ^ n / ↑n ! * d
⊢ Continuous fun τ => ↑v.L * ((↑v.L * |τ - ↑v.t₀|) ^ n / ↑n ! * d)

Next tactic:
refine .mul continuous_const <| .mul (.div_const ?_ _) continuous_const