l3lab/ntp-mathlib huggingface dataset:
theorem exists_mem_and_iff {P : Set α → Prop} {Q : Set α → Prop} (hP : Antitone P)
    (hQ : Antitone Q) : ((∃ u ∈ f, P u) ∧ ∃ u ∈ f, Q u) ↔ ∃ u ∈ f, P u ∧ Q u := by
  constructor
  · rintro ⟨⟨u, huf, hPu⟩, v, hvf, hQv⟩
    exact
      ⟨u ∩ v, inter_mem huf hvf, hP (inter_subset_left _ _) hPu, hQ (inter_subset_right _ _) hQv⟩
  · 

Proof state:
case mpr
α : Type u
f g : Filter α
s t : Set α
P Q : Set α → Prop
hP : Antitone P
hQ : Antitone Q
⊢ (∃ u ∈ f, P u ∧ Q u) → (∃ u ∈ f, P u) ∧ ∃ u ∈ f, Q u

Next tactic:
rintro ⟨u, huf, hPu, hQu⟩
theorem exists_mem_and_iff {P : Set α → Prop} {Q : Set α → Prop} (hP : Antitone P)
    (hQ : Antitone Q) : ((∃ u ∈ f, P u) ∧ ∃ u ∈ f, Q u) ↔ ∃ u ∈ f, P u ∧ Q u := by
  constructor
  · rintro ⟨⟨u, huf, hPu⟩, v, hvf, hQv⟩
    exact
      ⟨u ∩ v, inter_mem huf hvf, hP (inter_subset_left _ _) hPu, hQ (inter_subset_right _ _) hQv⟩
  · rintro ⟨u, huf, hPu, hQu⟩
    

Proof state:
case mpr.intro.intro.intro
α : Type u
f g : Filter α
s t : Set α
P Q : Set α → Prop
hP : Antitone P
hQ : Antitone Q
u : Set α
huf : u ∈ f
hPu : P u
hQu : Q u
⊢ (∃ u ∈ f, P u) ∧ ∃ u ∈ f, Q u

Next tactic:
exact ⟨⟨u, huf, hPu⟩, u, huf, hQu⟩
/-- The join of a filter of filters is defined by the relation `s ∈ join f ↔ {t | s ∈ t} ∈ f`. -/
def join (f : Filter (Filter α)) : Filter α where
  sets := { s | { t : Filter α | s ∈ t } ∈ f }
  univ_sets := by 

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f : Filter (Filter α)
⊢ univ ∈ {s | {t | s ∈ t} ∈ f}

Next tactic:
simp only [mem_setOf_eq, univ_sets, ← Filter.mem_sets, setOf_true]
protected theorem not_le : ¬f ≤ g ↔ ∃ s ∈ g, s ∉ f := by 

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s t : Set α
⊢ ¬f ≤ g ↔ ∃ s ∈ g, s ∉ f

