l3lab/ntp-mathlib huggingface dataset:
theorem eventually_atTop_prod_self' [SemilatticeSup α] [Nonempty α] {p : α × α → Prop} :
    (∀ᶠ x in atTop, p x) ↔ ∃ a, ∀ k ≥ a, ∀ l ≥ a, p (k, l) := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝¹ : SemilatticeSup α
inst✝ : Nonempty α
p : α × α → Prop
⊢ (∀ᶠ (x : α × α) in atTop, p x) ↔ ∃ a, ∀ k ≥ a, ∀ l ≥ a, p (k, l)

Next tactic:
simp only [eventually_atTop_prod_self, ball_cond_comm]
theorem eventually_atTop_curry [SemilatticeSup α] [SemilatticeSup β] {p : α × β → Prop}
    (hp : ∀ᶠ x : α × β in Filter.atTop, p x) : ∀ᶠ k in atTop, ∀ᶠ l in atTop, p (k, l) := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
p : α × β → Prop
hp : ∀ᶠ (x : α × β) in atTop, p x
⊢ ∀ᶠ (k : α) in atTop, ∀ᶠ (l : β) in atTop, p (k, l)

Next tactic:
rw [← prod_atTop_atTop_eq] at hp
theorem eventually_atTop_curry [SemilatticeSup α] [SemilatticeSup β] {p : α × β → Prop}
    (hp : ∀ᶠ x : α × β in Filter.atTop, p x) : ∀ᶠ k in atTop, ∀ᶠ l in atTop, p (k, l) := by
  rw [← prod_atTop_atTop_eq] at hp
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
p : α × β → Prop
hp : ∀ᶠ (x : α × β) in atTop ×ˢ atTop, p x
⊢ ∀ᶠ (k : α) in atTop, ∀ᶠ (l : β) in atTop, p (k, l)

