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

Commit 59629da

Browse files
urkudmergify[bot]
andauthored
chore(*): rename filter.inhabited_of_mem_sets to nonempty_of_mem_sets (#1943)
In other names `inhabited` means that we have a `default` element. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent a342132 commit 59629da

File tree

11 files changed

+24
-24
lines changed

11 files changed

+24
-24
lines changed

src/analysis/calculus/mean_value.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ begin
9696
change f x ≤ B x at hxB,
9797
cases lt_or_eq_of_le hxB with hxB hxB,
9898
{ -- If `f x < B x`, then all we need is continuity of both sides
99-
apply inhabited_of_mem_sets (nhds_within_Ioi_self_ne_bot x),
99+
apply nonempty_of_mem_sets (nhds_within_Ioi_self_ne_bot x),
100100
refine inter_mem_sets _ (Ioc_mem_nhds_within_Ioi ⟨le_refl x, hy⟩),
101101
have : ∀ᶠ x in nhds_within x (Icc a b), f x < B x,
102102
from A x (Ico_subset_Icc_self xab)

src/order/filter/bases.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ lemma has_basis.forall_nonempty_iff_ne_bot (hl : l.has_basis p s) :
6969
(∀ {i}, p i → (s i).nonempty) ↔ l ≠ ⊥ :=
7070
⟨λ H, forall_sets_nonempty_iff_ne_bot.1 $
7171
λ s hs, let ⟨i, hi, his⟩ := (hl s).1 hs in (H hi).mono his,
72-
λ H i hi, inhabited_of_mem_sets H (hl.mem_of_mem hi)⟩
72+
λ H i hi, nonempty_of_mem_sets H (hl.mem_of_mem hi)⟩
7373

7474
lemma basis_sets (l : filter α) : l.has_basis (λ s : set α, s ∈ l) id :=
7575
λ t, exists_sets_subset_iff.symm

src/order/filter/basic.lean

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ lemma empty_in_sets_eq_bot {f : filter α} : ∅ ∈ f ↔ f = ⊥ :=
392392
⟨assume h, bot_unique $ assume s _, mem_sets_of_superset h (empty_subset s),
393393
assume : f = ⊥, this.symm ▸ mem_bot_sets⟩
394394

395-
lemma inhabited_of_mem_sets {f : filter α} {s : set α} (hf : f ≠ ⊥) (hs : s ∈ f) :
395+
lemma nonempty_of_mem_sets {f : filter α} {s : set α} (hf : f ≠ ⊥) (hs : s ∈ f) :
396396
s.nonempty :=
397397
have ∅ ∉ f, from assume h, hf $ empty_in_sets_eq_bot.mp h,
398398
have s ≠ ∅, from assume h, this (h ▸ hs),
@@ -1054,15 +1054,15 @@ forall_sets_ne_empty_iff_ne_bot.mp $ assume s ⟨t, ht, t_s⟩,
10541054
lemma comap_ne_bot_of_range_mem {f : filter β} {m : α → β}
10551055
(hf : f ≠ ⊥) (hm : range m ∈ f) : comap m f ≠ ⊥ :=
10561056
comap_ne_bot $ assume t ht,
1057-
let ⟨_, ha, a, rfl⟩ := inhabited_of_mem_sets hf (inter_mem_sets ht hm)
1057+
let ⟨_, ha, a, rfl⟩ := nonempty_of_mem_sets hf (inter_mem_sets ht hm)
10581058
in ⟨a, ha⟩
10591059

10601060
lemma comap_inf_principal_ne_bot_of_image_mem {f : filter β} {m : α → β}
10611061
(hf : f ≠ ⊥) {s : set α} (hs : m '' s ∈ f) : (comap m f ⊓ principal s) ≠ ⊥ :=
10621062
begin
10631063
refine compl_compl s ▸ mt mem_sets_of_eq_bot _,
10641064
rintros ⟨t, ht, hts⟩,
1065-
rcases inhabited_of_mem_sets hf (inter_mem_sets hs ht) with ⟨_, ⟨x, hxs, rfl⟩, hxt⟩,
1065+
rcases nonempty_of_mem_sets hf (inter_mem_sets hs ht) with ⟨_, ⟨x, hxs, rfl⟩, hxt⟩,
10661066
exact absurd hxs (hts hxt)
10671067
end
10681068

@@ -1999,7 +1999,7 @@ lemma exists_ultrafilter (h : f ≠ ⊥) : ∃u, u ≤ f ∧ is_ultrafilter u :=
19991999
let
20002000
τ := {f' // f' ≠ ⊥ ∧ f' ≤ f},
20012001
r : τ → τ → Prop := λt₁ t₂, t₂.val ≤ t₁.val,
2002-
⟨a, ha⟩ := inhabited_of_mem_sets h univ_mem_sets,
2002+
⟨a, ha⟩ := nonempty_of_mem_sets h univ_mem_sets,
20032003
top : τ := ⟨f, h, le_refl f⟩,
20042004
sup : Π(c:set τ), chain r c → τ :=
20052005
λc hc, ⟨⨅a:{a:τ // a ∈ insert top c}, a.val.val,

src/order/liminf_limsup.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ lemma is_cobounded_of_is_bounded [is_trans α r] (hf : f ≠ ⊥) :
109109
f.is_bounded r → f.is_cobounded (flip r)
110110
| ⟨a, ha⟩ := ⟨a, assume b hb,
111111
have ∀ᶠ x in f, r x a ∧ r b x, from ha.and hb,
112-
let ⟨x, rxa, rbx⟩ := inhabited_of_mem_sets hf this in
112+
let ⟨x, rxa, rbx⟩ := nonempty_of_mem_sets hf this in
113113
show r b a, from trans rbx rxa⟩
114114

115115
lemma is_cobounded_bot : is_cobounded r ⊥ ↔ (∃b, ∀x, r b x) :=
@@ -190,7 +190,7 @@ theorem Liminf_le_Limsup {f : filter α}
190190
(hf : f ≠ ⊥) (h₁ : f.is_bounded (≤)) (h₂ : f.is_bounded (≥)) : f.Liminf ≤ f.Limsup :=
191191
Liminf_le_of_le h₂ $ assume a₀ ha₀, le_Limsup_of_le h₁ $ assume a₁ ha₁, show a₀ ≤ a₁, from
192192
have ∀ᶠ b in f, a₀ ≤ b ∧ b ≤ a₁, from ha₀.and ha₁,
193-
let ⟨b, hb₀, hb₁⟩ := inhabited_of_mem_sets hf this in
193+
let ⟨b, hb₀, hb₁⟩ := nonempty_of_mem_sets hf this in
194194
le_trans hb₀ hb₁
195195

196196
lemma Liminf_le_Liminf {f g : filter α}

src/topology/algebra/ordered.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ lemma is_lub_of_mem_nhds {s : set α} {a : α} {f : filter α}
890890
not_lt.1 $ assume hba,
891891
have s ∩ {a | b < a} ∈ f ⊓ 𝓝 a,
892892
from inter_mem_inf_sets hsf (mem_nhds_sets (is_open_lt' _) hba),
893-
let ⟨x, ⟨hxs, hxb⟩⟩ := inhabited_of_mem_sets hfa this in
893+
let ⟨x, ⟨hxs, hxb⟩⟩ := nonempty_of_mem_sets hfa this in
894894
have b < b, from lt_of_lt_of_le hxb $ hb hxs,
895895
lt_irrefl b this
896896

@@ -917,7 +917,7 @@ have ∀a'∈s, ¬ b < f a',
917917
have {x | a' < x} ∩ t₁ ∈ 𝓝 a, from inter_mem_sets this ht₁,
918918
have ({x | a' < x} ∩ t₁) ∩ s ∈ 𝓝 a ⊓ principal s,
919919
from inter_mem_inf_sets this (subset.refl s),
920-
let ⟨x, ⟨hx₁, hx₂⟩, hx₃⟩ := inhabited_of_mem_sets hnbot this in
920+
let ⟨x, ⟨hx₁, hx₂⟩, hx₃⟩ := nonempty_of_mem_sets hnbot this in
921921
have hxa' : f x < f a', from hs ⟨hx₂, ht₂ hx₃⟩,
922922
have ha'x : f a' ≤ f x, from hf _ ha' _ hx₃ $ le_of_lt hx₁,
923923
lt_irrefl _ (lt_of_le_of_lt ha'x hxa')),
@@ -1264,7 +1264,7 @@ begin
12641264
rintros x ⟨hxs, hxab⟩ y hyxb,
12651265
have : s ∩ Ioc x y ∈ nhds_within x (Ioi x),
12661266
from inter_mem_sets (hgt x ⟨hxs, hxab⟩) (Ioc_mem_nhds_within_Ioi ⟨le_refl _, hyxb⟩),
1267-
exact inhabited_of_mem_sets (nhds_within_Ioi_self_ne_bot' hxab.2) this
1267+
exact nonempty_of_mem_sets (nhds_within_Ioi_self_ne_bot' hxab.2) this
12681268
end
12691269

12701270
/-- A closed interval is connected. -/

src/topology/dense_embedding.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ forall_sets_ne_empty_iff_ne_bot.mp $
156156
assume s ⟨t, ht, (hs : i ⁻¹' t ⊆ s)⟩,
157157
have t ∩ range i ∈ 𝓝 b ⊓ principal (range i),
158158
from inter_mem_inf_sets ht (subset.refl _),
159-
let ⟨_, ⟨hx₁, y, rfl⟩⟩ := inhabited_of_mem_sets di.nhds_inf_ne_bot this in
159+
let ⟨_, ⟨hx₁, y, rfl⟩⟩ := nonempty_of_mem_sets di.nhds_inf_ne_bot this in
160160
subset_ne_empty hs $ ne_empty_of_mem hx₁
161161

162162
variables [topological_space γ]

src/topology/metric_space/basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1131,7 +1131,7 @@ instance complete_of_proper [proper_space α] : complete_space α :=
11311131
ball (therefore compact by properness) where it is nontrivial. -/
11321132
have A : ∃ t ∈ f, ∀ x y ∈ t, dist x y < 1 := (metric.cauchy_iff.1 hf).2 1 zero_lt_one,
11331133
rcases A with ⟨t, ⟨t_fset, ht⟩⟩,
1134-
rcases inhabited_of_mem_sets hf.1 t_fset with ⟨x, xt⟩,
1134+
rcases nonempty_of_mem_sets hf.1 t_fset with ⟨x, xt⟩,
11351135
have : t ⊆ closed_ball x 1 := by intros y yt; simp [dist_comm]; apply le_of_lt (ht x y xt yt),
11361136
have : closed_ball x 1 ∈ f := f.sets_of_superset t_fset this,
11371137
rcases (compact_iff_totally_bounded_complete.1 (proper_space.compact_ball x 1)).2 f hf (le_principal_iff.2 this)

src/topology/order.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ have comap f (𝓝 (f a) ⊓ principal (f '' s)) ≠ ⊥ ↔ 𝓝 (f a) ⊓ prin
551551
from mem_inf_sets_of_right $ by simp [subset.refl],
552552
have s₂ ∩ f '' s ∈ 𝓝 (f a) ⊓ principal (f '' s),
553553
from inter_mem_sets hs₂ this,
554-
let ⟨b, hb₁, ⟨a, ha, ha₂⟩⟩ := inhabited_of_mem_sets h this in
554+
let ⟨b, hb₁, ⟨a, ha, ha₂⟩⟩ := nonempty_of_mem_sets h this in
555555
ne_empty_of_mem $ hs $ by rwa [←ha₂] at hb₁⟩,
556556
calc a ∈ @closure α (topological_space.induced f t) s
557557
↔ (@nhds α (topological_space.induced f t) a) ⊓ principal s ≠ ⊥ : by rw [closure_eq_nhds]; refl

src/topology/uniform_space/cauchy.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ lemma totally_bounded_iff_filter {s : set α} :
302302
in
303303
have c ≤ principal s, from le_trans ‹c ≤ f› this,
304304
have m ∩ s ∈ c.sets, from inter_mem_sets hm $ le_principal_iff.mp this,
305-
let ⟨y, hym, hys⟩ := inhabited_of_mem_sets hc₂.left this in
305+
let ⟨y, hym, hys⟩ := nonempty_of_mem_sets hc₂.left this in
306306
let ys := (⋃y'∈({y}:set α), {x | (x, y') ∈ d}) in
307307
have m ⊆ ys,
308308
from assume y' hy',
@@ -394,10 +394,10 @@ end
394394
/-- A sequence of points such that `seq n ∈ set_seq n`. Here `set_seq` is a monotonically
395395
decreasing sequence of sets `set_seq n ∈ f` with diameters controlled by a given sequence
396396
of entourages. -/
397-
def seq (n : ℕ) : α := some $ inhabited_of_mem_sets hf.1 (set_seq_mem hf U_mem n)
397+
def seq (n : ℕ) : α := some $ nonempty_of_mem_sets hf.1 (set_seq_mem hf U_mem n)
398398

399399
lemma seq_mem (n : ℕ) : seq hf U_mem n ∈ set_seq hf U_mem n :=
400-
some_spec $ inhabited_of_mem_sets hf.1 (set_seq_mem hf U_mem n)
400+
some_spec $ nonempty_of_mem_sets hf.1 (set_seq_mem hf U_mem n)
401401

402402
lemma seq_pair_mem ⦃N m n : ℕ⦄ (hm : N ≤ m) (hn : N ≤ n) :
403403
(seq hf U_mem m, seq hf U_mem n) ∈ U N :=

src/topology/uniform_space/completion.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ let ⟨t₃, (ht₃ : t₃ ∈ h.val), t₄, (ht₄ : t₄ ∈ g.val), (h₂ : s
9292
have t₂ ∩ t₃ ∈ h.val,
9393
from inter_mem_sets ht₂ ht₃,
9494
let ⟨x, xt₂, xt₃⟩ :=
95-
inhabited_of_mem_sets (h.property.left) this in
95+
nonempty_of_mem_sets (h.property.left) this in
9696
(filter.prod f.val g.val).sets_of_superset
9797
(prod_mem_prod ht₁ ht₄)
9898
(assume ⟨a, b⟩ ⟨(ha : a ∈ t₁), (hb : b ∈ t₄)⟩,
@@ -162,7 +162,7 @@ have h_ex : ∀ s ∈ 𝓤 (Cauchy α), ∃y:α, (f, pure_cauchy y) ∈ s, from
162162
have t' ∈ filter.prod (f.val) (f.val),
163163
from f.property.right ht'₁,
164164
let ⟨t, ht, (h : set.prod t t ⊆ t')⟩ := mem_prod_same_iff.mp this in
165-
let ⟨x, (hx : x ∈ t)⟩ := inhabited_of_mem_sets f.property.left ht in
165+
let ⟨x, (hx : x ∈ t)⟩ := nonempty_of_mem_sets f.property.left ht in
166166
have t'' ∈ filter.prod f.val (pure x),
167167
from mem_prod_iff.mpr ⟨t, ht, {y:α | (x, y) ∈ t'},
168168
h $ mk_mem_prod hx hx,

0 commit comments

Comments
 (0)