l3lab/ntp-mathlib huggingface dataset:
@[simp, nolint simpNF] -- Porting note: linter claims that LHS doesn't simplify. It does.
theorem tendsto_comp_val_Ioi_atTop [SemilatticeSup α] [NoMaxOrder α] {a : α} {f : α → β}
    {l : Filter β} : Tendsto (fun x : Ioi a => f x) atTop l ↔ Tendsto f atTop l := by
  rw [← map_val_Ioi_atTop a, tendsto_map'_iff]; 

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝¹ : SemilatticeSup α
inst✝ : NoMaxOrder α
a : α
f : α → β
l : Filter β
⊢ Tendsto (fun x => f ↑x) atTop l ↔ Tendsto (f ∘ Subtype.val) atTop l

Next tactic:
rfl
@[simp, nolint simpNF] -- Porting note: linter claims that LHS doesn't simplify. It does.
theorem tendsto_comp_val_Ici_atTop [SemilatticeSup α] {a : α} {f : α → β} {l : Filter β} :
    Tendsto (fun x : Ici a => f x) atTop l ↔ Tendsto f atTop l := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
a : α
f : α → β
l : Filter β
⊢ Tendsto (fun x => f ↑x) atTop l ↔ Tendsto f atTop l

Next tactic:
rw [← map_val_Ici_atTop a, tendsto_map'_iff]
@[simp, nolint simpNF] -- Porting note: linter claims that LHS doesn't simplify. It does.
theorem tendsto_comp_val_Ici_atTop [SemilatticeSup α] {a : α} {f : α → β} {l : Filter β} :
    Tendsto (fun x : Ici a => f x) atTop l ↔ Tendsto f atTop l := by
  rw [← map_val_Ici_atTop a, tendsto_map'_iff]; 

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
a : α
f : α → β
l : Filter β
⊢ Tendsto (fun x => f ↑x) atTop l ↔ Tendsto (f ∘ Subtype.val) atTop l

Next tactic:
rfl
@[simp, nolint simpNF] -- Porting note: linter claims that LHS doesn't simplify. It does.
theorem tendsto_comp_val_Iio_atBot [SemilatticeInf α] [NoMinOrder α] {a : α} {f : α → β}
    {l : Filter β} : Tendsto (fun x : Iio a => f x) atBot l ↔ Tendsto f atBot l := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝¹ : SemilatticeInf α
inst✝ : NoMinOrder α
a : α
f : α → β
l : Filter β
⊢ Tendsto (fun x => f ↑x) atBot l ↔ Tendsto f atBot l

Next tactic:
rw [← map_val_Iio_atBot a, tendsto_map'_iff]
@[simp, nolint simpNF] -- Porting note: linter claims that LHS doesn't simplify. It does.
theorem tendsto_comp_val_Iio_atBot [SemilatticeInf α] [NoMinOrder α] {a : α} {f : α → β}
    {l : Filter β} : Tendsto (fun x : Iio a => f x) atBot l ↔ Tendsto f atBot l := by
  rw [← map_val_Iio_atBot a, tendsto_map'_iff]; 

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝¹ : SemilatticeInf α
inst✝ : NoMinOrder α
a : α
f : α → β
l : Filter β
⊢ Tendsto (fun x => f ↑x) atBot l ↔ Tendsto (f ∘ Subtype.val) atBot l

Next tactic:
rfl
@[simp, nolint simpNF] -- Porting note: linter claims that LHS doesn't simplify. It does.
theorem tendsto_comp_val_Iic_atBot [SemilatticeInf α] {a : α} {f : α → β} {l : Filter β} :
    Tendsto (fun x : Iic a => f x) atBot l ↔ Tendsto f atBot l := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeInf α
a : α
f : α → β
l : Filter β
⊢ Tendsto (fun x => f ↑x) atBot l ↔ Tendsto f atBot l

Next tactic:
rw [← map_val_Iic_atBot a, tendsto_map'_iff]
@[simp, nolint simpNF] -- Porting note: linter claims that LHS doesn't simplify. It does.
theorem tendsto_comp_val_Iic_atBot [SemilatticeInf α] {a : α} {f : α → β} {l : Filter β} :
    Tendsto (fun x : Iic a => f x) atBot l ↔ Tendsto f atBot l := by
  rw [← map_val_Iic_atBot a, tendsto_map'_iff]; 

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeInf α
a : α
f : α → β
l : Filter β
⊢ Tendsto (fun x => f ↑x) atBot l ↔ Tendsto (f ∘ Subtype.val) atBot l

Next tactic:
rfl
theorem map_add_atTop_eq_nat (k : ℕ) : map (fun a => a + k) atTop = atTop :=
  map_atTop_eq_of_gc (fun a => a - k) k (fun a b h => add_le_add_right h k)
    (fun a b h => (le_tsub_iff_right h).symm) fun a h => by 

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
k a : ℕ
h : a ≥ k
⊢ a ≤ (fun a => a - k) a + k

Next tactic:
rw [tsub_add_cancel_of_le h]
theorem map_sub_atTop_eq_nat (k : ℕ) : map (fun a => a - k) atTop = atTop :=
  map_atTop_eq_of_gc (fun a => a + k) 0 (fun a b h => tsub_le_tsub_right h _)
    (fun a b _ => tsub_le_iff_right) fun b _ => by 

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
k b : ℕ
x✝ : b ≥ 0
⊢ b ≤ (fun a => a + k) b - k

Next tactic:
rw [add_tsub_cancel_right]
theorem tendsto_add_atTop_iff_nat {f : ℕ → α} {l : Filter α} (k : ℕ) :
    Tendsto (fun n => f (n + k)) atTop l ↔ Tendsto f atTop l :=
  show Tendsto (f ∘ fun n => n + k) atTop l ↔ Tendsto f atTop l by
    

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
f : ℕ → α
l : Filter α
k : ℕ
⊢ Tendsto (f ∘ fun n => n + k) atTop l ↔ Tendsto f atTop l

Next tactic:
rw [← tendsto_map'_iff, map_add_atTop_eq_nat]
theorem map_div_atTop_eq_nat (k : ℕ) (hk : 0 < k) : map (fun a => a / k) atTop = atTop :=
  map_atTop_eq_of_gc (fun b => b * k + (k - 1)) 1 (fun a b h => Nat.div_le_div_right h)
    -- porting note: there was a parse error in `calc`, use `simp` instead
    (fun a b _ => by 

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
k : ℕ
hk : 0 < k
a b : ℕ
x✝ : b ≥ 1
⊢ a / k ≤ b ↔ a ≤ (fun b => b * k + (k - 1)) b

Next tactic:
simp only [← Nat.lt_succ_iff, Nat.div_lt_iff_lt_mul hk, Nat.succ_eq_add_one,
      add_assoc, tsub_add_cancel_of_le (Nat.one_le_iff_ne_zero.2 hk.ne'), add_mul, one_mul]
theorem map_div_atTop_eq_nat (k : ℕ) (hk : 0 < k) : map (fun a => a / k) atTop = atTop :=
  map_atTop_eq_of_gc (fun b => b * k + (k - 1)) 1 (fun a b h => Nat.div_le_div_right h)
    -- porting note: there was a parse error in `calc`, use `simp` instead
    (fun a b _ => by simp only [← Nat.lt_succ_iff, Nat.div_lt_iff_lt_mul hk, Nat.succ_eq_add_one,
      add_assoc, tsub_add_cancel_of_le (Nat.one_le_iff_ne_zero.2 hk.ne'), add_mul, one_mul])
    fun b _ =>
    calc
      b = b * k / k := by 

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
k : ℕ
hk : 0 < k
b : ℕ
x✝ : b ≥ 1
⊢ b = b * k / k

Next tactic:
rw [Nat.mul_div_cancel b hk]
/-- If `u` is a monotone function with linear ordered codomain and the range of `u` is not bounded
above, then `Tendsto u atTop atTop`. -/
theorem tendsto_atTop_atTop_of_monotone' [Preorder ι] [LinearOrder α] {u : ι → α} (h : Monotone u)
    (H : ¬BddAbove (range u)) : Tendsto u atTop atTop := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝¹ : Preorder ι
inst✝ : LinearOrder α
u : ι → α
h : Monotone u
H : ¬BddAbove (range u)
⊢ Tendsto u atTop atTop

Next tactic:
apply h.tendsto_atTop_atTop
/-- If `u` is a monotone function with linear ordered codomain and the range of `u` is not bounded
above, then `Tendsto u atTop atTop`. -/
theorem tendsto_atTop_atTop_of_monotone' [Preorder ι] [LinearOrder α] {u : ι → α} (h : Monotone u)
    (H : ¬BddAbove (range u)) : Tendsto u atTop atTop := by
  apply h.tendsto_atTop_atTop
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝¹ : Preorder ι
inst✝ : LinearOrder α
u : ι → α
h : Monotone u
H : ¬BddAbove (range u)
⊢ ∀ (b : α), ∃ a, b ≤ u a

Next tactic:
intro b
/-- If `u` is a monotone function with linear ordered codomain and the range of `u` is not bounded
above, then `Tendsto u atTop atTop`. -/
theorem tendsto_atTop_atTop_of_monotone' [Preorder ι] [LinearOrder α] {u : ι → α} (h : Monotone u)
    (H : ¬BddAbove (range u)) : Tendsto u atTop atTop := by
  apply h.tendsto_atTop_atTop
  intro b
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝¹ : Preorder ι
inst✝ : LinearOrder α
u : ι → α
h : Monotone u
H : ¬BddAbove (range u)
b : α
⊢ ∃ a, b ≤ u a

Next tactic:
rcases not_bddAbove_iff.1 H b with ⟨_, ⟨N, rfl⟩, hN⟩
/-- If `u` is a monotone function with linear ordered codomain and the range of `u` is not bounded
above, then `Tendsto u atTop atTop`. -/
theorem tendsto_atTop_atTop_of_monotone' [Preorder ι] [LinearOrder α] {u : ι → α} (h : Monotone u)
    (H : ¬BddAbove (range u)) : Tendsto u atTop atTop := by
  apply h.tendsto_atTop_atTop
  intro b
  rcases not_bddAbove_iff.1 H b with ⟨_, ⟨N, rfl⟩, hN⟩
  

Proof state:
case intro.intro.intro
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝¹ : Preorder ι
inst✝ : LinearOrder α
u : ι → α
h : Monotone u
H : ¬BddAbove (range u)
b : α
N : ι
hN : b < u N
⊢ ∃ a, b ≤ u a

Next tactic:
exact ⟨N, le_of_lt hN⟩
theorem unbounded_of_tendsto_atTop [Nonempty α] [SemilatticeSup α] [Preorder β] [NoMaxOrder β]
    {f : α → β} (h : Tendsto f atTop atTop) : ¬BddAbove (range f) := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝³ : Nonempty α
inst✝² : SemilatticeSup α
inst✝¹ : Preorder β
inst✝ : NoMaxOrder β
f : α → β
h : Tendsto f atTop atTop
⊢ ¬BddAbove (range f)

Next tactic:
rintro ⟨M, hM⟩
theorem unbounded_of_tendsto_atTop [Nonempty α] [SemilatticeSup α] [Preorder β] [NoMaxOrder β]
    {f : α → β} (h : Tendsto f atTop atTop) : ¬BddAbove (range f) := by
  rintro ⟨M, hM⟩
  

Proof state:
case intro
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝³ : Nonempty α
inst✝² : SemilatticeSup α
inst✝¹ : Preorder β
inst✝ : NoMaxOrder β
f : α → β
h : Tendsto f atTop atTop
M : β
hM : M ∈ upperBounds (range f)
⊢ False

Next tactic:
cases' mem_atTop_sets.mp (h <| Ioi_mem_atTop M) with a ha
theorem unbounded_of_tendsto_atTop [Nonempty α] [SemilatticeSup α] [Preorder β] [NoMaxOrder β]
    {f : α → β} (h : Tendsto f atTop atTop) : ¬BddAbove (range f) := by
  rintro ⟨M, hM⟩
  cases' mem_atTop_sets.mp (h <| Ioi_mem_atTop M) with a ha
  

Proof state:
case intro.intro
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝³ : Nonempty α
inst✝² : SemilatticeSup α
inst✝¹ : Preorder β
inst✝ : NoMaxOrder β
f : α → β
h : Tendsto f atTop atTop
M : β
hM : M ∈ upperBounds (range f)
a : α
ha : ∀ b ≥ a, b ∈ f ⁻¹' Ioi M
⊢ False

Next tactic:
apply lt_irrefl M
theorem unbounded_of_tendsto_atTop [Nonempty α] [SemilatticeSup α] [Preorder β] [NoMaxOrder β]
    {f : α → β} (h : Tendsto f atTop atTop) : ¬BddAbove (range f) := by
  rintro ⟨M, hM⟩
  cases' mem_atTop_sets.mp (h <| Ioi_mem_atTop M) with a ha
  apply lt_irrefl M
  

Proof state:
case intro.intro
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝³ : Nonempty α
inst✝² : SemilatticeSup α
inst✝¹ : Preorder β
inst✝ : NoMaxOrder β
f : α → β
h : Tendsto f atTop atTop
M : β
hM : M ∈ upperBounds (range f)
a : α
ha : ∀ b ≥ a, b ∈ f ⁻¹' Ioi M
⊢ M < M

Next tactic:
calc
    M < f a := ha a le_rfl
    _ ≤ M := hM (Set.mem_range_self a)
/-- Let `f` and `g` be two maps to the same commutative monoid. This lemma gives a sufficient
condition for comparison of the filter `atTop.map (fun s ↦ ∏ b in s, f b)` with
`atTop.map (fun s ↦ ∏ b in s, g b)`. This is useful to compare the set of limit points of
`Π b in s, f b` as `s → atTop` with the similar set for `g`. -/
@[to_additive "Let `f` and `g` be two maps to the same commutative additive monoid. This lemma gives
a sufficient condition for comparison of the filter `atTop.map (fun s ↦ ∑ b in s, f b)` with
`atTop.map (fun s ↦ ∑ b in s, g b)`. This is useful to compare the set of limit points of
`∑ b in s, f b` as `s → atTop` with the similar set for `g`."]
theorem map_atTop_finset_prod_le_of_prod_eq [CommMonoid α] {f : β → α} {g : γ → α}
    (h_eq : ∀ u : Finset γ,
      ∃ v : Finset β, ∀ v', v ⊆ v' → ∃ u', u ⊆ u' ∧ ∏ x in u', g x = ∏ b in v', f b) :
    (atTop.map fun s : Finset β => ∏ b in s, f b) ≤
      atTop.map fun s : Finset γ => ∏ x in s, g x := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : CommMonoid α
f : β → α
g : γ → α
h_eq : ∀ (u : Finset γ), ∃ v, ∀ (v' : Finset β), v ⊆ v' → ∃ u', u ⊆ u' ∧ ∏ x in u', g x = ∏ b in v', f b
⊢ map (fun s => ∏ b in s, f b) atTop ≤ map (fun s => ∏ x in s, g x) atTop

Next tactic:
classical
    refine' ((atTop_basis.map _).le_basis_iff (atTop_basis.map _)).2 fun b _ => _
    let ⟨v, hv⟩ := h_eq b
    refine ⟨v, trivial, ?_⟩
    simpa [image_subset_iff] using hv
/-- Let `f` and `g` be two maps to the same commutative monoid. This lemma gives a sufficient
condition for comparison of the filter `atTop.map (fun s ↦ ∏ b in s, f b)` with
`atTop.map (fun s ↦ ∏ b in s, g b)`. This is useful to compare the set of limit points of
`Π b in s, f b` as `s → atTop` with the similar set for `g`. -/
@[to_additive "Let `f` and `g` be two maps to the same commutative additive monoid. This lemma gives
a sufficient condition for comparison of the filter `atTop.map (fun s ↦ ∑ b in s, f b)` with
`atTop.map (fun s ↦ ∑ b in s, g b)`. This is useful to compare the set of limit points of
`∑ b in s, f b` as `s → atTop` with the similar set for `g`."]
theorem map_atTop_finset_prod_le_of_prod_eq [CommMonoid α] {f : β → α} {g : γ → α}
    (h_eq : ∀ u : Finset γ,
      ∃ v : Finset β, ∀ v', v ⊆ v' → ∃ u', u ⊆ u' ∧ ∏ x in u', g x = ∏ b in v', f b) :
    (atTop.map fun s : Finset β => ∏ b in s, f b) ≤
      atTop.map fun s : Finset γ => ∏ x in s, g x := by
  classical
    

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : CommMonoid α
f : β → α
g : γ → α
h_eq : ∀ (u : Finset γ), ∃ v, ∀ (v' : Finset β), v ⊆ v' → ∃ u', u ⊆ u' ∧ ∏ x in u', g x = ∏ b in v', f b
⊢ map (fun s => ∏ b in s, f b) atTop ≤ map (fun s => ∏ x in s, g x) atTop

Next tactic:
refine' ((atTop_basis.map _).le_basis_iff (atTop_basis.map _)).2 fun b _ => _
/-- Let `f` and `g` be two maps to the same commutative monoid. This lemma gives a sufficient
condition for comparison of the filter `atTop.map (fun s ↦ ∏ b in s, f b)` with
`atTop.map (fun s ↦ ∏ b in s, g b)`. This is useful to compare the set of limit points of
`Π b in s, f b` as `s → atTop` with the similar set for `g`. -/
@[to_additive "Let `f` and `g` be two maps to the same commutative additive monoid. This lemma gives
a sufficient condition for comparison of the filter `atTop.map (fun s ↦ ∑ b in s, f b)` with
`atTop.map (fun s ↦ ∑ b in s, g b)`. This is useful to compare the set of limit points of
`∑ b in s, f b` as `s → atTop` with the similar set for `g`."]
theorem map_atTop_finset_prod_le_of_prod_eq [CommMonoid α] {f : β → α} {g : γ → α}
    (h_eq : ∀ u : Finset γ,
      ∃ v : Finset β, ∀ v', v ⊆ v' → ∃ u', u ⊆ u' ∧ ∏ x in u', g x = ∏ b in v', f b) :
    (atTop.map fun s : Finset β => ∏ b in s, f b) ≤
      atTop.map fun s : Finset γ => ∏ x in s, g x := by
  classical
    refine' ((atTop_basis.map _).le_basis_iff (atTop_basis.map _)).2 fun b _ => _
    

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : CommMonoid α
f : β → α
g : γ → α
h_eq : ∀ (u : Finset γ), ∃ v, ∀ (v' : Finset β), v ⊆ v' → ∃ u', u ⊆ u' ∧ ∏ x in u', g x = ∏ b in v', f b
b : Finset γ
x✝ : True
⊢ ∃ i, True ∧ (fun s => ∏ b in s, f b) '' Ici i ⊆ (fun s => ∏ x in s, g x) '' Ici b

Next tactic:
let ⟨v, hv⟩ := h_eq b
/-- Let `f` and `g` be two maps to the same commutative monoid. This lemma gives a sufficient
condition for comparison of the filter `atTop.map (fun s ↦ ∏ b in s, f b)` with
`atTop.map (fun s ↦ ∏ b in s, g b)`. This is useful to compare the set of limit points of
`Π b in s, f b` as `s → atTop` with the similar set for `g`. -/
@[to_additive "Let `f` and `g` be two maps to the same commutative additive monoid. This lemma gives
a sufficient condition for comparison of the filter `atTop.map (fun s ↦ ∑ b in s, f b)` with
`atTop.map (fun s ↦ ∑ b in s, g b)`. This is useful to compare the set of limit points of
`∑ b in s, f b` as `s → atTop` with the similar set for `g`."]
theorem map_atTop_finset_prod_le_of_prod_eq [CommMonoid α] {f : β → α} {g : γ → α}
    (h_eq : ∀ u : Finset γ,
      ∃ v : Finset β, ∀ v', v ⊆ v' → ∃ u', u ⊆ u' ∧ ∏ x in u', g x = ∏ b in v', f b) :
    (atTop.map fun s : Finset β => ∏ b in s, f b) ≤
      atTop.map fun s : Finset γ => ∏ x in s, g x := by
  classical
    refine' ((atTop_basis.map _).le_basis_iff (atTop_basis.map _)).2 fun b _ => _
    let ⟨v, hv⟩ := h_eq b
    

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : CommMonoid α
f : β → α
g : γ → α
h_eq : ∀ (u : Finset γ), ∃ v, ∀ (v' : Finset β), v ⊆ v' → ∃ u', u ⊆ u' ∧ ∏ x in u', g x = ∏ b in v', f b
b : Finset γ
x✝ : True
v : Finset β
hv : ∀ (v' : Finset β), v ⊆ v' → ∃ u', b ⊆ u' ∧ ∏ x in u', g x = ∏ b in v', f b
⊢ ∃ i, True ∧ (fun s => ∏ b in s, f b) '' Ici i ⊆ (fun s => ∏ x in s, g x) '' Ici b

Next tactic:
refine ⟨v, trivial, ?_⟩
/-- Let `f` and `g` be two maps to the same commutative monoid. This lemma gives a sufficient
condition for comparison of the filter `atTop.map (fun s ↦ ∏ b in s, f b)` with
`atTop.map (fun s ↦ ∏ b in s, g b)`. This is useful to compare the set of limit points of
`Π b in s, f b` as `s → atTop` with the similar set for `g`. -/
@[to_additive "Let `f` and `g` be two maps to the same commutative additive monoid. This lemma gives
a sufficient condition for comparison of the filter `atTop.map (fun s ↦ ∑ b in s, f b)` with
`atTop.map (fun s ↦ ∑ b in s, g b)`. This is useful to compare the set of limit points of
`∑ b in s, f b` as `s → atTop` with the similar set for `g`."]
theorem map_atTop_finset_prod_le_of_prod_eq [CommMonoid α] {f : β → α} {g : γ → α}
    (h_eq : ∀ u : Finset γ,
      ∃ v : Finset β, ∀ v', v ⊆ v' → ∃ u', u ⊆ u' ∧ ∏ x in u', g x = ∏ b in v', f b) :
    (atTop.map fun s : Finset β => ∏ b in s, f b) ≤
      atTop.map fun s : Finset γ => ∏ x in s, g x := by
  classical
    refine' ((atTop_basis.map _).le_basis_iff (atTop_basis.map _)).2 fun b _ => _
    let ⟨v, hv⟩ := h_eq b
    refine ⟨v, trivial, ?_⟩
    

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : CommMonoid α
f : β → α
g : γ → α
h_eq : ∀ (u : Finset γ), ∃ v, ∀ (v' : Finset β), v ⊆ v' → ∃ u', u ⊆ u' ∧ ∏ x in u', g x = ∏ b in v', f b
b : Finset γ
x✝ : True
v : Finset β
hv : ∀ (v' : Finset β), v ⊆ v' → ∃ u', b ⊆ u' ∧ ∏ x in u', g x = ∏ b in v', f b
⊢ (fun s => ∏ b in s, f b) '' Ici v ⊆ (fun s => ∏ x in s, g x) '' Ici b

Next tactic:
simpa [image_subset_iff] using hv
/-- Given an antitone basis `s : ℕ → Set α` of a filter, extract an antitone subbasis `s ∘ φ`,
`φ : ℕ → ℕ`, such that `m < n` implies `r (φ m) (φ n)`. This lemma can be used to extract an
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
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
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 ∘ φ)

Next tactic:
rsuffices ⟨φ, hφ, hrφ⟩ : ∃ φ : ℕ → ℕ, StrictMono φ ∧ ∀ m n, m < n → r (φ m) (φ n)
/-- Given an antitone basis `s : ℕ → Set α` of a filter, extract an antitone subbasis `s ∘ φ`,
`φ : ℕ → ℕ`, such that `m < n` implies `r (φ m) (φ n)`. This lemma can be used to extract an
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
  rsuffices ⟨φ, hφ, hrφ⟩ : ∃ φ : ℕ → ℕ, StrictMono φ ∧ ∀ m n, m < n → r (φ m) (φ n)
  · 

Proof state:
case intro.intro
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
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 ∘ φ)

Next tactic:
exact ⟨φ, hφ, hrφ, hs.comp_strictMono hφ⟩
/-- Given an antitone basis `s : ℕ → Set α` of a filter, extract an antitone subbasis `s ∘ φ`,
`φ : ℕ → ℕ`, such that `m < n` implies `r (φ m) (φ n)`. This lemma can be used to extract an
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
  rsuffices ⟨φ, hφ, hrφ⟩ : ∃ φ : ℕ → ℕ, StrictMono φ ∧ ∀ m n, m < n → r (φ m) (φ n)
  · exact ⟨φ, hφ, hrφ, hs.comp_strictMono hφ⟩
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
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)

Next 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 _)
/-- Given an antitone basis `s : ℕ → Set α` of a filter, extract an antitone subbasis `s ∘ φ`,
`φ : ℕ → ℕ`, such that `m < n` implies `r (φ m) (φ n)`. This lemma can be used to extract an
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
  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 _)
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
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 ∈ t, m < n ∧ r m n
⊢ ∃ φ, StrictMono φ ∧ ∀ (m n : ℕ), m < n → r (φ m) (φ n)

Next tactic:
rcases seq_of_forall_finite_exists fun t ht => (this t ht).exists with ⟨φ, hφ⟩
/-- Given an antitone basis `s : ℕ → Set α` of a filter, extract an antitone subbasis `s ∘ φ`,
`φ : ℕ → ℕ`, such that `m < n` implies `r (φ m) (φ n)`. This lemma can be used to extract an
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
  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φ⟩
  

Proof state:
case intro
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
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 ∈ 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)

Next tactic:
simp only [ball_image_iff, forall_and, mem_Iio] at hφ