Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 6a68f86

Browse files
committed
chore(topology/algebra/order/basic): deduplicate (#16287)
Primed and non-primed versions of 2 lemmas were almost defeq. Merge them.
1 parent 386acba commit 6a68f86

File tree

2 files changed

+7
-35
lines changed

2 files changed

+7
-35
lines changed

src/analysis/calculus/extend_deriv.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ begin
131131
have : has_deriv_within_at f e (Icc a b) a,
132132
{ rw [has_deriv_within_at_iff_has_fderiv_within_at, ← t_closure],
133133
exact has_fderiv_at_boundary_of_tendsto_fderiv t_diff t_conv t_open t_cont t_diff' },
134-
exact this.nhds_within (mem_nhds_within_Ici_iff_exists_Icc_subset.2 ⟨b, ab, subset.refl _⟩)
134+
exact this.nhds_within (Icc_mem_nhds_within_Ici $ left_mem_Ico.2 ab)
135135
end
136136

137137
/-- If a function is differentiable on the left of a point `a : ℝ`, continuous at `a`, and
@@ -170,7 +170,7 @@ begin
170170
have : has_deriv_within_at f e (Icc b a) a,
171171
{ rw [has_deriv_within_at_iff_has_fderiv_within_at, ← t_closure],
172172
exact has_fderiv_at_boundary_of_tendsto_fderiv t_diff t_conv t_open t_cont t_diff' },
173-
exact this.nhds_within (mem_nhds_within_Iic_iff_exists_Icc_subset.2 ⟨b, ba, subset.refl _⟩)
173+
exact this.nhds_within (Icc_mem_nhds_within_Iic $ right_mem_Ioc.2 ba)
174174
end
175175

176176
/-- If a real function `f` has a derivative `g` everywhere but at a point, and `f` and `g` are

src/topology/algebra/order/basic.lean

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,8 +1527,8 @@ let ⟨u', hu'⟩ := exists_gt a in mem_nhds_within_Ici_iff_exists_Ico_subset' h
15271527

15281528
/-- A set is a neighborhood of `a` within `[a, +∞)` if and only if it contains an interval `[a, u]`
15291529
with `a < u`. -/
1530-
lemma mem_nhds_within_Ici_iff_exists_Icc_subset' [no_max_order α] [densely_ordered α]
1531-
{a : α} {s : set α} : s ∈ 𝓝[≥] a ↔ ∃u ∈ Ioi a, Icc a u ⊆ s :=
1530+
lemma mem_nhds_within_Ici_iff_exists_Icc_subset [no_max_order α] [densely_ordered α]
1531+
{a : α} {s : set α} : s ∈ 𝓝[≥] a ↔ ∃ u, a < u ∧ Icc a u ⊆ s :=
15321532
begin
15331533
rw mem_nhds_within_Ici_iff_exists_Ico_subset,
15341534
split,
@@ -1573,42 +1573,14 @@ let ⟨l', hl'⟩ := exists_lt a in mem_nhds_within_Iic_iff_exists_Ioc_subset' h
15731573

15741574
/-- A set is a neighborhood of `a` within `(-∞, a]` if and only if it contains an interval `[l, a]`
15751575
with `l < a`. -/
1576-
lemma mem_nhds_within_Iic_iff_exists_Icc_subset' [no_min_order α] [densely_ordered α]
1577-
{a : α} {s : set α} : s ∈ 𝓝[≤] a ↔ ∃l ∈ Iio a, Icc l a ⊆ s :=
1576+
lemma mem_nhds_within_Iic_iff_exists_Icc_subset [no_min_order α] [densely_ordered α]
1577+
{a : α} {s : set α} : s ∈ 𝓝[≤] a ↔ ∃ l, l < a ∧ Icc l a ⊆ s :=
15781578
begin
1579-
convert @mem_nhds_within_Ici_iff_exists_Icc_subset' αᵒᵈ _ _ _ _ _ _ _,
1579+
convert @mem_nhds_within_Ici_iff_exists_Icc_subset αᵒᵈ _ _ _ _ _ _ _,
15801580
simp_rw (show ∀ u : αᵒᵈ, @Icc αᵒᵈ _ a u = @Icc α _ u a, from λ u, dual_Icc),
15811581
refl,
15821582
end
15831583

1584-
/-- A set is a neighborhood of `a` within `[a, +∞)` if and only if it contains an interval `[a, u]`
1585-
with `a < u`. -/
1586-
lemma mem_nhds_within_Ici_iff_exists_Icc_subset [no_max_order α] [densely_ordered α]
1587-
{a : α} {s : set α} : s ∈ 𝓝[≥] a ↔ ∃u, a < u ∧ Icc a u ⊆ s :=
1588-
begin
1589-
rw mem_nhds_within_Ici_iff_exists_Ico_subset,
1590-
split,
1591-
{ rintros ⟨u, au, as⟩,
1592-
rcases exists_between au with ⟨v, hv⟩,
1593-
exact ⟨v, hv.1, λx hx, as ⟨hx.1, lt_of_le_of_lt hx.2 hv.2⟩⟩ },
1594-
{ rintros ⟨u, au, as⟩,
1595-
exact ⟨u, au, subset.trans Ico_subset_Icc_self as⟩ }
1596-
end
1597-
1598-
/-- A set is a neighborhood of `a` within `(-∞, a]` if and only if it contains an interval `[l, a]`
1599-
with `l < a`. -/
1600-
lemma mem_nhds_within_Iic_iff_exists_Icc_subset [no_min_order α] [densely_ordered α]
1601-
{a : α} {s : set α} : s ∈ 𝓝[≤] a ↔ ∃l, l < a ∧ Icc l a ⊆ s :=
1602-
begin
1603-
rw mem_nhds_within_Iic_iff_exists_Ioc_subset,
1604-
split,
1605-
{ rintros ⟨l, la, as⟩,
1606-
rcases exists_between la with ⟨v, hv⟩,
1607-
refine ⟨v, hv.2, λx hx, as ⟨lt_of_lt_of_le hv.1 hx.1, hx.2⟩⟩, },
1608-
{ rintros ⟨l, la, as⟩,
1609-
exact ⟨l, la, subset.trans Ioc_subset_Icc_self as⟩ }
1610-
end
1611-
16121584
end order_topology
16131585

16141586
end linear_order

0 commit comments

Comments
 (0)