Next tactic:
exact hp.curry
/-- A function `f` maps upwards closed sets (atTop sets) to upwards closed sets when it is a
Galois insertion. The Galois "insertion" and "connection" is weakened to only require it to be an
insertion and a connection above `b'`. -/
theorem map_atTop_eq_of_gc [SemilatticeSup α] [SemilatticeSup β] {f : α → β} (g : β → α) (b' : β)
    (hf : Monotone f) (gc : ∀ a, ∀ b ≥ b', f a ≤ b ↔ a ≤ g b) (hgi : ∀ b ≥ b', b ≤ f (g b)) :
    map f atTop = atTop := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
f : α → β
g : β → α
b' : β
hf : Monotone f
gc : ∀ (a : α), ∀ b ≥ b', f a ≤ b ↔ a ≤ g b
hgi : ∀ b ≥ b', b ≤ f (g b)
⊢ map f atTop = atTop

Next tactic:
refine'
    le_antisymm
      (hf.tendsto_atTop_atTop fun b => ⟨g (b ⊔ b'), le_sup_left.trans <| hgi _ le_sup_right⟩) _
/-- A function `f` maps upwards closed sets (atTop sets) to upwards closed sets when it is a
Galois insertion. The Galois "insertion" and "connection" is weakened to only require it to be an
insertion and a connection above `b'`. -/
theorem map_atTop_eq_of_gc [SemilatticeSup α] [SemilatticeSup β] {f : α → β} (g : β → α) (b' : β)
    (hf : Monotone f) (gc : ∀ a, ∀ b ≥ b', f a ≤ b ↔ a ≤ g b) (hgi : ∀ b ≥ b', b ≤ f (g b)) :
    map f atTop = atTop := by
  refine'
    le_antisymm
      (hf.tendsto_atTop_atTop fun b => ⟨g (b ⊔ b'), le_sup_left.trans <| hgi _ le_sup_right⟩) _
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
f : α → β
g : β → α
b' : β
hf : Monotone f
gc : ∀ (a : α), ∀ b ≥ b', f a ≤ b ↔ a ≤ g b
hgi : ∀ b ≥ b', b ≤ f (g b)
⊢ atTop ≤ map f atTop

Next tactic:
rw [@map_atTop_eq _ _ ⟨g b'⟩]
/-- A function `f` maps upwards closed sets (atTop sets) to upwards closed sets when it is a
Galois insertion. The Galois "insertion" and "connection" is weakened to only require it to be an
insertion and a connection above `b'`. -/
theorem map_atTop_eq_of_gc [SemilatticeSup α] [SemilatticeSup β] {f : α → β} (g : β → α) (b' : β)
    (hf : Monotone f) (gc : ∀ a, ∀ b ≥ b', f a ≤ b ↔ a ≤ g b) (hgi : ∀ b ≥ b', b ≤ f (g b)) :
    map f atTop = atTop := by
  refine'
    le_antisymm
      (hf.tendsto_atTop_atTop fun b => ⟨g (b ⊔ b'), le_sup_left.trans <| hgi _ le_sup_right⟩) _
  rw [@map_atTop_eq _ _ ⟨g b'⟩]
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
f : α → β
g : β → α
b' : β
hf : Monotone f
gc : ∀ (a : α), ∀ b ≥ b', f a ≤ b ↔ a ≤ g b
hgi : ∀ b ≥ b', b ≤ f (g b)
⊢ atTop ≤ ⨅ a, 𝓟 (f '' {a' | a ≤ a'})

Next tactic:
refine' le_iInf fun a => iInf_le_of_le (f a ⊔ b') <| principal_mono.2 fun b hb => _
/-- A function `f` maps upwards closed sets (atTop sets) to upwards closed sets when it is a
Galois insertion. The Galois "insertion" and "connection" is weakened to only require it to be an
insertion and a connection above `b'`. -/
theorem map_atTop_eq_of_gc [SemilatticeSup α] [SemilatticeSup β] {f : α → β} (g : β → α) (b' : β)
    (hf : Monotone f) (gc : ∀ a, ∀ b ≥ b', f a ≤ b ↔ a ≤ g b) (hgi : ∀ b ≥ b', b ≤ f (g b)) :
    map f atTop = atTop := by
  refine'
    le_antisymm
      (hf.tendsto_atTop_atTop fun b => ⟨g (b ⊔ b'), le_sup_left.trans <| hgi _ le_sup_right⟩) _
  rw [@map_atTop_eq _ _ ⟨g b'⟩]
  refine' le_iInf fun a => iInf_le_of_le (f a ⊔ b') <| principal_mono.2 fun b hb => _
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
f : α → β
g : β → α
b' : β
hf : Monotone f
gc : ∀ (a : α), ∀ b ≥ b', f a ≤ b ↔ a ≤ g b
hgi : ∀ b ≥ b', b ≤ f (g b)
a : α
b : β
hb : b ∈ Ici (f a ⊔ b')
⊢ b ∈ f '' {a' | a ≤ a'}

Next tactic:
rw [mem_Ici, sup_le_iff] at hb
/-- A function `f` maps upwards closed sets (atTop sets) to upwards closed sets when it is a
Galois insertion. The Galois "insertion" and "connection" is weakened to only require it to be an
insertion and a connection above `b'`. -/
theorem map_atTop_eq_of_gc [SemilatticeSup α] [SemilatticeSup β] {f : α → β} (g : β → α) (b' : β)
    (hf : Monotone f) (gc : ∀ a, ∀ b ≥ b', f a ≤ b ↔ a ≤ g b) (hgi : ∀ b ≥ b', b ≤ f (g b)) :
    map f atTop = atTop := by
  refine'
    le_antisymm
      (hf.tendsto_atTop_atTop fun b => ⟨g (b ⊔ b'), le_sup_left.trans <| hgi _ le_sup_right⟩) _
  rw [@map_atTop_eq _ _ ⟨g b'⟩]
  refine' le_iInf fun a => iInf_le_of_le (f a ⊔ b') <| principal_mono.2 fun b hb => _
  rw [mem_Ici, sup_le_iff] at hb
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝¹ : SemilatticeSup α
inst✝ : SemilatticeSup β
f : α → β
g : β → α
b' : β
hf : Monotone f
gc : ∀ (a : α), ∀ b ≥ b', f a ≤ b ↔ a ≤ g b
hgi : ∀ b ≥ b', b ≤ f (g b)
a : α
b : β
hb : f a ≤ b ∧ b' ≤ b
⊢ b ∈ f '' {a' | a ≤ a'}

Next tactic:
exact ⟨g b, (gc _ _ hb.2).1 hb.1, le_antisymm ((gc _ _ hb.2).2 le_rfl) (hgi _ hb.2)⟩
theorem map_val_atTop_of_Ici_subset [SemilatticeSup α] {a : α} {s : Set α} (h : Ici a ⊆ s) :
    map ((↑) : s → α) atTop = atTop := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
a : α
s : Set α
h : Ici a ⊆ s
⊢ map Subtype.val atTop = atTop

Next tactic:
haveI : Nonempty s := ⟨⟨a, h le_rfl⟩⟩
theorem map_val_atTop_of_Ici_subset [SemilatticeSup α] {a : α} {s : Set α} (h : Ici a ⊆ s) :
    map ((↑) : s → α) atTop = atTop := by
  haveI : Nonempty s := ⟨⟨a, h le_rfl⟩⟩
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
a : α
s : Set α
h : Ici a ⊆ s
this : Nonempty ↑s
⊢ map Subtype.val atTop = atTop

Next tactic:
have : Directed (· ≥ ·) fun x : s => 𝓟 (Ici x) := fun x y ↦ by
    use ⟨x ⊔ y ⊔ a, h le_sup_right⟩
    simp only [principal_mono, Ici_subset_Ici, ← Subtype.coe_le_coe, Subtype.coe_mk]
    exact ⟨le_sup_left.trans le_sup_left, le_sup_right.trans le_sup_left⟩
theorem map_val_atTop_of_Ici_subset [SemilatticeSup α] {a : α} {s : Set α} (h : Ici a ⊆ s) :
    map ((↑) : s → α) atTop = atTop := by
  haveI : Nonempty s := ⟨⟨a, h le_rfl⟩⟩
  have : Directed (· ≥ ·) fun x : s => 𝓟 (Ici x) := fun x y ↦ by
    

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
a : α
s : Set α
h : Ici a ⊆ s
this : Nonempty ↑s
x y : ↑s
⊢ ∃ z,
    (fun x x_1 => x ≥ x_1) ((fun x => 𝓟 (Ici x)) x) ((fun x => 𝓟 (Ici x)) z) ∧
      (fun x x_1 => x ≥ x_1) ((fun x => 𝓟 (Ici x)) y) ((fun x => 𝓟 (Ici x)) z)

Next tactic:
use ⟨x ⊔ y ⊔ a, h le_sup_right⟩
theorem map_val_atTop_of_Ici_subset [SemilatticeSup α] {a : α} {s : Set α} (h : Ici a ⊆ s) :
    map ((↑) : s → α) atTop = atTop := by
  haveI : Nonempty s := ⟨⟨a, h le_rfl⟩⟩
  have : Directed (· ≥ ·) fun x : s => 𝓟 (Ici x) := fun x y ↦ by
    use ⟨x ⊔ y ⊔ a, h le_sup_right⟩
    

Proof state:
case h
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
a : α
s : Set α
h : Ici a ⊆ s
this : Nonempty ↑s
x y : ↑s
⊢ (fun x x_1 => x ≥ x_1) ((fun x => 𝓟 (Ici x)) x)
      ((fun x => 𝓟 (Ici x)) { val := ↑x ⊔ ↑y ⊔ a, property := (_ : ↑x ⊔ ↑y ⊔ a ∈ s) }) ∧
    (fun x x_1 => x ≥ x_1) ((fun x => 𝓟 (Ici x)) y)
      ((fun x => 𝓟 (Ici x)) { val := ↑x ⊔ ↑y ⊔ a, property := (_ : ↑x ⊔ ↑y ⊔ a ∈ s) })

Next tactic:
simp only [principal_mono, Ici_subset_Ici, ← Subtype.coe_le_coe, Subtype.coe_mk]
theorem map_val_atTop_of_Ici_subset [SemilatticeSup α] {a : α} {s : Set α} (h : Ici a ⊆ s) :
    map ((↑) : s → α) atTop = atTop := by
  haveI : Nonempty s := ⟨⟨a, h le_rfl⟩⟩
  have : Directed (· ≥ ·) fun x : s => 𝓟 (Ici x) := fun x y ↦ by
    use ⟨x ⊔ y ⊔ a, h le_sup_right⟩
    simp only [principal_mono, Ici_subset_Ici, ← Subtype.coe_le_coe, Subtype.coe_mk]
    

Proof state:
case h
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
a : α
s : Set α
h : Ici a ⊆ s
this : Nonempty ↑s
x y : ↑s
⊢ ↑x ≤ ↑x ⊔ ↑y ⊔ a ∧ ↑y ≤ ↑x ⊔ ↑y ⊔ a

Next tactic:
exact ⟨le_sup_left.trans le_sup_left, le_sup_right.trans le_sup_left⟩
theorem map_val_atTop_of_Ici_subset [SemilatticeSup α] {a : α} {s : Set α} (h : Ici a ⊆ s) :
    map ((↑) : s → α) atTop = atTop := by
  haveI : Nonempty s := ⟨⟨a, h le_rfl⟩⟩
  have : Directed (· ≥ ·) fun x : s => 𝓟 (Ici x) := fun x y ↦ by
    use ⟨x ⊔ y ⊔ a, h le_sup_right⟩
    simp only [principal_mono, Ici_subset_Ici, ← Subtype.coe_le_coe, Subtype.coe_mk]
    exact ⟨le_sup_left.trans le_sup_left, le_sup_right.trans le_sup_left⟩
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
a : α
s : Set α
h : Ici a ⊆ s
this✝ : Nonempty ↑s
this : Directed (fun x x_1 => x ≥ x_1) fun x => 𝓟 (Ici x)
⊢ map Subtype.val atTop = atTop

Next tactic:
simp only [le_antisymm_iff, atTop, le_iInf_iff, le_principal_iff, mem_map, mem_setOf_eq,
    map_iInf_eq this, map_principal]
theorem map_val_atTop_of_Ici_subset [SemilatticeSup α] {a : α} {s : Set α} (h : Ici a ⊆ s) :
    map ((↑) : s → α) atTop = atTop := by
  haveI : Nonempty s := ⟨⟨a, h le_rfl⟩⟩
  have : Directed (· ≥ ·) fun x : s => 𝓟 (Ici x) := fun x y ↦ by
    use ⟨x ⊔ y ⊔ a, h le_sup_right⟩
    simp only [principal_mono, Ici_subset_Ici, ← Subtype.coe_le_coe, Subtype.coe_mk]
    exact ⟨le_sup_left.trans le_sup_left, le_sup_right.trans le_sup_left⟩
  simp only [le_antisymm_iff, atTop, le_iInf_iff, le_principal_iff, mem_map, mem_setOf_eq,
    map_iInf_eq this, map_principal]
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
a : α
s : Set α
h : Ici a ⊆ s
this✝ : Nonempty ↑s
this : Directed (fun x x_1 => x ≥ x_1) fun x => 𝓟 (Ici x)
⊢ (∀ (i : α), Ici i ∈ ⨅ i, 𝓟 (Subtype.val '' Ici i)) ∧ ∀ (i : ↑s), Subtype.val '' Ici i ∈ ⨅ a, 𝓟 (Ici a)

Next tactic:
constructor
theorem map_val_atTop_of_Ici_subset [SemilatticeSup α] {a : α} {s : Set α} (h : Ici a ⊆ s) :
    map ((↑) : s → α) atTop = atTop := by
  haveI : Nonempty s := ⟨⟨a, h le_rfl⟩⟩
  have : Directed (· ≥ ·) fun x : s => 𝓟 (Ici x) := fun x y ↦ by
    use ⟨x ⊔ y ⊔ a, h le_sup_right⟩
    simp only [principal_mono, Ici_subset_Ici, ← Subtype.coe_le_coe, Subtype.coe_mk]
    exact ⟨le_sup_left.trans le_sup_left, le_sup_right.trans le_sup_left⟩
  simp only [le_antisymm_iff, atTop, le_iInf_iff, le_principal_iff, mem_map, mem_setOf_eq,
    map_iInf_eq this, map_principal]
  constructor
  · 

Proof state:
case left
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
a : α
s : Set α
h : Ici a ⊆ s
this✝ : Nonempty ↑s
this : Directed (fun x x_1 => x ≥ x_1) fun x => 𝓟 (Ici x)
⊢ ∀ (i : α), Ici i ∈ ⨅ i, 𝓟 (Subtype.val '' Ici i)

Next tactic:
intro x
theorem map_val_atTop_of_Ici_subset [SemilatticeSup α] {a : α} {s : Set α} (h : Ici a ⊆ s) :
    map ((↑) : s → α) atTop = atTop := by
  haveI : Nonempty s := ⟨⟨a, h le_rfl⟩⟩
  have : Directed (· ≥ ·) fun x : s => 𝓟 (Ici x) := fun x y ↦ by
    use ⟨x ⊔ y ⊔ a, h le_sup_right⟩
    simp only [principal_mono, Ici_subset_Ici, ← Subtype.coe_le_coe, Subtype.coe_mk]
    exact ⟨le_sup_left.trans le_sup_left, le_sup_right.trans le_sup_left⟩
  simp only [le_antisymm_iff, atTop, le_iInf_iff, le_principal_iff, mem_map, mem_setOf_eq,
    map_iInf_eq this, map_principal]
  constructor
  · intro x
    

Proof state:
case left
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
a : α
s : Set α
h : Ici a ⊆ s
this✝ : Nonempty ↑s
this : Directed (fun x x_1 => x ≥ x_1) fun x => 𝓟 (Ici x)
x : α
⊢ Ici x ∈ ⨅ i, 𝓟 (Subtype.val '' Ici i)

Next tactic:
refine' mem_of_superset (mem_iInf_of_mem ⟨x ⊔ a, h le_sup_right⟩ (mem_principal_self _)) _
theorem map_val_atTop_of_Ici_subset [SemilatticeSup α] {a : α} {s : Set α} (h : Ici a ⊆ s) :
    map ((↑) : s → α) atTop = atTop := by
  haveI : Nonempty s := ⟨⟨a, h le_rfl⟩⟩
  have : Directed (· ≥ ·) fun x : s => 𝓟 (Ici x) := fun x y ↦ by
    use ⟨x ⊔ y ⊔ a, h le_sup_right⟩
    simp only [principal_mono, Ici_subset_Ici, ← Subtype.coe_le_coe, Subtype.coe_mk]
    exact ⟨le_sup_left.trans le_sup_left, le_sup_right.trans le_sup_left⟩
  simp only [le_antisymm_iff, atTop, le_iInf_iff, le_principal_iff, mem_map, mem_setOf_eq,
    map_iInf_eq this, map_principal]
  constructor
  · intro x
    refine' mem_of_superset (mem_iInf_of_mem ⟨x ⊔ a, h le_sup_right⟩ (mem_principal_self _)) _
    

Proof state:
case left
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
a : α
s : Set α
h : Ici a ⊆ s
this✝ : Nonempty ↑s
this : Directed (fun x x_1 => x ≥ x_1) fun x => 𝓟 (Ici x)
x : α
⊢ Subtype.val '' Ici { val := x ⊔ a, property := (_ : x ⊔ a ∈ s) } ⊆ Ici x

Next tactic:
rintro _ ⟨y, hy, rfl⟩
theorem map_val_atTop_of_Ici_subset [SemilatticeSup α] {a : α} {s : Set α} (h : Ici a ⊆ s) :
    map ((↑) : s → α) atTop = atTop := by
  haveI : Nonempty s := ⟨⟨a, h le_rfl⟩⟩
  have : Directed (· ≥ ·) fun x : s => 𝓟 (Ici x) := fun x y ↦ by
    use ⟨x ⊔ y ⊔ a, h le_sup_right⟩
    simp only [principal_mono, Ici_subset_Ici, ← Subtype.coe_le_coe, Subtype.coe_mk]
    exact ⟨le_sup_left.trans le_sup_left, le_sup_right.trans le_sup_left⟩
  simp only [le_antisymm_iff, atTop, le_iInf_iff, le_principal_iff, mem_map, mem_setOf_eq,
    map_iInf_eq this, map_principal]
  constructor
  · intro x
    refine' mem_of_superset (mem_iInf_of_mem ⟨x ⊔ a, h le_sup_right⟩ (mem_principal_self _)) _
    rintro _ ⟨y, hy, rfl⟩
    

Proof state:
case left.intro.intro
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
a : α
s : Set α
h : Ici a ⊆ s
this✝ : Nonempty ↑s
this : Directed (fun x x_1 => x ≥ x_1) fun x => 𝓟 (Ici x)
x : α
y : ↑s
hy : y ∈ Ici { val := x ⊔ a, property := (_ : x ⊔ a ∈ s) }
⊢ ↑y ∈ Ici x

Next tactic:
exact le_trans le_sup_left (Subtype.coe_le_coe.2 hy)
theorem map_val_atTop_of_Ici_subset [SemilatticeSup α] {a : α} {s : Set α} (h : Ici a ⊆ s) :
    map ((↑) : s → α) atTop = atTop := by
  haveI : Nonempty s := ⟨⟨a, h le_rfl⟩⟩
  have : Directed (· ≥ ·) fun x : s => 𝓟 (Ici x) := fun x y ↦ by
    use ⟨x ⊔ y ⊔ a, h le_sup_right⟩
    simp only [principal_mono, Ici_subset_Ici, ← Subtype.coe_le_coe, Subtype.coe_mk]
    exact ⟨le_sup_left.trans le_sup_left, le_sup_right.trans le_sup_left⟩
  simp only [le_antisymm_iff, atTop, le_iInf_iff, le_principal_iff, mem_map, mem_setOf_eq,
    map_iInf_eq this, map_principal]
  constructor
  · intro x
    refine' mem_of_superset (mem_iInf_of_mem ⟨x ⊔ a, h le_sup_right⟩ (mem_principal_self _)) _
    rintro _ ⟨y, hy, rfl⟩
    exact le_trans le_sup_left (Subtype.coe_le_coe.2 hy)
  · 

Proof state:
case right
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
a : α
s : Set α
h : Ici a ⊆ s
this✝ : Nonempty ↑s
this : Directed (fun x x_1 => x ≥ x_1) fun x => 𝓟 (Ici x)
⊢ ∀ (i : ↑s), Subtype.val '' Ici i ∈ ⨅ a, 𝓟 (Ici a)

Next tactic:
intro x
theorem map_val_atTop_of_Ici_subset [SemilatticeSup α] {a : α} {s : Set α} (h : Ici a ⊆ s) :
    map ((↑) : s → α) atTop = atTop := by
  haveI : Nonempty s := ⟨⟨a, h le_rfl⟩⟩
  have : Directed (· ≥ ·) fun x : s => 𝓟 (Ici x) := fun x y ↦ by
    use ⟨x ⊔ y ⊔ a, h le_sup_right⟩
    simp only [principal_mono, Ici_subset_Ici, ← Subtype.coe_le_coe, Subtype.coe_mk]
    exact ⟨le_sup_left.trans le_sup_left, le_sup_right.trans le_sup_left⟩
  simp only [le_antisymm_iff, atTop, le_iInf_iff, le_principal_iff, mem_map, mem_setOf_eq,
    map_iInf_eq this, map_principal]
  constructor
  · intro x
    refine' mem_of_superset (mem_iInf_of_mem ⟨x ⊔ a, h le_sup_right⟩ (mem_principal_self _)) _
    rintro _ ⟨y, hy, rfl⟩
    exact le_trans le_sup_left (Subtype.coe_le_coe.2 hy)
  · intro x
    

Proof state:
case right
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
a : α
s : Set α
h : Ici a ⊆ s
this✝ : Nonempty ↑s
this : Directed (fun x x_1 => x ≥ x_1) fun x => 𝓟 (Ici x)
x : ↑s
⊢ Subtype.val '' Ici x ∈ ⨅ a, 𝓟 (Ici a)

Next tactic:
filter_upwards [mem_atTop (↑x ⊔ a)] with b hb
theorem map_val_atTop_of_Ici_subset [SemilatticeSup α] {a : α} {s : Set α} (h : Ici a ⊆ s) :
    map ((↑) : s → α) atTop = atTop := by
  haveI : Nonempty s := ⟨⟨a, h le_rfl⟩⟩
  have : Directed (· ≥ ·) fun x : s => 𝓟 (Ici x) := fun x y ↦ by
    use ⟨x ⊔ y ⊔ a, h le_sup_right⟩
    simp only [principal_mono, Ici_subset_Ici, ← Subtype.coe_le_coe, Subtype.coe_mk]
    exact ⟨le_sup_left.trans le_sup_left, le_sup_right.trans le_sup_left⟩
  simp only [le_antisymm_iff, atTop, le_iInf_iff, le_principal_iff, mem_map, mem_setOf_eq,
    map_iInf_eq this, map_principal]
  constructor
  · intro x
    refine' mem_of_superset (mem_iInf_of_mem ⟨x ⊔ a, h le_sup_right⟩ (mem_principal_self _)) _
    rintro _ ⟨y, hy, rfl⟩
    exact le_trans le_sup_left (Subtype.coe_le_coe.2 hy)
  · intro x
    filter_upwards [mem_atTop (↑x ⊔ a)] with b hb
    

Proof state:
case h
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
a : α
s : Set α
h : Ici a ⊆ s
this✝ : Nonempty ↑s
this : Directed (fun x x_1 => x ≥ x_1) fun x => 𝓟 (Ici x)
x : ↑s
b : α
hb : ↑x ⊔ a ≤ b
⊢ b ∈ Subtype.val '' Ici x

Next tactic:
exact ⟨⟨b, h <| le_sup_right.trans hb⟩, Subtype.coe_le_coe.1 (le_sup_left.trans hb), rfl⟩
/-- The `atTop` filter for an open interval `Ioi a` comes from the `atTop` filter in the ambient
order. -/
theorem atTop_Ioi_eq [SemilatticeSup α] (a : α) : atTop = comap ((↑) : Ioi a → α) atTop := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
a : α
⊢ atTop = comap Subtype.val atTop

Next tactic:
rcases isEmpty_or_nonempty (Ioi a) with h|⟨⟨b, hb⟩⟩
/-- The `atTop` filter for an open interval `Ioi a` comes from the `atTop` filter in the ambient
order. -/
theorem atTop_Ioi_eq [SemilatticeSup α] (a : α) : atTop = comap ((↑) : Ioi a → α) atTop := by
  rcases isEmpty_or_nonempty (Ioi a) with h|⟨⟨b, hb⟩⟩
  · 

Proof state:
case inl
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
a : α
h : IsEmpty ↑(Ioi a)
⊢ atTop = comap Subtype.val atTop

Next tactic:
exact Subsingleton.elim _ _
/-- The `atTop` filter for an open interval `Ioi a` comes from the `atTop` filter in the ambient
order. -/
theorem atTop_Ioi_eq [SemilatticeSup α] (a : α) : atTop = comap ((↑) : Ioi a → α) atTop := by
  rcases isEmpty_or_nonempty (Ioi a) with h|⟨⟨b, hb⟩⟩
  · exact Subsingleton.elim _ _
  · 

Proof state:
case inr.intro.mk
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
a b : α
hb : b ∈ Ioi a
⊢ atTop = comap Subtype.val atTop

Next tactic:
rw [← map_val_atTop_of_Ici_subset (Ici_subset_Ioi.2 hb), comap_map Subtype.coe_injective]
/-- The `atTop` filter for an open interval `Ici a` comes from the `atTop` filter in the ambient
order. -/
theorem atTop_Ici_eq [SemilatticeSup α] (a : α) : atTop = comap ((↑) : Ici a → α) atTop := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
α : Type u_3
β : Type u_4
γ : Type u_5
inst✝ : SemilatticeSup α
a : α
⊢ atTop = comap Subtype.val atTop

Next tactic:
rw [← map_val_Ici_atTop a, comap_map Subtype.coe_injective]
theorem tendsto_Ioi_atTop [SemilatticeSup α] {a : α} {f : β → Ioi a} {l : Filter β} :
    Tendsto f l atTop ↔ Tendsto (fun x => (f x : α)) l atTop := by
  

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

Next tactic:
rw [atTop_Ioi_eq, tendsto_comap_iff]
theorem tendsto_Ioi_atTop [SemilatticeSup α] {a : α} {f : β → Ioi a} {l : Filter β} :
    Tendsto f l atTop ↔ Tendsto (fun x => (f x : α)) l atTop := by
  rw [atTop_Ioi_eq, tendsto_comap_iff]; 

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

Next tactic:
rfl
theorem tendsto_Iio_atBot [SemilatticeInf α] {a : α} {f : β → Iio a} {l : Filter β} :
    Tendsto f l atBot ↔ Tendsto (fun x => (f x : α)) l atBot := by
  

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

Next tactic:
rw [atBot_Iio_eq, tendsto_comap_iff]
theorem tendsto_Iio_atBot [SemilatticeInf α] {a : α} {f : β → Iio a} {l : Filter β} :
    Tendsto f l atBot ↔ Tendsto (fun x => (f x : α)) l atBot := by
  rw [atBot_Iio_eq, tendsto_comap_iff]; 

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

Next tactic:
rfl
theorem tendsto_Ici_atTop [SemilatticeSup α] {a : α} {f : β → Ici a} {l : Filter β} :
    Tendsto f l atTop ↔ Tendsto (fun x => (f x : α)) l atTop := by
  

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

Next tactic:
rw [atTop_Ici_eq, tendsto_comap_iff]
theorem tendsto_Ici_atTop [SemilatticeSup α] {a : α} {f : β → Ici a} {l : Filter β} :
    Tendsto f l atTop ↔ Tendsto (fun x => (f x : α)) l atTop := by
  rw [atTop_Ici_eq, tendsto_comap_iff]; 

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

Next tactic:
rfl
theorem tendsto_Iic_atBot [SemilatticeInf α] {a : α} {f : β → Iic a} {l : Filter β} :
    Tendsto f l atBot ↔ Tendsto (fun x => (f x : α)) l atBot := by
  

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

Next tactic:
rw [atBot_Iic_eq, tendsto_comap_iff]
theorem tendsto_Iic_atBot [SemilatticeInf α] {a : α} {f : β → Iic a} {l : Filter β} :
    Tendsto f l atBot ↔ Tendsto (fun x => (f x : α)) l atBot := by
  rw [atBot_Iic_eq, tendsto_comap_iff]; 

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

Next tactic:
rfl
@[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
  

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 atTop l

Next tactic:
rw [← map_val_Ioi_atTop a, tendsto_map'_iff]