Skip to content

Commit

Permalink
chore: address rsuffices porting notes (#9014)
Browse files Browse the repository at this point in the history
Updates proofs that had been doing `rsuffices` manually.
  • Loading branch information
dwrensha committed Dec 13, 2023
1 parent f7006a7 commit 6bb383b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
6 changes: 2 additions & 4 deletions Mathlib/Order/Filter/AtTopBot.lean
Expand Up @@ -1861,10 +1861,8 @@ antitone basis with basis sets decreasing "sufficiently fast". -/
theorem HasAntitoneBasis.subbasis_with_rel {f : Filter α} {s : ℕ → Set α}
(hs : f.HasAntitoneBasis s) {r : ℕ → ℕ → Prop} (hr : ∀ m, ∀ᶠ n in atTop, r m n) :
∃ φ : ℕ → ℕ, StrictMono φ ∧ (∀ ⦃m n⦄, m < n → r (φ m) (φ n)) ∧ f.HasAntitoneBasis (s ∘ φ) := by
-- porting note: use `rsuffices`
suffices : ∃ φ : ℕ → ℕ, StrictMono φ ∧ ∀ m n, m < n → r (φ m) (φ n)
· rcases this with ⟨φ, hφ, hrφ⟩
exact ⟨φ, hφ, hrφ, hs.comp_strictMono hφ⟩
rsuffices ⟨φ, hφ, hrφ⟩ : ∃ φ : ℕ → ℕ, StrictMono φ ∧ ∀ m n, m < n → r (φ m) (φ n)
· exact ⟨φ, hφ, hrφ, hs.comp_strictMono hφ⟩
have : ∀ t : Set ℕ, t.Finite → ∀ᶠ n in atTop, ∀ m ∈ t, m < n ∧ r m n := fun t ht =>
(eventually_all_finite ht).2 fun m _ => (eventually_gt_atTop m).and (hr _)
rcases seq_of_forall_finite_exists fun t ht => (this t ht).exists with ⟨φ, hφ⟩
Expand Down
4 changes: 1 addition & 3 deletions Mathlib/RingTheory/Subring/Basic.lean
Expand Up @@ -1383,10 +1383,8 @@ protected theorem InClosure.recOn {C : R → Prop} {x : R} (hx : x ∈ closure s
exact ha this (ih HL.2)
replace HL := HL.1
clear ih tl
-- Porting note: was `rsuffices` instead of `obtain` + `rotate_left`
obtain ⟨L, HL', HP | HP⟩ :
rsuffices ⟨L, HL', HP | HP⟩ :
∃ L : List R, (∀ x ∈ L, x ∈ s) ∧ (List.prod hd = List.prod L ∨ List.prod hd = -List.prod L)
rotate_left
· rw [HP]
clear HP HL hd
induction' L with hd tl ih
Expand Down
3 changes: 1 addition & 2 deletions Mathlib/Topology/Algebra/Semigroup.lean
Expand Up @@ -32,8 +32,7 @@ theorem exists_idempotent_of_compact_t2_of_continuous_mul_left {M} [Nonempty M]
It will turn out that any minimal element is `{m}` for an idempotent `m : M`. -/
let S : Set (Set M) :=
{ N | IsClosed N ∧ N.Nonempty ∧ ∀ (m) (_ : m ∈ N) (m') (_ : m' ∈ N), m * m' ∈ N }
obtain ⟨N, ⟨N_closed, ⟨m, hm⟩, N_mul⟩, N_minimal⟩ : ∃ N ∈ S, ∀ N' ∈ S, N' ⊆ N → N' = N
rotate_left -- Porting note: restore to `rsuffices`
rsuffices ⟨N, ⟨N_closed, ⟨m, hm⟩, N_mul⟩, N_minimal⟩ : ∃ N ∈ S, ∀ N' ∈ S, N' ⊆ N → N' = N
· use m
/- We now have an element `m : M` of a minimal subsemigroup `N`, and want to show `m + m = m`.
We first show that every element of `N` is of the form `m' + m`.-/
Expand Down
5 changes: 2 additions & 3 deletions Mathlib/Topology/FiberBundle/Basic.lean
Expand Up @@ -353,9 +353,8 @@ theorem FiberBundle.exists_trivialization_Icc_subset [ConditionallyCompleteLinea
`d ∈ (c, b]`, hence `c` is not an upper bound of `s`. -/
cases' hc.2.eq_or_lt with heq hlt
· exact ⟨ec, heq ▸ hec⟩
suffices : ∃ d ∈ Ioc c b, ∃ e : Trivialization F (π F E), Icc a d ⊆ e.baseSet
· rcases this with ⟨d, hdcb, hd⟩ -- porting note: todo: use `rsuffices`
exact ((hsc.1 ⟨⟨hc.1.trans hdcb.1.le, hdcb.2⟩, hd⟩).not_lt hdcb.1).elim
rsuffices ⟨d, hdcb, hd⟩ : ∃ d ∈ Ioc c b, ∃ e : Trivialization F (π F E), Icc a d ⊆ e.baseSet
· exact ((hsc.1 ⟨⟨hc.1.trans hdcb.1.le, hdcb.2⟩, hd⟩).not_lt hdcb.1).elim
/- Since the base set of `ec` is open, it includes `[c, d)` (hence, `[a, d)`) for some
`d ∈ (c, b]`. -/
obtain ⟨d, hdcb, hd⟩ : ∃ d ∈ Ioc c b, Ico c d ⊆ ec.baseSet :=
Expand Down

0 comments on commit 6bb383b

Please sign in to comment.