Skip to content

Commit 0aeb8ea

Browse files
committed
feat(Topology/Order): Remove hypothesis in extendFrom lemmas (leanprover-community#36627)
Remove a hypothesis in some extendFrom lemmas by using cases. Co-authored-by: NoahW314 <noahwalker3.14@gmail.com>
1 parent f349f79 commit 0aeb8ea

2 files changed

Lines changed: 16 additions & 9 deletions

File tree

Mathlib/Topology/Order/ExtendFrom.lean

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ section RegularSpace
2424
variable [RegularSpace β]
2525

2626
theorem continuousOn_Icc_extendFrom_Ioo
27-
(hab : a ≠ b) (hf : ContinuousOn f (Ioo a b)) (ha : Tendsto f (𝓝[>] a) (𝓝 la))
27+
(hf : ContinuousOn f (Ioo a b)) (ha : Tendsto f (𝓝[>] a) (𝓝 la))
2828
(hb : Tendsto f (𝓝[<] b) (𝓝 lb)) : ContinuousOn (extendFrom (Ioo a b) f) (Icc a b) := by
29+
by_cases! hab : a = b
30+
· simp [hab]
2931
apply continuousOn_extendFrom
3032
· rw [closure_Ioo hab]
3133
· intro x x_in
@@ -35,20 +37,24 @@ theorem continuousOn_Icc_extendFrom_Ioo
3537
· exact ⟨f x, hf x h⟩
3638

3739
theorem continuousOn_uIcc_extendFrom_uIoo
38-
(hab : a ≠ b) (hf : ContinuousOn f (uIoo a b))
40+
(hf : ContinuousOn f (uIoo a b))
3941
(ha : Tendsto f (𝓝[uIoo a b] a) (𝓝 la)) (hb : Tendsto f (𝓝[uIoo a b] b) (𝓝 lb)) :
4042
ContinuousOn (extendFrom (uIoo a b) f) (uIcc a b) := by
43+
by_cases! hab : a = b
44+
· simp [hab]
4145
obtain hab' | hba' := hab.lt_or_gt
4246
· simp only [hab', uIoo_of_lt, nhdsWithin_Ioo_eq_nhdsGT, nhdsWithin_Ioo_eq_nhdsLT,
4347
uIcc_of_lt] at ha hb hf ⊢
44-
exact continuousOn_Icc_extendFrom_Ioo hab hf ha hb
48+
exact continuousOn_Icc_extendFrom_Ioo hf ha hb
4549
· simp only [hba', uIoo_of_gt, nhdsWithin_Ioo_eq_nhdsGT, nhdsWithin_Ioo_eq_nhdsLT,
4650
uIcc_of_gt] at ha hb hf ⊢
47-
exact continuousOn_Icc_extendFrom_Ioo hab.symm hf hb ha
51+
exact continuousOn_Icc_extendFrom_Ioo hf hb ha
4852

4953
theorem continuousOn_Ico_extendFrom_Ioo
50-
(hab : a < b) (hf : ContinuousOn f (Ioo a b)) (ha : Tendsto f (𝓝[>] a) (𝓝 la)) :
54+
(hf : ContinuousOn f (Ioo a b)) (ha : Tendsto f (𝓝[>] a) (𝓝 la)) :
5155
ContinuousOn (extendFrom (Ioo a b) f) (Ico a b) := by
56+
by_cases! hab : a ≥ b
57+
· simp [hab]
5258
apply continuousOn_extendFrom
5359
· rw [closure_Ioo hab.ne]
5460
exact Ico_subset_Icc_self
@@ -59,9 +65,10 @@ theorem continuousOn_Ico_extendFrom_Ioo
5965
· exact ⟨f x, hf x h⟩
6066

6167
theorem continuousOn_Ioc_extendFrom_Ioo
62-
(hab : a < b) (hf : ContinuousOn f (Ioo a b)) (hb : Tendsto f (𝓝[<] b) (𝓝 lb)) :
68+
(hf : ContinuousOn f (Ioo a b)) (hb : Tendsto f (𝓝[<] b) (𝓝 lb)) :
6369
ContinuousOn (extendFrom (Ioo a b) f) (Ioc a b) := by
64-
have := continuousOn_Ico_extendFrom_Ioo (f := f ∘ OrderDual.ofDual) (la := lb) hab.dual
70+
have := continuousOn_Ico_extendFrom_Ioo (f := f ∘ OrderDual.ofDual) (a := OrderDual.toDual b)
71+
(b := OrderDual.toDual a) (la := lb)
6572
rw [Ico_toDual, Ioi_toDual, Ioo_toDual] at this
6673
exact this hf hb
6774

Mathlib/Topology/Order/Rolle.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ lemma exists_isExtrOn_Ioo_of_tendsto (hab : a < b) (hfc : ContinuousOn f (Ioo a
7070
∃ c ∈ Ioo a b, IsExtrOn f (Ioo a b) c := by
7171
have h : EqOn (extendFrom (Ioo a b) f) f (Ioo a b) := extendFrom_extends hfc
7272
obtain ⟨c, hc, hfc⟩ : ∃ c ∈ Ioo a b, IsExtrOn (extendFrom (Ioo a b) f) (Icc a b) c :=
73-
exists_Ioo_extr_on_Icc hab (continuousOn_Icc_extendFrom_Ioo hab.ne hfc ha hb)
73+
exists_Ioo_extr_on_Icc hab (continuousOn_Icc_extendFrom_Ioo hfc ha hb)
7474
((eq_lim_at_left_extendFrom_Ioo hab ha).trans (eq_lim_at_right_extendFrom_Ioo hab hb).symm)
7575
exact ⟨c, hc, (hfc.on_subset Ioo_subset_Icc_self).congr h (h hc)⟩
7676

@@ -104,7 +104,7 @@ lemma exists_isExtrOn_uIoo_of_tendsto (hab : a ≠ b) (hfc : ContinuousOn f (uIo
104104
∃ c ∈ uIoo a b, IsExtrOn f (uIoo a b) c := by
105105
have h : EqOn (extendFrom (uIoo a b) f) f (uIoo a b) := extendFrom_extends hfc
106106
obtain ⟨c, hc, hfc⟩ : ∃ c ∈ uIoo a b, IsExtrOn (extendFrom (uIoo a b) f) (uIcc a b) c :=
107-
exists_uIoo_isExtrOn_uIcc hab (continuousOn_uIcc_extendFrom_uIoo hab hfc ha hb)
107+
exists_uIoo_isExtrOn_uIcc hab (continuousOn_uIcc_extendFrom_uIoo hfc ha hb)
108108
((eq_lim_at_left_extendFrom_uIoo hab ha).trans (eq_lim_at_right_extendFrom_uIoo hab hb).symm)
109109
exact ⟨c, hc, (hfc.on_subset uIoo_subset_uIcc_self).congr h (h hc)⟩
110110

0 commit comments

Comments
 (0)