l3lab/ntp-mathlib huggingface dataset:
/-- Construct a realizer for the inf of two filters -/
protected def inf {f g : Filter α} (F : f.Realizer) (G : g.Realizer) : (f ⊓ g).Realizer :=
  ⟨F.σ × G.σ,
    { f := fun ⟨s, t⟩ ↦ F.F s ∩ G.F t
      pt := (F.F.pt, G.F.pt)
      inf := fun ⟨a, a'⟩ ⟨b, b'⟩ ↦ (F.F.inf a b, G.F.inf a' b')
      inf_le_left := fun _ _ ↦ inter_subset_inter (F.F.inf_le_left _ _) (G.F.inf_le_left _ _)
      inf_le_right := fun _ _ ↦ inter_subset_inter (F.F.inf_le_right _ _) (G.F.inf_le_right _ _) },
    by
      cases F; cases G; substs f g; simp only [CFilter.toFilter, Prod.exists]; ext
      constructor
      · rintro ⟨s, t, h⟩
        apply mem_inf_of_inter _ _ h
        use s
        

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
σ✝¹ : Type ?u.33500
F✝¹ : CFilter (Set α) σ✝¹
σ✝ : Type ?u.33555
F✝ : CFilter (Set α) σ✝
s✝ : Set α
s : σ✝¹
t : σ✝
h : CFilter.f F✝¹ s ∩ CFilter.f F✝ t ⊆ s✝
⊢ CFilter.f F✝ t ∈
    { sets := {a | ∃ b, CFilter.f F✝ b ⊆ a}, univ_sets := (_ : ∃ b, CFilter.f F✝ b ⊆ univ),
      sets_of_superset :=
        (_ : ∀ {x y : Set α}, x ∈ {a | ∃ b, CFilter.f F✝ b ⊆ a} → x ⊆ y → y ∈ {a | ∃ b, CFilter.f F✝ b ⊆ a}),
      inter_sets :=
        (_ :
          ∀ {x y : Set α},
            x ∈ {a | ∃ b, CFilter.f F✝ b ⊆ a} →
              y ∈ {a | ∃ b, CFilter.f F✝ b ⊆ a} → x ∩ y ∈ {a | ∃ b, CFilter.f F✝ b ⊆ a}) }

Next tactic:
use t
/-- Construct a realizer for the inf of two filters -/
protected def inf {f g : Filter α} (F : f.Realizer) (G : g.Realizer) : (f ⊓ g).Realizer :=
  ⟨F.σ × G.σ,
    { f := fun ⟨s, t⟩ ↦ F.F s ∩ G.F t
      pt := (F.F.pt, G.F.pt)
      inf := fun ⟨a, a'⟩ ⟨b, b'⟩ ↦ (F.F.inf a b, G.F.inf a' b')
      inf_le_left := fun _ _ ↦ inter_subset_inter (F.F.inf_le_left _ _) (G.F.inf_le_left _ _)
      inf_le_right := fun _ _ ↦ inter_subset_inter (F.F.inf_le_right _ _) (G.F.inf_le_right _ _) },
    by
      cases F; cases G; substs f g; simp only [CFilter.toFilter, Prod.exists]; ext
      constructor
      · rintro ⟨s, t, h⟩
        apply mem_inf_of_inter _ _ h
        use s
        use t
      · 

