-- Mathlib/Order/Filter/CountableInter.lean
theorem mem_countableGenerate_iff {s : Set α} :
    s ∈ countableGenerate g ↔ ∃ S : Set (Set α), S ⊆ g ∧ S.Countable ∧ ⋂₀ S ⊆ s

Proof state:
case mpr
α : Type u_2
g : Set (Set α)
s : Set α
h : ∃ S ⊆ g, S.Countable ∧ ⋂₀ S ⊆ s
⊢ s ∈ countableGenerate g

Tactic:
rcases h with ⟨S, Sg, Sct, hS⟩

Result:
case mpr.intro.intro.intro
α : Type u_2
g : Set (Set α)
s : Set α
S : Set (Set α)
Sg : S ⊆ g
Sct : S.Countable
hS : ⋂₀ S ⊆ s
⊢ s ∈ countableGenerate g

Proof state:
case mp.sInter.h
α : Type u_2
g : Set (Set α)
s✝ : Set α
S : Set (Set α)
Sct : S.Countable
a✝ : ∀ s ∈ S, CountableGenerateSets g s
T : (s : Set α) → s ∈ S → Set (Set α)
Tg : ∀ (s : Set α) (a : s ∈ S), T s a ⊆ g
Tct : ∀ (s : Set α) (a : s ∈ S), (T s a).Countable
hT : ∀ (s : Set α) (a : s ∈ S), ⋂₀ T s a ⊆ s
s : Set α
H : s ∈ S
⊢ ⋂₀ ⋃ s, ⋃ (H : s ∈ S), T s H ⊆ s

Tactic:
exact subset_trans (sInter_subset_sInter (subset_iUnion₂ s H)) (hT s H)

Result:
no goals

Proof state:
case mp.superset
α : Type u_2
g : Set (Set α)
s s✝ t✝ : Set α
a✝¹ : CountableGenerateSets g s✝
a✝ : s✝ ⊆ t✝
ih : ∃ S ⊆ g, S.Countable ∧ ⋂₀ S ⊆ s✝
⊢ ∃ S ⊆ g, S.Countable ∧ ⋂₀ S ⊆ t✝

Tactic:
refine Exists.imp (fun S => ?_) ih

Result:
case mp.superset
α : Type u_2
g : Set (Set α)
s s✝ t✝ : Set α
a✝¹ : CountableGenerateSets g s✝
a✝ : s✝ ⊆ t✝
ih : ∃ S ⊆ g, S.Countable ∧ ⋂₀ S ⊆ s✝
S : Set (Set α)
⊢ S ⊆ g ∧ S.Countable ∧ ⋂₀ S ⊆ s✝ → S ⊆ g ∧ S.Countable ∧ ⋂₀ S ⊆ t✝

Proof state:
α : Type u_2
g : Set (Set α)
s : Set α
⊢ s ∈ countableGenerate g ↔ ∃ S ⊆ g, S.Countable ∧ ⋂₀ S ⊆ s

Tactic:
constructor <;> intro h

Result:
case mp
α : Type u_2
g : Set (Set α)
s : Set α
h : s ∈ countableGenerate g
⊢ ∃ S ⊆ g, S.Countable ∧ ⋂₀ S ⊆ s

case mpr
α : Type u_2
g : Set (Set α)
s : Set α
h : ∃ S ⊆ g, S.Countable ∧ ⋂₀ S ⊆ s
⊢ s ∈ countableGenerate g

Proof state:
case mp.basic
α : Type u_2
g : Set (Set α)
s✝ s : Set α
hs : s ∈ g
⊢ ∃ S ⊆ g, S.Countable ∧ ⋂₀ S ⊆ s

Tactic:
exact ⟨{s}, by simp [hs, subset_refl]⟩

Result:
no goals

Proof state:
case mp.sInter
α : Type u_2
g : Set (Set α)
s : Set α
S : Set (Set α)
Sct : S.Countable
a✝ : ∀ s ∈ S, CountableGenerateSets g s
T : (s : Set α) → s ∈ S → Set (Set α)
Tg : ∀ (s : Set α) (a : s ∈ S), T s a ⊆ g
Tct : ∀ (s : Set α) (a : s ∈ S), (T s a).Countable
hT : ∀ (s : Set α) (a : s ∈ S), ⋂₀ T s a ⊆ s
⊢ ⋂₀ ⋃ s, ⋃ (H : s ∈ S), T s H ⊆ ⋂₀ S

Tactic:
apply subset_sInter

