analysis.ODE.picard_lindelofMathlib.Analysis.ODE.PicardLindelof

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -397,8 +397,8 @@ theorem dist_next_apply_le_of_le {f₁ f₂ : FunSpace v} {n : ℕ} {d : ℝ}
         exact uIcc_subset_Icc v.t₀.2 t.2 <| Ioc_subset_Icc_self hτ
     _ = (v.L * |t - v.t₀|) ^ (n + 1) / (n + 1)! * d := _
   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]
+    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]
 #align picard_lindelof.fun_space.dist_next_apply_le_of_le PicardLindelof.FunSpace.dist_next_apply_le_of_le
 -/
 
@@ -538,10 +538,10 @@ theorem exists_isPicardLindelof_const_of_contDiffAt {s : Set E} (hv : ContDiffOn
       norm_le := fun t ht x hx => hC ⟨x, hx, rfl⟩
       C_hMul_le_R :=
         by
-        rw [add_sub_cancel', sub_sub_cancel, max_self, mul_ite, mul_one]
+        rw [add_sub_cancel_left, sub_sub_cancel, max_self, mul_ite, mul_one]
         split_ifs
         · rwa [← h] at hr'
-        · exact (mul_div_cancel' (r / 2) h).le }
+        · exact (mul_div_cancel₀ (r / 2) h).le }
 #align exists_is_picard_lindelof_const_of_cont_diff_on_nhds exists_isPicardLindelof_const_of_contDiffAt
 -/
 
Diff
@@ -367,7 +367,7 @@ theorem hasDerivWithinAt_next (t : Icc v.tMin v.tMax) :
     integral_has_deriv_within_at_right (f.interval_integrable_v_comp _ _)
       (f.continuous_v_comp.strongly_measurable_at_filter _ _)
       f.continuous_v_comp.continuous_within_at
-  rw [v_comp_apply_coe] at this 
+  rw [v_comp_apply_coe] at this
   refine' this.congr_of_eventually_eq_of_mem _ t.coe_prop
   filter_upwards [self_mem_nhdsWithin] with _ ht'
   rw [v.proj_of_mem ht']
@@ -540,7 +540,7 @@ theorem exists_isPicardLindelof_const_of_contDiffAt {s : Set E} (hv : ContDiffOn
         by
         rw [add_sub_cancel', sub_sub_cancel, max_self, mul_ite, mul_one]
         split_ifs
-        · rwa [← h] at hr' 
+        · rwa [← h] at hr'
         · exact (mul_div_cancel' (r / 2) h).le }
 #align exists_is_picard_lindelof_const_of_cont_diff_on_nhds exists_isPicardLindelof_const_of_contDiffAt
 -/
@@ -563,7 +563,7 @@ theorem exists_forall_hasDerivAt_Ioo_eq_of_contDiffAt {s : Set E} (hv : ContDiff
     apply ContinuousAt.preimage_mem_nhds this.continuous_at
     rw [hf1]
     exact hs
-  rw [Metric.mem_nhds_iff] at h 
+  rw [Metric.mem_nhds_iff] at h
   obtain ⟨r, hr1, hr2⟩ := h
   refine'
     ⟨min r ε, lt_min hr1 hε, f, hf1, fun t ht =>
Diff
@@ -499,10 +499,10 @@ theorem IsPicardLindelof.exists_forall_hasDerivWithinAt_Icc_eq [CompleteSpace E]
 
 variable [ProperSpace E] {v : E → E} (t₀ : ℝ) (x₀ : E)
 
-#print exists_isPicardLindelof_const_of_contDiffOn_nhds /-
+#print exists_isPicardLindelof_const_of_contDiffAt /-
 /-- A time-independent, locally continuously differentiable ODE satisfies the hypotheses of the
   Picard-Lindelöf theorem. -/
-theorem exists_isPicardLindelof_const_of_contDiffOn_nhds {s : Set E} (hv : ContDiffOn ℝ 1 v s)
+theorem exists_isPicardLindelof_const_of_contDiffAt {s : Set E} (hv : ContDiffOn ℝ 1 v s)
     (hs : s ∈ 𝓝 x₀) :
     ∃ ε > (0 : ℝ), ∃ L R C, IsPicardLindelof (fun t => v) (t₀ - ε) t₀ (t₀ + ε) x₀ L R C :=
   by
@@ -542,18 +542,18 @@ theorem exists_isPicardLindelof_const_of_contDiffOn_nhds {s : Set E} (hv : ContD
         split_ifs
         · rwa [← h] at hr' 
         · exact (mul_div_cancel' (r / 2) h).le }
-#align exists_is_picard_lindelof_const_of_cont_diff_on_nhds exists_isPicardLindelof_const_of_contDiffOn_nhds
+#align exists_is_picard_lindelof_const_of_cont_diff_on_nhds exists_isPicardLindelof_const_of_contDiffAt
 -/
 
-#print exists_forall_deriv_at_Ioo_eq_of_contDiffOn_nhds /-
+#print exists_forall_hasDerivAt_Ioo_eq_of_contDiffAt /-
 /-- A time-independent, locally continuously differentiable ODE admits a solution in some open
 interval. -/
-theorem exists_forall_deriv_at_Ioo_eq_of_contDiffOn_nhds {s : Set E} (hv : ContDiffOn ℝ 1 v s)
+theorem exists_forall_hasDerivAt_Ioo_eq_of_contDiffAt {s : Set E} (hv : ContDiffOn ℝ 1 v s)
     (hs : s ∈ 𝓝 x₀) :
     ∃ ε > (0 : ℝ),
       ∃ f : ℝ → E, f t₀ = x₀ ∧ ∀ t ∈ Ioo (t₀ - ε) (t₀ + ε), f t ∈ s ∧ HasDerivAt f (v (f t)) t :=
   by
-  obtain ⟨ε, hε, L, R, C, hpl⟩ := exists_isPicardLindelof_const_of_contDiffOn_nhds t₀ x₀ hv hs
+  obtain ⟨ε, hε, L, R, C, hpl⟩ := exists_isPicardLindelof_const_of_contDiffAt t₀ x₀ hv hs
   obtain ⟨f, hf1, hf2⟩ := IsPicardLindelof.exists_forall_hasDerivWithinAt_Icc_eq x₀ hpl
   have hf2' : ∀ t ∈ Ioo (t₀ - ε) (t₀ + ε), HasDerivAt f (v (f t)) t := fun t ht =>
     (hf2 t (Ioo_subset_Icc_self ht)).HasDerivAt (Icc_mem_nhds ht.1 ht.2)
@@ -577,7 +577,7 @@ theorem exists_forall_deriv_at_Ioo_eq_of_contDiffOn_nhds {s : Set E} (hv : ContD
   apply Set.mem_of_mem_of_subset ht
   rw [← Real.ball_eq_Ioo]
   exact Metric.ball_subset_ball (min_le_left _ _)
-#align exists_forall_deriv_at_Ioo_eq_of_cont_diff_on_nhds exists_forall_deriv_at_Ioo_eq_of_contDiffOn_nhds
+#align exists_forall_deriv_at_Ioo_eq_of_cont_diff_on_nhds exists_forall_hasDerivAt_Ioo_eq_of_contDiffAt
 -/
 
 #print exists_forall_hasDerivAt_Ioo_eq_of_contDiff /-
@@ -585,7 +585,7 @@ theorem exists_forall_deriv_at_Ioo_eq_of_contDiffOn_nhds {s : Set E} (hv : ContD
 theorem exists_forall_hasDerivAt_Ioo_eq_of_contDiff (hv : ContDiff ℝ 1 v) :
     ∃ ε > (0 : ℝ), ∃ f : ℝ → E, f t₀ = x₀ ∧ ∀ t ∈ Ioo (t₀ - ε) (t₀ + ε), HasDerivAt f (v (f t)) t :=
   let ⟨ε, hε, f, hf1, hf2⟩ :=
-    exists_forall_deriv_at_Ioo_eq_of_contDiffOn_nhds t₀ x₀ hv.ContDiffOn
+    exists_forall_hasDerivAt_Ioo_eq_of_contDiffAt t₀ x₀ hv.ContDiffOn
       (IsOpen.mem_nhds isOpen_univ (mem_univ _))
   ⟨ε, hε, f, hf1, fun t ht => (hf2 t ht).2⟩
 #align exists_forall_deriv_at_Ioo_eq_of_cont_diff exists_forall_hasDerivAt_Ioo_eq_of_contDiff
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2021 Yury G. Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury G. Kudryashov, Winston Yin
 -/
-import Mathbin.Analysis.SpecialFunctions.Integrals
-import Mathbin.Topology.MetricSpace.Contracting
+import Analysis.SpecialFunctions.Integrals
+import Topology.MetricSpace.Contracting
 
 #align_import analysis.ODE.picard_lindelof from "leanprover-community/mathlib"@"fd4551cfe4b7484b81c2c9ba3405edae27659676"
 
Diff
@@ -60,7 +60,7 @@ structure IsPicardLindelof {E : Type _} [NormedAddCommGroup E] (v : ℝ → E 
   lipschitz : ∀ t ∈ Icc t_min t_max, LipschitzOnWith L (v t) (closedBall x₀ R)
   cont : ∀ x ∈ closedBall x₀ R, ContinuousOn (fun t : ℝ => v t x) (Icc t_min t_max)
   norm_le : ∀ t ∈ Icc t_min t_max, ∀ x ∈ closedBall x₀ R, ‖v t x‖ ≤ C
-  C_mul_le_R : (C : ℝ) * LinearOrder.max (t_max - t₀) (t₀ - t_min) ≤ R
+  C_hMul_le_R : (C : ℝ) * LinearOrder.max (t_max - t₀) (t₀ - t_min) ≤ R
 #align is_picard_lindelof IsPicardLindelof
 -/
 
@@ -97,7 +97,7 @@ instance : Inhabited (PicardLindelof E) :=
         lipschitz := fun t ht => (LipschitzWith.const 0).LipschitzOnWith _
         cont := fun _ _ => by simpa only [Pi.zero_apply] using continuousOn_const
         norm_le := fun t ht x hx => norm_zero.le
-        C_mul_le_R := (MulZeroClass.zero_mul _).le }⟩⟩
+        C_hMul_le_R := (MulZeroClass.zero_mul _).le }⟩⟩
 
 #print PicardLindelof.tMin_le_tMax /-
 theorem tMin_le_tMax : v.tMin ≤ v.tMax :=
@@ -260,7 +260,7 @@ protected theorem mem_closedBall (t : Icc v.tMin v.tMax) : f t ∈ closedBall v.
     dist (f t) v.x₀ = dist (f t) (f.toFun v.t₀) := by rw [f.map_t₀']
     _ ≤ v.C * dist t v.t₀ := (f.lipschitz.dist_le_mul _ _)
     _ ≤ v.C * v.tDist := (mul_le_mul_of_nonneg_left (v.dist_t₀_le _) v.C.2)
-    _ ≤ v.r := v.is_pl.C_mul_le_R
+    _ ≤ v.r := v.is_pl.C_hMul_le_R
 #align picard_lindelof.fun_space.mem_closed_ball PicardLindelof.FunSpace.mem_closedBall
 -/
 
@@ -536,7 +536,8 @@ theorem exists_isPicardLindelof_const_of_contDiffOn_nhds {s : Set E} (hv : ContD
           (subset_inter_iff.mp (subset_trans (closed_ball_subset_ball (half_lt_self hr)) hball)).2
       cont := fun x hx => continuousOn_const
       norm_le := fun t ht x hx => hC ⟨x, hx, rfl⟩
-      C_mul_le_R := by
+      C_hMul_le_R :=
+        by
         rw [add_sub_cancel', sub_sub_cancel, max_self, mul_ite, mul_one]
         split_ifs
         · rwa [← h] at hr' 
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2021 Yury G. Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury G. Kudryashov, Winston Yin
-
-! This file was ported from Lean 3 source module analysis.ODE.picard_lindelof
-! leanprover-community/mathlib commit fd4551cfe4b7484b81c2c9ba3405edae27659676
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Analysis.SpecialFunctions.Integrals
 import Mathbin.Topology.MetricSpace.Contracting
 
+#align_import analysis.ODE.picard_lindelof from "leanprover-community/mathlib"@"fd4551cfe4b7484b81c2c9ba3405edae27659676"
+
 /-!
 # Picard-Lindelöf (Cauchy-Lipschitz) Theorem
 
Diff
@@ -127,7 +127,7 @@ protected theorem lipschitzOnWith {t} (ht : t ∈ Icc v.tMin v.tMax) :
 protected theorem continuousOn :
     ContinuousOn (uncurry v) (Icc v.tMin v.tMax ×ˢ closedBall v.x₀ v.r) :=
   have : ContinuousOn (uncurry (flip v)) (closedBall v.x₀ v.r ×ˢ Icc v.tMin v.tMax) :=
-    continuousOn_prod_of_continuousOn_lipschitz_on _ v.l v.is_pl.cont v.is_pl.lipschitz
+    continuousOn_prod_of_continuousOn_lipschitzOnWith _ v.l v.is_pl.cont v.is_pl.lipschitz
   this.comp continuous_swap.ContinuousOn (preimage_swap_prod _ _).symm.Subset
 #align picard_lindelof.continuous_on PicardLindelof.continuousOn
 -/
Diff
@@ -102,9 +102,11 @@ instance : Inhabited (PicardLindelof E) :=
         norm_le := fun t ht x hx => norm_zero.le
         C_mul_le_R := (MulZeroClass.zero_mul _).le }⟩⟩
 
+#print PicardLindelof.tMin_le_tMax /-
 theorem tMin_le_tMax : v.tMin ≤ v.tMax :=
   v.t₀.2.1.trans v.t₀.2.2
 #align picard_lindelof.t_min_le_t_max PicardLindelof.tMin_le_tMax
+-/
 
 #print PicardLindelof.nonempty_Icc /-
 protected theorem nonempty_Icc : (Icc v.tMin v.tMax).Nonempty :=
@@ -112,24 +114,30 @@ protected theorem nonempty_Icc : (Icc v.tMin v.tMax).Nonempty :=
 #align picard_lindelof.nonempty_Icc PicardLindelof.nonempty_Icc
 -/
 
+#print PicardLindelof.lipschitzOnWith /-
 protected theorem lipschitzOnWith {t} (ht : t ∈ Icc v.tMin v.tMax) :
     LipschitzOnWith v.l (v t) (closedBall v.x₀ v.r) :=
   v.is_pl.lipschitz t ht
 #align picard_lindelof.lipschitz_on_with PicardLindelof.lipschitzOnWith
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print PicardLindelof.continuousOn /-
 protected theorem continuousOn :
     ContinuousOn (uncurry v) (Icc v.tMin v.tMax ×ˢ closedBall v.x₀ v.r) :=
   have : ContinuousOn (uncurry (flip v)) (closedBall v.x₀ v.r ×ˢ Icc v.tMin v.tMax) :=
     continuousOn_prod_of_continuousOn_lipschitz_on _ v.l v.is_pl.cont v.is_pl.lipschitz
   this.comp continuous_swap.ContinuousOn (preimage_swap_prod _ _).symm.Subset
 #align picard_lindelof.continuous_on PicardLindelof.continuousOn
+-/
 
+#print PicardLindelof.norm_le /-
 theorem norm_le {t : ℝ} (ht : t ∈ Icc v.tMin v.tMax) {x : E} (hx : x ∈ closedBall v.x₀ v.r) :
     ‖v t x‖ ≤ v.C :=
   v.is_pl.norm_le _ ht _ hx
 #align picard_lindelof.norm_le PicardLindelof.norm_le
+-/
 
 #print PicardLindelof.tDist /-
 /-- The maximum of distances from `t₀` to the endpoints of `[t_min, t_max]`. -/
@@ -138,10 +146,13 @@ def tDist : ℝ :=
 #align picard_lindelof.t_dist PicardLindelof.tDist
 -/
 
+#print PicardLindelof.tDist_nonneg /-
 theorem tDist_nonneg : 0 ≤ v.tDist :=
   le_max_iff.2 <| Or.inl <| sub_nonneg.2 v.t₀.2.2
 #align picard_lindelof.t_dist_nonneg PicardLindelof.tDist_nonneg
+-/
 
+#print PicardLindelof.dist_t₀_le /-
 theorem dist_t₀_le (t : Icc v.tMin v.tMax) : dist t v.t₀ ≤ v.tDist :=
   by
   rw [Subtype.dist_eq, Real.dist_eq]
@@ -151,6 +162,7 @@ theorem dist_t₀_le (t : Icc v.tMin v.tMax) : dist t v.t₀ ≤ v.tDist :=
   · rw [abs_of_nonneg (sub_nonneg.2 <| Subtype.coe_le_coe.2 ht)]
     exact (sub_le_sub_right t.2.2 _).trans (le_max_left _ _)
 #align picard_lindelof.dist_t₀_le PicardLindelof.dist_t₀_le
+-/
 
 #print PicardLindelof.proj /-
 /-- Projection $ℝ → [t_{\min}, t_{\max}]$ sending $(-∞, t_{\min}]$ to $t_{\min}$ and $[t_{\max}, ∞)$
@@ -223,9 +235,11 @@ def toContinuousMap : v.FunSpace ↪ C(Icc v.tMin v.tMax, E) :=
 instance : MetricSpace v.FunSpace :=
   MetricSpace.induced toContinuousMap toContinuousMap.Injective inferInstance
 
+#print PicardLindelof.FunSpace.uniformInducing_toContinuousMap /-
 theorem uniformInducing_toContinuousMap : UniformInducing (@toContinuousMap _ _ _ v) :=
   ⟨rfl⟩
 #align picard_lindelof.fun_space.uniform_inducing_to_continuous_map PicardLindelof.FunSpace.uniformInducing_toContinuousMap
+-/
 
 #print PicardLindelof.FunSpace.range_toContinuousMap /-
 theorem range_toContinuousMap :
@@ -243,6 +257,7 @@ theorem map_t₀ : f v.t₀ = v.x₀ :=
 #align picard_lindelof.fun_space.map_t₀ PicardLindelof.FunSpace.map_t₀
 -/
 
+#print PicardLindelof.FunSpace.mem_closedBall /-
 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 rw [f.map_t₀']
@@ -250,6 +265,7 @@ protected theorem mem_closedBall (t : Icc v.tMin v.tMax) : f t ∈ closedBall v.
     _ ≤ v.C * v.tDist := (mul_le_mul_of_nonneg_left (v.dist_t₀_le _) v.C.2)
     _ ≤ v.r := v.is_pl.C_mul_le_R
 #align picard_lindelof.fun_space.mem_closed_ball PicardLindelof.FunSpace.mem_closedBall
+-/
 
 #print PicardLindelof.FunSpace.vComp /-
 /-- Given a curve $γ \colon [t_{\min}, t_{\max}] → E$, `v_comp` is the function
@@ -275,21 +291,27 @@ theorem continuous_vComp : Continuous f.vComp :=
 #align picard_lindelof.fun_space.continuous_v_comp PicardLindelof.FunSpace.continuous_vComp
 -/
 
+#print PicardLindelof.FunSpace.norm_vComp_le /-
 theorem norm_vComp_le (t : ℝ) : ‖f.vComp t‖ ≤ v.C :=
   v.norm_le (v.proj t).2 <| f.mem_closedBall _
 #align picard_lindelof.fun_space.norm_v_comp_le PicardLindelof.FunSpace.norm_vComp_le
+-/
 
+#print PicardLindelof.FunSpace.dist_apply_le_dist /-
 theorem dist_apply_le_dist (f₁ f₂ : FunSpace v) (t : Icc v.tMin v.tMax) :
     dist (f₁ t) (f₂ t) ≤ dist f₁ f₂ :=
   @ContinuousMap.dist_apply_le_dist _ _ _ _ _ f₁.toContinuousMap f₂.toContinuousMap _
 #align picard_lindelof.fun_space.dist_apply_le_dist PicardLindelof.FunSpace.dist_apply_le_dist
+-/
 
+#print PicardLindelof.FunSpace.dist_le_of_forall /-
 theorem dist_le_of_forall {f₁ f₂ : FunSpace v} {d : ℝ} (h : ∀ t, dist (f₁ t) (f₂ t) ≤ d) :
     dist f₁ f₂ ≤ d :=
   (@ContinuousMap.dist_le_iff_of_nonempty _ _ _ _ _ f₁.toContinuousMap f₂.toContinuousMap _
         v.nonempty_Icc.to_subtype).2
     h
 #align picard_lindelof.fun_space.dist_le_of_forall PicardLindelof.FunSpace.dist_le_of_forall
+-/
 
 instance [CompleteSpace E] : CompleteSpace v.FunSpace :=
   by
@@ -329,9 +351,11 @@ def next (f : FunSpace v) : FunSpace v
 #align picard_lindelof.fun_space.next PicardLindelof.FunSpace.next
 -/
 
+#print PicardLindelof.FunSpace.next_apply /-
 theorem next_apply (t : Icc v.tMin v.tMax) : f.next t = v.x₀ + ∫ τ : ℝ in v.t₀..t, f.vComp τ :=
   rfl
 #align picard_lindelof.fun_space.next_apply PicardLindelof.FunSpace.next_apply
+-/
 
 #print PicardLindelof.FunSpace.hasDerivWithinAt_next /-
 theorem hasDerivWithinAt_next (t : Icc v.tMin v.tMax) :
@@ -353,6 +377,7 @@ theorem hasDerivWithinAt_next (t : Icc v.tMin v.tMax) :
 #align picard_lindelof.fun_space.has_deriv_within_at_next PicardLindelof.FunSpace.hasDerivWithinAt_next
 -/
 
+#print PicardLindelof.FunSpace.dist_next_apply_le_of_le /-
 theorem dist_next_apply_le_of_le {f₁ f₂ : FunSpace v} {n : ℕ} {d : ℝ}
     (h : ∀ t, dist (f₁ t) (f₂ t) ≤ (v.l * |t - v.t₀|) ^ n / n ! * d) (t : Icc v.tMin v.tMax) :
     dist (next f₁ t) (next f₂ t) ≤ (v.l * |t - v.t₀|) ^ (n + 1) / (n + 1)! * d :=
@@ -378,7 +403,9 @@ theorem dist_next_apply_le_of_le {f₁ f₂ : FunSpace v} {n : ℕ} {d : ℝ}
     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]
 #align picard_lindelof.fun_space.dist_next_apply_le_of_le PicardLindelof.FunSpace.dist_next_apply_le_of_le
+-/
 
+#print PicardLindelof.FunSpace.dist_iterate_next_apply_le /-
 theorem dist_iterate_next_apply_le (f₁ f₂ : FunSpace v) (n : ℕ) (t : Icc v.tMin v.tMax) :
     dist ((next^[n]) f₁ t) ((next^[n]) f₂ t) ≤ (v.l * |t - v.t₀|) ^ n / n ! * dist f₁ f₂ :=
   by
@@ -388,7 +415,9 @@ theorem dist_iterate_next_apply_le (f₁ f₂ : FunSpace v) (n : ℕ) (t : Icc v
   · rw [iterate_succ_apply', iterate_succ_apply']
     exact dist_next_apply_le_of_le ihn _
 #align picard_lindelof.fun_space.dist_iterate_next_apply_le PicardLindelof.FunSpace.dist_iterate_next_apply_le
+-/
 
+#print PicardLindelof.FunSpace.dist_iterate_next_le /-
 theorem dist_iterate_next_le (f₁ f₂ : FunSpace v) (n : ℕ) :
     dist ((next^[n]) f₁) ((next^[n]) f₂) ≤ (v.l * v.tDist) ^ n / n ! * dist f₁ f₂ :=
   by
@@ -397,6 +426,7 @@ theorem dist_iterate_next_le (f₁ f₂ : FunSpace v) (n : ℕ) :
   have : |(t - v.t₀ : ℝ)| ≤ v.t_dist := v.dist_t₀_le t
   mono* <;> simp only [Nat.cast_nonneg, mul_nonneg, NNReal.coe_nonneg, abs_nonneg, *]
 #align picard_lindelof.fun_space.dist_iterate_next_le PicardLindelof.FunSpace.dist_iterate_next_le
+-/
 
 end FunSpace
 
@@ -404,6 +434,7 @@ variable [CompleteSpace E]
 
 section
 
+#print PicardLindelof.exists_contracting_iterate /-
 theorem exists_contracting_iterate :
     ∃ (N : ℕ) (K : _), ContractingWith K ((FunSpace.next : v.FunSpace → v.FunSpace)^[N]) :=
   by
@@ -415,6 +446,7 @@ theorem exists_contracting_iterate :
   exact
     ⟨N, ⟨_, this⟩, hN, LipschitzWith.of_dist_le_mul fun f g => fun_space.dist_iterate_next_le f g N⟩
 #align picard_lindelof.exists_contracting_iterate PicardLindelof.exists_contracting_iterate
+-/
 
 #print PicardLindelof.exists_fixed /-
 theorem exists_fixed : ∃ f : v.FunSpace, f.next = f :=
@@ -444,11 +476,13 @@ theorem exists_solution :
 
 end PicardLindelof
 
+#print IsPicardLindelof.norm_le₀ /-
 theorem IsPicardLindelof.norm_le₀ {E : Type _} [NormedAddCommGroup E] {v : ℝ → E → E}
     {t_min t₀ t_max : ℝ} {x₀ : E} {C R : ℝ} {L : ℝ≥0}
     (hpl : IsPicardLindelof v t_min t₀ t_max x₀ L R C) : ‖v t₀ x₀‖ ≤ C :=
   hpl.norm_le t₀ hpl.ht₀ x₀ <| mem_closedBall_self hpl.hR
 #align is_picard_lindelof.norm_le₀ IsPicardLindelof.norm_le₀
+-/
 
 #print IsPicardLindelof.exists_forall_hasDerivWithinAt_Icc_eq /-
 /-- Picard-Lindelöf (Cauchy-Lipschitz) theorem. -/
@@ -468,6 +502,7 @@ theorem IsPicardLindelof.exists_forall_hasDerivWithinAt_Icc_eq [CompleteSpace E]
 
 variable [ProperSpace E] {v : E → E} (t₀ : ℝ) (x₀ : E)
 
+#print exists_isPicardLindelof_const_of_contDiffOn_nhds /-
 /-- A time-independent, locally continuously differentiable ODE satisfies the hypotheses of the
   Picard-Lindelöf theorem. -/
 theorem exists_isPicardLindelof_const_of_contDiffOn_nhds {s : Set E} (hv : ContDiffOn ℝ 1 v s)
@@ -510,7 +545,9 @@ theorem exists_isPicardLindelof_const_of_contDiffOn_nhds {s : Set E} (hv : ContD
         · rwa [← h] at hr' 
         · exact (mul_div_cancel' (r / 2) h).le }
 #align exists_is_picard_lindelof_const_of_cont_diff_on_nhds exists_isPicardLindelof_const_of_contDiffOn_nhds
+-/
 
+#print exists_forall_deriv_at_Ioo_eq_of_contDiffOn_nhds /-
 /-- A time-independent, locally continuously differentiable ODE admits a solution in some open
 interval. -/
 theorem exists_forall_deriv_at_Ioo_eq_of_contDiffOn_nhds {s : Set E} (hv : ContDiffOn ℝ 1 v s)
@@ -543,7 +580,9 @@ theorem exists_forall_deriv_at_Ioo_eq_of_contDiffOn_nhds {s : Set E} (hv : ContD
   rw [← Real.ball_eq_Ioo]
   exact Metric.ball_subset_ball (min_le_left _ _)
 #align exists_forall_deriv_at_Ioo_eq_of_cont_diff_on_nhds exists_forall_deriv_at_Ioo_eq_of_contDiffOn_nhds
+-/
 
+#print exists_forall_hasDerivAt_Ioo_eq_of_contDiff /-
 /-- A time-independent, continuously differentiable ODE admits a solution in some open interval. -/
 theorem exists_forall_hasDerivAt_Ioo_eq_of_contDiff (hv : ContDiff ℝ 1 v) :
     ∃ ε > (0 : ℝ), ∃ f : ℝ → E, f t₀ = x₀ ∧ ∀ t ∈ Ioo (t₀ - ε) (t₀ + ε), HasDerivAt f (v (f t)) t :=
@@ -552,4 +591,5 @@ theorem exists_forall_hasDerivAt_Ioo_eq_of_contDiff (hv : ContDiff ℝ 1 v) :
       (IsOpen.mem_nhds isOpen_univ (mem_univ _))
   ⟨ε, hε, f, hf1, fun t ht => (hf2 t ht).2⟩
 #align exists_forall_deriv_at_Ioo_eq_of_cont_diff exists_forall_hasDerivAt_Ioo_eq_of_contDiff
+-/
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury G. Kudryashov, Winston Yin
 
 ! This file was ported from Lean 3 source module analysis.ODE.picard_lindelof
-! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
+! leanprover-community/mathlib commit fd4551cfe4b7484b81c2c9ba3405edae27659676
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -14,6 +14,9 @@ import Mathbin.Topology.MetricSpace.Contracting
 /-!
 # Picard-Lindelöf (Cauchy-Lipschitz) Theorem
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 In this file we prove that an ordinary differential equation $\dot x=v(t, x)$ such that $v$ is
 Lipschitz continuous in $x$ and continuous in $t$ has a local solution, see
 `exists_forall_deriv_within_Icc_eq_of_is_picard_lindelof`.
Diff
@@ -48,6 +48,7 @@ noncomputable section
 
 variable {E : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E]
 
+#print IsPicardLindelof /-
 /-- `Prop` structure holding the hypotheses of the Picard-Lindelöf theorem.
 
 The similarly named `picard_lindelof` structure is part of the internal API for convenience, so as
@@ -61,7 +62,9 @@ structure IsPicardLindelof {E : Type _} [NormedAddCommGroup E] (v : ℝ → E 
   norm_le : ∀ t ∈ Icc t_min t_max, ∀ x ∈ closedBall x₀ R, ‖v t x‖ ≤ C
   C_mul_le_R : (C : ℝ) * LinearOrder.max (t_max - t₀) (t₀ - t_min) ≤ R
 #align is_picard_lindelof IsPicardLindelof
+-/
 
+#print PicardLindelof /-
 /-- This structure holds arguments of the Picard-Lipschitz (Cauchy-Lipschitz) theorem. It is part of
 the internal API for convenience, so as not to constantly invoke choice. Unless you want to use one
 of the auxiliary lemmas, use `exists_forall_deriv_within_Icc_eq_of_lipschitz_of_continuous` instead
@@ -78,6 +81,7 @@ structure PicardLindelof (E : Type _) [NormedAddCommGroup E] [NormedSpace ℝ E]
   (C r l : ℝ≥0)
   is_pl : IsPicardLindelof to_fun t_min t₀ t_max x₀ L R C
 #align picard_lindelof PicardLindelof
+-/
 
 namespace PicardLindelof
 
@@ -99,9 +103,11 @@ theorem tMin_le_tMax : v.tMin ≤ v.tMax :=
   v.t₀.2.1.trans v.t₀.2.2
 #align picard_lindelof.t_min_le_t_max PicardLindelof.tMin_le_tMax
 
+#print PicardLindelof.nonempty_Icc /-
 protected theorem nonempty_Icc : (Icc v.tMin v.tMax).Nonempty :=
   nonempty_Icc.2 v.tMin_le_tMax
 #align picard_lindelof.nonempty_Icc PicardLindelof.nonempty_Icc
+-/
 
 protected theorem lipschitzOnWith {t} (ht : t ∈ Icc v.tMin v.tMax) :
     LipschitzOnWith v.l (v t) (closedBall v.x₀ v.r) :=
@@ -122,10 +128,12 @@ theorem norm_le {t : ℝ} (ht : t ∈ Icc v.tMin v.tMax) {x : E} (hx : x ∈ clo
   v.is_pl.norm_le _ ht _ hx
 #align picard_lindelof.norm_le PicardLindelof.norm_le
 
+#print PicardLindelof.tDist /-
 /-- The maximum of distances from `t₀` to the endpoints of `[t_min, t_max]`. -/
 def tDist : ℝ :=
   max (v.tMax - v.t₀) (v.t₀ - v.tMin)
 #align picard_lindelof.t_dist PicardLindelof.tDist
+-/
 
 theorem tDist_nonneg : 0 ≤ v.tDist :=
   le_max_iff.2 <| Or.inl <| sub_nonneg.2 v.t₀.2.2
@@ -141,25 +149,34 @@ theorem dist_t₀_le (t : Icc v.tMin v.tMax) : dist t v.t₀ ≤ v.tDist :=
     exact (sub_le_sub_right t.2.2 _).trans (le_max_left _ _)
 #align picard_lindelof.dist_t₀_le PicardLindelof.dist_t₀_le
 
+#print PicardLindelof.proj /-
 /-- Projection $ℝ → [t_{\min}, t_{\max}]$ sending $(-∞, t_{\min}]$ to $t_{\min}$ and $[t_{\max}, ∞)$
 to $t_{\max}$. -/
 def proj : ℝ → Icc v.tMin v.tMax :=
   projIcc v.tMin v.tMax v.tMin_le_tMax
 #align picard_lindelof.proj PicardLindelof.proj
+-/
 
+#print PicardLindelof.proj_coe /-
 theorem proj_coe (t : Icc v.tMin v.tMax) : v.proj t = t :=
   projIcc_val _ _
 #align picard_lindelof.proj_coe PicardLindelof.proj_coe
+-/
 
+#print PicardLindelof.proj_of_mem /-
 theorem proj_of_mem {t : ℝ} (ht : t ∈ Icc v.tMin v.tMax) : ↑(v.proj t) = t := by
   simp only [proj, proj_Icc_of_mem _ ht, Subtype.coe_mk]
 #align picard_lindelof.proj_of_mem PicardLindelof.proj_of_mem
+-/
 
+#print PicardLindelof.continuous_proj /-
 @[continuity]
 theorem continuous_proj : Continuous v.proj :=
   continuous_projIcc
 #align picard_lindelof.continuous_proj PicardLindelof.continuous_proj
+-/
 
+#print PicardLindelof.FunSpace /-
 /-- The space of curves $γ \colon [t_{\min}, t_{\max}] \to E$ such that $γ(t₀) = x₀$ and $γ$ is
 Lipschitz continuous with constant $C$. The map sending $γ$ to
 $\mathbf Pγ(t)=x₀ + ∫_{t₀}^{t} v(τ, γ(τ))\,dτ$ is a contracting map on this space, and its fixed
@@ -169,6 +186,7 @@ structure FunSpace where
   map_t₀' : to_fun v.t₀ = v.x₀
   lipschitz' : LipschitzWith v.C to_fun
 #align picard_lindelof.fun_space PicardLindelof.FunSpace
+-/
 
 namespace FunSpace
 
@@ -180,18 +198,24 @@ instance : CoeFun (FunSpace v) fun _ => Icc v.tMin v.tMax → E :=
 instance : Inhabited v.FunSpace :=
   ⟨⟨fun _ => v.x₀, rfl, (LipschitzWith.const _).weaken (zero_le _)⟩⟩
 
+#print PicardLindelof.FunSpace.lipschitz /-
 protected theorem lipschitz : LipschitzWith v.C f :=
   f.lipschitz'
 #align picard_lindelof.fun_space.lipschitz PicardLindelof.FunSpace.lipschitz
+-/
 
+#print PicardLindelof.FunSpace.continuous /-
 protected theorem continuous : Continuous f :=
   f.lipschitz.Continuous
 #align picard_lindelof.fun_space.continuous PicardLindelof.FunSpace.continuous
+-/
 
+#print PicardLindelof.FunSpace.toContinuousMap /-
 /-- Each curve in `picard_lindelof.fun_space` 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; simpa using h⟩
 #align picard_lindelof.fun_space.to_continuous_map PicardLindelof.FunSpace.toContinuousMap
+-/
 
 instance : MetricSpace v.FunSpace :=
   MetricSpace.induced toContinuousMap toContinuousMap.Injective inferInstance
@@ -200,6 +224,7 @@ theorem uniformInducing_toContinuousMap : UniformInducing (@toContinuousMap _ _
   ⟨rfl⟩
 #align picard_lindelof.fun_space.uniform_inducing_to_continuous_map PicardLindelof.FunSpace.uniformInducing_toContinuousMap
 
+#print PicardLindelof.FunSpace.range_toContinuousMap /-
 theorem range_toContinuousMap :
     range toContinuousMap = {f : C(Icc v.tMin v.tMax, E) | f v.t₀ = v.x₀ ∧ LipschitzWith v.C f} :=
   by
@@ -207,10 +232,13 @@ theorem range_toContinuousMap :
   · rintro ⟨⟨f, hf₀, hf_lip⟩, rfl⟩; exact ⟨hf₀, hf_lip⟩
   · rcases f with ⟨f, hf⟩; rintro ⟨hf₀, hf_lip⟩; exact ⟨⟨f, hf₀, hf_lip⟩, rfl⟩
 #align picard_lindelof.fun_space.range_to_continuous_map PicardLindelof.FunSpace.range_toContinuousMap
+-/
 
+#print PicardLindelof.FunSpace.map_t₀ /-
 theorem map_t₀ : f v.t₀ = v.x₀ :=
   f.map_t₀'
 #align picard_lindelof.fun_space.map_t₀ PicardLindelof.FunSpace.map_t₀
+-/
 
 protected theorem mem_closedBall (t : Icc v.tMin v.tMax) : f t ∈ closedBall v.x₀ v.r :=
   calc
@@ -220,23 +248,29 @@ protected theorem mem_closedBall (t : Icc v.tMin v.tMax) : f t ∈ closedBall v.
     _ ≤ v.r := v.is_pl.C_mul_le_R
 #align picard_lindelof.fun_space.mem_closed_ball PicardLindelof.FunSpace.mem_closedBall
 
+#print PicardLindelof.FunSpace.vComp /-
 /-- Given a curve $γ \colon [t_{\min}, t_{\max}] → E$, `v_comp` is the function
 $F(t)=v(π t, γ(π t))$, where `π` is the projection $ℝ → [t_{\min}, t_{\max}]$. The integral of this
 function is the image of `γ` under the contracting map we are going to define below. -/
 def vComp (t : ℝ) : E :=
   v (v.proj t) (f (v.proj t))
 #align picard_lindelof.fun_space.v_comp PicardLindelof.FunSpace.vComp
+-/
 
+#print PicardLindelof.FunSpace.vComp_apply_coe /-
 theorem vComp_apply_coe (t : Icc v.tMin v.tMax) : f.vComp t = v t (f t) := by
   simp only [v_comp, proj_coe]
 #align picard_lindelof.fun_space.v_comp_apply_coe PicardLindelof.FunSpace.vComp_apply_coe
+-/
 
+#print PicardLindelof.FunSpace.continuous_vComp /-
 theorem continuous_vComp : Continuous f.vComp :=
   by
   have := (continuous_subtype_coe.prod_mk f.continuous).comp v.continuous_proj
   refine' ContinuousOn.comp_continuous v.continuous_on this fun x => _
   exact ⟨(v.proj x).2, f.mem_closed_ball _⟩
 #align picard_lindelof.fun_space.continuous_v_comp PicardLindelof.FunSpace.continuous_vComp
+-/
 
 theorem norm_vComp_le (t : ℝ) : ‖f.vComp t‖ ≤ v.C :=
   v.norm_le (v.proj t).2 <| f.mem_closedBall _
@@ -265,12 +299,15 @@ instance [CompleteSpace E] : CompleteSpace v.FunSpace :=
     isClosed_setOf_lipschitzWith v.C
   exact this.preimage ContinuousMap.continuous_coe
 
+#print PicardLindelof.FunSpace.intervalIntegrable_vComp /-
 theorem intervalIntegrable_vComp (t₁ t₂ : ℝ) : IntervalIntegrable f.vComp volume t₁ t₂ :=
   f.continuous_vComp.IntervalIntegrable _ _
 #align picard_lindelof.fun_space.interval_integrable_v_comp PicardLindelof.FunSpace.intervalIntegrable_vComp
+-/
 
 variable [CompleteSpace E]
 
+#print PicardLindelof.FunSpace.next /-
 /-- The Picard-Lindelöf operator. This is a contracting map on `picard_lindelof.fun_space v` such
 that the fixed point of this map is the solution of the corresponding ODE.
 
@@ -287,11 +324,13 @@ def next (f : FunSpace v) : FunSpace v
           (f.interval_integrable_v_comp _ _)]
       exact norm_integral_le_of_norm_le_const fun t ht => f.norm_v_comp_le _
 #align picard_lindelof.fun_space.next PicardLindelof.FunSpace.next
+-/
 
 theorem next_apply (t : Icc v.tMin v.tMax) : f.next t = v.x₀ + ∫ τ : ℝ in v.t₀..t, f.vComp τ :=
   rfl
 #align picard_lindelof.fun_space.next_apply PicardLindelof.FunSpace.next_apply
 
+#print PicardLindelof.FunSpace.hasDerivWithinAt_next /-
 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
@@ -309,6 +348,7 @@ theorem hasDerivWithinAt_next (t : Icc v.tMin v.tMax) :
   filter_upwards [self_mem_nhdsWithin] with _ ht'
   rw [v.proj_of_mem ht']
 #align picard_lindelof.fun_space.has_deriv_within_at_next PicardLindelof.FunSpace.hasDerivWithinAt_next
+-/
 
 theorem dist_next_apply_le_of_le {f₁ f₂ : FunSpace v} {n : ℕ} {d : ℝ}
     (h : ∀ t, dist (f₁ t) (f₂ t) ≤ (v.l * |t - v.t₀|) ^ n / n ! * d) (t : Icc v.tMin v.tMax) :
@@ -373,13 +413,16 @@ theorem exists_contracting_iterate :
     ⟨N, ⟨_, this⟩, hN, LipschitzWith.of_dist_le_mul fun f g => fun_space.dist_iterate_next_le f g N⟩
 #align picard_lindelof.exists_contracting_iterate PicardLindelof.exists_contracting_iterate
 
+#print PicardLindelof.exists_fixed /-
 theorem exists_fixed : ∃ f : v.FunSpace, f.next = f :=
   let ⟨N, K, hK⟩ := exists_contracting_iterate v
   ⟨_, hK.isFixedPt_fixedPoint_iterate⟩
 #align picard_lindelof.exists_fixed PicardLindelof.exists_fixed
+-/
 
 end
 
+#print PicardLindelof.exists_solution /-
 /-- Picard-Lindelöf (Cauchy-Lipschitz) theorem. Use
 `exists_forall_deriv_within_Icc_eq_of_is_picard_lindelof` instead for the public API. -/
 theorem exists_solution :
@@ -394,6 +437,7 @@ theorem exists_solution :
     lift t to Icc v.t_min v.t_max using ht
     simpa only [hf, v.proj_coe] using f.has_deriv_within_at_next t
 #align picard_lindelof.exists_solution PicardLindelof.exists_solution
+-/
 
 end PicardLindelof
 
@@ -403,8 +447,9 @@ theorem IsPicardLindelof.norm_le₀ {E : Type _} [NormedAddCommGroup E] {v : ℝ
   hpl.norm_le t₀ hpl.ht₀ x₀ <| mem_closedBall_self hpl.hR
 #align is_picard_lindelof.norm_le₀ IsPicardLindelof.norm_le₀
 
+#print IsPicardLindelof.exists_forall_hasDerivWithinAt_Icc_eq /-
 /-- Picard-Lindelöf (Cauchy-Lipschitz) theorem. -/
-theorem exists_forall_deriv_within_Icc_eq_of_isPicardLindelof [CompleteSpace E] {v : ℝ → E → E}
+theorem IsPicardLindelof.exists_forall_hasDerivWithinAt_Icc_eq [CompleteSpace E] {v : ℝ → E → E}
     {t_min t₀ t_max : ℝ} (x₀ : E) {C R : ℝ} {L : ℝ≥0}
     (hpl : IsPicardLindelof v t_min t₀ t_max x₀ L R C) :
     ∃ f : ℝ → E,
@@ -415,7 +460,8 @@ theorem exists_forall_deriv_within_Icc_eq_of_isPicardLindelof [CompleteSpace E]
   exact
     PicardLindelof.exists_solution
       ⟨v, t_min, t_max, t₀, x₀, C, ⟨R, hpl.hR⟩, L, { hpl with ht₀ := t₀.property }⟩
-#align exists_forall_deriv_within_Icc_eq_of_is_picard_lindelof exists_forall_deriv_within_Icc_eq_of_isPicardLindelof
+#align exists_forall_deriv_within_Icc_eq_of_is_picard_lindelof IsPicardLindelof.exists_forall_hasDerivWithinAt_Icc_eq
+-/
 
 variable [ProperSpace E] {v : E → E} (t₀ : ℝ) (x₀ : E)
 
@@ -470,7 +516,7 @@ theorem exists_forall_deriv_at_Ioo_eq_of_contDiffOn_nhds {s : Set E} (hv : ContD
       ∃ f : ℝ → E, f t₀ = x₀ ∧ ∀ t ∈ Ioo (t₀ - ε) (t₀ + ε), f t ∈ s ∧ HasDerivAt f (v (f t)) t :=
   by
   obtain ⟨ε, hε, L, R, C, hpl⟩ := exists_isPicardLindelof_const_of_contDiffOn_nhds t₀ x₀ hv hs
-  obtain ⟨f, hf1, hf2⟩ := exists_forall_deriv_within_Icc_eq_of_isPicardLindelof x₀ hpl
+  obtain ⟨f, hf1, hf2⟩ := IsPicardLindelof.exists_forall_hasDerivWithinAt_Icc_eq x₀ hpl
   have hf2' : ∀ t ∈ Ioo (t₀ - ε) (t₀ + ε), HasDerivAt f (v (f t)) t := fun t ht =>
     (hf2 t (Ioo_subset_Icc_self ht)).HasDerivAt (Icc_mem_nhds ht.1 ht.2)
   have h : f ⁻¹' s ∈ 𝓝 t₀ :=
@@ -496,11 +542,11 @@ theorem exists_forall_deriv_at_Ioo_eq_of_contDiffOn_nhds {s : Set E} (hv : ContD
 #align exists_forall_deriv_at_Ioo_eq_of_cont_diff_on_nhds exists_forall_deriv_at_Ioo_eq_of_contDiffOn_nhds
 
 /-- A time-independent, continuously differentiable ODE admits a solution in some open interval. -/
-theorem exists_forall_deriv_at_Ioo_eq_of_contDiff (hv : ContDiff ℝ 1 v) :
+theorem exists_forall_hasDerivAt_Ioo_eq_of_contDiff (hv : ContDiff ℝ 1 v) :
     ∃ ε > (0 : ℝ), ∃ f : ℝ → E, f t₀ = x₀ ∧ ∀ t ∈ Ioo (t₀ - ε) (t₀ + ε), HasDerivAt f (v (f t)) t :=
   let ⟨ε, hε, f, hf1, hf2⟩ :=
     exists_forall_deriv_at_Ioo_eq_of_contDiffOn_nhds t₀ x₀ hv.ContDiffOn
       (IsOpen.mem_nhds isOpen_univ (mem_univ _))
   ⟨ε, hε, f, hf1, fun t ht => (hf2 t ht).2⟩
-#align exists_forall_deriv_at_Ioo_eq_of_cont_diff exists_forall_deriv_at_Ioo_eq_of_contDiff
+#align exists_forall_deriv_at_Ioo_eq_of_cont_diff exists_forall_hasDerivAt_Ioo_eq_of_contDiff
 
Diff
@@ -218,7 +218,6 @@ protected theorem mem_closedBall (t : Icc v.tMin v.tMax) : f t ∈ closedBall v.
     _ ≤ v.C * dist t v.t₀ := (f.lipschitz.dist_le_mul _ _)
     _ ≤ v.C * v.tDist := (mul_le_mul_of_nonneg_left (v.dist_t₀_le _) v.C.2)
     _ ≤ v.r := v.is_pl.C_mul_le_R
-    
 #align picard_lindelof.fun_space.mem_closed_ball PicardLindelof.FunSpace.mem_closedBall
 
 /-- Given a curve $γ \colon [t_{\min}, t_{\max}] → E$, `v_comp` is the function
@@ -332,7 +331,6 @@ theorem dist_next_apply_le_of_le {f₁ f₂ : FunSpace v} {n : ℕ} {d : ℝ}
         rw [v.proj_of_mem]
         exact uIcc_subset_Icc v.t₀.2 t.2 <| Ioc_subset_Icc_self hτ
     _ = (v.L * |t - v.t₀|) ^ (n + 1) / (n + 1)! * d := _
-    
   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]
Diff
@@ -201,7 +201,7 @@ theorem uniformInducing_toContinuousMap : UniformInducing (@toContinuousMap _ _
 #align picard_lindelof.fun_space.uniform_inducing_to_continuous_map PicardLindelof.FunSpace.uniformInducing_toContinuousMap
 
 theorem range_toContinuousMap :
-    range toContinuousMap = { f : C(Icc v.tMin v.tMax, E) | f v.t₀ = v.x₀ ∧ LipschitzWith v.C f } :=
+    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⟩
@@ -262,7 +262,7 @@ instance [CompleteSpace E] : CompleteSpace v.FunSpace :=
       (IsClosed.isComplete _)
   rw [range_to_continuous_map, set_of_and]
   refine' (isClosed_eq (ContinuousMap.continuous_eval_const _) continuous_const).inter _
-  have : IsClosed { f : Icc v.t_min v.t_max → E | LipschitzWith v.C f } :=
+  have : IsClosed {f : Icc v.t_min v.t_max → E | LipschitzWith v.C f} :=
     isClosed_setOf_lipschitzWith v.C
   exact this.preimage ContinuousMap.continuous_coe
 
@@ -307,7 +307,7 @@ theorem hasDerivWithinAt_next (t : Icc v.tMin v.tMax) :
       f.continuous_v_comp.continuous_within_at
   rw [v_comp_apply_coe] at this 
   refine' this.congr_of_eventually_eq_of_mem _ t.coe_prop
-  filter_upwards [self_mem_nhdsWithin]with _ ht'
+  filter_upwards [self_mem_nhdsWithin] with _ ht'
   rw [v.proj_of_mem ht']
 #align picard_lindelof.fun_space.has_deriv_within_at_next PicardLindelof.FunSpace.hasDerivWithinAt_next
 
Diff
@@ -53,7 +53,7 @@ variable {E : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E]
 The similarly named `picard_lindelof` structure is part of the internal API for convenience, so as
 not to constantly invoke choice, but is not intended for public use. -/
 structure IsPicardLindelof {E : Type _} [NormedAddCommGroup E] (v : ℝ → E → E) (t_min t₀ t_max : ℝ)
-  (x₀ : E) (L : ℝ≥0) (R C : ℝ) : Prop where
+    (x₀ : E) (L : ℝ≥0) (R C : ℝ) : Prop where
   ht₀ : t₀ ∈ Icc t_min t_max
   hR : 0 ≤ R
   lipschitz : ∀ t ∈ Icc t_min t_max, LipschitzOnWith L (v t) (closedBall x₀ R)
@@ -305,7 +305,7 @@ theorem hasDerivWithinAt_next (t : Icc v.tMin v.tMax) :
     integral_has_deriv_within_at_right (f.interval_integrable_v_comp _ _)
       (f.continuous_v_comp.strongly_measurable_at_filter _ _)
       f.continuous_v_comp.continuous_within_at
-  rw [v_comp_apply_coe] at this
+  rw [v_comp_apply_coe] at this 
   refine' this.congr_of_eventually_eq_of_mem _ t.coe_prop
   filter_upwards [self_mem_nhdsWithin]with _ ht'
   rw [v.proj_of_mem ht']
@@ -364,7 +364,7 @@ variable [CompleteSpace E]
 section
 
 theorem exists_contracting_iterate :
-    ∃ (N : ℕ)(K : _), ContractingWith K ((FunSpace.next : v.FunSpace → v.FunSpace)^[N]) :=
+    ∃ (N : ℕ) (K : _), ContractingWith K ((FunSpace.next : v.FunSpace → v.FunSpace)^[N]) :=
   by
   rcases((Real.tendsto_pow_div_factorial_atTop (v.L * v.t_dist)).Eventually
         (gt_mem_nhds zero_lt_one)).exists with
@@ -460,7 +460,7 @@ theorem exists_isPicardLindelof_const_of_contDiffOn_nhds {s : Set E} (hv : ContD
       C_mul_le_R := by
         rw [add_sub_cancel', sub_sub_cancel, max_self, mul_ite, mul_one]
         split_ifs
-        · rwa [← h] at hr'
+        · rwa [← h] at hr' 
         · exact (mul_div_cancel' (r / 2) h).le }
 #align exists_is_picard_lindelof_const_of_cont_diff_on_nhds exists_isPicardLindelof_const_of_contDiffOn_nhds
 
@@ -481,7 +481,7 @@ theorem exists_forall_deriv_at_Ioo_eq_of_contDiffOn_nhds {s : Set E} (hv : ContD
     apply ContinuousAt.preimage_mem_nhds this.continuous_at
     rw [hf1]
     exact hs
-  rw [Metric.mem_nhds_iff] at h
+  rw [Metric.mem_nhds_iff] at h 
   obtain ⟨r, hr1, hr2⟩ := h
   refine'
     ⟨min r ε, lt_min hr1 hε, f, hf1, fun t ht =>
Diff
@@ -42,7 +42,7 @@ open Filter Function Set Metric TopologicalSpace intervalIntegral MeasureTheory
 
 open MeasureTheory.MeasureSpace (volume)
 
-open Filter Topology NNReal ENNReal Nat Interval
+open scoped Filter Topology NNReal ENNReal Nat Interval
 
 noncomputable section
 
Diff
@@ -88,9 +88,7 @@ instance : CoeFun (PicardLindelof E) fun _ => ℝ → E → E :=
 
 instance : Inhabited (PicardLindelof E) :=
   ⟨⟨0, 0, 0, ⟨0, le_rfl, le_rfl⟩, 0, 0, 0, 0,
-      { ht₀ := by
-          rw [Subtype.coe_mk, Icc_self]
-          exact mem_singleton _
+      { ht₀ := by rw [Subtype.coe_mk, Icc_self]; exact mem_singleton _
         hR := by rfl
         lipschitz := fun t ht => (LipschitzWith.const 0).LipschitzOnWith _
         cont := fun _ _ => by simpa only [Pi.zero_apply] using continuousOn_const
@@ -192,10 +190,7 @@ protected theorem continuous : Continuous f :=
 
 /-- Each curve in `picard_lindelof.fun_space` 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
-    simpa using h⟩
+  ⟨fun f => ⟨f, f.Continuous⟩, fun f g h => by cases f; cases g; simpa using h⟩
 #align picard_lindelof.fun_space.to_continuous_map PicardLindelof.FunSpace.toContinuousMap
 
 instance : MetricSpace v.FunSpace :=
@@ -209,11 +204,8 @@ 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⟩
-    exact ⟨⟨f, hf₀, hf_lip⟩, rfl⟩
+  · rintro ⟨⟨f, hf₀, hf_lip⟩, rfl⟩; exact ⟨hf₀, hf_lip⟩
+  · rcases f with ⟨f, hf⟩; rintro ⟨hf₀, hf_lip⟩; exact ⟨⟨f, hf₀, hf_lip⟩, rfl⟩
 #align picard_lindelof.fun_space.range_to_continuous_map PicardLindelof.FunSpace.range_toContinuousMap
 
 theorem map_t₀ : f v.t₀ = v.x₀ :=
@@ -458,9 +450,7 @@ theorem exists_isPicardLindelof_const_of_contDiffOn_nhds {s : Set E} (hv : ContD
     · exact div_pos (half_pos hr) (lt_of_le_of_ne hC' (Ne.symm h))
   refine' ⟨ε, hε0, L, r / 2, C, _⟩
   exact
-    { ht₀ := by
-        rw [← Real.closedBall_eq_Icc]
-        exact mem_closed_ball_self hε0.le
+    { ht₀ := by rw [← Real.closedBall_eq_Icc]; exact mem_closed_ball_self hε0.le
       hR := (half_pos hr).le
       lipschitz := fun t ht =>
         hlip.mono
Diff
@@ -274,9 +274,9 @@ instance [CompleteSpace E] : CompleteSpace v.FunSpace :=
     isClosed_setOf_lipschitzWith v.C
   exact this.preimage ContinuousMap.continuous_coe
 
-theorem intervalIntegrableVComp (t₁ t₂ : ℝ) : IntervalIntegrable f.vComp volume t₁ t₂ :=
+theorem intervalIntegrable_vComp (t₁ t₂ : ℝ) : IntervalIntegrable f.vComp volume t₁ t₂ :=
   f.continuous_vComp.IntervalIntegrable _ _
-#align picard_lindelof.fun_space.interval_integrable_v_comp PicardLindelof.FunSpace.intervalIntegrableVComp
+#align picard_lindelof.fun_space.interval_integrable_v_comp PicardLindelof.FunSpace.intervalIntegrable_vComp
 
 variable [CompleteSpace E]
 
@@ -331,7 +331,7 @@ theorem dist_next_apply_le_of_le {f₁ f₂ : FunSpace v} {n : ℕ} {d : ℝ}
     ‖∫ τ in Ι (v.t₀ : ℝ) t, f₁.v_comp τ - f₂.v_comp τ‖ ≤
         ∫ τ in Ι (v.t₀ : ℝ) t, v.L * ((v.L * |τ - v.t₀|) ^ n / n ! * d) :=
       by
-      refine' norm_integral_le_of_norm_le (Continuous.integrableOnUIoc _) _
+      refine' norm_integral_le_of_norm_le (Continuous.integrableOn_uIoc _) _
       · continuity
       · refine' (ae_restrict_mem measurableSet_Ioc).mono fun τ hτ => _
         refine'
Diff
@@ -75,7 +75,7 @@ structure PicardLindelof (E : Type _) [NormedAddCommGroup E] [NormedSpace ℝ E]
   (tMin tMax : ℝ)
   t₀ : Icc t_min t_max
   x₀ : E
-  (c r l : ℝ≥0)
+  (C r l : ℝ≥0)
   is_pl : IsPicardLindelof to_fun t_min t₀ t_max x₀ L R C
 #align picard_lindelof PicardLindelof
 
@@ -120,7 +120,7 @@ protected theorem continuousOn :
 #align picard_lindelof.continuous_on PicardLindelof.continuousOn
 
 theorem norm_le {t : ℝ} (ht : t ∈ Icc v.tMin v.tMax) {x : E} (hx : x ∈ closedBall v.x₀ v.r) :
-    ‖v t x‖ ≤ v.c :=
+    ‖v t x‖ ≤ v.C :=
   v.is_pl.norm_le _ ht _ hx
 #align picard_lindelof.norm_le PicardLindelof.norm_le
 
@@ -169,7 +169,7 @@ point is a solution of the ODE $\dot x=v(t, x)$. -/
 structure FunSpace where
   toFun : Icc v.tMin v.tMax → E
   map_t₀' : to_fun v.t₀ = v.x₀
-  lipschitz' : LipschitzWith v.c to_fun
+  lipschitz' : LipschitzWith v.C to_fun
 #align picard_lindelof.fun_space PicardLindelof.FunSpace
 
 namespace FunSpace
@@ -182,7 +182,7 @@ instance : CoeFun (FunSpace v) fun _ => Icc v.tMin v.tMax → E :=
 instance : Inhabited v.FunSpace :=
   ⟨⟨fun _ => v.x₀, rfl, (LipschitzWith.const _).weaken (zero_le _)⟩⟩
 
-protected theorem lipschitz : LipschitzWith v.c f :=
+protected theorem lipschitz : LipschitzWith v.C f :=
   f.lipschitz'
 #align picard_lindelof.fun_space.lipschitz PicardLindelof.FunSpace.lipschitz
 
@@ -206,7 +206,7 @@ theorem uniformInducing_toContinuousMap : UniformInducing (@toContinuousMap _ _
 #align picard_lindelof.fun_space.uniform_inducing_to_continuous_map PicardLindelof.FunSpace.uniformInducing_toContinuousMap
 
 theorem range_toContinuousMap :
-    range toContinuousMap = { f : C(Icc v.tMin v.tMax, E) | f v.t₀ = v.x₀ ∧ LipschitzWith v.c f } :=
+    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⟩
@@ -223,8 +223,8 @@ theorem map_t₀ : f v.t₀ = v.x₀ :=
 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 rw [f.map_t₀']
-    _ ≤ v.c * dist t v.t₀ := (f.lipschitz.dist_le_mul _ _)
-    _ ≤ v.c * v.tDist := (mul_le_mul_of_nonneg_left (v.dist_t₀_le _) v.c.2)
+    _ ≤ v.C * dist t v.t₀ := (f.lipschitz.dist_le_mul _ _)
+    _ ≤ v.C * v.tDist := (mul_le_mul_of_nonneg_left (v.dist_t₀_le _) v.C.2)
     _ ≤ v.r := v.is_pl.C_mul_le_R
     
 #align picard_lindelof.fun_space.mem_closed_ball PicardLindelof.FunSpace.mem_closedBall
@@ -247,7 +247,7 @@ theorem continuous_vComp : Continuous f.vComp :=
   exact ⟨(v.proj x).2, f.mem_closed_ball _⟩
 #align picard_lindelof.fun_space.continuous_v_comp PicardLindelof.FunSpace.continuous_vComp
 
-theorem norm_vComp_le (t : ℝ) : ‖f.vComp t‖ ≤ v.c :=
+theorem norm_vComp_le (t : ℝ) : ‖f.vComp t‖ ≤ v.C :=
   v.norm_le (v.proj t).2 <| f.mem_closedBall _
 #align picard_lindelof.fun_space.norm_v_comp_le PicardLindelof.FunSpace.norm_vComp_le
 
Diff
@@ -95,7 +95,7 @@ instance : Inhabited (PicardLindelof E) :=
         lipschitz := fun t ht => (LipschitzWith.const 0).LipschitzOnWith _
         cont := fun _ _ => by simpa only [Pi.zero_apply] using continuousOn_const
         norm_le := fun t ht x hx => norm_zero.le
-        C_mul_le_R := (zero_mul _).le }⟩⟩
+        C_mul_le_R := (MulZeroClass.zero_mul _).le }⟩⟩
 
 theorem tMin_le_tMax : v.tMin ≤ v.tMax :=
   v.t₀.2.1.trans v.t₀.2.2
Diff
@@ -223,8 +223,8 @@ theorem map_t₀ : f v.t₀ = v.x₀ :=
 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 rw [f.map_t₀']
-    _ ≤ v.c * dist t v.t₀ := f.lipschitz.dist_le_mul _ _
-    _ ≤ v.c * v.tDist := mul_le_mul_of_nonneg_left (v.dist_t₀_le _) v.c.2
+    _ ≤ v.c * dist t v.t₀ := (f.lipschitz.dist_le_mul _ _)
+    _ ≤ v.c * v.tDist := (mul_le_mul_of_nonneg_left (v.dist_t₀_le _) v.c.2)
     _ ≤ v.r := v.is_pl.C_mul_le_R
     
 #align picard_lindelof.fun_space.mem_closed_ball PicardLindelof.FunSpace.mem_closedBall
Diff
@@ -42,7 +42,7 @@ open Filter Function Set Metric TopologicalSpace intervalIntegral MeasureTheory
 
 open MeasureTheory.MeasureSpace (volume)
 
-open Filter Topology NNReal Ennreal Nat Interval
+open Filter Topology NNReal ENNReal Nat Interval
 
 noncomputable section
 

Changes in mathlib4

mathlib3
mathlib4
chore: superfluous parentheses part 2 (#12131)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -207,8 +207,8 @@ theorem map_t₀ : f v.t₀ = v.x₀ :=
 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 rw [f.map_t₀']
-    _ ≤ v.C * dist t v.t₀ := (f.lipschitz.dist_le_mul _ _)
-    _ ≤ v.C * v.tDist := (mul_le_mul_of_nonneg_left (v.dist_t₀_le _) v.C.2)
+    _ ≤ v.C * dist t v.t₀ := f.lipschitz.dist_le_mul _ _
+    _ ≤ v.C * v.tDist := mul_le_mul_of_nonneg_left (v.dist_t₀_le _) v.C.2
     _ ≤ v.R := v.isPicardLindelof.C_mul_le_R
 #align picard_lindelof.fun_space.mem_closed_ball PicardLindelof.FunSpace.mem_closedBall
 
change the order of operation in zsmulRec and nsmulRec (#11451)

We change the following field in the definition of an additive commutative monoid:

 nsmul_succ : ∀ (n : ℕ) (x : G),
-  AddMonoid.nsmul (n + 1) x = x + AddMonoid.nsmul n x
+  AddMonoid.nsmul (n + 1) x = AddMonoid.nsmul n x + x

where the latter is more natural

We adjust the definitions of ^ in monoids, groups, etc. Originally there was a warning comment about why this natural order was preferred

use x * npowRec n x and not npowRec n x * x in the definition to make sure that definitional unfolding of npowRec is blocked, to avoid deep recursion issues.

but it seems to no longer apply.

Remarks on the PR :

  • pow_succ and pow_succ' have switched their meanings.
  • Most of the time, the proofs were adjusted by priming/unpriming one lemma, or exchanging left and right; a few proofs were more complicated to adjust.
  • In particular, [Mathlib/NumberTheory/RamificationInertia.lean] used Ideal.IsPrime.mul_mem_pow which is defined in [Mathlib/RingTheory/DedekindDomain/Ideal.lean]. Changing the order of operation forced me to add the symmetric lemma Ideal.IsPrime.mem_pow_mul.
  • the docstring for Cauchy condensation test in [Mathlib/Analysis/PSeries.lean] was mathematically incorrect, I added the mention that the function is antitone.
Diff
@@ -314,7 +314,7 @@ theorem dist_next_apply_le_of_le {f₁ f₂ : FunSpace v} {n : ℕ} {d : ℝ}
     _ = (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]
+        pow_succ' (v.L : ℝ), Nat.factorial_succ, Nat.cast_mul, Nat.cast_succ, mul_inv, mul_assoc]
 #align picard_lindelof.fun_space.dist_next_apply_le_of_le PicardLindelof.FunSpace.dist_next_apply_le_of_le
 
 theorem dist_iterate_next_apply_le (f₁ f₂ : FunSpace v) (n : ℕ) (t : Icc v.tMin v.tMax) :
chore: Rename mul-div cancellation lemmas (#11530)

Lemma names around cancellation of multiplication and division are a mess.

This PR renames a handful of them according to the following table (each big row contains the multiplicative statement, then the three rows contain the GroupWithZero lemma name, the Group lemma, the AddGroup lemma name).

| Statement | New name | Old name | |

Diff
@@ -415,7 +415,7 @@ theorem exists_isPicardLindelof_const_of_contDiffAt (hv : ContDiffAt ℝ 1 v x
         (closedBall_subset_ball <| half_lt_self <| lt_min hR₁ hR₂).trans <|
         (Metric.ball_subset_ball <| min_le_right _ _).trans (subset_refl _)
       C_mul_le_R := by
-        rw [add_sub_cancel', sub_sub_cancel, max_self, hε, mul_div_left_comm, div_self, mul_one]
+        rw [add_sub_cancel_left, sub_sub_cancel, max_self, hε, mul_div_left_comm, div_self, mul_one]
         exact ne_of_gt <| add_pos_of_pos_of_nonneg zero_lt_one <| norm_nonneg _ }
 #align exists_is_picard_lindelof_const_of_cont_diff_on_nhds exists_isPicardLindelof_const_of_contDiffAt
 
style: homogenise porting notes (#11145)

Homogenises porting notes via capitalisation and addition of whitespace.

It makes the following changes:

  • converts "--porting note" into "-- Porting note";
  • converts "porting note" into "Porting note".
Diff
@@ -302,7 +302,7 @@ theorem dist_next_apply_le_of_le {f₁ f₂ : FunSpace v} {n : ℕ} {d : ℝ}
     ‖∫ τ 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`
+      · -- 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
feat: local existence of integral curves of vector field (#8483)

Port of [mathlib#17140](https://github.com/leanprover-community/mathlib/pull/17140) plus much more. Comments therein addressed.

For any continuously differentiable vector field (section of tangent bundle) on a manifold M and any chosen interior point x₀ : M, there exists an integral curve γ : ℝ → M such that γ t₀ = x₀ for any real number t₀ and the tangent vector of γ at t coincides with the vector field at γ t for all t within an open interval around t₀.

As a corollary, such an integral curve exists for any starting point x₀ if M is a manifold without boundary.

We define three Props:

  1. IsIntegralCurveOn γ v s means γ t is tangent to v (γ t) for all t within s : Set ℝ.
  2. IsIntegralCurveAt γ v t₀ means γ is a local integral curve to v. That is, γ t is tangent to v (γ t) for all t within some open interval of t₀.
  3. IsIntegralCurve γ v means γ is a global integral curve to v. That is, γ t is tangent to v (γ t) for all t : ℝ.

Lemmas about rescaling and translation of integral curves are proven:

  • If γ solves v at t₀, then γ (t + dt) is tangent to v at t₀ - dt.
  • If γ solves v at t₀, then γ (a * t) is tangent to a • v at t₀ / a for any non-zero a.
  • The constant function at x₀ solves any v with v x₀ = 0.

We also shuffle the position of ∃ ε > (0 : ℝ) in PicardLindelof to one that makes more sense, since f t₀ = x₀ does not depend on ε yet.

Co-authored-by: Michael Rothgang <rothgami@math.hu-berlin.de>

Diff
@@ -423,18 +423,19 @@ variable [CompleteSpace E]
 
 /-- A time-independent, continuously differentiable ODE admits a solution in some open interval. -/
 theorem exists_forall_hasDerivAt_Ioo_eq_of_contDiffAt (hv : ContDiffAt ℝ 1 v x₀) :
-    ∃ ε > (0 : ℝ),
-      ∃ f : ℝ → E, f t₀ = x₀ ∧ ∀ t ∈ Ioo (t₀ - ε) (t₀ + ε), HasDerivAt f (v (f t)) t := by
+    ∃ f : ℝ → E, f t₀ = x₀ ∧
+      ∃ ε > (0 : ℝ), ∀ t ∈ Ioo (t₀ - ε) (t₀ + ε), HasDerivAt f (v (f t)) t := by
   obtain ⟨ε, hε, _, _, _, hpl⟩ := exists_isPicardLindelof_const_of_contDiffAt t₀ hv
   obtain ⟨f, hf1, hf2⟩ := hpl.exists_forall_hasDerivWithinAt_Icc_eq x₀
-  exact ⟨ε, hε, f, hf1, fun t ht =>
+  exact ⟨f, hf1, ε, hε, fun t ht =>
     (hf2 t (Ioo_subset_Icc_self ht)).hasDerivAt (Icc_mem_nhds ht.1 ht.2)⟩
 #align exists_forall_deriv_at_Ioo_eq_of_cont_diff_on_nhds exists_forall_hasDerivAt_Ioo_eq_of_contDiffAt
 
 /-- A time-independent, continuously differentiable ODE admits a solution in some open interval. -/
 theorem exists_forall_hasDerivAt_Ioo_eq_of_contDiff (hv : ContDiff ℝ 1 v) :
-    ∃ ε > (0 : ℝ), ∃ f : ℝ → E, f t₀ = x₀ ∧ ∀ t ∈ Ioo (t₀ - ε) (t₀ + ε), HasDerivAt f (v (f t)) t :=
-  let ⟨ε, hε, f, hf1, hf2⟩ :=
+    ∃ f : ℝ → E, f t₀ = x₀ ∧
+      ∃ ε > (0 : ℝ), ∀ t ∈ Ioo (t₀ - ε) (t₀ + ε), HasDerivAt f (v (f t)) t :=
+  let ⟨f, hf1, ε, hε, hf2⟩ :=
     exists_forall_hasDerivAt_Ioo_eq_of_contDiffAt t₀ hv.contDiffAt
-  ⟨ε, hε, f, hf1, fun _ h => hf2 _ h⟩
+  ⟨f, hf1, ε, hε, fun _ h => hf2 _ h⟩
 #align exists_forall_deriv_at_Ioo_eq_of_cont_diff exists_forall_hasDerivAt_Ioo_eq_of_contDiff
chore: remove uses of cases' (#9171)

I literally went through and regex'd some uses of cases', replacing them with rcases; this is meant to be a low effort PR as I hope that tools can do this in the future.

rcases is an easier replacement than cases, though with better tools we could in future do a second pass converting simple rcases added here (and existing ones) to cases.

Diff
@@ -126,7 +126,7 @@ theorem tDist_nonneg : 0 ≤ v.tDist :=
 
 theorem dist_t₀_le (t : Icc v.tMin v.tMax) : dist t v.t₀ ≤ v.tDist := by
   rw [Subtype.dist_eq, Real.dist_eq]
-  cases' le_total t v.t₀ with ht ht
+  rcases le_total t v.t₀ with ht | ht
   · rw [abs_of_nonpos (sub_nonpos.2 <| Subtype.coe_le_coe.2 ht), neg_sub]
     exact (sub_le_sub_left t.2.1 _).trans (le_max_right _ _)
   · rw [abs_of_nonneg (sub_nonneg.2 <| Subtype.coe_le_coe.2 ht)]
chore: bump to v4.3.0-rc2 (#8366)

PR contents

This is the supremum of

along with some minor fixes from failures on nightly-testing as Mathlib master is merged into it.

Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.

I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0 branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.

Lean PRs involved in this bump

In particular this includes adjustments for the Lean PRs

leanprover/lean4#2778

We can get rid of all the

local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)

macros across Mathlib (and in any projects that want to write natural number powers of reals).

leanprover/lean4#2722

Changes the default behaviour of simp to (config := {decide := false}). This makes simp (and consequentially norm_num) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp or norm_num to decide or rfl, or adding (config := {decide := true}).

leanprover/lean4#2783

This changed the behaviour of simp so that simp [f] will only unfold "fully applied" occurrences of f. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true }). We may in future add a syntax for this, e.g. simp [!f]; please provide feedback! In the meantime, we have made the following changes:

  • switching to using explicit lemmas that have the intended level of application
  • (config := { unfoldPartialApp := true }) in some places, to recover the old behaviour
  • Using @[eqns] to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp and Function.flip.

This change in Lean may require further changes down the line (e.g. adding the !f syntax, and/or upstreaming the special treatment for Function.comp and Function.flip, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!

Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>

Diff
@@ -34,8 +34,6 @@ related theorems in `Mathlib/Analysis/ODE/Gronwall.lean`.
 differential equation
 -/
 
-local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
-
 open Filter Function Set Metric TopologicalSpace intervalIntegral MeasureTheory
 open MeasureTheory.MeasureSpace (volume)
 open scoped Filter Topology NNReal ENNReal Nat Interval
fix: Incorrect integral curve existence theorem for vector fields (#6875)

exists_isPicardLindelof_const_of_contDiffOn_nhds had unnecessarily specific assumptions.

ContDiffOn assumption is replaced with ContDiffAt.

ProperSpace E assumption is removed.

Diff
@@ -391,79 +391,52 @@ theorem IsPicardLindelof.exists_forall_hasDerivWithinAt_Icc_eq [CompleteSpace E]
     ⟨v, tMin, tMax, t₀, x₀, C, ⟨R, hpl.hR⟩, L, { hpl with ht₀ := t₀.property }⟩
 #align exists_forall_deriv_within_Icc_eq_of_is_picard_lindelof IsPicardLindelof.exists_forall_hasDerivWithinAt_Icc_eq
 
-variable [ProperSpace E] {v : E → E} (t₀ : ℝ) (x₀ : E)
+variable {v : E → E} (t₀ : ℝ) {x₀ : E}
 
-/-- A time-independent, locally continuously differentiable ODE satisfies the hypotheses of the
+/-- A time-independent, continuously differentiable ODE satisfies the hypotheses of the
   Picard-Lindelöf theorem. -/
-theorem exists_isPicardLindelof_const_of_contDiffOn_nhds {s : Set E} (hv : ContDiffOn ℝ 1 v s)
-    (hs : s ∈ 𝓝 x₀) :
+theorem exists_isPicardLindelof_const_of_contDiffAt (hv : ContDiffAt ℝ 1 v x₀) :
     ∃ ε > (0 : ℝ), ∃ L R C, IsPicardLindelof (fun _ => v) (t₀ - ε) t₀ (t₀ + ε) x₀ L R C := by
-  -- extract Lipschitz constant
-  obtain ⟨L, s', hs', hlip⟩ :=
-    ContDiffAt.exists_lipschitzOnWith ((hv.contDiffWithinAt (mem_of_mem_nhds hs)).contDiffAt hs)
-  -- radius of closed ball in which v is bounded
-  obtain ⟨r, hr : 0 < r, hball⟩ := Metric.mem_nhds_iff.mp (inter_sets (𝓝 x₀) hs hs')
-  have hr' := (half_pos hr).le
-  -- uses [ProperSpace E] for `isCompact_closedBall`
-  obtain ⟨C, hC⟩ := (isCompact_closedBall x₀ (r / 2)).bddAbove_image <| hv.continuousOn.norm.mono
-    (subset_inter_iff.mp ((closedBall_subset_ball (half_lt_self hr)).trans hball)).left
-  have hC' : 0 ≤ C := by
-    apply (norm_nonneg (v x₀)).trans
-    apply hC
-    exact ⟨x₀, ⟨mem_closedBall_self hr', rfl⟩⟩
-  set ε := if C = 0 then 1 else r / 2 / C with hε
-  have hε0 : 0 < ε := by
-    rw [hε]
-    split_ifs with h
-    · exact zero_lt_one
-    · exact div_pos (half_pos hr) (lt_of_le_of_ne hC' (Ne.symm h))
-  refine' ⟨ε, hε0, L, r / 2, C, _⟩
+  obtain ⟨L, s, hs, hlip⟩ := hv.exists_lipschitzOnWith
+  obtain ⟨R₁, hR₁ : 0 < R₁, hball⟩ := Metric.mem_nhds_iff.mp hs
+  obtain ⟨R₂, hR₂ : 0 < R₂, hbdd⟩ := Metric.continuousAt_iff.mp hv.continuousAt.norm 1 zero_lt_one
+  have hbdd' : ∀ x ∈ Metric.ball x₀ R₂, ‖v x‖ ≤ 1 + ‖v x₀‖ := fun _ hx =>
+    sub_le_iff_le_add.mp <| le_of_lt <| lt_of_abs_lt <| Real.dist_eq _ _ ▸ hbdd hx
+  set ε := min R₁ R₂ / 2 / (1 + ‖v x₀‖) with hε
+  have hε0 : 0 < ε := hε ▸ div_pos (half_pos <| lt_min hR₁ hR₂)
+    (add_pos_of_pos_of_nonneg zero_lt_one (norm_nonneg _))
+  refine' ⟨ε, hε0, L, min R₁ R₂ / 2, 1 + ‖v x₀‖, _⟩
   exact
-    { ht₀ := by rw [← Real.closedBall_eq_Icc]; exact mem_closedBall_self hε0.le
-      hR := (half_pos hr).le
-      lipschitz := fun t _ => hlip.mono
-        (subset_inter_iff.mp (Subset.trans (closedBall_subset_ball (half_lt_self hr)) hball)).2
-      cont := fun x _ => continuousOn_const
-      norm_le := fun t _ x hx => hC ⟨x, hx, rfl⟩
+    { ht₀ := Real.closedBall_eq_Icc ▸ mem_closedBall_self hε0.le
+      hR := by positivity
+      lipschitz := fun _ _ => hlip.mono <|
+        (closedBall_subset_ball <| half_lt_self <| lt_min hR₁ hR₂).trans <|
+        (Metric.ball_subset_ball <| min_le_left _ _).trans hball
+      cont := fun _ _ => continuousOn_const
+      norm_le := fun _ _ x hx => hbdd' x <| mem_of_mem_of_subset hx <|
+        (closedBall_subset_ball <| half_lt_self <| lt_min hR₁ hR₂).trans <|
+        (Metric.ball_subset_ball <| min_le_right _ _).trans (subset_refl _)
       C_mul_le_R := by
-        rw [add_sub_cancel', sub_sub_cancel, max_self, mul_ite, mul_one]
-        split_ifs with h
-        · rwa [← h] at hr'
-        · exact (mul_div_cancel' (r / 2) h).le }
-#align exists_is_picard_lindelof_const_of_cont_diff_on_nhds exists_isPicardLindelof_const_of_contDiffOn_nhds
-
-/-- A time-independent, locally continuously differentiable ODE admits a solution in some open
-interval. -/
-theorem exists_forall_deriv_at_Ioo_eq_of_contDiffOn_nhds {s : Set E} (hv : ContDiffOn ℝ 1 v s)
-    (hs : s ∈ 𝓝 x₀) :
+        rw [add_sub_cancel', sub_sub_cancel, max_self, hε, mul_div_left_comm, div_self, mul_one]
+        exact ne_of_gt <| add_pos_of_pos_of_nonneg zero_lt_one <| norm_nonneg _ }
+#align exists_is_picard_lindelof_const_of_cont_diff_on_nhds exists_isPicardLindelof_const_of_contDiffAt
+
+variable [CompleteSpace E]
+
+/-- A time-independent, continuously differentiable ODE admits a solution in some open interval. -/
+theorem exists_forall_hasDerivAt_Ioo_eq_of_contDiffAt (hv : ContDiffAt ℝ 1 v x₀) :
     ∃ ε > (0 : ℝ),
-      ∃ f : ℝ → E, f t₀ = x₀ ∧ ∀ t ∈ Ioo (t₀ - ε) (t₀ + ε), f t ∈ s ∧ HasDerivAt f (v (f t)) t := by
-  obtain ⟨ε, hε, L, R, C, hpl⟩ := exists_isPicardLindelof_const_of_contDiffOn_nhds t₀ x₀ hv hs
+      ∃ f : ℝ → E, f t₀ = x₀ ∧ ∀ t ∈ Ioo (t₀ - ε) (t₀ + ε), HasDerivAt f (v (f t)) t := by
+  obtain ⟨ε, hε, _, _, _, hpl⟩ := exists_isPicardLindelof_const_of_contDiffAt t₀ hv
   obtain ⟨f, hf1, hf2⟩ := hpl.exists_forall_hasDerivWithinAt_Icc_eq x₀
-  have hf2' : ∀ t ∈ Ioo (t₀ - ε) (t₀ + ε), HasDerivAt f (v (f t)) t := fun t ht =>
-    (hf2 t (Ioo_subset_Icc_self ht)).hasDerivAt (Icc_mem_nhds ht.1 ht.2)
-  have h : f ⁻¹' s ∈ 𝓝 t₀ := by
-    have := hf2' t₀ (mem_Ioo.mpr ⟨sub_lt_self _ hε, lt_add_of_pos_right _ hε⟩)
-    apply ContinuousAt.preimage_mem_nhds this.continuousAt
-    rw [hf1]
-    exact hs
-  rw [Metric.mem_nhds_iff] at h
-  obtain ⟨r, hr1, hr2⟩ := h
-  refine ⟨min r ε, lt_min hr1 hε, f, hf1, fun t ht => ⟨?_,
-    hf2' t (mem_of_mem_of_subset ht (Ioo_subset_Ioo (sub_le_sub_left (min_le_right _ _) _)
-      (add_le_add_left (min_le_right _ _) _)))⟩⟩
-  rw [← Set.mem_preimage]
-  apply Set.mem_of_mem_of_subset _ hr2
-  apply Set.mem_of_mem_of_subset ht
-  rw [← Real.ball_eq_Ioo]
-  exact Metric.ball_subset_ball (min_le_left _ _)
-#align exists_forall_deriv_at_Ioo_eq_of_cont_diff_on_nhds exists_forall_deriv_at_Ioo_eq_of_contDiffOn_nhds
+  exact ⟨ε, hε, f, hf1, fun t ht =>
+    (hf2 t (Ioo_subset_Icc_self ht)).hasDerivAt (Icc_mem_nhds ht.1 ht.2)⟩
+#align exists_forall_deriv_at_Ioo_eq_of_cont_diff_on_nhds exists_forall_hasDerivAt_Ioo_eq_of_contDiffAt
 
 /-- A time-independent, continuously differentiable ODE admits a solution in some open interval. -/
 theorem exists_forall_hasDerivAt_Ioo_eq_of_contDiff (hv : ContDiff ℝ 1 v) :
     ∃ ε > (0 : ℝ), ∃ f : ℝ → E, f t₀ = x₀ ∧ ∀ t ∈ Ioo (t₀ - ε) (t₀ + ε), HasDerivAt f (v (f t)) t :=
   let ⟨ε, hε, f, hf1, hf2⟩ :=
-    exists_forall_deriv_at_Ioo_eq_of_contDiffOn_nhds t₀ x₀ hv.contDiffOn
-      (IsOpen.mem_nhds isOpen_univ (mem_univ _))
-  ⟨ε, hε, f, hf1, fun t ht => (hf2 t ht).2⟩
+    exists_forall_hasDerivAt_Ioo_eq_of_contDiffAt t₀ hv.contDiffAt
+  ⟨ε, hε, f, hf1, fun _ h => hf2 _ h⟩
 #align exists_forall_deriv_at_Ioo_eq_of_cont_diff exists_forall_hasDerivAt_Ioo_eq_of_contDiff
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -42,13 +42,13 @@ open scoped Filter Topology NNReal ENNReal Nat Interval
 
 noncomputable section
 
-variable {E : Type _} [NormedAddCommGroup E] [NormedSpace ℝ E]
+variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
 
 /-- `Prop` structure holding the hypotheses of the Picard-Lindelöf theorem.
 
 The similarly named `PicardLindelof` structure is part of the internal API for convenience, so as
 not to constantly invoke choice, but is not intended for public use. -/
-structure IsPicardLindelof {E : Type _} [NormedAddCommGroup E] (v : ℝ → E → E) (tMin t₀ tMax : ℝ)
+structure IsPicardLindelof {E : Type*} [NormedAddCommGroup E] (v : ℝ → E → E) (tMin t₀ tMax : ℝ)
     (x₀ : E) (L : ℝ≥0) (R C : ℝ) : Prop where
   ht₀ : t₀ ∈ Icc tMin tMax
   hR : 0 ≤ R
@@ -66,7 +66,7 @@ of using this structure.
 The similarly named `IsPicardLindelof` is a bundled `Prop` holding the long hypotheses of the
 Picard-Lindelöf theorem as named arguments. It is used as part of the public API.
 -/
-structure PicardLindelof (E : Type _) [NormedAddCommGroup E] [NormedSpace ℝ E] where
+structure PicardLindelof (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] where
   toFun : ℝ → E → E
   (tMin tMax : ℝ)
   t₀ : Icc tMin tMax
@@ -373,7 +373,7 @@ theorem exists_solution :
 
 end PicardLindelof
 
-theorem IsPicardLindelof.norm_le₀ {E : Type _} [NormedAddCommGroup E] {v : ℝ → E → E}
+theorem IsPicardLindelof.norm_le₀ {E : Type*} [NormedAddCommGroup E] {v : ℝ → E → E}
     {tMin t₀ tMax : ℝ} {x₀ : E} {C R : ℝ} {L : ℝ≥0}
     (hpl : IsPicardLindelof v tMin t₀ tMax x₀ L R C) : ‖v t₀ x₀‖ ≤ C :=
   hpl.norm_le t₀ hpl.ht₀ x₀ <| mem_closedBall_self hpl.hR
chore: regularize HPow.hPow porting notes (#6465)
Diff
@@ -34,7 +34,7 @@ related theorems in `Mathlib/Analysis/ODE/Gronwall.lean`.
 differential equation
 -/
 
-local macro_rules | `($x ^ $y)   => `(HPow.hPow $x $y) -- Porting note: See Lean 4 issue #2220
+local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue lean4#2220
 
 open Filter Function Set Metric TopologicalSpace intervalIntegral MeasureTheory
 open MeasureTheory.MeasureSpace (volume)
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2021 Yury G. Kudryashov. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yury G. Kudryashov, Winston Yin
-
-! This file was ported from Lean 3 source module analysis.ODE.picard_lindelof
-! leanprover-community/mathlib commit f2ce6086713c78a7f880485f7917ea547a215982
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Analysis.SpecialFunctions.Integrals
 import Mathlib.Topology.MetricSpace.Contracting
 
+#align_import analysis.ODE.picard_lindelof from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982"
+
 /-!
 # Picard-Lindelöf (Cauchy-Lipschitz) Theorem
 
fix precedence of Nat.iterate (#5589)
Diff
@@ -323,7 +323,7 @@ theorem dist_next_apply_le_of_le {f₁ f₂ : FunSpace v} {n : ℕ} {d : ℝ}
 #align picard_lindelof.fun_space.dist_next_apply_le_of_le PicardLindelof.FunSpace.dist_next_apply_le_of_le
 
 theorem dist_iterate_next_apply_le (f₁ f₂ : FunSpace v) (n : ℕ) (t : Icc v.tMin v.tMax) :
-    dist ((next^[n]) f₁ t) ((next^[n]) f₂ t) ≤ (v.L * |t.1 - v.t₀|) ^ n / n ! * dist f₁ f₂ := by
+    dist (next^[n] f₁ t) (next^[n] f₂ t) ≤ (v.L * |t.1 - v.t₀|) ^ n / n ! * dist f₁ f₂ := by
   induction' n with n ihn generalizing t
   · rw [Nat.zero_eq, pow_zero, Nat.factorial_zero, Nat.cast_one, div_one, one_mul]
     exact dist_apply_le_dist f₁ f₂ t
@@ -332,7 +332,7 @@ theorem dist_iterate_next_apply_le (f₁ f₂ : FunSpace v) (n : ℕ) (t : Icc v
 #align picard_lindelof.fun_space.dist_iterate_next_apply_le PicardLindelof.FunSpace.dist_iterate_next_apply_le
 
 theorem dist_iterate_next_le (f₁ f₂ : FunSpace v) (n : ℕ) :
-    dist ((next^[n]) f₁) ((next^[n]) f₂) ≤ (v.L * v.tDist) ^ n / n ! * dist f₁ f₂ := by
+    dist (next^[n] f₁) (next^[n] f₂) ≤ (v.L * v.tDist) ^ n / n ! * dist f₁ f₂ := by
   refine' dist_le_of_forall fun t => (dist_iterate_next_apply_le _ _ _ _).trans _
   have : |(t - v.t₀ : ℝ)| ≤ v.tDist := v.dist_t₀_le t
   gcongr
@@ -345,7 +345,7 @@ variable [CompleteSpace E]
 section
 
 theorem exists_contracting_iterate :
-    ∃ (N : ℕ) (K : _), ContractingWith K ((FunSpace.next : v.FunSpace → v.FunSpace)^[N]) := by
+    ∃ (N : ℕ) (K : _), ContractingWith K (FunSpace.next : v.FunSpace → v.FunSpace)^[N] := by
   rcases ((Real.tendsto_pow_div_factorial_atTop (v.L * v.tDist)).eventually
     (gt_mem_nhds zero_lt_one)).exists with ⟨N, hN⟩
   have : (0 : ℝ) ≤ (v.L * v.tDist) ^ N / N ! :=
chore: tidy various files (#5482)
Diff
@@ -30,7 +30,7 @@ valued structure `IsPicardLindelof`, which holds the long hypotheses of the Pica
 theorem for actual use as part of the public API.
 
 We only prove existence of a solution in this file. For uniqueness see `ODE_solution_unique` and
-related theorems in `analysis.ODE.gronwall`.
+related theorems in `Mathlib/Analysis/ODE/Gronwall.lean`.
 
 ## Tags
 
@@ -290,7 +290,7 @@ theorem hasDerivWithinAt_next (t : Icc v.tMin v.tMax) :
     integral_hasDerivWithinAt_right (f.intervalIntegrable_vComp _ _)
       (f.continuous_vComp.stronglyMeasurableAtFilter _ _)
       f.continuous_vComp.continuousWithinAt
-  rw [vComp_apply_coe] at this 
+  rw [vComp_apply_coe] at this
   refine' this.congr_of_eventuallyEq_of_mem _ t.coe_prop
   filter_upwards [self_mem_nhdsWithin] with _ ht'
   rw [v.proj_of_mem ht']
@@ -431,7 +431,7 @@ theorem exists_isPicardLindelof_const_of_contDiffOn_nhds {s : Set E} (hv : ContD
       C_mul_le_R := by
         rw [add_sub_cancel', sub_sub_cancel, max_self, mul_ite, mul_one]
         split_ifs with h
-        · rwa [← h] at hr' 
+        · rwa [← h] at hr'
         · exact (mul_div_cancel' (r / 2) h).le }
 #align exists_is_picard_lindelof_const_of_cont_diff_on_nhds exists_isPicardLindelof_const_of_contDiffOn_nhds
 
@@ -450,7 +450,7 @@ theorem exists_forall_deriv_at_Ioo_eq_of_contDiffOn_nhds {s : Set E} (hv : ContD
     apply ContinuousAt.preimage_mem_nhds this.continuousAt
     rw [hf1]
     exact hs
-  rw [Metric.mem_nhds_iff] at h 
+  rw [Metric.mem_nhds_iff] at h
   obtain ⟨r, hr1, hr2⟩ := h
   refine ⟨min r ε, lt_min hr1 hε, f, hf1, fun t ht => ⟨?_,
     hf2' t (mem_of_mem_of_subset ht (Ioo_subset_Ioo (sub_le_sub_left (min_le_right _ _) _)
@@ -470,4 +470,3 @@ theorem exists_forall_hasDerivAt_Ioo_eq_of_contDiff (hv : ContDiff ℝ 1 v) :
       (IsOpen.mem_nhds isOpen_univ (mem_univ _))
   ⟨ε, hε, f, hf1, fun t ht => (hf2 t ht).2⟩
 #align exists_forall_deriv_at_Ioo_eq_of_cont_diff exists_forall_hasDerivAt_Ioo_eq_of_contDiff
-
feat: generalize continuousOn_prod_of_continuousOn_lipschitz_on etc (#5308)
  • It suffices to require continuity in the second argument for the first argument from a dense set.
  • Rename lemmas to include lipschitzWith/lipschitzWithOn.
Diff
@@ -110,7 +110,7 @@ protected theorem lipschitzOnWith {t} (ht : t ∈ Icc v.tMin v.tMax) :
 protected theorem continuousOn :
     ContinuousOn (uncurry v) (Icc v.tMin v.tMax ×ˢ closedBall v.x₀ v.R) :=
   have : ContinuousOn (uncurry (flip v)) (closedBall v.x₀ v.R ×ˢ Icc v.tMin v.tMax) :=
-    continuousOn_prod_of_continuousOn_lipschitz_on _ v.L v.isPicardLindelof.cont
+    continuousOn_prod_of_continuousOn_lipschitzOnWith _ v.L v.isPicardLindelof.cont
       v.isPicardLindelof.lipschitz
   this.comp continuous_swap.continuousOn (preimage_swap_prod _ _).symm.subset
 #align picard_lindelof.continuous_on PicardLindelof.continuousOn
feat: port Analysis.ODE.PicardLindelof (#4907)

Dependencies 12 + 1071

1072 files ported (98.9%)
483912 lines ported (98.9%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file