Next tactic:
simp_rw [le_def, not_forall, exists_prop]
theorem mem_generate_iff {s : Set <| Set α} {U : Set α} :
    U ∈ generate s ↔ ∃ (t : _) (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝ t : Set α
s : Set (Set α)
U : Set α
⊢ U ∈ generate s ↔ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U

Next tactic:
constructor
theorem mem_generate_iff {s : Set <| Set α} {U : Set α} :
    U ∈ generate s ↔ ∃ (t : _) (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U := by
  constructor <;> 

Proof state:
case mp
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝ t : Set α
s : Set (Set α)
U : Set α
⊢ U ∈ generate s → ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U

Next tactic:
intro h
theorem mem_generate_iff {s : Set <| Set α} {U : Set α} :
    U ∈ generate s ↔ ∃ (t : _) (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U := by
  constructor <;> 

Proof state:
case mpr
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝ t : Set α
s : Set (Set α)
U : Set α
⊢ (∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U) → U ∈ generate s

Next tactic:
intro h
theorem mem_generate_iff {s : Set <| Set α} {U : Set α} :
    U ∈ generate s ↔ ∃ (t : _) (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U := by
  constructor <;> intro h
  · 

Proof state:
case mp
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝ t : Set α
s : Set (Set α)
U : Set α
h : U ∈ generate s
⊢ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U

Next tactic:
induction h
theorem mem_generate_iff {s : Set <| Set α} {U : Set α} :
    U ∈ generate s ↔ ∃ (t : _) (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U := by
  constructor <;> intro h
  · induction h
    

Proof state:
case mp.basic
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝¹ t : Set α
s : Set (Set α)
U s✝ : Set α
a✝ : s✝ ∈ s
⊢ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ s✝
case mp.univ
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝ t : Set α
s : Set (Set α)
U : Set α
⊢ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ univ
case mp.superset
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝¹ t : Set α
s : Set (Set α)
U s✝ t✝ : Set α
a✝¹ : GenerateSets s s✝
a✝ : s✝ ⊆ t✝
a_ih✝ : ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ s✝
⊢ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ t✝
case mp.inter
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝¹ t : Set α
s : Set (Set α)
U s✝ t✝ : Set α
a✝¹ : GenerateSets s s✝
a✝ : GenerateSets s t✝
a_ih✝¹ : ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ s✝
a_ih✝ : ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ t✝
⊢ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ s✝ ∩ t✝

Next tactic:
case basic V V_in =>
      exact ⟨{V}, singleton_subset_iff.2 V_in, finite_singleton _, (sInter_singleton _).subset⟩
theorem mem_generate_iff {s : Set <| Set α} {U : Set α} :
    U ∈ generate s ↔ ∃ (t : _) (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U := by
  constructor <;> intro h
  · induction h
    

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝ t : Set α
s : Set (Set α)
U V : Set α
V_in : V ∈ s
⊢ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ V

Next tactic:
case basic V V_in =>
      exact ⟨{V}, singleton_subset_iff.2 V_in, finite_singleton _, (sInter_singleton _).subset⟩
theorem mem_generate_iff {s : Set <| Set α} {U : Set α} :
    U ∈ generate s ↔ ∃ (t : _) (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U := by
  constructor <;> intro h
  · induction h
    case basic V V_in =>
      

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝ t : Set α
s : Set (Set α)
U V : Set α
V_in : V ∈ s
⊢ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ V

Next tactic:
exact ⟨{V}, singleton_subset_iff.2 V_in, finite_singleton _, (sInter_singleton _).subset⟩
theorem mem_generate_iff {s : Set <| Set α} {U : Set α} :
    U ∈ generate s ↔ ∃ (t : _) (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U := by
  constructor <;> intro h
  · induction h
    case basic V V_in =>
      exact ⟨{V}, singleton_subset_iff.2 V_in, finite_singleton _, (sInter_singleton _).subset⟩
    

Proof state:
case mp.univ
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝ t : Set α
s : Set (Set α)
U : Set α
⊢ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ univ
case mp.superset
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝¹ t : Set α
s : Set (Set α)
U s✝ t✝ : Set α
a✝¹ : GenerateSets s s✝
a✝ : s✝ ⊆ t✝
a_ih✝ : ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ s✝
⊢ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ t✝
case mp.inter
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝¹ t : Set α
s : Set (Set α)
U s✝ t✝ : Set α
a✝¹ : GenerateSets s s✝
a✝ : GenerateSets s t✝
a_ih✝¹ : ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ s✝
a_ih✝ : ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ t✝
⊢ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ s✝ ∩ t✝

Next tactic:
case univ => exact ⟨∅, empty_subset _, finite_empty, subset_univ _⟩
theorem mem_generate_iff {s : Set <| Set α} {U : Set α} :
    U ∈ generate s ↔ ∃ (t : _) (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U := by
  constructor <;> intro h
  · induction h
    case basic V V_in =>
      exact ⟨{V}, singleton_subset_iff.2 V_in, finite_singleton _, (sInter_singleton _).subset⟩
    

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝ t : Set α
s : Set (Set α)
U : Set α
⊢ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ univ

Next tactic:
case univ => exact ⟨∅, empty_subset _, finite_empty, subset_univ _⟩
theorem mem_generate_iff {s : Set <| Set α} {U : Set α} :
    U ∈ generate s ↔ ∃ (t : _) (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U := by
  constructor <;> intro h
  · induction h
    case basic V V_in =>
      exact ⟨{V}, singleton_subset_iff.2 V_in, finite_singleton _, (sInter_singleton _).subset⟩
    case univ => 

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝ t : Set α
s : Set (Set α)
U : Set α
⊢ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ univ

Next tactic:
exact ⟨∅, empty_subset _, finite_empty, subset_univ _⟩
theorem mem_generate_iff {s : Set <| Set α} {U : Set α} :
    U ∈ generate s ↔ ∃ (t : _) (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U := by
  constructor <;> intro h
  · induction h
    case basic V V_in =>
      exact ⟨{V}, singleton_subset_iff.2 V_in, finite_singleton _, (sInter_singleton _).subset⟩
    case univ => exact ⟨∅, empty_subset _, finite_empty, subset_univ _⟩
    

Proof state:
case mp.superset
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝¹ t : Set α
s : Set (Set α)
U s✝ t✝ : Set α
a✝¹ : GenerateSets s s✝
a✝ : s✝ ⊆ t✝
a_ih✝ : ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ s✝
⊢ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ t✝
case mp.inter
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝¹ t : Set α
s : Set (Set α)
U s✝ t✝ : Set α
a✝¹ : GenerateSets s s✝
a✝ : GenerateSets s t✝
a_ih✝¹ : ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ s✝
a_ih✝ : ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ t✝
⊢ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ s✝ ∩ t✝

Next tactic:
case superset V W _ hVW hV =>
      rcases hV with ⟨t, hts, ht, htV⟩
      exact ⟨t, hts, ht, htV.trans hVW⟩
theorem mem_generate_iff {s : Set <| Set α} {U : Set α} :
    U ∈ generate s ↔ ∃ (t : _) (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U := by
  constructor <;> intro h
  · induction h
    case basic V V_in =>
      exact ⟨{V}, singleton_subset_iff.2 V_in, finite_singleton _, (sInter_singleton _).subset⟩
    case univ => exact ⟨∅, empty_subset _, finite_empty, subset_univ _⟩
    

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝ t : Set α
s : Set (Set α)
U V W : Set α
a✝ : GenerateSets s V
hVW : V ⊆ W
hV : ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ V
⊢ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ W

Next tactic:
case superset V W _ hVW hV =>
      rcases hV with ⟨t, hts, ht, htV⟩
      exact ⟨t, hts, ht, htV.trans hVW⟩
theorem mem_generate_iff {s : Set <| Set α} {U : Set α} :
    U ∈ generate s ↔ ∃ (t : _) (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U := by
  constructor <;> intro h
  · induction h
    case basic V V_in =>
      exact ⟨{V}, singleton_subset_iff.2 V_in, finite_singleton _, (sInter_singleton _).subset⟩
    case univ => exact ⟨∅, empty_subset _, finite_empty, subset_univ _⟩
    case superset V W _ hVW hV =>
      

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝ t : Set α
s : Set (Set α)
U V W : Set α
a✝ : GenerateSets s V
hVW : V ⊆ W
hV : ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ V
⊢ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ W

Next tactic:
rcases hV with ⟨t, hts, ht, htV⟩
theorem mem_generate_iff {s : Set <| Set α} {U : Set α} :
    U ∈ generate s ↔ ∃ (t : _) (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U := by
  constructor <;> intro h
  · induction h
    case basic V V_in =>
      exact ⟨{V}, singleton_subset_iff.2 V_in, finite_singleton _, (sInter_singleton _).subset⟩
    case univ => exact ⟨∅, empty_subset _, finite_empty, subset_univ _⟩
    case superset V W _ hVW hV =>
      rcases hV with ⟨t, hts, ht, htV⟩
      

Proof state:
case intro.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝ t✝ : Set α
s : Set (Set α)
U V W : Set α
a✝ : GenerateSets s V
hVW : V ⊆ W
t : Set (Set α)
hts : t ⊆ s
ht : Set.Finite t
htV : ⋂₀ t ⊆ V
⊢ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ W

Next tactic:
exact ⟨t, hts, ht, htV.trans hVW⟩
theorem mem_generate_iff {s : Set <| Set α} {U : Set α} :
    U ∈ generate s ↔ ∃ (t : _) (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U := by
  constructor <;> intro h
  · induction h
    case basic V V_in =>
      exact ⟨{V}, singleton_subset_iff.2 V_in, finite_singleton _, (sInter_singleton _).subset⟩
    case univ => exact ⟨∅, empty_subset _, finite_empty, subset_univ _⟩
    case superset V W _ hVW hV =>
      rcases hV with ⟨t, hts, ht, htV⟩
      exact ⟨t, hts, ht, htV.trans hVW⟩
    

Proof state:
case mp.inter
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝¹ t : Set α
s : Set (Set α)
U s✝ t✝ : Set α
a✝¹ : GenerateSets s s✝
a✝ : GenerateSets s t✝
a_ih✝¹ : ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ s✝
a_ih✝ : ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ t✝
⊢ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ s✝ ∩ t✝

Next tactic:
case inter V W _ _ hV hW =>
      rcases hV, hW with ⟨⟨t, hts, ht, htV⟩, u, hus, hu, huW⟩
      exact
        ⟨t ∪ u, union_subset hts hus, ht.union hu,
          (sInter_union _ _).subset.trans <| inter_subset_inter htV huW⟩
theorem mem_generate_iff {s : Set <| Set α} {U : Set α} :
    U ∈ generate s ↔ ∃ (t : _) (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U := by
  constructor <;> intro h
  · induction h
    case basic V V_in =>
      exact ⟨{V}, singleton_subset_iff.2 V_in, finite_singleton _, (sInter_singleton _).subset⟩
    case univ => exact ⟨∅, empty_subset _, finite_empty, subset_univ _⟩
    case superset V W _ hVW hV =>
      rcases hV with ⟨t, hts, ht, htV⟩
      exact ⟨t, hts, ht, htV.trans hVW⟩
    

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝ t : Set α
s : Set (Set α)
U V W : Set α
a✝¹ : GenerateSets s V
a✝ : GenerateSets s W
hV : ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ V
hW : ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ W
⊢ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ V ∩ W

Next tactic:
case inter V W _ _ hV hW =>
      rcases hV, hW with ⟨⟨t, hts, ht, htV⟩, u, hus, hu, huW⟩
      exact
        ⟨t ∪ u, union_subset hts hus, ht.union hu,
          (sInter_union _ _).subset.trans <| inter_subset_inter htV huW⟩
theorem mem_generate_iff {s : Set <| Set α} {U : Set α} :
    U ∈ generate s ↔ ∃ (t : _) (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U := by
  constructor <;> intro h
  · induction h
    case basic V V_in =>
      exact ⟨{V}, singleton_subset_iff.2 V_in, finite_singleton _, (sInter_singleton _).subset⟩
    case univ => exact ⟨∅, empty_subset _, finite_empty, subset_univ _⟩
    case superset V W _ hVW hV =>
      rcases hV with ⟨t, hts, ht, htV⟩
      exact ⟨t, hts, ht, htV.trans hVW⟩
    case inter V W _ _ hV hW =>
      

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝ t : Set α
s : Set (Set α)
U V W : Set α
a✝¹ : GenerateSets s V
a✝ : GenerateSets s W
hV : ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ V
hW : ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ W
⊢ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ V ∩ W

Next tactic:
rcases hV, hW with ⟨⟨t, hts, ht, htV⟩, u, hus, hu, huW⟩
theorem mem_generate_iff {s : Set <| Set α} {U : Set α} :
    U ∈ generate s ↔ ∃ (t : _) (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U := by
  constructor <;> intro h
  · induction h
    case basic V V_in =>
      exact ⟨{V}, singleton_subset_iff.2 V_in, finite_singleton _, (sInter_singleton _).subset⟩
    case univ => exact ⟨∅, empty_subset _, finite_empty, subset_univ _⟩
    case superset V W _ hVW hV =>
      rcases hV with ⟨t, hts, ht, htV⟩
      exact ⟨t, hts, ht, htV.trans hVW⟩
    case inter V W _ _ hV hW =>
      rcases hV, hW with ⟨⟨t, hts, ht, htV⟩, u, hus, hu, huW⟩
      

Proof state:
case intro.intro.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝ t✝ : Set α
s : Set (Set α)
U V W : Set α
a✝¹ : GenerateSets s V
a✝ : GenerateSets s W
t : Set (Set α)
hts : t ⊆ s
ht : Set.Finite t
htV : ⋂₀ t ⊆ V
u : Set (Set α)
hus : u ⊆ s
hu : Set.Finite u
huW : ⋂₀ u ⊆ W
⊢ ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ V ∩ W

Next tactic:
exact
        ⟨t ∪ u, union_subset hts hus, ht.union hu,
          (sInter_union _ _).subset.trans <| inter_subset_inter htV huW⟩
theorem mem_generate_iff {s : Set <| Set α} {U : Set α} :
    U ∈ generate s ↔ ∃ (t : _) (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U := by
  constructor <;> intro h
  · induction h
    case basic V V_in =>
      exact ⟨{V}, singleton_subset_iff.2 V_in, finite_singleton _, (sInter_singleton _).subset⟩
    case univ => exact ⟨∅, empty_subset _, finite_empty, subset_univ _⟩
    case superset V W _ hVW hV =>
      rcases hV with ⟨t, hts, ht, htV⟩
      exact ⟨t, hts, ht, htV.trans hVW⟩
    case inter V W _ _ hV hW =>
      rcases hV, hW with ⟨⟨t, hts, ht, htV⟩, u, hus, hu, huW⟩
      exact
        ⟨t ∪ u, union_subset hts hus, ht.union hu,
          (sInter_union _ _).subset.trans <| inter_subset_inter htV huW⟩
  · 

Proof state:
case mpr
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝ t : Set α
s : Set (Set α)
U : Set α
h : ∃ t, ∃ (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U
⊢ U ∈ generate s

Next tactic:
rcases h with ⟨t, hts, tfin, h⟩
theorem mem_generate_iff {s : Set <| Set α} {U : Set α} :
    U ∈ generate s ↔ ∃ (t : _) (_ : t ⊆ s), Set.Finite t ∧ ⋂₀ t ⊆ U := by
  constructor <;> intro h
  · induction h
    case basic V V_in =>
      exact ⟨{V}, singleton_subset_iff.2 V_in, finite_singleton _, (sInter_singleton _).subset⟩
    case univ => exact ⟨∅, empty_subset _, finite_empty, subset_univ _⟩
    case superset V W _ hVW hV =>
      rcases hV with ⟨t, hts, ht, htV⟩
      exact ⟨t, hts, ht, htV.trans hVW⟩
    case inter V W _ _ hV hW =>
      rcases hV, hW with ⟨⟨t, hts, ht, htV⟩, u, hus, hu, huW⟩
      exact
        ⟨t ∪ u, union_subset hts hus, ht.union hu,
          (sInter_union _ _).subset.trans <| inter_subset_inter htV huW⟩
  · rcases h with ⟨t, hts, tfin, h⟩
    

Proof state:
case mpr.intro.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝ t✝ : Set α
s : Set (Set α)
U : Set α
t : Set (Set α)
hts : t ⊆ s
tfin : Set.Finite t
h : ⋂₀ t ⊆ U
⊢ U ∈ generate s

Next tactic:
exact mem_of_superset ((sInter_mem tfin).2 fun V hV => GenerateSets.basic <| hts hV) h
/-- The infimum of filters is the filter generated by intersections
  of elements of the two filters. -/
instance : Inf (Filter α) :=
  ⟨fun f g : Filter α =>
    { sets := { s | ∃ a ∈ f, ∃ b ∈ g, s = a ∩ b }
      univ_sets := ⟨_, univ_mem, _, univ_mem, by 

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g✝ : Filter α
s t : Set α
f g : Filter α
⊢ univ = univ ∩ univ

Next tactic:
simp
/-- The infimum of filters is the filter generated by intersections
  of elements of the two filters. -/
instance : Inf (Filter α) :=
  ⟨fun f g : Filter α =>
    { sets := { s | ∃ a ∈ f, ∃ b ∈ g, s = a ∩ b }
      univ_sets := ⟨_, univ_mem, _, univ_mem, by simp⟩
      sets_of_superset := by
        

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g✝ : Filter α
s t : Set α
f g : Filter α
⊢ ∀ {x y : Set α}, x ∈ {s | ∃ a ∈ f, ∃ b ∈ g, s = a ∩ b} → x ⊆ y → y ∈ {s | ∃ a ∈ f, ∃ b ∈ g, s = a ∩ b}

Next tactic:
rintro x y ⟨a, ha, b, hb, rfl⟩ xy
/-- The infimum of filters is the filter generated by intersections
  of elements of the two filters. -/
instance : Inf (Filter α) :=
  ⟨fun f g : Filter α =>
    { sets := { s | ∃ a ∈ f, ∃ b ∈ g, s = a ∩ b }
      univ_sets := ⟨_, univ_mem, _, univ_mem, by simp⟩
      sets_of_superset := by
        rintro x y ⟨a, ha, b, hb, rfl⟩ xy
        

Proof state:
case intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g✝ : Filter α
s t : Set α
f g : Filter α
y a : Set α
ha : a ∈ f
b : Set α
hb : b ∈ g
xy : a ∩ b ⊆ y
⊢ y ∈ {s | ∃ a ∈ f, ∃ b ∈ g, s = a ∩ b}

Next tactic:
refine'
          ⟨a ∪ y, mem_of_superset ha (subset_union_left a y), b ∪ y,
            mem_of_superset hb (subset_union_left b y), _⟩
/-- The infimum of filters is the filter generated by intersections
  of elements of the two filters. -/
instance : Inf (Filter α) :=
  ⟨fun f g : Filter α =>
    { sets := { s | ∃ a ∈ f, ∃ b ∈ g, s = a ∩ b }
      univ_sets := ⟨_, univ_mem, _, univ_mem, by simp⟩
      sets_of_superset := by
        rintro x y ⟨a, ha, b, hb, rfl⟩ xy
        refine'
          ⟨a ∪ y, mem_of_superset ha (subset_union_left a y), b ∪ y,
            mem_of_superset hb (subset_union_left b y), _⟩
        

Proof state:
case intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g✝ : Filter α
s t : Set α
f g : Filter α
y a : Set α
ha : a ∈ f
b : Set α
hb : b ∈ g
xy : a ∩ b ⊆ y
⊢ y = (a ∪ y) ∩ (b ∪ y)

Next tactic:
rw [← inter_union_distrib_right, union_eq_self_of_subset_left xy]
/-- The infimum of filters is the filter generated by intersections
  of elements of the two filters. -/
instance : Inf (Filter α) :=
  ⟨fun f g : Filter α =>
    { sets := { s | ∃ a ∈ f, ∃ b ∈ g, s = a ∩ b }
      univ_sets := ⟨_, univ_mem, _, univ_mem, by simp⟩
      sets_of_superset := by
        rintro x y ⟨a, ha, b, hb, rfl⟩ xy
        refine'
          ⟨a ∪ y, mem_of_superset ha (subset_union_left a y), b ∪ y,
            mem_of_superset hb (subset_union_left b y), _⟩
        rw [← inter_union_distrib_right, union_eq_self_of_subset_left xy]
      inter_sets := by
        

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g✝ : Filter α
s t : Set α
f g : Filter α
⊢ ∀ {x y : Set α},
    x ∈ {s | ∃ a ∈ f, ∃ b ∈ g, s = a ∩ b} →
      y ∈ {s | ∃ a ∈ f, ∃ b ∈ g, s = a ∩ b} → x ∩ y ∈ {s | ∃ a ∈ f, ∃ b ∈ g, s = a ∩ b}

Next tactic:
rintro x y ⟨a, ha, b, hb, rfl⟩ ⟨c, hc, d, hd, rfl⟩
/-- The infimum of filters is the filter generated by intersections
  of elements of the two filters. -/
instance : Inf (Filter α) :=
  ⟨fun f g : Filter α =>
    { sets := { s | ∃ a ∈ f, ∃ b ∈ g, s = a ∩ b }
      univ_sets := ⟨_, univ_mem, _, univ_mem, by simp⟩
      sets_of_superset := by
        rintro x y ⟨a, ha, b, hb, rfl⟩ xy
        refine'
          ⟨a ∪ y, mem_of_superset ha (subset_union_left a y), b ∪ y,
            mem_of_superset hb (subset_union_left b y), _⟩
        rw [← inter_union_distrib_right, union_eq_self_of_subset_left xy]
      inter_sets := by
        rintro x y ⟨a, ha, b, hb, rfl⟩ ⟨c, hc, d, hd, rfl⟩
        

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g✝ : Filter α
s t : Set α
f g : Filter α
a : Set α
ha : a ∈ f
b : Set α
hb : b ∈ g
c : Set α
hc : c ∈ f
d : Set α
hd : d ∈ g
⊢ a ∩ b ∩ (c ∩ d) ∈ {s | ∃ a ∈ f, ∃ b ∈ g, s = a ∩ b}

Next tactic:
refine' ⟨a ∩ c, inter_mem ha hc, b ∩ d, inter_mem hb hd, _⟩
/-- The infimum of filters is the filter generated by intersections
  of elements of the two filters. -/
instance : Inf (Filter α) :=
  ⟨fun f g : Filter α =>
    { sets := { s | ∃ a ∈ f, ∃ b ∈ g, s = a ∩ b }
      univ_sets := ⟨_, univ_mem, _, univ_mem, by simp⟩
      sets_of_superset := by
        rintro x y ⟨a, ha, b, hb, rfl⟩ xy
        refine'
          ⟨a ∪ y, mem_of_superset ha (subset_union_left a y), b ∪ y,
            mem_of_superset hb (subset_union_left b y), _⟩
        rw [← inter_union_distrib_right, union_eq_self_of_subset_left xy]
      inter_sets := by
        rintro x y ⟨a, ha, b, hb, rfl⟩ ⟨c, hc, d, hd, rfl⟩
        refine' ⟨a ∩ c, inter_mem ha hc, b ∩ d, inter_mem hb hd, _⟩
        

Proof state:
case intro.intro.intro.intro.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g✝ : Filter α
s t : Set α
f g : Filter α
a : Set α
ha : a ∈ f
b : Set α
hb : b ∈ g
c : Set α
hc : c ∈ f
d : Set α
hd : d ∈ g
⊢ a ∩ b ∩ (c ∩ d) = a ∩ c ∩ (b ∩ d)

Next tactic:
ac_rfl
@[simp]
theorem mem_top {s : Set α} : s ∈ (⊤ : Filter α) ↔ s = univ := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s✝ t s : Set α
⊢ s ∈ ⊤ ↔ s = univ

Next tactic:
rw [mem_top_iff_forall, eq_univ_iff_forall]
@[simp] theorem sup_neBot {f g : Filter α} : NeBot (f ⊔ g) ↔ NeBot f ∨ NeBot g := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f✝ g✝ : Filter α
s t : Set α
f g : Filter α
⊢ NeBot (f ⊔ g) ↔ NeBot f ∨ NeBot g

Next tactic:
simp only [neBot_iff, not_and_or, Ne.def, sup_eq_bot_iff]
theorem not_disjoint_self_iff : ¬Disjoint f f ↔ f.NeBot := by 

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f g : Filter α
s t : Set α
⊢ ¬Disjoint f f ↔ NeBot f

Next tactic:
rw [disjoint_self, neBot_iff]
@[simp]
theorem mem_iSup {x : Set α} {f : ι → Filter α} : x ∈ iSup f ↔ ∀ i, x ∈ f i := by
  

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

Next tactic:
simp only [← Filter.mem_sets, iSup_sets_eq, iff_self_iff, mem_iInter]
@[simp]
theorem iSup_neBot {f : ι → Filter α} : (⨆ i, f i).NeBot ↔ ∃ i, (f i).NeBot := by
  

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

Next tactic:
simp [neBot_iff]