Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat: uniqueness of integral curves of a vector field on a manifold #8886

Closed
wants to merge 228 commits into from
Closed
Show file tree
Hide file tree
Changes from 221 commits
Commits
Show all changes
228 commits
Select commit Hold shift + click to select a range
4e53e96
doc
winstonyin Nov 13, 2023
f14b378
compiles
winstonyin Nov 17, 2023
22b4f1f
indent
winstonyin Nov 17, 2023
0747174
import, indent
winstonyin Nov 17, 2023
23d691f
docstring
winstonyin Nov 17, 2023
e8e7338
Mathlib.lean
winstonyin Nov 17, 2023
ccc8f77
lake manifest
winstonyin Nov 17, 2023
42341d1
Merge remote-tracking branch 'origin/master' into integral_curve
winstonyin Nov 17, 2023
720ec35
removed temporary notation
winstonyin Nov 18, 2023
25f1065
integralCurveAt, change PicardLindelof statement order
winstonyin Nov 18, 2023
d4139b6
compiles
winstonyin Nov 18, 2023
4b57dfe
Sketch a section on interior and boundary of manifolds.
grunweg Nov 18, 2023
e9d3546
More progress. Tweaks, polish and fleshing out some sorries.
grunweg Nov 19, 2023
cbd22f4
One more lemma.
grunweg Nov 19, 2023
0dbf3b0
One lemma was in mathlib. :-)
grunweg Nov 19, 2023
a978f02
Fix the build; mild clean-ups.
grunweg Nov 19, 2023
1f6dbaa
Small simplifications.
grunweg Nov 19, 2023
9c58652
has -> is, docstring, shift/stretch lemmas
winstonyin Nov 20, 2023
6b55cbc
detailed proof steps
winstonyin Nov 20, 2023
0ada08e
open Set
winstonyin Nov 20, 2023
063822d
`IsIntegralCurveAt` in preamble
winstonyin Nov 20, 2023
fb4196f
IsIntegralCurveAt.comp_add
winstonyin Nov 20, 2023
6f665ad
translation, scale, and reverse lemmas
winstonyin Nov 21, 2023
b59c82f
iff lemmas
winstonyin Nov 21, 2023
3c2e424
Small polish. Note that smoothness is not required;
grunweg Nov 21, 2023
c95243e
The boundary is closed: entails showing that interior and boundary ar…
grunweg Nov 21, 2023
933cc59
Almost-proof that boundary has empty interior: need to adjust definit…
grunweg Nov 21, 2023
2041d30
Correct the definition of boundary:
grunweg Nov 21, 2023
f1fda32
Fix and complete proof that the boundary has empty interior.
grunweg Nov 21, 2023
6a4e39c
Small clean-ups:
grunweg Nov 21, 2023
88bea4c
Clean up lemmas about boundary.
grunweg Nov 21, 2023
73e203f
Small golfs.
grunweg Nov 21, 2023
90090b2
Fix rebase, make it build and fix a docstring typo.
grunweg Nov 21, 2023
338ab9f
Fix casing for real: IsInteriorPoint is correct.
grunweg Nov 21, 2023
378088c
Name lemma in snake_case.
grunweg Nov 21, 2023
efe0880
naming
winstonyin Nov 22, 2023
d35e843
move lemma, style
winstonyin Nov 22, 2023
dce81a6
Define topological manifolds and use them for defining interior and b…
grunweg Nov 21, 2023
79fcb13
Alternative, more minimal fix.
grunweg Nov 21, 2023
e1a9363
sketch boundary argument
grunweg Nov 21, 2023
f38f823
MAYBE this tweak makes the proof easier.
grunweg Nov 21, 2023
07d1dbc
Cleanup, one easy sorry.
grunweg Nov 21, 2023
c331ee2
Another easy sorry.
grunweg Nov 21, 2023
191a5c1
Move a helper upfront; eliminating another sorry.
grunweg Nov 21, 2023
66b1943
Starting at scifi lemma: might be science *fiction* actually...
grunweg Nov 21, 2023
7840b91
Small golfs.
grunweg Nov 22, 2023
61fd70e
Extract lemmas used in the proof so far.
grunweg Nov 22, 2023
5869bd5
Fill sorry in description of boundary.
grunweg Nov 22, 2023
058bb70
Extract one more useful lemma; tiny golf.
grunweg Nov 22, 2023
7e1542d
Simplify: use chart source instead of extChart.source.
grunweg Nov 22, 2023
219f85c
Fill in one more helper sorry.
grunweg Nov 22, 2023
b97611e
Move helpers to better namespace; show a MapsTo version;
grunweg Nov 22, 2023
ef4c232
Reduce interior independence statement to a local lemma.
grunweg Nov 22, 2023
184a062
Give up: remove WIP claim that boundary as empty interior.
grunweg Nov 22, 2023
c634f1a
Rename and golf mapsTo results for extended local homeos.
grunweg Nov 22, 2023
dd9e73f
Small golfs and clean-ups.
grunweg Nov 22, 2023
3d820be
Move complete (and now unused) helper results to their files:
grunweg Nov 22, 2023
2c69553
compiles
winstonyin Nov 22, 2023
7c6bccf
new lemmas and slight golfing
winstonyin Nov 23, 2023
e74b860
Essentials are complete.
grunweg Nov 25, 2023
f8e3340
Clean up; document TODOs/next steps; move all helpers to their proper…
grunweg Nov 25, 2023
4febc74
Remove helper lemmas not needed here.
grunweg Nov 25, 2023
c1f3395
Pare down interior/boundary file to the necesssary basics; sorry-free.
grunweg Nov 25, 2023
25ff469
Merge branch 'MR-manifolds-boundary' into integral_curve
grunweg Nov 25, 2023
1459dfb
Simplify.
grunweg Nov 25, 2023
094ca88
compiles
winstonyin Nov 26, 2023
ca11211
Merge branch 'integral_curve' of https://github.com/leanprover-commun…
winstonyin Nov 26, 2023
7754760
range_mem_nhds_isInteriorPoint
winstonyin Nov 26, 2023
6033099
namespace
winstonyin Nov 26, 2023
429fd8b
Merge remote-tracking branch 'origin/MR-manifolds-boundary' into inte…
winstonyin Nov 26, 2023
d1a8296
hI as separate lemma
winstonyin Nov 26, 2023
7f7a49d
actually compiles
winstonyin Nov 26, 2023
ab30700
minor
winstonyin Nov 26, 2023
98ff512
Prefer refine over refine' in new code, per zulip.
grunweg Nov 27, 2023
00f4e77
Use mfld_simps to make proofs more readable.
grunweg Nov 27, 2023
e86759d
Small golf, use mfld_simps more.
grunweg Nov 27, 2023
85fbe5d
hasFDerivWithinAt_tangentCoordChange
winstonyin Nov 27, 2023
d924890
some golf
winstonyin Nov 28, 2023
4cf8097
shorten comment
winstonyin Nov 28, 2023
e8bfdb0
shorten
winstonyin Nov 28, 2023
de44a9c
move tangentCoordChange
winstonyin Nov 28, 2023
a792394
minor spacing
winstonyin Nov 28, 2023
4cc6c69
isIntegralCurveAt_const
winstonyin Nov 28, 2023
b4ba5a0
remove todo
winstonyin Nov 28, 2023
f14affa
use implicit lambdas
winstonyin Nov 28, 2023
0a3d359
Fix style.
grunweg Nov 29, 2023
fa1b5f3
Remove superfluous helper lemma.
grunweg Nov 29, 2023
9e9ee92
docstring, rename theorem
winstonyin Nov 30, 2023
75c2b52
rename
winstonyin Nov 30, 2023
f019e9b
remove `x₀` from `IsIntegralCurveAt`
winstonyin Nov 30, 2023
30c333f
end with exact
winstonyin Nov 30, 2023
e140c43
`IsIntegralCurveOn`, `IsIntegralCurve`
winstonyin Nov 30, 2023
b810d2a
docstring
winstonyin Nov 30, 2023
9f5b559
IsIntegralCurveAt.isIntegralCurveOn
winstonyin Nov 30, 2023
0445938
`comp_add` lemmas
winstonyin Nov 30, 2023
3b7cca0
refactored `IsIntegralCurveXX`
winstonyin Nov 30, 2023
082574b
unused arg
winstonyin Nov 30, 2023
ac90345
statement
winstonyin Dec 1, 2023
19a2e81
gronwall LipschitzOnWith
winstonyin Dec 1, 2023
b08e243
partial
winstonyin Dec 1, 2023
08d1e12
some corollaries in Gronwall
winstonyin Dec 4, 2023
f80b337
Ioo version
winstonyin Dec 5, 2023
49c5acb
stuck
winstonyin Dec 6, 2023
e52f2ff
can't believe it compiles lol
winstonyin Dec 6, 2023
5e4df2a
draft
winstonyin Dec 7, 2023
33d9a79
uniqueness sorry-free!
winstonyin Dec 7, 2023
f22da92
docstring
winstonyin Dec 8, 2023
fbb74c9
Merge remote-tracking branch 'origin/master' into integral_curve
winstonyin Dec 8, 2023
5607d5a
Merge branch 'integral_curve' into unique_integral_curve
winstonyin Dec 8, 2023
a9d4cae
space
winstonyin Dec 8, 2023
9d54e62
Merge branch 'integral_curve' into unique_integral_curve
winstonyin Dec 8, 2023
0249431
Merge remote-tracking branch 'origin/master' into unique_integral_curve
winstonyin Dec 8, 2023
860f52f
shorten
winstonyin Dec 8, 2023
d6d70f5
shorten
winstonyin Dec 8, 2023
6ea9338
unused
winstonyin Dec 8, 2023
6d4af73
Small things: sectioning; re-use variables.
grunweg Dec 8, 2023
ffa3c4b
Tinygolf.
grunweg Dec 8, 2023
7dde305
Line breaks.
grunweg Dec 8, 2023
b6a1ada
golf a bit
winstonyin Dec 8, 2023
f5f7f70
golf and docstring
winstonyin Dec 8, 2023
4b2a738
usued args
winstonyin Dec 8, 2023
1898133
remove temp notation
winstonyin Dec 8, 2023
fa1e07f
oops
winstonyin Dec 8, 2023
780373e
small golf
winstonyin Dec 9, 2023
8cfee4c
EqOn
winstonyin Dec 9, 2023
64942d1
style
winstonyin Dec 9, 2023
cb2fab2
style
winstonyin Dec 9, 2023
3a6a98d
have parentheses
winstonyin Dec 9, 2023
06674b3
style
winstonyin Dec 13, 2023
5c5f070
fix
winstonyin Dec 13, 2023
71d1021
Merge branch 'integral_curve' into unique_integral_curve
winstonyin Dec 13, 2023
ccd1830
style
winstonyin Dec 13, 2023
122546d
spacing
winstonyin Dec 13, 2023
c1c57c9
spacing
winstonyin Dec 13, 2023
0ed0eec
split aux lemmas out
winstonyin Dec 13, 2023
729d547
refactored with shrinkable
winstonyin Dec 14, 2023
5e45ca2
use filters, eventually
winstonyin Dec 14, 2023
842284d
all using filters now
winstonyin Dec 14, 2023
abbcbd8
style
winstonyin Dec 14, 2023
8d91420
doc
winstonyin Dec 14, 2023
2c4d77d
restate existence theorem using filters
winstonyin Dec 14, 2023
5f7bb14
define `IsIntegralCurveAt` using `Eventually`
winstonyin Dec 14, 2023
182c699
Merge branch 'integral_curve' into unique_integral_curve
winstonyin Dec 14, 2023
eec9c85
Merge remote-tracking branch 'origin/master' into unique_integral_curve
winstonyin Dec 14, 2023
29170c6
Merge remote-tracking branch 'origin/master' into integral_curve
winstonyin Dec 14, 2023
6341072
PartialEquiv
winstonyin Dec 14, 2023
7911121
PartialEquiv
winstonyin Dec 14, 2023
8e54212
PartialEquiv
winstonyin Dec 14, 2023
7b1bc43
PartialEquiv
winstonyin Dec 14, 2023
4efc1ad
PartialEquiv
winstonyin Dec 14, 2023
2508953
Partial
winstonyin Dec 14, 2023
7b804f9
Replace => by \mapsto, per the style guide.
grunweg Dec 14, 2023
22d5ceb
Small golfs.
grunweg Dec 14, 2023
c4dd6bc
small golf
winstonyin Dec 15, 2023
d32e895
congr_deriv
winstonyin Dec 15, 2023
7dead4d
Merge remote-tracking branch 'origin/congr_deriv' into unique_integra…
winstonyin Dec 15, 2023
fff3d19
use new lemmas
winstonyin Dec 15, 2023
4559d57
missed one
winstonyin Dec 15, 2023
17cb91b
fderiv -> deriv
winstonyin Dec 15, 2023
8712cb8
congr_mfderiv
winstonyin Dec 15, 2023
d4c5b05
mfderiv_chartAt_eq_tangentCoordChange
winstonyin Dec 15, 2023
a5c75c1
golf
winstonyin Dec 15, 2023
f17b87d
uncomment
winstonyin Dec 15, 2023
9acde4a
reorder
winstonyin Dec 15, 2023
fa459a5
implicit variables
winstonyin Dec 15, 2023
850ab35
Merge branch 'integral_curve' into unique_integral_curve
winstonyin Dec 15, 2023
e34a30a
implicit variable
winstonyin Dec 15, 2023
3ba365f
organise variables, docstring
winstonyin Dec 15, 2023
9cb4fb6
Merge remote-tracking branch 'origin/master' into unique_integral_curve
winstonyin Dec 16, 2023
e784d93
Update Mathlib/Geometry/Manifold/IntegralCurve.lean
winstonyin Dec 17, 2023
47e137d
Update Mathlib/Geometry/Manifold/IntegralCurve.lean
winstonyin Dec 17, 2023
2e0b9bf
Update Mathlib/Geometry/Manifold/IntegralCurve.lean
winstonyin Dec 18, 2023
26be30a
remove newlines
winstonyin Dec 18, 2023
90755c3
Merge remote-tracking branch 'origin/master' into integral_curve
winstonyin Dec 19, 2023
5aab426
fix
winstonyin Dec 19, 2023
020e07b
Merge branch 'integral_curve' into unique_integral_curve
winstonyin Dec 19, 2023
1ea3813
fix
winstonyin Dec 20, 2023
749ea8c
IsIntegralCurveAt.hasMFDerivAt
winstonyin Dec 29, 2023
3c41d58
Merge branch 'integral_curve' into unique_integral_curve
winstonyin Dec 29, 2023
ca88b9d
Merge remote-tracking branch 'origin/master' into integral_curve
winstonyin Jan 5, 2024
e06f50b
Merge branch 'integral_curve' into unique_integral_curve
winstonyin Jan 5, 2024
c74e830
BoundarylessManifold
winstonyin Jan 5, 2024
ec1df62
BoundarylessManifold
winstonyin Jan 5, 2024
9db3abf
BoundarylessManifold
winstonyin Jan 5, 2024
353f3c9
Make I implicit again.
grunweg Jan 8, 2024
7d7a716
docs, golf, add `isIntegralCurveOn_iff_isIntegralCurveAt`
winstonyin Jan 8, 2024
db893bd
use `Eventually` in `IsIntegralCurveAt`
winstonyin Jan 8, 2024
ad6d0a6
minor
winstonyin Jan 8, 2024
e9eaec2
Merge branch 'integral_curve' into unique_integral_curve
winstonyin Jan 9, 2024
5c7eca6
fix
winstonyin Jan 9, 2024
fed6c68
golf
winstonyin Jan 9, 2024
89e0297
golf
winstonyin Jan 9, 2024
8f0b80a
Merge remote-tracking branch 'origin/master' into unique_integral_curve
winstonyin Jan 9, 2024
a00ed88
golf some earlier proofs
winstonyin Jan 9, 2024
8493b01
minor
winstonyin Jan 9, 2024
15f7e4f
doc
winstonyin Jan 9, 2024
1c91b79
section header
winstonyin Jan 9, 2024
fbd2199
typo
winstonyin Jan 11, 2024
4ef4954
Merge remote-tracking branch 'origin/master' into unique_integral_curve
winstonyin Jan 15, 2024
eb40505
Merge remote-tracking branch 'origin/master' into unique_integral_curve
winstonyin Jan 17, 2024
a889e9f
fix
winstonyin Jan 17, 2024
a44856a
gronwall doc
winstonyin Jan 17, 2024
92df5b9
minor
winstonyin Jan 17, 2024
06d6fa4
move lemma
winstonyin Jan 17, 2024
092bf9f
ext t
winstonyin Jan 20, 2024
e7f4498
_Icc
winstonyin Jan 20, 2024
06050fd
cleanup with suffices
winstonyin Jan 20, 2024
6dc062f
refactor
winstonyin Jan 20, 2024
266b14b
eventually
winstonyin Jan 20, 2024
831d9b3
EventuallyEq version compiles
winstonyin Jan 20, 2024
b4bd4f7
use new theorem
winstonyin Jan 20, 2024
ce92a98
golf a bit
winstonyin Jan 20, 2024
f47dc11
golf some more
winstonyin Jan 20, 2024
6e4fd1a
golf
winstonyin Jan 20, 2024
ba7629c
naming
winstonyin Jan 20, 2024
f29fc5d
naming
winstonyin Jan 20, 2024
98c3c82
shorten hypothesis
winstonyin Jan 20, 2024
fda10a0
100
winstonyin Jan 20, 2024
3c1cc52
simplify assumptions
winstonyin Jan 20, 2024
d1d4fe1
match gronwall
winstonyin Jan 20, 2024
aea843d
minor
winstonyin Jan 20, 2024
e68b3a6
extract abs lemma
winstonyin Jan 23, 2024
2dd5739
rename
winstonyin Jan 23, 2024
bff7ea3
Merge remote-tracking branch 'origin/master' into unique_integral_curve
winstonyin Jan 23, 2024
6bc6460
name
winstonyin Jan 23, 2024
0b0b3d6
fix
winstonyin Jan 23, 2024
bceedaf
collect vars
winstonyin Jan 23, 2024
492f603
fix
winstonyin Jan 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 103 additions & 4 deletions Mathlib/Analysis/ODE/Gronwall.lean
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ a given initial value provided that the RHS is Lipschitz continuous in `x` withi
and we consider only solutions included in `s`.

