Theorem: isMeagre_iff_countable_union_isNowhereDense
File: Mathlib/Topology/GDelta.lean

tactic: rw [IsMeagre, mem_residual_iff, compl_bijective.surjective.image_surjective.exists]
state_before: X✝ : Type u_1
Y : Type u_2
ι : Type u_3
ι' : Sort u_4
X : Type u_5
inst✝ : TopologicalSpace X
s : Set X
⊢ IsMeagre s ↔ ∃ S, (∀ t ∈ S, IsNowhereDense t) ∧ S.Countable ∧ s ⊆ ⋃₀ S
state_after: X✝ : Type u_1
Y : Type u_2
ι : Type u_3
ι' : Sort u_4
X : Type u_5
inst✝ : TopologicalSpace X
s : Set X
⊢ (∃ x, (∀ t ∈ compl '' x, IsOpen t) ∧ (∀ t ∈ compl '' x, Dense t) ∧ (compl '' x).Countable ∧ ⋂₀ (compl '' x) ⊆ sᶜ) ↔
    ∃ S, (∀ t ∈ S, IsNowhereDense t) ∧ S.Countable ∧ s ⊆ ⋃₀ S

tactic: simp_rw [← and_assoc, ← forall_and, forall_mem_image, ← isClosed_isNowhereDense_iff_compl,
  sInter_image, ← compl_iUnion₂, compl_subset_compl, ← sUnion_eq_biUnion, and_assoc]
state_before: X✝ : Type u_1
Y : Type u_2
ι : Type u_3
ι' : Sort u_4
X : Type u_5
inst✝ : TopologicalSpace X
s : Set X
⊢ (∃ x, (∀ t ∈ compl '' x, IsOpen t) ∧ (∀ t ∈ compl '' x, Dense t) ∧ (compl '' x).Countable ∧ ⋂₀ (compl '' x) ⊆ sᶜ) ↔
    ∃ S, (∀ t ∈ S, IsNowhereDense t) ∧ S.Countable ∧ s ⊆ ⋃₀ S
state_after: X✝ : Type u_1
Y : Type u_2
ι : Type u_3
ι' : Sort u_4
X : Type u_5
inst✝ : TopologicalSpace X
s : Set X
⊢ (∃ x, (∀ ⦃x_1 : Set X⦄, x_1 ∈ x → IsClosed x_1 ∧ IsNowhereDense x_1) ∧ (compl '' x).Countable ∧ s ⊆ ⋃₀ x) ↔
    ∃ S, (∀ t ∈ S, IsNowhereDense t) ∧ S.Countable ∧ s ⊆ ⋃₀ S

tactic: refine ⟨fun ⟨S, hS, hc, hsub⟩ ↦ ⟨S, fun s hs ↦ (hS hs).2, ?_, hsub⟩, ?_⟩
state_before: X✝ : Type u_1
Y : Type u_2
ι : Type u_3
ι' : Sort u_4
X : Type u_5
inst✝ : TopologicalSpace X
s : Set X
⊢ (∃ x, (∀ ⦃x_1 : Set X⦄, x_1 ∈ x → IsClosed x_1 ∧ IsNowhereDense x_1) ∧ (compl '' x).Countable ∧ s ⊆ ⋃₀ x) ↔
    ∃ S, (∀ t ∈ S, IsNowhereDense t) ∧ S.Countable ∧ s ⊆ ⋃₀ S
state_after: case refine_1
X✝ : Type u_1
Y : Type u_2
ι : Type u_3
ι' : Sort u_4
X : Type u_5
inst✝ : TopologicalSpace X
s : Set X
x✝ : ∃ x, (∀ ⦃x_1 : Set X⦄, x_1 ∈ x → IsClosed x_1 ∧ IsNowhereDense x_1) ∧ (compl '' x).Countable ∧ s ⊆ ⋃₀ x
S : Set (Set X)
hS : ∀ ⦃x : Set X⦄, x ∈ S → IsClosed x ∧ IsNowhereDense x
hc : (compl '' S).Countable
hsub : s ⊆ ⋃₀ S
⊢ S.Countable

case refine_2
X✝ : Type u_1
Y : Type u_2
ι : Type u_3
ι' : Sort u_4
X : Type u_5
inst✝ : TopologicalSpace X
s : Set X
⊢ (∃ S, (∀ t ∈ S, IsNowhereDense t) ∧ S.Countable ∧ s ⊆ ⋃₀ S) →
    ∃ x, (∀ ⦃x_1 : Set X⦄, x_1 ∈ x → IsClosed x_1 ∧ IsNowhereDense x_1) ∧ (compl '' x).Countable ∧ s ⊆ ⋃₀ x

tactic: rw [← compl_compl_image S]
state_before: case refine_1
X✝ : Type u_1
Y : Type u_2
ι : Type u_3
ι' : Sort u_4
X : Type u_5
inst✝ : TopologicalSpace X
s : Set X
x✝ : ∃ x, (∀ ⦃x_1 : Set X⦄, x_1 ∈ x → IsClosed x_1 ∧ IsNowhereDense x_1) ∧ (compl '' x).Countable ∧ s ⊆ ⋃₀ x
S : Set (Set X)
hS : ∀ ⦃x : Set X⦄, x ∈ S → IsClosed x ∧ IsNowhereDense x
hc : (compl '' S).Countable
hsub : s ⊆ ⋃₀ S
⊢ S.Countable
state_after: case refine_1
X✝ : Type u_1
Y : Type u_2
ι : Type u_3
ι' : Sort u_4
X : Type u_5
inst✝ : TopologicalSpace X
s : Set X
x✝ : ∃ x, (∀ ⦃x_1 : Set X⦄, x_1 ∈ x → IsClosed x_1 ∧ IsNowhereDense x_1) ∧ (compl '' x).Countable ∧ s ⊆ ⋃₀ x
S : Set (Set X)
hS : ∀ ⦃x : Set X⦄, x ∈ S → IsClosed x ∧ IsNowhereDense x
hc : (compl '' S).Countable
hsub : s ⊆ ⋃₀ S
⊢ (compl '' (compl '' S)).Countable

