Theorem: Filter.HasAntitoneBasis.subbasis_with_rel
File: Mathlib/Order/Filter/AtTopBot.lean

tactic: suffices : ∃ φ : ℕ → ℕ, StrictMono φ ∧ ∀ m n, m < n → r (φ m) (φ n)
state_before: ι : Type ?u.362344
ι' : Type ?u.362347
α : Type u_1
β : Type ?u.362353
γ : Type ?u.362356
f : Filter α
s : ℕ → Set α
hs : HasAntitoneBasis f s
r : ℕ → ℕ → Prop
hr : ∀ (m : ℕ), ∀ᶠ (n : ℕ) in atTop, r m n
⊢ ∃ φ, StrictMono φ ∧ (∀ ⦃m n : ℕ⦄, m < n → r (φ m) (φ n)) ∧ HasAntitoneBasis f (s ∘ φ)

tactic: 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 _)
state_before: case this
ι : Type ?u.362344
ι' : Type ?u.362347
α : Type u_1
β : Type ?u.362353
γ : Type ?u.362356
f : Filter α
s : ℕ → Set α
hs : HasAntitoneBasis f s
r : ℕ → ℕ → Prop
hr : ∀ (m : ℕ), ∀ᶠ (n : ℕ) in atTop, r m n
⊢ ∃ φ, StrictMono φ ∧ ∀ (m n : ℕ), m < n → r (φ m) (φ n)

tactic: rcases seq_of_forall_finite_exists fun t ht => (this t ht).exists with ⟨φ, hφ⟩
state_before: case this
ι : Type ?u.362344
ι' : Type ?u.362347
α : Type u_1
β : Type ?u.362353
γ : Type ?u.362356
f : Filter α
s : ℕ → Set α
hs : HasAntitoneBasis f s
r : ℕ → ℕ → Prop
hr : ∀ (m : ℕ), ∀ᶠ (n : ℕ) in atTop, r m n
this : ∀ (t : Set ℕ), Set.Finite t → ∀ᶠ (n : ℕ) in atTop, ∀ (m : ℕ), m ∈ t → m < n ∧ r m n
⊢ ∃ φ, StrictMono φ ∧ ∀ (m n : ℕ), m < n → r (φ m) (φ n)

tactic: simp only [ball_image_iff, forall_and, mem_Iio] at hφ
state_before: case this.intro
ι : Type ?u.362344
ι' : Type ?u.362347
α : Type u_1
β : Type ?u.362353
γ : Type ?u.362356
f : Filter α
s : ℕ → Set α
hs : HasAntitoneBasis f s
r : ℕ → ℕ → Prop
hr : ∀ (m : ℕ), ∀ᶠ (n : ℕ) in atTop, r m n
this : ∀ (t : Set ℕ), Set.Finite t → ∀ᶠ (n : ℕ) in atTop, ∀ (m : ℕ), m ∈ t → m < n ∧ r m n
φ : ℕ → ℕ
hφ : ∀ (n m : ℕ), m ∈ φ '' Iio n → m < φ n ∧ r m (φ n)
⊢ ∃ φ, StrictMono φ ∧ ∀ (m n : ℕ), m < n → r (φ m) (φ n)

tactic: exact ⟨φ, forall_swap.2 hφ.1, forall_swap.2 hφ.2⟩
state_before: case this.intro
ι : Type ?u.362344
ι' : Type ?u.362347
α : Type u_1
β : Type ?u.362353
γ : Type ?u.362356
f : Filter α
s : ℕ → Set α
hs : HasAntitoneBasis f s
r : ℕ → ℕ → Prop
hr : ∀ (m : ℕ), ∀ᶠ (n : ℕ) in atTop, r m n
this : ∀ (t : Set ℕ), Set.Finite t → ∀ᶠ (n : ℕ) in atTop, ∀ (m : ℕ), m ∈ t → m < n ∧ r m n
φ : ℕ → ℕ
hφ : (∀ (x x_1 : ℕ), x_1 < x → φ x_1 < φ x) ∧ ∀ (x x_1 : ℕ), x_1 < x → r (φ x_1) (φ x)
⊢ ∃ φ, StrictMono φ ∧ ∀ (m n : ℕ), m < n → r (φ m) (φ n)

tactic: rcases this with ⟨φ, hφ, hrφ⟩
state_before: ι : Type ?u.362344
ι' : Type ?u.362347
α : Type u_1
β : Type ?u.362353
γ : Type ?u.362356
f : Filter α
s : ℕ → Set α
hs : HasAntitoneBasis f s
r : ℕ → ℕ → Prop
hr : ∀ (m : ℕ), ∀ᶠ (n : ℕ) in atTop, r m n
this : ∃ φ, StrictMono φ ∧ ∀ (m n : ℕ), m < n → r (φ m) (φ n)
⊢ ∃ φ, StrictMono φ ∧ (∀ ⦃m n : ℕ⦄, m < n → r (φ m) (φ n)) ∧ HasAntitoneBasis f (s ∘ φ)

tactic: exact ⟨φ, hφ, hrφ, hs.comp_strictMono hφ⟩
state_before: case intro.intro
ι : Type ?u.362344
ι' : Type ?u.362347
α : Type u_1
β : Type ?u.362353
γ : Type ?u.362356
f : Filter α
s : ℕ → Set α
hs : HasAntitoneBasis f s
r : ℕ → ℕ → Prop
hr : ∀ (m : ℕ), ∀ᶠ (n : ℕ) in atTop, r m n
φ : ℕ → ℕ
hφ : StrictMono φ
hrφ : ∀ (m n : ℕ), m < n → r (φ m) (φ n)
⊢ ∃ φ, StrictMono φ ∧ (∀ ⦃m n : ℕ⦄, m < n → r (φ m) (φ n)) ∧ HasAntitoneBasis f (s ∘ φ)