This version shows uniqueness in a closed interval `Icc a b`, where `a` is the initial time. -/
theorem ODE_solution_unique_of_mem_set {v : ℝ → E → E} {s : ℝ → Set E} {K : ℝ≥0}
theorem ODE_solution_unique_of_mem_set_Icc_right {v : ℝ → E → E} {s : ℝ → Set E} {K : ℝ≥0}
(hv : ∀ t, LipschitzOnWith K (v t) (s t))
{f g : ℝ → E} {a b : ℝ} (hf : ContinuousOn f (Icc a b))
(hf' : ∀ t ∈ Ico a b, HasDerivWithinAt f (v t (f t)) (Ici t) t) (hfs : ∀ t ∈ Ico a b, f t ∈ s t)
Expand All @@ -242,17 +242,116 @@ theorem ODE_solution_unique_of_mem_set {v : ℝ → E → E} {s : ℝ → Set E}
have := dist_le_of_trajectories_ODE_of_mem_set hv hf hf' hfs hg hg' hgs (dist_le_zero.2 ha) t ht
rwa [zero_mul, dist_le_zero] at this
set_option linter.uppercaseLean3 false in
#align ODE_solution_unique_of_mem_set ODE_solution_unique_of_mem_set
#align ODE_solution_unique_of_mem_set ODE_solution_unique_of_mem_set_Icc_right

/-- A time-reversed version of `ODE_solution_unique_of_mem_Icc_right`. Uniqueness is shown in a
closed interval `Icc a b`, where `b` is the "initial" time. -/
theorem ODE_solution_unique_of_mem_set_Icc_left {v : ℝ → E → E} {s : ℝ → Set E} {K : ℝ≥0}
(hv : ∀ t, LipschitzOnWith K (v t) (s t))
{f g : ℝ → E} {a b : ℝ} (hf : ContinuousOn f (Icc a b))
(hf' : ∀ t ∈ Ioc a b, HasDerivWithinAt f (v t (f t)) (Iic t) t) (hfs : ∀ t ∈ Ioc a b, f t ∈ s t)
(hg : ContinuousOn g (Icc a b)) (hg' : ∀ t ∈ Ioc a b, HasDerivWithinAt g (v t (g t)) (Iic t) t)
(hgs : ∀ t ∈ Ioc a b, g t ∈ s t) (hb : f b = g b) : EqOn f g (Icc a b) := by
have hv' t : LipschitzOnWith K (Neg.neg ∘ (v (-t))) (s (-t)) := by
rw [← one_mul K]
exact LipschitzWith.id.neg.comp_lipschitzOnWith (hv _)
have hmt1 : MapsTo Neg.neg (Icc (-b) (-a)) (Icc a b) :=
fun _ ht ↦ ⟨le_neg.mp ht.2, neg_le.mp ht.1⟩
have hmt2 : MapsTo Neg.neg (Ico (-b) (-a)) (Ioc a b) :=
fun _ ht ↦ ⟨lt_neg.mp ht.2, neg_le.mp ht.1⟩
have hmt3 (t : ℝ) : MapsTo Neg.neg (Ici t) (Iic (-t)) :=
fun _ ht' ↦ mem_Iic.mpr <| neg_le_neg ht'
suffices EqOn (f ∘ Neg.neg) (g ∘ Neg.neg) (Icc (-b) (-a)) by
rw [eqOn_comp_right_iff] at this
convert this
simp
apply ODE_solution_unique_of_mem_set_Icc_right hv'
(hf.comp continuousOn_neg hmt1) _ (fun _ ht ↦ hfs _ (hmt2 ht))
(hg.comp continuousOn_neg hmt1) _ (fun _ ht ↦ hgs _ (hmt2 ht)) (by simp [hb])
· intros t ht
convert HasFDerivWithinAt.comp_hasDerivWithinAt t (hf' (-t) (hmt2 ht))
(hasDerivAt_neg t).hasDerivWithinAt (hmt3 t)
simp
· intros t ht
convert HasFDerivWithinAt.comp_hasDerivWithinAt t (hg' (-t) (hmt2 ht))
(hasDerivAt_neg t).hasDerivWithinAt (hmt3 t)
simp

/-- A version of `ODE_solution_unique_of_mem_Icc_right` for uniqueness in a closed interval whose
interior contains the initial time. -/
theorem ODE_solution_unique_of_mem_set_Icc {v : ℝ → E → E} {s : ℝ → Set E} {K : ℝ≥0}
(hv : ∀ t, LipschitzOnWith K (v t) (s t))
{f g : ℝ → E} {a b t₀ : ℝ} (ht : t₀ ∈ Ioo a b) (hf : ContinuousOn f (Icc a b))
(hf' : ∀ t ∈ Ioo a b, HasDerivAt f (v t (f t)) t) (hfs : ∀ t ∈ Ioo a b, f t ∈ s t)
(hg : ContinuousOn g (Icc a b)) (hg' : ∀ t ∈ Ioo a b, HasDerivAt g (v t (g t)) t)
(hgs : ∀ t ∈ Ioo a b, g t ∈ s t) (heq : f t₀ = g t₀) : EqOn f g (Icc a b) := by
rw [← Icc_union_Icc_eq_Icc (le_of_lt ht.1) (le_of_lt ht.2)]
apply EqOn.union
· have hss : Ioc a t₀ ⊆ Ioo a b := Ioc_subset_Ioo_right ht.2
exact ODE_solution_unique_of_mem_set_Icc_left hv
(hf.mono <| Icc_subset_Icc_right <| le_of_lt ht.2)
(fun _ ht' ↦ (hf' _ (hss ht')).hasDerivWithinAt) (fun _ ht' ↦ (hfs _ (hss ht')))
(hg.mono <| Icc_subset_Icc_right <| le_of_lt ht.2)
(fun _ ht' ↦ (hg' _ (hss ht')).hasDerivWithinAt) (fun _ ht' ↦ (hgs _ (hss ht'))) heq
· have hss : Ico t₀ b ⊆ Ioo a b := Ico_subset_Ioo_left ht.1
exact ODE_solution_unique_of_mem_set_Icc_right hv
(hf.mono <| Icc_subset_Icc_left <| le_of_lt ht.1)
(fun _ ht' ↦ (hf' _ (hss ht')).hasDerivWithinAt) (fun _ ht' ↦ (hfs _ (hss ht')))
(hg.mono <| Icc_subset_Icc_left <| le_of_lt ht.1)
(fun _ ht' ↦ (hg' _ (hss ht')).hasDerivWithinAt) (fun _ ht' ↦ (hgs _ (hss ht'))) heq

/-- A version of `ODE_solution_unique_of_mem_set_Icc` for uniqueness in an open interval. -/
theorem ODE_solution_unique_of_mem_set_Ioo {v : ℝ → E → E} {s : ℝ → Set E} {K : ℝ≥0}
(hv : ∀ t, LipschitzOnWith K (v t) (s t))
{f g : ℝ → E} {a b t₀ : ℝ} (ht : t₀ ∈ Ioo a b)
(hf : ∀ t ∈ Ioo a b, HasDerivAt f (v t (f t)) t ∧ f t ∈ s t)
(hg : ∀ t ∈ Ioo a b, HasDerivAt g (v t (g t)) t ∧ g t ∈ s t)
(heq : f t₀ = g t₀) : EqOn f g (Ioo a b) := by
intros t' ht'
rcases lt_or_le t' t₀ with (h | h)
· have hss : Icc t' t₀ ⊆ Ioo a b :=
fun _ ht'' ↦ ⟨lt_of_lt_of_le ht'.1 ht''.1, lt_of_le_of_lt ht''.2 ht.2⟩
exact ODE_solution_unique_of_mem_set_Icc_left hv
(ContinuousAt.continuousOn fun _ ht'' ↦ (hf _ <| hss ht'').1.continuousAt)
(fun _ ht'' ↦ (hf _ <| hss <| Ioc_subset_Icc_self ht'').1.hasDerivWithinAt)
(fun _ ht'' ↦ (hf _ <| hss <| Ioc_subset_Icc_self ht'').2)
(ContinuousAt.continuousOn fun _ ht'' ↦ (hg _ <| hss ht'').1.continuousAt)
(fun _ ht'' ↦ (hg _ <| hss <| Ioc_subset_Icc_self ht'').1.hasDerivWithinAt)
(fun _ ht'' ↦ (hg _ <| hss <| Ioc_subset_Icc_self ht'').2) heq
⟨le_rfl, le_of_lt h⟩
· have hss : Icc t₀ t' ⊆ Ioo a b :=
fun _ ht'' ↦ ⟨lt_of_lt_of_le ht.1 ht''.1, lt_of_le_of_lt ht''.2 ht'.2⟩
exact ODE_solution_unique_of_mem_set_Icc_right hv
(ContinuousAt.continuousOn fun _ ht'' ↦ (hf _ <| hss ht'').1.continuousAt)
(fun _ ht'' ↦ (hf _ <| hss <| Ico_subset_Icc_self ht'').1.hasDerivWithinAt)
(fun _ ht'' ↦ (hf _ <| hss <| Ico_subset_Icc_self ht'').2)
(ContinuousAt.continuousOn fun _ ht'' ↦ (hg _ <| hss ht'').1.continuousAt)
(fun _ ht'' ↦ (hg _ <| hss <| Ico_subset_Icc_self ht'').1.hasDerivWithinAt)
(fun _ ht'' ↦ (hg _ <| hss <| Ico_subset_Icc_self ht'').2) heq
⟨h, le_rfl⟩

/-- Local unqueness of ODE solutions. -/
theorem ODE_solution_unique_of_mem_set_eventually {v : ℝ → E → E} {s : ℝ → Set E} {K : ℝ≥0}
(hv : ∀ t, LipschitzOnWith K (v t) (s t)) {f g : ℝ → E} {t₀ : ℝ}
(hf : ∀ᶠ t in 𝓝 t₀, HasDerivAt f (v t (f t)) t ∧ f t ∈ s t)
(hg : ∀ᶠ t in 𝓝 t₀, HasDerivAt g (v t (g t)) t ∧ g t ∈ s t)
(heq : f t₀ = g t₀) : f =ᶠ[𝓝 t₀] g := by
obtain ⟨ε, hε, h⟩ := eventually_nhds_iff_ball.mp (hf.and hg)
rw [Filter.eventuallyEq_iff_exists_mem]
refine ⟨ball t₀ ε, ball_mem_nhds _ hε, ?_⟩
simp_rw [Real.ball_eq_Ioo] at *
apply ODE_solution_unique_of_mem_set_Ioo hv (Real.ball_eq_Ioo t₀ ε ▸ mem_ball_self hε)
(fun _ ht ↦ (h _ ht).1) (fun _ ht ↦ (h _ ht).2) heq

/-- There exists only one solution of an ODE \(\dot x=v(t, x)\) with
a given initial value provided that RHS is Lipschitz continuous in `x`. -/
a given initial value provided that the RHS is Lipschitz continuous in `x`. -/
theorem ODE_solution_unique {v : ℝ → E → E} {K : ℝ≥0} (hv : ∀ t, LipschitzWith K (v t))
{f g : ℝ → E} {a b : ℝ} (hf : ContinuousOn f (Icc a b))
(hf' : ∀ t ∈ Ico a b, HasDerivWithinAt f (v t (f t)) (Ici t) t) (hg : ContinuousOn g (Icc a b))
(hg' : ∀ t ∈ Ico a b, HasDerivWithinAt g (v t (g t)) (Ici t) t) (ha : f a = g a) :
EqOn f g (Icc a b) :=
have hfs : ∀ t ∈ Ico a b, f t ∈ @univ E := fun _ _ => trivial
ODE_solution_unique_of_mem_set (fun t => (hv t).lipschitzOnWith _) hf hf' hfs hg hg'
ODE_solution_unique_of_mem_set_Icc_right (fun t => (hv t).lipschitzOnWith _) hf hf' hfs hg hg'
(fun _ _ => trivial) ha
set_option linter.uppercaseLean3 false in
#align ODE_solution_unique ODE_solution_unique
Loading
Loading