Result:
case mp.sInter.h
α : Type u_2
g : Set (Set α)
s : Set α
S : Set (Set α)
Sct : S.Countable
a✝ : ∀ s ∈ S, CountableGenerateSets g s
T : (s : Set α) → s ∈ S → Set (Set α)
Tg : ∀ (s : Set α) (a : s ∈ S), T s a ⊆ g
Tct : ∀ (s : Set α) (a : s ∈ S), (T s a).Countable
hT : ∀ (s : Set α) (a : s ∈ S), ⋂₀ T s a ⊆ s
⊢ ∀ t' ∈ S, ⋂₀ ⋃ s, ⋃ (H : s ∈ S), T s H ⊆ t'

Proof state:
case mpr.intro.intro.intro
α : Type u_2
g : Set (Set α)
s : Set α
S : Set (Set α)
Sg : S ⊆ g
Sct : S.Countable
hS : ⋂₀ S ⊆ s
⊢ ∀ s ∈ S, s ∈ countableGenerate g

Tactic:
intro s H

Result:
case mpr.intro.intro.intro
α : Type u_2
g : Set (Set α)
s✝ : Set α
S : Set (Set α)
Sg : S ⊆ g
Sct : S.Countable
hS : ⋂₀ S ⊆ s✝
s : Set α
H : s ∈ S
⊢ s ∈ countableGenerate g

Proof state:
case mp.sInter.h
α : Type u_2
g : Set (Set α)
s : Set α
S : Set (Set α)
Sct : S.Countable
a✝ : ∀ s ∈ S, CountableGenerateSets g s
T : (s : Set α) → s ∈ S → Set (Set α)
Tg : ∀ (s : Set α) (a : s ∈ S), T s a ⊆ g
Tct : ∀ (s : Set α) (a : s ∈ S), (T s a).Countable
hT : ∀ (s : Set α) (a : s ∈ S), ⋂₀ T s a ⊆ s
⊢ ∀ t' ∈ S, ⋂₀ ⋃ s, ⋃ (H : s ∈ S), T s H ⊆ t'

Tactic:
intro s H

Result:
case mp.sInter.h
α : Type u_2
g : Set (Set α)
s✝ : Set α
S : Set (Set α)
Sct : S.Countable
a✝ : ∀ s ∈ S, CountableGenerateSets g s
T : (s : Set α) → s ∈ S → Set (Set α)
Tg : ∀ (s : Set α) (a : s ∈ S), T s a ⊆ g
Tct : ∀ (s : Set α) (a : s ∈ S), (T s a).Countable
hT : ∀ (s : Set α) (a : s ∈ S), ⋂₀ T s a ⊆ s
s : Set α
H : s ∈ S
⊢ ⋂₀ ⋃ s, ⋃ (H : s ∈ S), T s H ⊆ s

Proof state:
α : Type u_2
g : Set (Set α)
s : Set α
S : Set (Set α)
Sct : S.Countable
a✝ : ∀ s ∈ S, CountableGenerateSets g s
T : (s : Set α) → s ∈ S → Set (Set α)
Tg : ∀ (s : Set α) (a : s ∈ S), T s a ⊆ g
Tct : ∀ (s : Set α) (a : s ∈ S), (T s a).Countable
hT : ∀ (s : Set α) (a : s ∈ S), ⋂₀ T s a ⊆ s
⊢ ⋃ s, ⋃ (H : s ∈ S), T s H ⊆ g

Tactic:
simpa

Result:
no goals

Proof state:
case mpr.intro.intro.intro
α : Type u_2
g : Set (Set α)
s : Set α
S : Set (Set α)
Sg : S ⊆ g
Sct : S.Countable
hS : ⋂₀ S ⊆ s
⊢ s ∈ countableGenerate g

Tactic:
refine mem_of_superset ((countable_sInter_mem Sct).mpr ?_) hS

Result:
case mpr.intro.intro.intro
α : Type u_2
g : Set (Set α)
s : Set α
S : Set (Set α)
Sg : S ⊆ g
Sct : S.Countable
hS : ⋂₀ S ⊆ s
⊢ ∀ s ∈ S, s ∈ countableGenerate g

Proof state:
α : Type u_2
g : Set (Set α)
s✝ s : Set α
hs : s ∈ g
⊢ {s} ⊆ g ∧ {s}.Countable ∧ ⋂₀ {s} ⊆ s

Tactic:
simp [hs, subset_refl]

Result:
no goals

Proof state:
case mp.univ
α : Type u_2
g : Set (Set α)
s : Set α
⊢ ∃ S ⊆ g, S.Countable ∧ ⋂₀ S ⊆ univ

Tactic:
exact ⟨∅, by simp⟩

Result:
no goals

Proof state:
case mp
α : Type u_2
g : Set (Set α)
s : Set α
h : s ∈ countableGenerate g
⊢ ∃ S ⊆ g, S.Countable ∧ ⋂₀ S ⊆ s

