Skip to content

Commit aa30cf9

Browse files
committed
chore(Order): remove almost all autoImplicit (#14304)
In two files, only reduce the scope of it; the other occurrences seem harder to remove.
1 parent 0b88a97 commit aa30cf9

12 files changed

Lines changed: 69 additions & 89 deletions

File tree

Mathlib/Order/Atoms.lean

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ which are lattices with only two elements, and related ideas.
4949
5050
-/
5151

52-
set_option autoImplicit true
53-
54-
55-
variable {α β : Type*}
52+
variable {ι : Sort*} {α β : Type*}
5653

5754
section Atoms
5855

@@ -114,7 +111,7 @@ alias ⟨CovBy.is_atom, IsAtom.bot_covBy⟩ := bot_covBy_iff
114111

115112
end PartialOrder
116113

117-
theorem atom_le_iSup [Order.Frame α] (ha : IsAtom a) {f : ι → α} :
114+
theorem atom_le_iSup [Order.Frame α] {a : α} (ha : IsAtom a) {f : ι → α} :
118115
a ≤ iSup f ↔ ∃ i, a ≤ f i := by
119116
refine ⟨?_, fun ⟨i, hi⟩ => le_trans hi (le_iSup _ _)⟩
120117
show (a ≤ ⨆ i, f i) → _
@@ -204,7 +201,7 @@ alias ⟨CovBy.isCoatom, IsCoatom.covBy_top⟩ := covBy_top_iff
204201

205202
end PartialOrder
206203

207-
theorem iInf_le_coatom [Order.Coframe α] (ha : IsCoatom a) {f : ι → α} :
204+
theorem iInf_le_coatom [Order.Coframe α] {a : α} (ha : IsCoatom a) {f : ι → α} :
208205
iInf f ≤ a ↔ ∃ i, f i ≤ a :=
209206
atom_le_iSup (α := αᵒᵈ) ha
210207

@@ -1003,7 +1000,8 @@ end «Prop»
10031000

10041001
namespace Pi
10051002

1006-
variable {π : ι → Type u}
1003+
universe u
1004+
variable {ι : Type*} {π : ι → Type u}
10071005

10081006
protected theorem eq_bot_iff [∀ i, Bot (π i)] {f : ∀ i, π i} : f = ⊥ ↔ ∀ i, f i = ⊥ :=
10091007
⟨(· ▸ by simp), fun h => funext fun i => by simp [h]⟩
@@ -1037,8 +1035,8 @@ theorem isAtom_iff {f : ∀ i, π i} [∀ i, PartialOrder (π i)] [∀ i, OrderB
10371035
simpa using this (fun k => by by_cases h : k = j; { subst h; simp }; simp [h]) i
10381036
(by rwa [Function.update_noteq (Ne.symm hj), bot_apply, bot_lt_iff_ne_bot]) j
10391037

1040-
theorem isAtom_single [DecidableEq ι] [∀ i, PartialOrder (π i)] [∀ i, OrderBot (π i)] {a : π i}
1041-
(h : IsAtom a) : IsAtom (Function.update (⊥ : ∀ i, π i) i a) :=
1038+
theorem isAtom_single {i : ι} [DecidableEq ι] [∀ i, PartialOrder (π i)] [∀ i, OrderBot (π i)]
1039+
{a : π i} (h : IsAtom a) : IsAtom (Function.update (⊥ : ∀ i, π i) i a) :=
10421040
isAtom_iff.2 ⟨i, by simpa, fun j hji => Function.update_noteq hji _ _⟩
10431041

10441042
theorem isAtom_iff_eq_single [DecidableEq ι] [∀ i, PartialOrder (π i)]

Mathlib/Order/Bounds/OrderIso.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ import Mathlib.Order.Hom.Set
1212
# Order isomorphisms and bounds.
1313
-/
1414

15-
set_option autoImplicit true
16-
1715
open Set
1816

1917
namespace OrderIso
2018

21-
variable [Preorder α] [Preorder β] (f : α ≃o β)
19+
variable {α β : Type*} [Preorder α] [Preorder β] (f : α ≃o β)
2220

2321
theorem upperBounds_image {s : Set α} : upperBounds (f '' s) = f '' upperBounds s :=
2422
Subset.antisymm

Mathlib/Order/CompleteBooleanAlgebra.lean

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,9 @@ distributive lattice.
5050
* [Francis Borceux, *Handbook of Categorical Algebra III*][borceux-vol3]
5151
-/
5252

53-
set_option autoImplicit true
54-
55-
5653
open Function Set
5754

58-
universe u v w
55+
universe u v w w'
5956

6057
variable {α : Type u} {β : Type v} {ι : Sort w} {κ : ι → Sort w'}
6158

Mathlib/Order/Filter/AtTopBot.lean

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ In this file we define the filters
2828
Then we prove many lemmas like “if `f → +∞`, then `f ± c → +∞`”.
2929
-/
3030

31-
set_option autoImplicit true
32-
3331
variable {ι ι' α β γ : Type*}
3432

3533
open Set
@@ -263,12 +261,12 @@ theorem eventually_forall_le_atBot [Preorder α] {p : α → Prop} :
263261
(∀ᶠ x in atBot, ∀ y, y ≤ x → p y) ↔ ∀ᶠ x in atBot, p x :=
264262
eventually_forall_ge_atTop (α := αᵒᵈ)
265263

266-
theorem Tendsto.eventually_forall_ge_atTop {α β : Type*} [Preorder β] {l : Filter α}
264+
theorem Tendsto.eventually_forall_ge_atTop [Preorder β] {l : Filter α}
267265
{p : β → Prop} {f : α → β} (hf : Tendsto f l atTop) (h_evtl : ∀ᶠ x in atTop, p x) :
268266
∀ᶠ x in l, ∀ y, f x ≤ y → p y := by
269267
rw [← Filter.eventually_forall_ge_atTop] at h_evtl; exact (h_evtl.comap f).filter_mono hf.le_comap
270268

271-
theorem Tendsto.eventually_forall_le_atBot {α β : Type*} [Preorder β] {l : Filter α}
269+
theorem Tendsto.eventually_forall_le_atBot [Preorder β] {l : Filter α}
272270
{p : β → Prop} {f : α → β} (hf : Tendsto f l atBot) (h_evtl : ∀ᶠ x in atBot, p x) :
273271
∀ᶠ x in l, ∀ y, y ≤ f x → p y := by
274272
rw [← Filter.eventually_forall_le_atBot] at h_evtl; exact (h_evtl.comap f).filter_mono hf.le_comap
@@ -651,7 +649,7 @@ theorem frequently_low_scores [LinearOrder β] [NoMinOrder β] {u : ℕ → β}
651649
@frequently_high_scores βᵒᵈ _ _ _ hu
652650
#align filter.frequently_low_scores Filter.frequently_low_scores
653651

654-
theorem strictMono_subseq_of_tendsto_atTop {β : Type*} [LinearOrder β] [NoMaxOrder β] {u : ℕ → β}
652+
theorem strictMono_subseq_of_tendsto_atTop [LinearOrder β] [NoMaxOrder β] {u : ℕ → β}
655653
(hu : Tendsto u atTop atTop) : ∃ φ : ℕ → ℕ, StrictMono φ ∧ StrictMono (u ∘ φ) :=
656654
let ⟨φ, h, h'⟩ := extraction_of_frequently_atTop (frequently_high_scores hu)
657655
⟨φ, h, fun _ m hnm => h' m _ (h hnm)⟩
@@ -1545,9 +1543,9 @@ theorem prod_atTop_atTop_eq [Preorder α] [Preorder β] :
15451543
#align filter.prod_at_top_at_top_eq Filter.prod_atTop_atTop_eq
15461544

15471545
-- Porting note: generalized from `SemilatticeSup` to `Preorder`
1548-
theorem prod_atBot_atBot_eq [Preorder β₁] [Preorder β] :
1549-
(atBot : Filter β₁) ×ˢ (atBot : Filter β) = (atBot : Filter (β₁ × β)) :=
1550-
@prod_atTop_atTop_eq β₁ᵒᵈ β₂ᵒᵈ _ _
1546+
theorem prod_atBot_atBot_eq [Preorder α] [Preorder β] :
1547+
(atBot : Filter α) ×ˢ (atBot : Filter β) = (atBot : Filter (α × β)) :=
1548+
@prod_atTop_atTop_eq αᵒᵈ βᵒᵈ _ _
15511549
#align filter.prod_at_bot_at_bot_eq Filter.prod_atBot_atBot_eq
15521550

15531551
-- Porting note: generalized from `SemilatticeSup` to `Preorder`
@@ -2023,7 +2021,7 @@ lemma frequently_iff_seq_forall {ι : Type*} {l : Filter ι} {p : ι → Prop}
20232021
hnsl.frequently <| frequently_of_forall hpns⟩
20242022

20252023
/-- A sequence converges if every subsequence has a convergent subsequence. -/
2026-
theorem tendsto_of_subseq_tendsto {α ι : Type*} {x : ι → α} {f : Filter α} {l : Filter ι}
2024+
theorem tendsto_of_subseq_tendsto {ι : Type*} {x : ι → α} {f : Filter α} {l : Filter ι}
20272025
[l.IsCountablyGenerated]
20282026
(hxy : ∀ ns : ℕ → ι, Tendsto ns atTop l →
20292027
∃ ms : ℕ → ℕ, Tendsto (fun n => x (ns <| ms n)) atTop f) :

Mathlib/Order/Filter/Bases.lean

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,8 @@ machinery, e.g., `simp only [true_and]` or `simp only [forall_const]` can help w
7878
`p = fun _ ↦ True`.
7979
-/
8080

81-
set_option autoImplicit true
82-
83-
8481
open Set Filter
8582

86-
open scoped Classical
87-
open Filter
88-
8983
section sort
9084

9185
variable {α β γ : Type*} {ι ι' : Sort*}

Mathlib/Order/Filter/Basic.lean

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ we do *not* require. This gives `Filter X` better formal properties, in particul
7979

8080
assert_not_exists OrderedSemiring
8181

82-
set_option autoImplicit true
83-
84-
8582
open Function Set Order
8683
open scoped Classical
8784

@@ -1333,10 +1330,11 @@ theorem Eventually.exists {p : α → Prop} {f : Filter α} [NeBot f] (hp : ∀
13331330
hp.frequently.exists
13341331
#align filter.eventually.exists Filter.Eventually.exists
13351332

1336-
lemma frequently_iff_neBot {p : α → Prop} : (∃ᶠ x in l, p x) ↔ NeBot (l ⊓ 𝓟 {x | p x}) := by
1333+
lemma frequently_iff_neBot {l : Filter α} {p : α → Prop} :
1334+
(∃ᶠ x in l, p x) ↔ NeBot (l ⊓ 𝓟 {x | p x}) := by
13371335
rw [neBot_iff, Ne, inf_principal_eq_bot]; rfl
13381336

1339-
lemma frequently_mem_iff_neBot {s : Set α} : (∃ᶠ x in l, x ∈ s) ↔ NeBot (l ⊓ 𝓟 s) :=
1337+
lemma frequently_mem_iff_neBot {l : Filter α} {s : Set α} : (∃ᶠ x in l, x ∈ s) ↔ NeBot (l ⊓ 𝓟 s) :=
13401338
frequently_iff_neBot
13411339

13421340
theorem frequently_iff_forall_eventually_exists_and {p : α → Prop} {f : Filter α} :
@@ -1539,7 +1537,8 @@ theorem EventuallyEq.trans {l : Filter α} {f g h : α → β} (H₁ : f =ᶠ[l]
15391537
H₂.rw (fun x y => f x = y) H₁
15401538
#align filter.eventually_eq.trans Filter.EventuallyEq.trans
15411539

1542-
instance : Trans ((· =ᶠ[l] ·) : (α → β) → (α → β) → Prop) (· =ᶠ[l] ·) (· =ᶠ[l] ·) where
1540+
instance {l : Filter α} :
1541+
Trans ((· =ᶠ[l] ·) : (α → β) → (α → β) → Prop) (· =ᶠ[l] ·) (· =ᶠ[l] ·) where
15431542
trans := EventuallyEq.trans
15441543

15451544
theorem EventuallyEq.prod_mk {l} {f f' : α → β} (hf : f =ᶠ[l] f') {g g' : α → γ} (hg : g =ᶠ[l] g') :
@@ -1734,6 +1733,8 @@ instance : Trans ((· ≤ᶠ[l] ·) : (α → β) → (α → β) → Prop) (·
17341733

17351734
end Preorder
17361735

1736+
variable {l : Filter α}
1737+
17371738
theorem EventuallyLE.antisymm [PartialOrder β] {l : Filter α} {f g : α → β} (h₁ : f ≤ᶠ[l] g)
17381739
(h₂ : g ≤ᶠ[l] f) : f =ᶠ[l] g :=
17391740
h₂.mp <| h₁.mono fun _ => le_antisymm
@@ -2139,7 +2140,7 @@ theorem map_pure (f : α → β) (a : α) : map f (pure a) = pure (f a) :=
21392140
rfl
21402141
#align filter.map_pure Filter.map_pure
21412142

2142-
theorem pure_le_principal (a : α) : pure a ≤ 𝓟 s ↔ a ∈ s := by
2143+
theorem pure_le_principal {s : Set α} (a : α) : pure a ≤ 𝓟 s ↔ a ∈ s := by
21432144
simp
21442145

21452146
@[simp] theorem join_pure (f : Filter α) : join (pure f) = f := rfl
@@ -2367,11 +2368,13 @@ theorem comap_mono : Monotone (comap m) :=
23672368
#align filter.comap_mono Filter.comap_mono
23682369

23692370
/-- Temporary lemma that we can tag with `gcongr` -/
2370-
@[gcongr] theorem _root_.GCongr.Filter.map_le_map (h : F ≤ G) : map m F ≤ map m G := map_mono h
2371+
@[gcongr] theorem _root_.GCongr.Filter.map_le_map {F G : Filter α} (h : F ≤ G) :
2372+
map m F ≤ map m G := map_mono h
23712373

23722374
/-- Temporary lemma that we can tag with `gcongr` -/
23732375
@[gcongr]
2374-
theorem _root_.GCongr.Filter.comap_le_comap (h : F ≤ G) : comap m F ≤ comap m G := comap_mono h
2376+
theorem _root_.GCongr.Filter.comap_le_comap {F G : Filter β} (h : F ≤ G) :
2377+
comap m F ≤ comap m G := comap_mono h
23752378

23762379
@[simp] theorem map_bot : map m ⊥ = ⊥ := (gc_map_comap m).l_bot
23772380
#align filter.map_bot Filter.map_bot
@@ -3317,25 +3320,27 @@ theorem Set.MapsTo.tendsto {α β} {s : Set α} {t : Set β} {f : α → β} (h
33173320
Filter.tendsto_principal_principal.2 h
33183321
#align set.maps_to.tendsto Set.MapsTo.tendsto
33193322

3320-
theorem Filter.EventuallyEq.comp_tendsto {f' : α → β} (H : f =ᶠ[l] f') {g : γ → α} {lc : Filter γ}
3321-
(hg : Tendsto g lc l) : f ∘ g =ᶠ[lc] f' ∘ g :=
3323+
theorem Filter.EventuallyEq.comp_tendsto {α β γ : Type*} {l : Filter α} {f : α → β} {f' : α → β}
3324+
(H : f =ᶠ[l] f') {g : γ → α} {lc : Filter γ} (hg : Tendsto g lc l) :
3325+
f ∘ g =ᶠ[lc] f' ∘ g :=
33223326
hg.eventually H
33233327
#align filter.eventually_eq.comp_tendsto Filter.EventuallyEq.comp_tendsto
33243328

3329+
variable {α β : Type*} {F : Filter α} {G : Filter β}
3330+
33253331
theorem Filter.map_mapsTo_Iic_iff_tendsto {m : α → β} :
33263332
MapsTo (map m) (Iic F) (Iic G) ↔ Tendsto m F G :=
33273333
fun hm ↦ hm right_mem_Iic, fun hm _ ↦ hm.mono_left⟩
33283334

33293335
alias ⟨_, Filter.Tendsto.map_mapsTo_Iic⟩ := Filter.map_mapsTo_Iic_iff_tendsto
33303336

3331-
theorem Filter.map_mapsTo_Iic_iff_mapsTo {m : α → β} :
3337+
theorem Filter.map_mapsTo_Iic_iff_mapsTo {s : Set α} {t : Set β} {m : α → β} :
33323338
MapsTo (map m) (Iic <| 𝓟 s) (Iic <| 𝓟 t) ↔ MapsTo m s t := by
33333339
rw [map_mapsTo_Iic_iff_tendsto, tendsto_principal_principal, MapsTo]
33343340

33353341
alias ⟨_, Set.MapsTo.filter_map_Iic⟩ := Filter.map_mapsTo_Iic_iff_mapsTo
33363342

33373343
-- TODO(Anatole): unify with the global case
3338-
33393344
theorem Filter.map_surjOn_Iic_iff_le_map {m : α → β} :
33403345
SurjOn (map m) (Iic F) (Iic G) ↔ G ≤ map m F := by
33413346
refine ⟨fun hm ↦ ?_, fun hm ↦ ?_⟩
@@ -3345,13 +3350,13 @@ theorem Filter.map_surjOn_Iic_iff_le_map {m : α → β} :
33453350
fun H (hHG : H ≤ G) ↦ by simpa [Filter.push_pull] using hHG.trans hm
33463351
exact this.surjOn fun H _ ↦ mem_Iic.mpr inf_le_left
33473352

3348-
theorem Filter.map_surjOn_Iic_iff_surjOn {m : α → β} :
3353+
theorem Filter.map_surjOn_Iic_iff_surjOn {s : Set α} {t : Set β} {m : α → β} :
33493354
SurjOn (map m) (Iic <| 𝓟 s) (Iic <| 𝓟 t) ↔ SurjOn m s t := by
33503355
rw [map_surjOn_Iic_iff_le_map, map_principal, principal_mono, SurjOn]
33513356

33523357
alias ⟨_, Set.SurjOn.filter_map_Iic⟩ := Filter.map_surjOn_Iic_iff_surjOn
33533358

3354-
theorem Filter.filter_injOn_Iic_iff_injOn {m : α → β} :
3359+
theorem Filter.filter_injOn_Iic_iff_injOn {s : Set α} {m : α → β} :
33553360
InjOn (map m) (Iic <| 𝓟 s) ↔ InjOn m s := by
33563361
refine ⟨fun hm x hx y hy hxy ↦ ?_, fun hm F hF G hG ↦ ?_⟩
33573362
· rwa [← pure_injective.eq_iff, ← map_pure, ← map_pure, hm.eq_iff, pure_injective.eq_iff]

Mathlib/Order/Filter/CountableSeparatingOn.lean

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ We formalize several versions of this theorem in
7070
filter, countable
7171
-/
7272

73-
set_option autoImplicit true
74-
7573
open Function Set Filter
7674

7775
/-- We say that a type `α` has a *countable separating family of sets* satisfying a predicate
@@ -140,7 +138,7 @@ theorem HasCountableSeparatingOn.subtype_iff {α : Type*} {p : Set α → Prop}
140138

141139
namespace Filter
142140

143-
variable {l : Filter α} [CountableInterFilter l] {f g : α → β}
141+
variable {α β : Type*} {l : Filter α} [CountableInterFilter l] {f g : α → β}
144142

145143
/-!
146144
### Filters supported on a (sub)singleton

Mathlib/Order/InitialSeg.lean

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ any `b' < b` also belongs to the range). The type of these embeddings from `r` t
3939
`InitialSeg r s`, and denoted by `r ≼i s`.
4040
-/
4141

42-
set_option autoImplicit true
43-
44-
4542
variable {α : Type*} {β : Type*} {γ : Type*} {r : α → α → Prop} {s : β → β → Prop}
4643
{t : γ → γ → Prop}
4744

@@ -89,7 +86,7 @@ theorem init (f : r ≼i s) {a : α} {b : β} : s b (f a) → ∃ a', f a' = b :
8986
f.init' _ _
9087
#align initial_seg.init InitialSeg.init
9188

92-
theorem map_rel_iff (f : r ≼i s) : s (f a) (f b) ↔ r a b :=
89+
theorem map_rel_iff {a b : α} (f : r ≼i s) : s (f a) (f b) ↔ r a b :=
9390
f.map_rel_iff'
9491
#align initial_seg.map_rel_iff InitialSeg.map_rel_iff
9592

Mathlib/Order/Interval/Finset/Defs.lean

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ successor (and actually a predecessor as well), so it is a `SuccOrder`, but it's
9595
as `Icc (-1) 1` is infinite.
9696
-/
9797

98-
set_option autoImplicit true
99-
100-
10198
open Finset Function
10299

103100
/-- This is a mixin class describing a locally finite order,
@@ -1269,6 +1266,8 @@ end Finite
12691266
/-! We make the instances below low priority
12701267
so when alternative constructions are available they are preferred. -/
12711268

1269+
variable {y : α}
1270+
12721271
instance (priority := low) [Preorder α] [DecidableRel ((· : α) ≤ ·)] [LocallyFiniteOrder α] :
12731272
LocallyFiniteOrderTop { x : α // x ≤ y } where
12741273
finsetIoi a := Finset.Ioc a ⟨y, by rfl⟩

Mathlib/Order/LiminfLimsup.lean

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ the definitions of Limsup and Liminf.
3636
In complete lattices, however, it coincides with the `Inf Sup` definition.
3737
-/
3838

39-
set_option autoImplicit true
40-
41-
4239
open Filter Set Function
4340

4441
variable {α β γ ι ι' : Type*}
@@ -244,7 +241,7 @@ theorem IsBounded.isCobounded_le [Preorder α] [NeBot f] (h : f.IsBounded (·
244241
h.isCobounded_flip
245242
#align filter.is_bounded.is_cobounded_le Filter.IsBounded.isCobounded_le
246243

247-
theorem IsBoundedUnder.isCoboundedUnder_flip {l : Filter γ} [IsTrans α r] [NeBot l]
244+
theorem IsBoundedUnder.isCoboundedUnder_flip {u : γ → α} {l : Filter γ} [IsTrans α r] [NeBot l]
248245
(h : l.IsBoundedUnder r u) : l.IsCoboundedUnder (flip r) u :=
249246
h.isCobounded_flip
250247

0 commit comments

Comments
 (0)