Proof state:
case mk.mk.a.mpr
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
σ✝¹ : Type ?u.33500
F✝¹ : CFilter (Set α) σ✝¹
σ✝ : Type ?u.33555
F✝ : CFilter (Set α) σ✝
s✝ : Set α
⊢ s✝ ∈
      { sets := {a | ∃ b, CFilter.f F✝¹ b ⊆ a}, univ_sets := (_ : ∃ b, CFilter.f F✝¹ b ⊆ univ),
          sets_of_superset :=
            (_ : ∀ {x y : Set α}, x ∈ {a | ∃ b, CFilter.f F✝¹ b ⊆ a} → x ⊆ y → y ∈ {a | ∃ b, CFilter.f F✝¹ b ⊆ a}),
          inter_sets :=
            (_ :
              ∀ {x y : Set α},
                x ∈ {a | ∃ b, CFilter.f F✝¹ b ⊆ a} →
                  y ∈ {a | ∃ b, CFilter.f F✝¹ b ⊆ a} → x ∩ y ∈ {a | ∃ b, CFilter.f F✝¹ b ⊆ a}) } ⊓
        { sets := {a | ∃ b, CFilter.f F✝ b ⊆ a}, univ_sets := (_ : ∃ b, CFilter.f F✝ b ⊆ univ),
          sets_of_superset :=
            (_ : ∀ {x y : Set α}, x ∈ {a | ∃ b, CFilter.f F✝ b ⊆ a} → x ⊆ y → y ∈ {a | ∃ b, CFilter.f F✝ b ⊆ a}),
          inter_sets :=
            (_ :
              ∀ {x y : Set α},
                x ∈ {a | ∃ b, CFilter.f F✝ b ⊆ a} →
                  y ∈ {a | ∃ b, CFilter.f F✝ b ⊆ a} → x ∩ y ∈ {a | ∃ b, CFilter.f F✝ b ⊆ a}) } →
    s✝ ∈
      { sets := {a | ∃ a_1 b, CFilter.f F✝¹ a_1 ∩ CFilter.f F✝ b ⊆ a},
        univ_sets := (_ : univ ∈ {a | ∃ a_1 b, CFilter.f F✝¹ a_1 ∩ CFilter.f F✝ b ⊆ a}),
        sets_of_superset :=
          (_ :
            ∀ {x y : Set α},
              x ∈ {a | ∃ a_1 b, CFilter.f F✝¹ a_1 ∩ CFilter.f F✝ b ⊆ a} →
                x ⊆ y → y ∈ {a | ∃ a_1 b, CFilter.f F✝¹ a_1 ∩ CFilter.f F✝ b ⊆ a}),
        inter_sets :=
          (_ :
            ∀ {x y : Set α},
              x ∈ {a | ∃ a_1 b, CFilter.f F✝¹ a_1 ∩ CFilter.f F✝ b ⊆ a} →
                y ∈ {a | ∃ a_1 b, CFilter.f F✝¹ a_1 ∩ CFilter.f F✝ b ⊆ a} →
                  x ∩ y ∈ {a | ∃ a_1 b, CFilter.f F✝¹ a_1 ∩ CFilter.f F✝ b ⊆ a}) }

Next tactic:
rintro ⟨_, ⟨a, ha⟩, _, ⟨b, hb⟩, rfl⟩
/-- Construct a realizer for the inf of two filters -/
protected def inf {f g : Filter α} (F : f.Realizer) (G : g.Realizer) : (f ⊓ g).Realizer :=
  ⟨F.σ × G.σ,
    { f := fun ⟨s, t⟩ ↦ F.F s ∩ G.F t
      pt := (F.F.pt, G.F.pt)
      inf := fun ⟨a, a'⟩ ⟨b, b'⟩ ↦ (F.F.inf a b, G.F.inf a' b')
      inf_le_left := fun _ _ ↦ inter_subset_inter (F.F.inf_le_left _ _) (G.F.inf_le_left _ _)
      inf_le_right := fun _ _ ↦ inter_subset_inter (F.F.inf_le_right _ _) (G.F.inf_le_right _ _) },
    by
      cases F; cases G; substs f g; simp only [CFilter.toFilter, Prod.exists]; ext
      constructor
      · rintro ⟨s, t, h⟩
        apply mem_inf_of_inter _ _ h
        use s
        use t
      · rintro ⟨_, ⟨a, ha⟩, _, ⟨b, hb⟩, rfl⟩
        

Proof state:
case mk.mk.a.mpr.intro.intro.intro.intro.intro.intro
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
σ✝¹ : Type ?u.33500
F✝¹ : CFilter (Set α) σ✝¹
σ✝ : Type ?u.33555
F✝ : CFilter (Set α) σ✝
w✝¹ : Set α
a : σ✝¹
ha : CFilter.f F✝¹ a ⊆ w✝¹
w✝ : Set α
b : σ✝
hb : CFilter.f F✝ b ⊆ w✝
⊢ w✝¹ ∩ w✝ ∈
    { sets := {a | ∃ a_1 b, CFilter.f F✝¹ a_1 ∩ CFilter.f F✝ b ⊆ a},
      univ_sets := (_ : univ ∈ {a | ∃ a_1 b, CFilter.f F✝¹ a_1 ∩ CFilter.f F✝ b ⊆ a}),
      sets_of_superset :=
        (_ :
          ∀ {x y : Set α},
            x ∈ {a | ∃ a_1 b, CFilter.f F✝¹ a_1 ∩ CFilter.f F✝ b ⊆ a} →
              x ⊆ y → y ∈ {a | ∃ a_1 b, CFilter.f F✝¹ a_1 ∩ CFilter.f F✝ b ⊆ a}),
      inter_sets :=
        (_ :
          ∀ {x y : Set α},
            x ∈ {a | ∃ a_1 b, CFilter.f F✝¹ a_1 ∩ CFilter.f F✝ b ⊆ a} →
              y ∈ {a | ∃ a_1 b, CFilter.f F✝¹ a_1 ∩ CFilter.f F✝ b ⊆ a} →
                x ∩ y ∈ {a | ∃ a_1 b, CFilter.f F✝¹ a_1 ∩ CFilter.f F✝ b ⊆ a}) }