Tactic:
induction h with
| @basic s hs => exact ⟨{s}, by simp [hs, subset_refl]⟩
| univ => exact ⟨∅, by simp⟩
| superset _ _ ih => refine Exists.imp (fun S => ?_) ih; tauto
| @sInter S Sct _ ih =>
  choose T Tg Tct hT using ih
  refine ⟨⋃ (s) (H : s ∈ S), T s H, by simpa, Sct.biUnion Tct, ?_⟩
  apply subset_sInter
  intro s H
  exact subset_trans (sInter_subset_sInter (subset_iUnion₂ s H)) (hT s H)

Result:
no goals

Proof state:
case mp.sInter
α : Type u_2
g : Set (Set α)
s : Set α
S : Set (Set α)
Sct : S.Countable
a✝ : ∀ s ∈ S, CountableGenerateSets g s
T : (s : Set α) → s ∈ S → Set (Set α)
Tg : ∀ (s : Set α) (a : s ∈ S), T s a ⊆ g
Tct : ∀ (s : Set α) (a : s ∈ S), (T s a).Countable
hT : ∀ (s : Set α) (a : s ∈ S), ⋂₀ T s a ⊆ s
⊢ ∃ S_1 ⊆ g, S_1.Countable ∧ ⋂₀ S_1 ⊆ ⋂₀ S

Tactic:
refine ⟨⋃ (s) (H : s ∈ S), T s H, by simpa, Sct.biUnion Tct, ?_⟩

Result:
case mp.sInter
α : Type u_2
g : Set (Set α)
s : Set α
S : Set (Set α)
Sct : S.Countable
a✝ : ∀ s ∈ S, CountableGenerateSets g s
T : (s : Set α) → s ∈ S → Set (Set α)
Tg : ∀ (s : Set α) (a : s ∈ S), T s a ⊆ g
Tct : ∀ (s : Set α) (a : s ∈ S), (T s a).Countable
hT : ∀ (s : Set α) (a : s ∈ S), ⋂₀ T s a ⊆ s
⊢ ⋂₀ ⋃ s, ⋃ (H : s ∈ S), T s H ⊆ ⋂₀ S

Proof state:
case mpr.intro.intro.intro
α : Type u_2
g : Set (Set α)
s✝ : Set α
S : Set (Set α)
Sg : S ⊆ g
Sct : S.Countable
hS : ⋂₀ S ⊆ s✝
s : Set α
H : s ∈ S
⊢ s ∈ countableGenerate g

Tactic:
exact CountableGenerateSets.basic (Sg H)

Result:
no goals

Proof state:
α : Type u_2
g : Set (Set α)
s : Set α
⊢ ∅ ⊆ g ∧ ∅.Countable ∧ ⋂₀ ∅ ⊆ univ

Tactic:
simp

Result:
no goals

Proof state:
case mp.sInter
α : Type u_2
g : Set (Set α)
s : Set α
S : Set (Set α)
Sct : S.Countable
a✝ : ∀ s ∈ S, CountableGenerateSets g s
ih : ∀ s ∈ S, ∃ S ⊆ g, S.Countable ∧ ⋂₀ S ⊆ s
⊢ ∃ S_1 ⊆ g, S_1.Countable ∧ ⋂₀ S_1 ⊆ ⋂₀ S

Tactic:
choose T Tg Tct hT using ih

Result:
case mp.sInter
α : Type u_2
g : Set (Set α)
s : Set α
S : Set (Set α)
Sct : S.Countable
a✝ : ∀ s ∈ S, CountableGenerateSets g s
T : (s : Set α) → s ∈ S → Set (Set α)
Tg : ∀ (s : Set α) (a : s ∈ S), T s a ⊆ g
Tct : ∀ (s : Set α) (a : s ∈ S), (T s a).Countable
hT : ∀ (s : Set α) (a : s ∈ S), ⋂₀ T s a ⊆ s
⊢ ∃ S_1 ⊆ g, S_1.Countable ∧ ⋂₀ S_1 ⊆ ⋂₀ S

Proof state:
case mp.superset
α : Type u_2
g : Set (Set α)
s s✝ t✝ : Set α
a✝¹ : CountableGenerateSets g s✝
a✝ : s✝ ⊆ t✝
ih : ∃ S ⊆ g, S.Countable ∧ ⋂₀ S ⊆ s✝
S : Set (Set α)
⊢ S ⊆ g ∧ S.Countable ∧ ⋂₀ S ⊆ s✝ → S ⊆ g ∧ S.Countable ∧ ⋂₀ S ⊆ t✝

Tactic:
tauto

Result:
no goals