l3lab/ntp-mathlib huggingface dataset:
@[simp]
theorem sup_join {f₁ f₂ : Filter (Filter α)} : join f₁ ⊔ join f₂ = join (f₁ ⊔ f₂) :=
  Filter.ext fun x => by 

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s t : Set α
f₁ f₂ : Filter (Filter α)
x : Set α
⊢ x ∈ join f₁ ⊔ join f₂ ↔ x ∈ join (f₁ ⊔ f₂)

Next tactic:
simp only [mem_sup, mem_join]
@[simp]
theorem iSup_join {ι : Sort w} {f : ι → Filter (Filter α)} : ⨆ x, join (f x) = join (⨆ x, f x) :=
  Filter.ext fun x => by 

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι✝ : Sort x
f✝ g : Filter α
s t : Set α
ι : Sort w
f : ι → Filter (Filter α)
x : Set α
⊢ x ∈ ⨆ x, join (f x) ↔ x ∈ join (⨆ x, f x)

Next tactic:
simp only [mem_iSup, mem_join]
instance : DistribLattice (Filter α) :=
  { Filter.instCompleteLatticeFilter with
    le_sup_inf := by
      

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s t : Set α
src✝ : CompleteLattice (Filter α) := instCompleteLatticeFilter
⊢ ∀ (x y z : Filter α), (x ⊔ y) ⊓ (x ⊔ z) ≤ x ⊔ y ⊓ z

Next tactic:
intro x y z s
instance : DistribLattice (Filter α) :=
  { Filter.instCompleteLatticeFilter with
    le_sup_inf := by
      intro x y z s
      

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝ t : Set α
src✝ : CompleteLattice (Filter α) := instCompleteLatticeFilter
x y z : Filter α
s : Set α
⊢ s ∈ x ⊔ y ⊓ z → s ∈ (x ⊔ y) ⊓ (x ⊔ z)

Next tactic:
simp only [and_assoc, mem_inf_iff, mem_sup, exists_prop, exists_imp, and_imp]
instance : DistribLattice (Filter α) :=
  { Filter.instCompleteLatticeFilter with
    le_sup_inf := by
      intro x y z s
      simp only [and_assoc, mem_inf_iff, mem_sup, exists_prop, exists_imp, and_imp]
      

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝ t : Set α
src✝ : CompleteLattice (Filter α) := instCompleteLatticeFilter
x y z : Filter α
s : Set α
⊢ s ∈ x → ∀ x_1 ∈ y, ∀ x_2 ∈ z, s = x_1 ∩ x_2 → ∃ t₁ ∈ x, t₁ ∈ y ∧ ∃ t₂ ∈ x, t₂ ∈ z ∧ s = t₁ ∩ t₂

Next tactic:
rintro hs t₁ ht₁ t₂ ht₂ rfl
instance : DistribLattice (Filter α) :=
  { Filter.instCompleteLatticeFilter with
    le_sup_inf := by
      intro x y z s
      simp only [and_assoc, mem_inf_iff, mem_sup, exists_prop, exists_imp, and_imp]
      rintro hs t₁ ht₁ t₂ ht₂ rfl
      

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s t : Set α
src✝ : CompleteLattice (Filter α) := instCompleteLatticeFilter
x y z : Filter α
t₁ : Set α
ht₁ : t₁ ∈ y
t₂ : Set α
ht₂ : t₂ ∈ z
hs : t₁ ∩ t₂ ∈ x
⊢ ∃ t₁_1 ∈ x, t₁_1 ∈ y ∧ ∃ t₂_1 ∈ x, t₂_1 ∈ z ∧ t₁ ∩ t₂ = t₁_1 ∩ t₂_1

Next tactic:
exact
        ⟨t₁, x.sets_of_superset hs (inter_subset_left t₁ t₂), ht₁, t₂,
          x.sets_of_superset hs (inter_subset_right t₁ t₂), ht₂, rfl⟩
instance : Coframe (Filter α) :=
  { Filter.instCompleteLatticeFilter with
    iInf_sup_le_sup_sInf := fun f s t ⟨h₁, h₂⟩ => by
      

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t✝ : Set α
src✝ : CompleteLattice (Filter α) := instCompleteLatticeFilter
f : Filter α
s : Set (Filter α)
t : Set α
x✝ : t ∈ f ⊔ sInf s
h₁ : t ∈ f.sets
h₂ : t ∈ (sInf s).sets
⊢ t ∈ ⨅ b ∈ s, f ⊔ b

Next tactic:
rw [iInf_subtype']
instance : Coframe (Filter α) :=
  { Filter.instCompleteLatticeFilter with
    iInf_sup_le_sup_sInf := fun f s t ⟨h₁, h₂⟩ => by
      rw [iInf_subtype']
      

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t✝ : Set α
src✝ : CompleteLattice (Filter α) := instCompleteLatticeFilter
f : Filter α
s : Set (Filter α)
t : Set α
x✝ : t ∈ f ⊔ sInf s
h₁ : t ∈ f.sets
h₂ : t ∈ (sInf s).sets
⊢ t ∈ ⨅ x, f ⊔ ↑x

Next tactic:
rw [sInf_eq_iInf', iInf_sets_eq_finite, mem_iUnion] at h₂
instance : Coframe (Filter α) :=
  { Filter.instCompleteLatticeFilter with
    iInf_sup_le_sup_sInf := fun f s t ⟨h₁, h₂⟩ => by
      rw [iInf_subtype']
      rw [sInf_eq_iInf', iInf_sets_eq_finite, mem_iUnion] at h₂
      

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t✝ : Set α
src✝ : CompleteLattice (Filter α) := instCompleteLatticeFilter
f : Filter α
s : Set (Filter α)
t : Set α
x✝ : t ∈ f ⊔ sInf s
h₁ : t ∈ f.sets
h₂ : ∃ i, t ∈ (⨅ i_1 ∈ i, ↑i_1).sets
⊢ t ∈ ⨅ x, f ⊔ ↑x

Next tactic:
obtain ⟨u, hu⟩ := h₂
instance : Coframe (Filter α) :=
  { Filter.instCompleteLatticeFilter with
    iInf_sup_le_sup_sInf := fun f s t ⟨h₁, h₂⟩ => by
      rw [iInf_subtype']
      rw [sInf_eq_iInf', iInf_sets_eq_finite, mem_iUnion] at h₂
      obtain ⟨u, hu⟩ := h₂
      

Proof state:
case intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t✝ : Set α
src✝ : CompleteLattice (Filter α) := instCompleteLatticeFilter
f : Filter α
s : Set (Filter α)
t : Set α
x✝ : t ∈ f ⊔ sInf s
h₁ : t ∈ f.sets
u : Finset ↑s
hu : t ∈ (⨅ i ∈ u, ↑i).sets
⊢ t ∈ ⨅ x, f ⊔ ↑x

Next tactic:
rw [← Finset.inf_eq_iInf] at hu
instance : Coframe (Filter α) :=
  { Filter.instCompleteLatticeFilter with
    iInf_sup_le_sup_sInf := fun f s t ⟨h₁, h₂⟩ => by
      rw [iInf_subtype']
      rw [sInf_eq_iInf', iInf_sets_eq_finite, mem_iUnion] at h₂
      obtain ⟨u, hu⟩ := h₂
      rw [← Finset.inf_eq_iInf] at hu
      

Proof state:
case intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t✝ : Set α
src✝ : CompleteLattice (Filter α) := instCompleteLatticeFilter
f : Filter α
s : Set (Filter α)
t : Set α
x✝ : t ∈ f ⊔ sInf s
h₁ : t ∈ f.sets
u : Finset ↑s
hu : t ∈ (Finset.inf u fun i => ↑i).sets
⊢ t ∈ ⨅ x, f ⊔ ↑x

Next tactic:
suffices ⨅ i : s, f ⊔ ↑i ≤ f ⊔ u.inf fun i => ↑i from this ⟨h₁, hu⟩
instance : Coframe (Filter α) :=
  { Filter.instCompleteLatticeFilter with
    iInf_sup_le_sup_sInf := fun f s t ⟨h₁, h₂⟩ => by
      rw [iInf_subtype']
      rw [sInf_eq_iInf', iInf_sets_eq_finite, mem_iUnion] at h₂
      obtain ⟨u, hu⟩ := h₂
      rw [← Finset.inf_eq_iInf] at hu
      suffices ⨅ i : s, f ⊔ ↑i ≤ f ⊔ u.inf fun i => ↑i from this ⟨h₁, hu⟩
      

Proof state:
case intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t✝ : Set α
src✝ : CompleteLattice (Filter α) := instCompleteLatticeFilter
f : Filter α
s : Set (Filter α)
t : Set α
x✝ : t ∈ f ⊔ sInf s
h₁ : t ∈ f.sets
u : Finset ↑s
hu : t ∈ (Finset.inf u fun i => ↑i).sets
⊢ ⨅ i, f ⊔ ↑i ≤ f ⊔ Finset.inf u fun i => ↑i

Next tactic:
refine' Finset.induction_on u (le_sup_of_le_right le_top) _
instance : Coframe (Filter α) :=
  { Filter.instCompleteLatticeFilter with
    iInf_sup_le_sup_sInf := fun f s t ⟨h₁, h₂⟩ => by
      rw [iInf_subtype']
      rw [sInf_eq_iInf', iInf_sets_eq_finite, mem_iUnion] at h₂
      obtain ⟨u, hu⟩ := h₂
      rw [← Finset.inf_eq_iInf] at hu
      suffices ⨅ i : s, f ⊔ ↑i ≤ f ⊔ u.inf fun i => ↑i from this ⟨h₁, hu⟩
      refine' Finset.induction_on u (le_sup_of_le_right le_top) _
      

Proof state:
case intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t✝ : Set α
src✝ : CompleteLattice (Filter α) := instCompleteLatticeFilter
f : Filter α
s : Set (Filter α)
t : Set α
x✝ : t ∈ f ⊔ sInf s
h₁ : t ∈ f.sets
u : Finset ↑s
hu : t ∈ (Finset.inf u fun i => ↑i).sets
⊢ ∀ ⦃a : ↑s⦄ {s_1 : Finset ↑s},
    a ∉ s_1 → (⨅ i, f ⊔ ↑i ≤ f ⊔ Finset.inf s_1 fun i => ↑i) → ⨅ i, f ⊔ ↑i ≤ f ⊔ Finset.inf (insert a s_1) fun i => ↑i

Next tactic:
rintro ⟨i⟩ u _ ih
instance : Coframe (Filter α) :=
  { Filter.instCompleteLatticeFilter with
    iInf_sup_le_sup_sInf := fun f s t ⟨h₁, h₂⟩ => by
      rw [iInf_subtype']
      rw [sInf_eq_iInf', iInf_sets_eq_finite, mem_iUnion] at h₂
      obtain ⟨u, hu⟩ := h₂
      rw [← Finset.inf_eq_iInf] at hu
      suffices ⨅ i : s, f ⊔ ↑i ≤ f ⊔ u.inf fun i => ↑i from this ⟨h₁, hu⟩
      refine' Finset.induction_on u (le_sup_of_le_right le_top) _
      rintro ⟨i⟩ u _ ih
      

Proof state:
case intro.mk
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t✝ : Set α
src✝ : CompleteLattice (Filter α) := instCompleteLatticeFilter
f : Filter α
s : Set (Filter α)
t : Set α
x✝ : t ∈ f ⊔ sInf s
h₁ : t ∈ f.sets
u✝ : Finset ↑s
hu : t ∈ (Finset.inf u✝ fun i => ↑i).sets
i : Filter α
property✝ : i ∈ s
u : Finset ↑s
a✝ : { val := i, property := property✝ } ∉ u
ih : ⨅ i, f ⊔ ↑i ≤ f ⊔ Finset.inf u fun i => ↑i
⊢ ⨅ i, f ⊔ ↑i ≤ f ⊔ Finset.inf (insert { val := i, property := property✝ } u) fun i => ↑i

Next tactic:
rw [Finset.inf_insert, sup_inf_left]
instance : Coframe (Filter α) :=
  { Filter.instCompleteLatticeFilter with
    iInf_sup_le_sup_sInf := fun f s t ⟨h₁, h₂⟩ => by
      rw [iInf_subtype']
      rw [sInf_eq_iInf', iInf_sets_eq_finite, mem_iUnion] at h₂
      obtain ⟨u, hu⟩ := h₂
      rw [← Finset.inf_eq_iInf] at hu
      suffices ⨅ i : s, f ⊔ ↑i ≤ f ⊔ u.inf fun i => ↑i from this ⟨h₁, hu⟩
      refine' Finset.induction_on u (le_sup_of_le_right le_top) _
      rintro ⟨i⟩ u _ ih
      rw [Finset.inf_insert, sup_inf_left]
      

Proof state:
case intro.mk
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t✝ : Set α
src✝ : CompleteLattice (Filter α) := instCompleteLatticeFilter
f : Filter α
s : Set (Filter α)
t : Set α
x✝ : t ∈ f ⊔ sInf s
h₁ : t ∈ f.sets
u✝ : Finset ↑s
hu : t ∈ (Finset.inf u✝ fun i => ↑i).sets
i : Filter α
property✝ : i ∈ s
u : Finset ↑s
a✝ : { val := i, property := property✝ } ∉ u
ih : ⨅ i, f ⊔ ↑i ≤ f ⊔ Finset.inf u fun i => ↑i
⊢ ⨅ i, f ⊔ ↑i ≤ (f ⊔ ↑{ val := i, property := property✝ }) ⊓ (f ⊔ Finset.inf u fun i => ↑i)

Next tactic:
exact le_inf (iInf_le _ _) ih
theorem mem_iInf_finset {s : Finset α} {f : α → Filter β} {t : Set β} :
    (t ∈ ⨅ a ∈ s, f a) ↔ ∃ p : α → Set β, (∀ a ∈ s, p a ∈ f a) ∧ t = ⋂ a ∈ s, p a := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t✝ : Set α
s : Finset α
f : α → Filter β
t : Set β
⊢ t ∈ ⨅ a ∈ s, f a ↔ ∃ p, (∀ a ∈ s, p a ∈ f a) ∧ t = ⋂ a ∈ s, p a

Next tactic:
simp only [← Finset.set_biInter_coe, biInter_eq_iInter, iInf_subtype']
theorem mem_iInf_finset {s : Finset α} {f : α → Filter β} {t : Set β} :
    (t ∈ ⨅ a ∈ s, f a) ↔ ∃ p : α → Set β, (∀ a ∈ s, p a ∈ f a) ∧ t = ⋂ a ∈ s, p a := by
  simp only [← Finset.set_biInter_coe, biInter_eq_iInter, iInf_subtype']
  

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t✝ : Set α
s : Finset α
f : α → Filter β
t : Set β
⊢ t ∈ ⨅ x, f ↑x ↔ ∃ p, (∀ a ∈ s, p a ∈ f a) ∧ t = ⋂ x, p ↑x

Next tactic:
refine' ⟨fun h => _, _⟩
theorem mem_iInf_finset {s : Finset α} {f : α → Filter β} {t : Set β} :
    (t ∈ ⨅ a ∈ s, f a) ↔ ∃ p : α → Set β, (∀ a ∈ s, p a ∈ f a) ∧ t = ⋂ a ∈ s, p a := by
  simp only [← Finset.set_biInter_coe, biInter_eq_iInter, iInf_subtype']
  refine' ⟨fun h => _, _⟩
  · 

Proof state:
case refine'_1
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t✝ : Set α
s : Finset α
f : α → Filter β
t : Set β
h : t ∈ ⨅ x, f ↑x
⊢ ∃ p, (∀ a ∈ s, p a ∈ f a) ∧ t = ⋂ x, p ↑x

Next tactic:
rcases (mem_iInf_of_finite _).1 h with ⟨p, hp, rfl⟩
theorem mem_iInf_finset {s : Finset α} {f : α → Filter β} {t : Set β} :
    (t ∈ ⨅ a ∈ s, f a) ↔ ∃ p : α → Set β, (∀ a ∈ s, p a ∈ f a) ∧ t = ⋂ a ∈ s, p a := by
  simp only [← Finset.set_biInter_coe, biInter_eq_iInter, iInf_subtype']
  refine' ⟨fun h => _, _⟩
  · rcases (mem_iInf_of_finite _).1 h with ⟨p, hp, rfl⟩
    

Proof state:
case refine'_1.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t : Set α
s : Finset α
f : α → Filter β
p : { i // i ∈ s } → Set β
hp : ∀ (i : { i // i ∈ s }), p i ∈ f ↑i
h : ⋂ i, p i ∈ ⨅ x, f ↑x
⊢ ∃ p_1, (∀ a ∈ s, p_1 a ∈ f a) ∧ ⋂ i, p i = ⋂ x, p_1 ↑x

Next tactic:
refine'
      ⟨fun a => if h : a ∈ s then p ⟨a, h⟩ else univ, fun a ha => by simpa [ha] using hp ⟨a, ha⟩, _⟩
theorem mem_iInf_finset {s : Finset α} {f : α → Filter β} {t : Set β} :
    (t ∈ ⨅ a ∈ s, f a) ↔ ∃ p : α → Set β, (∀ a ∈ s, p a ∈ f a) ∧ t = ⋂ a ∈ s, p a := by
  simp only [← Finset.set_biInter_coe, biInter_eq_iInter, iInf_subtype']
  refine' ⟨fun h => _, _⟩
  · rcases (mem_iInf_of_finite _).1 h with ⟨p, hp, rfl⟩
    refine'
      ⟨fun a => if h : a ∈ s then p ⟨a, h⟩ else univ, fun a ha => by 

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t : Set α
s : Finset α
f : α → Filter β
p : { i // i ∈ s } → Set β
hp : ∀ (i : { i // i ∈ s }), p i ∈ f ↑i
h : ⋂ i, p i ∈ ⨅ x, f ↑x
a : α
ha : a ∈ s
⊢ (fun a => if h : a ∈ s then p { val := a, property := h } else univ) a ∈ f a

Next tactic:
simpa [ha] using hp ⟨a, ha⟩
theorem mem_iInf_finset {s : Finset α} {f : α → Filter β} {t : Set β} :
    (t ∈ ⨅ a ∈ s, f a) ↔ ∃ p : α → Set β, (∀ a ∈ s, p a ∈ f a) ∧ t = ⋂ a ∈ s, p a := by
  simp only [← Finset.set_biInter_coe, biInter_eq_iInter, iInf_subtype']
  refine' ⟨fun h => _, _⟩
  · rcases (mem_iInf_of_finite _).1 h with ⟨p, hp, rfl⟩
    refine'
      ⟨fun a => if h : a ∈ s then p ⟨a, h⟩ else univ, fun a ha => by simpa [ha] using hp ⟨a, ha⟩, _⟩
    

Proof state:
case refine'_1.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t : Set α
s : Finset α
f : α → Filter β
p : { i // i ∈ s } → Set β
hp : ∀ (i : { i // i ∈ s }), p i ∈ f ↑i
h : ⋂ i, p i ∈ ⨅ x, f ↑x
⊢ ⋂ i, p i = ⋂ x, (fun a => if h : a ∈ s then p { val := a, property := h } else univ) ↑x

Next tactic:
refine' iInter_congr_of_surjective id surjective_id _
theorem mem_iInf_finset {s : Finset α} {f : α → Filter β} {t : Set β} :
    (t ∈ ⨅ a ∈ s, f a) ↔ ∃ p : α → Set β, (∀ a ∈ s, p a ∈ f a) ∧ t = ⋂ a ∈ s, p a := by
  simp only [← Finset.set_biInter_coe, biInter_eq_iInter, iInf_subtype']
  refine' ⟨fun h => _, _⟩
  · rcases (mem_iInf_of_finite _).1 h with ⟨p, hp, rfl⟩
    refine'
      ⟨fun a => if h : a ∈ s then p ⟨a, h⟩ else univ, fun a ha => by simpa [ha] using hp ⟨a, ha⟩, _⟩
    refine' iInter_congr_of_surjective id surjective_id _
    

Proof state:
case refine'_1.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t : Set α
s : Finset α
f : α → Filter β
p : { i // i ∈ s } → Set β
hp : ∀ (i : { i // i ∈ s }), p i ∈ f ↑i
h : ⋂ i, p i ∈ ⨅ x, f ↑x
⊢ ∀ (x : { i // i ∈ s }), (fun a => if h : a ∈ s then p { val := a, property := h } else univ) ↑(id x) = p x

Next tactic:
rintro ⟨a, ha⟩
theorem mem_iInf_finset {s : Finset α} {f : α → Filter β} {t : Set β} :
    (t ∈ ⨅ a ∈ s, f a) ↔ ∃ p : α → Set β, (∀ a ∈ s, p a ∈ f a) ∧ t = ⋂ a ∈ s, p a := by
  simp only [← Finset.set_biInter_coe, biInter_eq_iInter, iInf_subtype']
  refine' ⟨fun h => _, _⟩
  · rcases (mem_iInf_of_finite _).1 h with ⟨p, hp, rfl⟩
    refine'
      ⟨fun a => if h : a ∈ s then p ⟨a, h⟩ else univ, fun a ha => by simpa [ha] using hp ⟨a, ha⟩, _⟩
    refine' iInter_congr_of_surjective id surjective_id _
    rintro ⟨a, ha⟩
    

Proof state:
case refine'_1.intro.intro.mk
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t : Set α
s : Finset α
f : α → Filter β
p : { i // i ∈ s } → Set β
hp : ∀ (i : { i // i ∈ s }), p i ∈ f ↑i
h : ⋂ i, p i ∈ ⨅ x, f ↑x
a : α
ha : a ∈ s
⊢ (fun a => if h : a ∈ s then p { val := a, property := h } else univ) ↑(id { val := a, property := ha }) =
    p { val := a, property := ha }

Next tactic:
simp [ha]
theorem mem_iInf_finset {s : Finset α} {f : α → Filter β} {t : Set β} :
    (t ∈ ⨅ a ∈ s, f a) ↔ ∃ p : α → Set β, (∀ a ∈ s, p a ∈ f a) ∧ t = ⋂ a ∈ s, p a := by
  simp only [← Finset.set_biInter_coe, biInter_eq_iInter, iInf_subtype']
  refine' ⟨fun h => _, _⟩
  · rcases (mem_iInf_of_finite _).1 h with ⟨p, hp, rfl⟩
    refine'
      ⟨fun a => if h : a ∈ s then p ⟨a, h⟩ else univ, fun a ha => by simpa [ha] using hp ⟨a, ha⟩, _⟩
    refine' iInter_congr_of_surjective id surjective_id _
    rintro ⟨a, ha⟩
    simp [ha]
  · 

Proof state:
case refine'_2
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t✝ : Set α
s : Finset α
f : α → Filter β
t : Set β
⊢ (∃ p, (∀ a ∈ s, p a ∈ f a) ∧ t = ⋂ x, p ↑x) → t ∈ ⨅ x, f ↑x

Next tactic:
rintro ⟨p, hpf, rfl⟩
theorem mem_iInf_finset {s : Finset α} {f : α → Filter β} {t : Set β} :
    (t ∈ ⨅ a ∈ s, f a) ↔ ∃ p : α → Set β, (∀ a ∈ s, p a ∈ f a) ∧ t = ⋂ a ∈ s, p a := by
  simp only [← Finset.set_biInter_coe, biInter_eq_iInter, iInf_subtype']
  refine' ⟨fun h => _, _⟩
  · rcases (mem_iInf_of_finite _).1 h with ⟨p, hp, rfl⟩
    refine'
      ⟨fun a => if h : a ∈ s then p ⟨a, h⟩ else univ, fun a ha => by simpa [ha] using hp ⟨a, ha⟩, _⟩
    refine' iInter_congr_of_surjective id surjective_id _
    rintro ⟨a, ha⟩
    simp [ha]
  · rintro ⟨p, hpf, rfl⟩
    

Proof state:
case refine'_2.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t : Set α
s : Finset α
f : α → Filter β
p : α → Set β
hpf : ∀ a ∈ s, p a ∈ f a
⊢ ⋂ x, p ↑x ∈ ⨅ x, f ↑x

Next tactic:
exact iInter_mem.2 fun a => mem_iInf_of_mem a (hpf a a.2)
/-- If `f : ι → Filter α` is directed, `ι` is not empty, and `∀ i, f i ≠ ⊥`, then `iInf f ≠ ⊥`.
See also `iInf_neBot_of_directed` for a version assuming `Nonempty α` instead of `Nonempty ι`. -/
theorem iInf_neBot_of_directed' {f : ι → Filter α} [Nonempty ι] (hd : Directed (· ≥ ·) f) :
    (∀ i, NeBot (f i)) → NeBot (iInf f) :=
  not_imp_not.1 <| by 

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s t : Set α
f : ι → Filter α
inst✝ : Nonempty ι
hd : Directed (fun x x_1 => x ≥ x_1) f
⊢ ¬NeBot (iInf f) → ¬∀ (i : ι), NeBot (f i)

Next tactic:
simpa only [not_forall, not_neBot, ← empty_mem_iff_bot,
    mem_iInf_of_directed hd] using id
/-- If `f : ι → Filter α` is directed, `α` is not empty, and `∀ i, f i ≠ ⊥`, then `iInf f ≠ ⊥`.
See also `iInf_neBot_of_directed'` for a version assuming `Nonempty ι` instead of `Nonempty α`. -/
theorem iInf_neBot_of_directed {f : ι → Filter α} [hn : Nonempty α] (hd : Directed (· ≥ ·) f)
    (hb : ∀ i, NeBot (f i)) : NeBot (iInf f) := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s t : Set α
f : ι → Filter α
hn : Nonempty α
hd : Directed (fun x x_1 => x ≥ x_1) f
hb : ∀ (i : ι), NeBot (f i)
⊢ NeBot (iInf f)

Next tactic:
cases isEmpty_or_nonempty ι
/-- If `f : ι → Filter α` is directed, `α` is not empty, and `∀ i, f i ≠ ⊥`, then `iInf f ≠ ⊥`.
See also `iInf_neBot_of_directed'` for a version assuming `Nonempty ι` instead of `Nonempty α`. -/
theorem iInf_neBot_of_directed {f : ι → Filter α} [hn : Nonempty α] (hd : Directed (· ≥ ·) f)
    (hb : ∀ i, NeBot (f i)) : NeBot (iInf f) := by
  cases isEmpty_or_nonempty ι
  · 

Proof state:
case inl
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s t : Set α
f : ι → Filter α
hn : Nonempty α
hd : Directed (fun x x_1 => x ≥ x_1) f
hb : ∀ (i : ι), NeBot (f i)
h✝ : IsEmpty ι
⊢ NeBot (iInf f)

Next tactic:
constructor
/-- If `f : ι → Filter α` is directed, `α` is not empty, and `∀ i, f i ≠ ⊥`, then `iInf f ≠ ⊥`.
See also `iInf_neBot_of_directed'` for a version assuming `Nonempty ι` instead of `Nonempty α`. -/
theorem iInf_neBot_of_directed {f : ι → Filter α} [hn : Nonempty α] (hd : Directed (· ≥ ·) f)
    (hb : ∀ i, NeBot (f i)) : NeBot (iInf f) := by
  cases isEmpty_or_nonempty ι
  · constructor
    

Proof state:
case inl.ne'
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s t : Set α
f : ι → Filter α
hn : Nonempty α
hd : Directed (fun x x_1 => x ≥ x_1) f
hb : ∀ (i : ι), NeBot (f i)
h✝ : IsEmpty ι
⊢ iInf f ≠ ⊥

Next tactic:
simp [iInf_of_empty f, top_ne_bot]
/-- If `f : ι → Filter α` is directed, `α` is not empty, and `∀ i, f i ≠ ⊥`, then `iInf f ≠ ⊥`.
See also `iInf_neBot_of_directed'` for a version assuming `Nonempty ι` instead of `Nonempty α`. -/
theorem iInf_neBot_of_directed {f : ι → Filter α} [hn : Nonempty α] (hd : Directed (· ≥ ·) f)
    (hb : ∀ i, NeBot (f i)) : NeBot (iInf f) := by
  cases isEmpty_or_nonempty ι
  · constructor
    simp [iInf_of_empty f, top_ne_bot]
  · 

Proof state:
case inr
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s t : Set α
f : ι → Filter α
hn : Nonempty α
hd : Directed (fun x x_1 => x ≥ x_1) f
hb : ∀ (i : ι), NeBot (f i)
h✝ : Nonempty ι
⊢ NeBot (iInf f)

Next tactic:
exact iInf_neBot_of_directed' hd hb
@[elab_as_elim]
theorem iInf_sets_induct {f : ι → Filter α} {s : Set α} (hs : s ∈ iInf f) {p : Set α → Prop}
    (uni : p univ) (ins : ∀ {i s₁ s₂}, s₁ ∈ f i → p s₂ → p (s₁ ∩ s₂)) : p s := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t : Set α
f : ι → Filter α
s : Set α
hs : s ∈ iInf f
p : Set α → Prop
uni : p univ
ins : ∀ {i : ι} {s₁ s₂ : Set α}, s₁ ∈ f i → p s₂ → p (s₁ ∩ s₂)
⊢ p s

Next tactic:
rw [mem_iInf_finite'] at hs
@[elab_as_elim]
theorem iInf_sets_induct {f : ι → Filter α} {s : Set α} (hs : s ∈ iInf f) {p : Set α → Prop}
    (uni : p univ) (ins : ∀ {i s₁ s₂}, s₁ ∈ f i → p s₂ → p (s₁ ∩ s₂)) : p s := by
  rw [mem_iInf_finite'] at hs
  

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t : Set α
f : ι → Filter α
s : Set α
hs : ∃ t, s ∈ ⨅ i ∈ t, f i.down
p : Set α → Prop
uni : p univ
ins : ∀ {i : ι} {s₁ s₂ : Set α}, s₁ ∈ f i → p s₂ → p (s₁ ∩ s₂)
⊢ p s

Next tactic:
simp only [← Finset.inf_eq_iInf] at hs
@[elab_as_elim]
theorem iInf_sets_induct {f : ι → Filter α} {s : Set α} (hs : s ∈ iInf f) {p : Set α → Prop}
    (uni : p univ) (ins : ∀ {i s₁ s₂}, s₁ ∈ f i → p s₂ → p (s₁ ∩ s₂)) : p s := by
  rw [mem_iInf_finite'] at hs
  simp only [← Finset.inf_eq_iInf] at hs
  

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t : Set α
f : ι → Filter α
s : Set α
p : Set α → Prop
uni : p univ
ins : ∀ {i : ι} {s₁ s₂ : Set α}, s₁ ∈ f i → p s₂ → p (s₁ ∩ s₂)
hs : ∃ t, s ∈ Finset.inf t fun a => f a.down
⊢ p s

Next tactic:
rcases hs with ⟨is, his⟩
@[elab_as_elim]
theorem iInf_sets_induct {f : ι → Filter α} {s : Set α} (hs : s ∈ iInf f) {p : Set α → Prop}
    (uni : p univ) (ins : ∀ {i s₁ s₂}, s₁ ∈ f i → p s₂ → p (s₁ ∩ s₂)) : p s := by
  rw [mem_iInf_finite'] at hs
  simp only [← Finset.inf_eq_iInf] at hs
  rcases hs with ⟨is, his⟩
  

Proof state:
case intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t : Set α
f : ι → Filter α
s : Set α
p : Set α → Prop
uni : p univ
ins : ∀ {i : ι} {s₁ s₂ : Set α}, s₁ ∈ f i → p s₂ → p (s₁ ∩ s₂)
is : Finset (PLift ι)
his : s ∈ Finset.inf is fun a => f a.down
⊢ p s

Next tactic:
induction is using Finset.induction_on generalizing s
@[elab_as_elim]
theorem iInf_sets_induct {f : ι → Filter α} {s : Set α} (hs : s ∈ iInf f) {p : Set α → Prop}
    (uni : p univ) (ins : ∀ {i s₁ s₂}, s₁ ∈ f i → p s₂ → p (s₁ ∩ s₂)) : p s := by
  rw [mem_iInf_finite'] at hs
  simp only [← Finset.inf_eq_iInf] at hs
  rcases hs with ⟨is, his⟩
  induction is using Finset.induction_on generalizing s
  

Proof state:
case intro.empty
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t : Set α
f : ι → Filter α
p : Set α → Prop
uni : p univ
ins : ∀ {i : ι} {s₁ s₂ : Set α}, s₁ ∈ f i → p s₂ → p (s₁ ∩ s₂)
s : Set α
his : s ∈ Finset.inf ∅ fun a => f a.down
⊢ p s
case intro.insert
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝¹ t : Set α
f : ι → Filter α
p : Set α → Prop
uni : p univ
ins : ∀ {i : ι} {s₁ s₂ : Set α}, s₁ ∈ f i → p s₂ → p (s₁ ∩ s₂)
a✝² : PLift ι
s✝ : Finset (PLift ι)
a✝¹ : a✝² ∉ s✝
a✝ : ∀ {s : Set α}, (s ∈ Finset.inf s✝ fun a => f a.down) → p s
s : Set α
his : s ∈ Finset.inf (insert a✝² s✝) fun a => f a.down
⊢ p s

Next tactic:
case empty => rwa [mem_top.1 his]
@[elab_as_elim]
theorem iInf_sets_induct {f : ι → Filter α} {s : Set α} (hs : s ∈ iInf f) {p : Set α → Prop}
    (uni : p univ) (ins : ∀ {i s₁ s₂}, s₁ ∈ f i → p s₂ → p (s₁ ∩ s₂)) : p s := by
  rw [mem_iInf_finite'] at hs
  simp only [← Finset.inf_eq_iInf] at hs
  rcases hs with ⟨is, his⟩
  induction is using Finset.induction_on generalizing s
  

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g : Filter α
s✝ t : Set α
f : ι → Filter α
p : Set α → Prop
uni : p univ
ins : ∀ {i : ι} {s₁ s₂ : Set α}, s₁ ∈ f i → p s₂ → p (s₁ ∩ s₂)
s : Set α
his : s ∈ Finset.inf ∅ fun a => f a.down
⊢ p s

Next tactic:
case empty => rwa [mem_top.1 his]