Next tactic:
exact ⟨a, b, inter_subset_inter ha hb⟩
/-- Construct a realizer for the cofinite filter -/
protected def cofinite [DecidableEq α] : (@cofinite α).Realizer :=
  ⟨Finset α,
    { f := fun s ↦ { a | a ∉ s }
      pt := ∅
      inf := (· ∪ ·)
      inf_le_left := fun _ _ _ ↦ mt (Finset.mem_union_left _)
      inf_le_right := fun _ _ _ ↦ mt (Finset.mem_union_right _) },
    filter_eq <|
      Set.ext fun _ ↦
        ⟨fun ⟨s, h⟩ ↦ s.finite_toSet.subset (compl_subset_comm.1 h), fun h ↦
          ⟨h.toFinset, by 

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
inst✝ : DecidableEq α
x✝ : Set α
h : x✝ ∈ cofinite.sets
⊢ CFilter.f
      { f := fun s => {a | a ∉ s}, pt := ∅, inf := fun x x_1 => x ∪ x_1,
        inf_le_left := (_ : ∀ (x x_1 : Finset α), ∀ x_2 ∉ (fun x x_3 => x ∪ x_3) x x_1, x_2 ∉ x),
        inf_le_right := (_ : ∀ (x x_1 : Finset α), ∀ x_2 ∉ (fun x x_3 => x ∪ x_3) x x_1, x_2 ∉ x_1) }
      (Finite.toFinset h) ⊆
    x✝