tactic: exact hc.image _
state_before: case refine_1
X✝ : Type u_1
Y : Type u_2
ι : Type u_3
ι' : Sort u_4
X : Type u_5
inst✝ : TopologicalSpace X
s : Set X
x✝ : ∃ x, (∀ ⦃x_1 : Set X⦄, x_1 ∈ x → IsClosed x_1 ∧ IsNowhereDense x_1) ∧ (compl '' x).Countable ∧ s ⊆ ⋃₀ x
S : Set (Set X)
hS : ∀ ⦃x : Set X⦄, x ∈ S → IsClosed x ∧ IsNowhereDense x
hc : (compl '' S).Countable
hsub : s ⊆ ⋃₀ S
⊢ (compl '' (compl '' S)).Countable
state_after: no goals

tactic: intro ⟨S, hS, hc, hsub⟩
state_before: case refine_2
X✝ : Type u_1
Y : Type u_2
ι : Type u_3
ι' : Sort u_4
X : Type u_5
inst✝ : TopologicalSpace X
s : Set X
⊢ (∃ S, (∀ t ∈ S, IsNowhereDense t) ∧ S.Countable ∧ s ⊆ ⋃₀ S) →
    ∃ x, (∀ ⦃x_1 : Set X⦄, x_1 ∈ x → IsClosed x_1 ∧ IsNowhereDense x_1) ∧ (compl '' x).Countable ∧ s ⊆ ⋃₀ x
state_after: case refine_2
X✝ : Type u_1
Y : Type u_2
ι : Type u_3
ι' : Sort u_4
X : Type u_5
inst✝ : TopologicalSpace X
s : Set X
S : Set (Set X)
hS : ∀ t ∈ S, IsNowhereDense t
hc : S.Countable
hsub : s ⊆ ⋃₀ S
⊢ ∃ x, (∀ ⦃x_1 : Set X⦄, x_1 ∈ x → IsClosed x_1 ∧ IsNowhereDense x_1) ∧ (compl '' x).Countable ∧ s ⊆ ⋃₀ x

tactic: use closure '' S
state_before: case refine_2
X✝ : Type u_1
Y : Type u_2
ι : Type u_3
ι' : Sort u_4
X : Type u_5
inst✝ : TopologicalSpace X
s : Set X
S : Set (Set X)
hS : ∀ t ∈ S, IsNowhereDense t
hc : S.Countable
hsub : s ⊆ ⋃₀ S
⊢ ∃ x, (∀ ⦃x_1 : Set X⦄, x_1 ∈ x → IsClosed x_1 ∧ IsNowhereDense x_1) ∧ (compl '' x).Countable ∧ s ⊆ ⋃₀ x
state_after: case h
X✝ : Type u_1
Y : Type u_2
ι : Type u_3
ι' : Sort u_4
X : Type u_5
inst✝ : TopologicalSpace X
s : Set X
S : Set (Set X)
hS : ∀ t ∈ S, IsNowhereDense t
hc : S.Countable
hsub : s ⊆ ⋃₀ S
⊢ (∀ ⦃x : Set X⦄, x ∈ closure '' S → IsClosed x ∧ IsNowhereDense x) ∧
    (compl '' (closure '' S)).Countable ∧ s ⊆ ⋃₀ (closure '' S)

tactic: rw [forall_mem_image]
state_before: case h
X✝ : Type u_1
Y : Type u_2
ι : Type u_3
ι' : Sort u_4
X : Type u_5
inst✝ : TopologicalSpace X
s : Set X
S : Set (Set X)
hS : ∀ t ∈ S, IsNowhereDense t
hc : S.Countable
hsub : s ⊆ ⋃₀ S
⊢ (∀ ⦃x : Set X⦄, x ∈ closure '' S → IsClosed x ∧ IsNowhereDense x) ∧
    (compl '' (closure '' S)).Countable ∧ s ⊆ ⋃₀ (closure '' S)
state_after: case h
X✝ : Type u_1
Y : Type u_2
ι : Type u_3
ι' : Sort u_4
X : Type u_5
inst✝ : TopologicalSpace X
s : Set X
S : Set (Set X)
hS : ∀ t ∈ S, IsNowhereDense t
hc : S.Countable
hsub : s ⊆ ⋃₀ S
⊢ (∀ ⦃x : Set X⦄, x ∈ S → IsClosed (closure x) ∧ IsNowhereDense (closure x)) ∧
    (compl '' (closure '' S)).Countable ∧ s ⊆ ⋃₀ (closure '' S)

tactic: exact ⟨fun s hs ↦ ⟨isClosed_closure, (hS s hs).closure⟩,
  (hc.image _).image _, hsub.trans (sUnion_mono_subsets fun s ↦ subset_closure)⟩
state_before: case h
X✝ : Type u_1
Y : Type u_2
ι : Type u_3
ι' : Sort u_4
X : Type u_5
inst✝ : TopologicalSpace X
s : Set X
S : Set (Set X)
hS : ∀ t ∈ S, IsNowhereDense t
hc : S.Countable
hsub : s ⊆ ⋃₀ S
⊢ (∀ ⦃x : Set X⦄, x ∈ S → IsClosed (closure x) ∧ IsNowhereDense (closure x)) ∧
    (compl '' (closure '' S)).Countable ∧ s ⊆ ⋃₀ (closure '' S)
state_after: no goals