Next tactic:
simp [Subset.rfl]
/-- Construct a realizer for filter bind -/
protected def bind {f : Filter α} {m : α → Filter β} (F : f.Realizer) (G : ∀ i, (m i).Realizer) :
    (f.bind m).Realizer :=
  ⟨Σs : F.σ, ∀ i ∈ F.F s, (G i).σ,
    { f := fun ⟨s, f⟩ ↦ ⋃ i ∈ F.F s, (G i).F (f i (by 

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
f✝ : Filter α
m : α → Filter β
F : Realizer f✝
G : (i : α) → Realizer (m i)
x✝ : (s : F.σ) × ((i : α) → i ∈ CFilter.f F.F s → (G i).σ)
s : F.σ
f : (i : α) → i ∈ CFilter.f F.F s → (G i).σ
i : α
h✝ : i ∈ CFilter.f F.F s
⊢ i ∈ CFilter.f F.F s

Next tactic:
assumption
/-- Construct a realizer for filter bind -/
protected def bind {f : Filter α} {m : α → Filter β} (F : f.Realizer) (G : ∀ i, (m i).Realizer) :
    (f.bind m).Realizer :=
  ⟨Σs : F.σ, ∀ i ∈ F.F s, (G i).σ,
    { f := fun ⟨s, f⟩ ↦ ⋃ i ∈ F.F s, (G i).F (f i (by assumption))
      pt := ⟨F.F.pt, fun i _ ↦ (G i).F.pt⟩
      inf := fun ⟨a, f⟩ ⟨b, f'⟩ ↦
        ⟨F.F.inf a b, fun i h ↦
          (G i).F.inf (f i (F.F.inf_le_left _ _ h)) (f' i (F.F.inf_le_right _ _ h))⟩
      inf_le_left := fun _ _ _ ↦ by
        

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
f : Filter α
m : α → Filter β
F : Realizer f
G : (i : α) → Realizer (m i)
x✝² x✝¹ : (s : F.σ) × ((i : α) → i ∈ CFilter.f F.F s → (G i).σ)
x✝ : β
⊢ x✝ ∈
      (fun x =>
          match x with
          | { fst := s, snd := f_1 } => ⋃ i, ⋃ (h : i ∈ CFilter.f F.F s), CFilter.f (G i).F (f_1 i h))
        ((fun x x_1 =>
            match x with
            | { fst := a, snd := f_1 } =>
              match x_1 with
              | { fst := b, snd := f' } =>
                { fst := CFilter.inf F.F a b,
                  snd := fun i h =>
                    CFilter.inf (G i).F (f_1 i (_ : i ∈ CFilter.f F.F a)) (f' i (_ : i ∈ CFilter.f F.F b)) })
          x✝² x✝¹) →
    x✝ ∈
      (fun x =>
          match x with
          | { fst := s, snd := f_1 } => ⋃ i, ⋃ (h : i ∈ CFilter.f F.F s), CFilter.f (G i).F (f_1 i h))
        x✝²

Next tactic:
simp only [mem_iUnion, forall_exists_index]
/-- Construct a realizer for filter bind -/
protected def bind {f : Filter α} {m : α → Filter β} (F : f.Realizer) (G : ∀ i, (m i).Realizer) :
    (f.bind m).Realizer :=
  ⟨Σs : F.σ, ∀ i ∈ F.F s, (G i).σ,
    { f := fun ⟨s, f⟩ ↦ ⋃ i ∈ F.F s, (G i).F (f i (by assumption))
      pt := ⟨F.F.pt, fun i _ ↦ (G i).F.pt⟩
      inf := fun ⟨a, f⟩ ⟨b, f'⟩ ↦
        ⟨F.F.inf a b, fun i h ↦
          (G i).F.inf (f i (F.F.inf_le_left _ _ h)) (f' i (F.F.inf_le_right _ _ h))⟩
      inf_le_left := fun _ _ _ ↦ by
        simp only [mem_iUnion, forall_exists_index]
        

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
f : Filter α
m : α → Filter β
F : Realizer f
G : (i : α) → Realizer (m i)
x✝² x✝¹ : (s : F.σ) × ((i : α) → i ∈ CFilter.f F.F s → (G i).σ)
x✝ : β
⊢ ∀ (x : α) (x_1 : x ∈ CFilter.f F.F (CFilter.inf F.F x✝².fst x✝¹.fst)),
    x✝ ∈
        CFilter.f (G x).F
          (CFilter.inf (G x).F (Sigma.snd x✝² x (_ : x ∈ CFilter.f F.F x✝².fst))
            (Sigma.snd x✝¹ x (_ : x ∈ CFilter.f F.F x✝¹.fst))) →
      ∃ i, ∃ (i_1 : i ∈ CFilter.f F.F x✝².fst), x✝ ∈ CFilter.f (G i).F (Sigma.snd x✝² i i_1)

Next tactic:
exact fun i h₁ h₂ ↦ ⟨i, F.F.inf_le_left _ _ h₁, (G i).F.inf_le_left _ _ h₂⟩
/-- Construct a realizer for filter bind -/
protected def bind {f : Filter α} {m : α → Filter β} (F : f.Realizer) (G : ∀ i, (m i).Realizer) :
    (f.bind m).Realizer :=
  ⟨Σs : F.σ, ∀ i ∈ F.F s, (G i).σ,
    { f := fun ⟨s, f⟩ ↦ ⋃ i ∈ F.F s, (G i).F (f i (by assumption))
      pt := ⟨F.F.pt, fun i _ ↦ (G i).F.pt⟩
      inf := fun ⟨a, f⟩ ⟨b, f'⟩ ↦
        ⟨F.F.inf a b, fun i h ↦
          (G i).F.inf (f i (F.F.inf_le_left _ _ h)) (f' i (F.F.inf_le_right _ _ h))⟩
      inf_le_left := fun _ _ _ ↦ by
        simp only [mem_iUnion, forall_exists_index]
        exact fun i h₁ h₂ ↦ ⟨i, F.F.inf_le_left _ _ h₁, (G i).F.inf_le_left _ _ h₂⟩
      inf_le_right := fun _ _ _ ↦ by
        

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
f : Filter α
m : α → Filter β
F : Realizer f
G : (i : α) → Realizer (m i)
x✝² x✝¹ : (s : F.σ) × ((i : α) → i ∈ CFilter.f F.F s → (G i).σ)
x✝ : β
⊢ x✝ ∈
      (fun x =>
          match x with
          | { fst := s, snd := f_1 } => ⋃ i, ⋃ (h : i ∈ CFilter.f F.F s), CFilter.f (G i).F (f_1 i h))
        ((fun x x_1 =>
            match x with
            | { fst := a, snd := f_1 } =>
              match x_1 with
              | { fst := b, snd := f' } =>
                { fst := CFilter.inf F.F a b,
                  snd := fun i h =>
                    CFilter.inf (G i).F (f_1 i (_ : i ∈ CFilter.f F.F a)) (f' i (_ : i ∈ CFilter.f F.F b)) })
          x✝² x✝¹) →
    x✝ ∈
      (fun x =>
          match x with
          | { fst := s, snd := f_1 } => ⋃ i, ⋃ (h : i ∈ CFilter.f F.F s), CFilter.f (G i).F (f_1 i h))
        x✝¹

Next tactic:
simp only [mem_iUnion, forall_exists_index]
/-- Construct a realizer for filter bind -/
protected def bind {f : Filter α} {m : α → Filter β} (F : f.Realizer) (G : ∀ i, (m i).Realizer) :
    (f.bind m).Realizer :=
  ⟨Σs : F.σ, ∀ i ∈ F.F s, (G i).σ,
    { f := fun ⟨s, f⟩ ↦ ⋃ i ∈ F.F s, (G i).F (f i (by assumption))
      pt := ⟨F.F.pt, fun i _ ↦ (G i).F.pt⟩
      inf := fun ⟨a, f⟩ ⟨b, f'⟩ ↦
        ⟨F.F.inf a b, fun i h ↦
          (G i).F.inf (f i (F.F.inf_le_left _ _ h)) (f' i (F.F.inf_le_right _ _ h))⟩
      inf_le_left := fun _ _ _ ↦ by
        simp only [mem_iUnion, forall_exists_index]
        exact fun i h₁ h₂ ↦ ⟨i, F.F.inf_le_left _ _ h₁, (G i).F.inf_le_left _ _ h₂⟩
      inf_le_right := fun _ _ _ ↦ by
        simp only [mem_iUnion, forall_exists_index]
        

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
f : Filter α
m : α → Filter β
F : Realizer f
G : (i : α) → Realizer (m i)
x✝² x✝¹ : (s : F.σ) × ((i : α) → i ∈ CFilter.f F.F s → (G i).σ)
x✝ : β
⊢ ∀ (x : α) (x_1 : x ∈ CFilter.f F.F (CFilter.inf F.F x✝².fst x✝¹.fst)),
    x✝ ∈
        CFilter.f (G x).F
          (CFilter.inf (G x).F (Sigma.snd x✝² x (_ : x ∈ CFilter.f F.F x✝².fst))
            (Sigma.snd x✝¹ x (_ : x ∈ CFilter.f F.F x✝¹.fst))) →
      ∃ i, ∃ (i_1 : i ∈ CFilter.f F.F x✝¹.fst), x✝ ∈ CFilter.f (G i).F (Sigma.snd x✝¹ i i_1)

Next tactic:
exact fun i h₁ h₂ ↦ ⟨i, F.F.inf_le_right _ _ h₁, (G i).F.inf_le_right _ _ h₂⟩
/-- Construct a realizer for filter bind -/
protected def bind {f : Filter α} {m : α → Filter β} (F : f.Realizer) (G : ∀ i, (m i).Realizer) :
    (f.bind m).Realizer :=
  ⟨Σs : F.σ, ∀ i ∈ F.F s, (G i).σ,
    { f := fun ⟨s, f⟩ ↦ ⋃ i ∈ F.F s, (G i).F (f i (by assumption))
      pt := ⟨F.F.pt, fun i _ ↦ (G i).F.pt⟩
      inf := fun ⟨a, f⟩ ⟨b, f'⟩ ↦
        ⟨F.F.inf a b, fun i h ↦
          (G i).F.inf (f i (F.F.inf_le_left _ _ h)) (f' i (F.F.inf_le_right _ _ h))⟩
      inf_le_left := fun _ _ _ ↦ by
        simp only [mem_iUnion, forall_exists_index]
        exact fun i h₁ h₂ ↦ ⟨i, F.F.inf_le_left _ _ h₁, (G i).F.inf_le_left _ _ h₂⟩
      inf_le_right := fun _ _ _ ↦ by
        simp only [mem_iUnion, forall_exists_index]
        exact fun i h₁ h₂ ↦ ⟨i, F.F.inf_le_right _ _ h₁, (G i).F.inf_le_right _ _ h₂⟩ },
    filter_eq <| Set.ext fun _ ↦ by
      cases' F with _ F _; subst f
      simp only [CFilter.toFilter, iUnion_subset_iff, Sigma.exists, Filter.mem_sets, mem_bind]
      

Proof state:
case mk
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
m : α → Filter β
G : (i : α) → Realizer (m i)
x✝ : Set β
σ✝ : Type ?u.42857
F : CFilter (Set α) σ✝
⊢ x✝ ∈ {a | ∃ a_1 b, ∀ (i : α) (i_1 : i ∈ CFilter.f F a_1), CFilter.f (G i).F (b i i_1) ⊆ a} ↔
    ∃
      t ∈
        { sets := {a | ∃ b, CFilter.f F b ⊆ a}, univ_sets := (_ : ∃ b, CFilter.f F b ⊆ univ),
          sets_of_superset :=
            (_ : ∀ {x y : Set α}, x ∈ {a | ∃ b, CFilter.f F b ⊆ a} → x ⊆ y → y ∈ {a | ∃ b, CFilter.f F b ⊆ a}),
          inter_sets :=
            (_ :
              ∀ {x y : Set α},
                x ∈ {a | ∃ b, CFilter.f F b ⊆ a} →
                  y ∈ {a | ∃ b, CFilter.f F b ⊆ a} → x ∩ y ∈ {a | ∃ b, CFilter.f F b ⊆ a}) },
      ∀ x ∈ t, x✝ ∈ m x

Next tactic:
exact
        ⟨fun ⟨s, f, h⟩ ↦
          ⟨F s, ⟨s, Subset.refl _⟩, fun i H ↦ (G i).mem_sets.2 ⟨f i H, fun _ h' ↦ h i H h'⟩⟩,
          fun ⟨_, ⟨s, h⟩, f⟩ ↦
          let ⟨f', h'⟩ := Classical.axiom_of_choice fun i : F s ↦ (G i).mem_sets.1 (f i (h i.2))
          ⟨s, fun i h ↦ f' ⟨i, h⟩, fun _ H _ m ↦ h' ⟨_, H⟩ m⟩⟩
/-- Construct a realizer for indexed supremum -/
protected def iSup {f : α → Filter β} (F : ∀ i, (f i).Realizer) : (⨆ i, f i).Realizer :=
  let F' : (⨆ i, f i).Realizer :=
    (Realizer.bind Realizer.top F).ofEq <|
      filter_eq <| Set.ext <| by 

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
f : α → Filter β
F : (i : α) → Realizer (f i)
⊢ ∀ (x : Set β), x ∈ (bind ⊤ fun i => f i).sets ↔ x ∈ (⨆ i, f i).sets

Next tactic:
simp [Filter.bind, eq_univ_iff_forall, iSup_sets_eq]
theorem ne_bot_iff {f : Filter α} (F : f.Realizer) : f ≠ ⊥ ↔ ∀ a : F.σ, (F.F a).Nonempty := by
  

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
f : Filter α
F : Realizer f
⊢ f ≠ ⊥ ↔ ∀ (a : F.σ), Set.Nonempty (CFilter.f F.F a)

Next tactic:
rw [not_iff_comm, ← le_bot_iff, F.le_iff Realizer.bot, not_forall]
theorem ne_bot_iff {f : Filter α} (F : f.Realizer) : f ≠ ⊥ ↔ ∀ a : F.σ, (F.F a).Nonempty := by
  rw [not_iff_comm, ← le_bot_iff, F.le_iff Realizer.bot, not_forall]
  

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
f : Filter α
F : Realizer f
⊢ (∃ x, ¬Set.Nonempty (CFilter.f F.F x)) ↔ ∀ (b : Realizer.bot.σ), ∃ a, CFilter.f F.F a ≤ CFilter.f Realizer.bot.F b

Next tactic:
simp only [Set.not_nonempty_iff_eq_empty]
theorem ne_bot_iff {f : Filter α} (F : f.Realizer) : f ≠ ⊥ ↔ ∀ a : F.σ, (F.F a).Nonempty := by
  rw [not_iff_comm, ← le_bot_iff, F.le_iff Realizer.bot, not_forall]
  simp only [Set.not_nonempty_iff_eq_empty]
  

Proof state:
α : Type u_1
β : Type u_2
σ : Type u_3
τ : Type u_4
f : Filter α
F : Realizer f
⊢ (∃ x, CFilter.f F.F x = ∅) ↔ ∀ (b : Realizer.bot.σ), ∃ a, CFilter.f F.F a ≤ CFilter.f Realizer.bot.F b

Next tactic:
exact ⟨fun ⟨x, e⟩ _ ↦ ⟨x, le_of_eq e⟩, fun h ↦
    let ⟨x, h⟩ := h ()
    ⟨x, le_bot_iff.1 h⟩⟩
/-- Intermediate value theorem for two functions: if `f` and `g` are two continuous functions
on a preconnected space and `f a ≤ g a` and `g b ≤ f b`, then for some `x` we have `f x = g x`. -/
theorem intermediate_value_univ₂ [PreconnectedSpace X] {a b : X} {f g : X → α} (hf : Continuous f)
    (hg : Continuous g) (ha : f a ≤ g a) (hb : g b ≤ f b) : ∃ x, f x = g x := by
  

Proof state:
X : Type u
α : Type v
inst✝⁴ : TopologicalSpace X
inst✝³ : LinearOrder α
inst✝² : TopologicalSpace α
inst✝¹ : OrderClosedTopology α
inst✝ : PreconnectedSpace X
a b : X
f g : X → α
hf : Continuous f
hg : Continuous g
ha : f a ≤ g a
hb : g b ≤ f b
⊢ ∃ x, f x = g x

Next tactic:
obtain ⟨x, _, hfg, hgf⟩ : (univ ∩ { x | f x ≤ g x ∧ g x ≤ f x }).Nonempty
/-- Intermediate value theorem for two functions: if `f` and `g` are two continuous functions
on a preconnected space and `f a ≤ g a` and `g b ≤ f b`, then for some `x` we have `f x = g x`. -/
theorem intermediate_value_univ₂ [PreconnectedSpace X] {a b : X} {f g : X → α} (hf : Continuous f)
    (hg : Continuous g) (ha : f a ≤ g a) (hb : g b ≤ f b) : ∃ x, f x = g x := by
  obtain ⟨x, _, hfg, hgf⟩ : (univ ∩ { x | f x ≤ g x ∧ g x ≤ f x }).Nonempty
  

Proof state:
X : Type u
α : Type v
inst✝⁴ : TopologicalSpace X
inst✝³ : LinearOrder α
inst✝² : TopologicalSpace α
inst✝¹ : OrderClosedTopology α
inst✝ : PreconnectedSpace X
a b : X
f g : X → α
hf : Continuous f
hg : Continuous g
ha : f a ≤ g a
hb : g b ≤ f b
⊢ Set.Nonempty (univ ∩ {x | f x ≤ g x ∧ g x ≤ f x})
case intro.intro.intro
X : Type u
α : Type v
inst✝⁴ : TopologicalSpace X
inst✝³ : LinearOrder α
inst✝² : TopologicalSpace α
inst✝¹ : OrderClosedTopology α
inst✝ : PreconnectedSpace X
a b : X
f g : X → α
hf : Continuous f
hg : Continuous g
ha : f a ≤ g a
hb : g b ≤ f b
x : X
left✝ : x ∈ univ
hfg : f x ≤ g x
hgf : g x ≤ f x
⊢ ∃ x, f x = g x

Next tactic:
exact
    isPreconnected_closed_iff.1 PreconnectedSpace.isPreconnected_univ _ _ (isClosed_le hf hg)
      (isClosed_le hg hf) (fun _ _ => le_total _ _) ⟨a, trivial, ha⟩ ⟨b, trivial, hb⟩
/-- Intermediate value theorem for two functions: if `f` and `g` are two continuous functions
on a preconnected space and `f a ≤ g a` and `g b ≤ f b`, then for some `x` we have `f x = g x`. -/
theorem intermediate_value_univ₂ [PreconnectedSpace X] {a b : X} {f g : X → α} (hf : Continuous f)
    (hg : Continuous g) (ha : f a ≤ g a) (hb : g b ≤ f b) : ∃ x, f x = g x := by
  obtain ⟨x, _, hfg, hgf⟩ : (univ ∩ { x | f x ≤ g x ∧ g x ≤ f x }).Nonempty
  exact
    isPreconnected_closed_iff.1 PreconnectedSpace.isPreconnected_univ _ _ (isClosed_le hf hg)
      (isClosed_le hg hf) (fun _ _ => le_total _ _) ⟨a, trivial, ha⟩ ⟨b, trivial, hb⟩
  

Proof state:
case intro.intro.intro
X : Type u
α : Type v
inst✝⁴ : TopologicalSpace X
inst✝³ : LinearOrder α
inst✝² : TopologicalSpace α
inst✝¹ : OrderClosedTopology α
inst✝ : PreconnectedSpace X
a b : X
f g : X → α
hf : Continuous f
hg : Continuous g
ha : f a ≤ g a
hb : g b ≤ f b
x : X
left✝ : x ∈ univ
hfg : f x ≤ g x
hgf : g x ≤ f x
⊢ ∃ x, f x = g x

Next tactic:
exact ⟨x, le_antisymm hfg hgf⟩
theorem IsPreconnected.intermediate_value₂_eventually₁ {s : Set X} (hs : IsPreconnected s) {a : X}
    {l : Filter X} (ha : a ∈ s) [NeBot l] (hl : l ≤ 𝓟 s) {f g : X → α} (hf : ContinuousOn f s)
    (hg : ContinuousOn g s) (ha' : f a ≤ g a) (he : g ≤ᶠ[l] f) : ∃ x ∈ s, f x = g x := by
  

Proof state:
X : Type u
α : Type v
inst✝⁴ : TopologicalSpace X
inst✝³ : LinearOrder α
inst✝² : TopologicalSpace α
inst✝¹ : OrderClosedTopology α
s : Set X
hs : IsPreconnected s
a : X
l : Filter X
ha : a ∈ s
inst✝ : NeBot l
hl : l ≤ 𝓟 s
f g : X → α
hf : ContinuousOn f s
hg : ContinuousOn g s
ha' : f a ≤ g a
he : g ≤ᶠ[l] f
⊢ ∃ x ∈ s, f x = g x

Next tactic:
rw [continuousOn_iff_continuous_restrict] at hf hg
theorem IsPreconnected.intermediate_value₂_eventually₁ {s : Set X} (hs : IsPreconnected s) {a : X}
    {l : Filter X} (ha : a ∈ s) [NeBot l] (hl : l ≤ 𝓟 s) {f g : X → α} (hf : ContinuousOn f s)
    (hg : ContinuousOn g s) (ha' : f a ≤ g a) (he : g ≤ᶠ[l] f) : ∃ x ∈ s, f x = g x := by
  rw [continuousOn_iff_continuous_restrict] at hf hg
  

Proof state:
X : Type u
α : Type v
inst✝⁴ : TopologicalSpace X
inst✝³ : LinearOrder α
inst✝² : TopologicalSpace α
inst✝¹ : OrderClosedTopology α
s : Set X
hs : IsPreconnected s
a : X
l : Filter X
ha : a ∈ s
inst✝ : NeBot l
hl : l ≤ 𝓟 s
f g : X → α
hf : Continuous (restrict s f)
hg : Continuous (restrict s g)
ha' : f a ≤ g a
he : g ≤ᶠ[l] f
⊢ ∃ x ∈ s, f x = g x

Next tactic:
obtain ⟨b, h⟩ :=
    @intermediate_value_univ₂_eventually₁ _ _ _ _ _ _ (Subtype.preconnectedSpace hs) ⟨a, ha⟩ _
      (comap_coe_neBot_of_le_principal hl) _ _ hf hg ha' (he.comap _)
theorem IsPreconnected.intermediate_value₂_eventually₁ {s : Set X} (hs : IsPreconnected s) {a : X}
    {l : Filter X} (ha : a ∈ s) [NeBot l] (hl : l ≤ 𝓟 s) {f g : X → α} (hf : ContinuousOn f s)
    (hg : ContinuousOn g s) (ha' : f a ≤ g a) (he : g ≤ᶠ[l] f) : ∃ x ∈ s, f x = g x := by
  rw [continuousOn_iff_continuous_restrict] at hf hg
  obtain ⟨b, h⟩ :=
    @intermediate_value_univ₂_eventually₁ _ _ _ _ _ _ (Subtype.preconnectedSpace hs) ⟨a, ha⟩ _
      (comap_coe_neBot_of_le_principal hl) _ _ hf hg ha' (he.comap _)
  

Proof state:
case intro
X : Type u
α : Type v
inst✝⁴ : TopologicalSpace X
inst✝³ : LinearOrder α
inst✝² : TopologicalSpace α
inst✝¹ : OrderClosedTopology α
s : Set X
hs : IsPreconnected s
a : X
l : Filter X
ha : a ∈ s
inst✝ : NeBot l
hl : l ≤ 𝓟 s
f g : X → α
hf : Continuous (restrict s f)
hg : Continuous (restrict s g)
ha' : f a ≤ g a
he : g ≤ᶠ[l] f
b : ↑s
h : restrict s f b = restrict s g b
⊢ ∃ x ∈ s, f x = g x

Next tactic:
exact ⟨b, b.prop, h⟩
theorem IsPreconnected.intermediate_value₂_eventually₂ {s : Set X} (hs : IsPreconnected s)
    {l₁ l₂ : Filter X} [NeBot l₁] [NeBot l₂] (hl₁ : l₁ ≤ 𝓟 s) (hl₂ : l₂ ≤ 𝓟 s) {f g : X → α}
    (hf : ContinuousOn f s) (hg : ContinuousOn g s) (he₁ : f ≤ᶠ[l₁] g) (he₂ : g ≤ᶠ[l₂] f) :
    ∃ x ∈ s, f x = g x := by
  

Proof state:
X : Type u
α : Type v
inst✝⁵ : TopologicalSpace X
inst✝⁴ : LinearOrder α
inst✝³ : TopologicalSpace α
inst✝² : OrderClosedTopology α
s : Set X
hs : IsPreconnected s
l₁ l₂ : Filter X
inst✝¹ : NeBot l₁
inst✝ : NeBot l₂
hl₁ : l₁ ≤ 𝓟 s
hl₂ : l₂ ≤ 𝓟 s
f g : X → α
hf : ContinuousOn f s
hg : ContinuousOn g s
he₁ : f ≤ᶠ[l₁] g
he₂ : g ≤ᶠ[l₂] f
⊢ ∃ x ∈ s, f x = g x

Next tactic:
rw [continuousOn_iff_continuous_restrict] at hf hg
theorem IsPreconnected.intermediate_value₂_eventually₂ {s : Set X} (hs : IsPreconnected s)
    {l₁ l₂ : Filter X} [NeBot l₁] [NeBot l₂] (hl₁ : l₁ ≤ 𝓟 s) (hl₂ : l₂ ≤ 𝓟 s) {f g : X → α}
    (hf : ContinuousOn f s) (hg : ContinuousOn g s) (he₁ : f ≤ᶠ[l₁] g) (he₂ : g ≤ᶠ[l₂] f) :
    ∃ x ∈ s, f x = g x := by
  rw [continuousOn_iff_continuous_restrict] at hf hg
  

Proof state:
X : Type u
α : Type v
inst✝⁵ : TopologicalSpace X
inst✝⁴ : LinearOrder α
inst✝³ : TopologicalSpace α
inst✝² : OrderClosedTopology α
s : Set X
hs : IsPreconnected s
l₁ l₂ : Filter X
inst✝¹ : NeBot l₁
inst✝ : NeBot l₂
hl₁ : l₁ ≤ 𝓟 s
hl₂ : l₂ ≤ 𝓟 s
f g : X → α
hf : Continuous (restrict s f)
hg : Continuous (restrict s g)
he₁ : f ≤ᶠ[l₁] g
he₂ : g ≤ᶠ[l₂] f
⊢ ∃ x ∈ s, f x = g x

Next tactic:
obtain ⟨b, h⟩ :=
    @intermediate_value_univ₂_eventually₂ _ _ _ _ _ _ (Subtype.preconnectedSpace hs) _ _
      (comap_coe_neBot_of_le_principal hl₁) (comap_coe_neBot_of_le_principal hl₂) _ _ hf hg
      (he₁.comap _) (he₂.comap _)