Theorem: Finpartition.card_filter_atomise_le_two_pow
File: Mathlib/Order/Partition/Finpartition.lean

Proof steps:
state_before: α : Type u_1
inst✝¹ : DecidableEq α
s t u : Finset α
P : Finpartition s
a : α
inst✝ : Fintype α
F : Finset (Finset α)
ht : t ∈ F
⊢ (filter (fun u => u ⊆ t ∧ u.Nonempty) (atomise s F).parts).card ≤ 2 ^ (F.card - 1)
state_after: α : Type u_1
inst✝¹ : DecidableEq α
s t u : Finset α
P : Finpartition s
a : α
inst✝ : Fintype α
F : Finset (Finset α)
ht : t ∈ F
⊢ filter (fun u => u ⊆ t ∧ u.Nonempty) (atomise s F).parts ⊆
    image (fun P => filter (fun i => ∀ x ∈ F, x ∈ insert t P ↔ i ∈ x) s) (F.erase t).powerset
tactic: suffices h :
    ((atomise s F).parts.filter fun u ↦ u ⊆ t ∧ u.Nonempty) ⊆
      (F.erase t).powerset.image fun P ↦ s.filter fun i ↦ ∀ x ∈ F, x ∈ insert t P ↔ i ∈ x by
    refine (card_le_card h).trans (card_image_le.trans ?_)
    rw [card_powerset, card_erase_of_mem ht]
state_before: α : Type u_1
inst✝¹ : DecidableEq α
s t u : Finset α
P : Finpartition s
a : α
inst✝ : Fintype α
F : Finset (Finset α)
ht : t ∈ F
⊢ filter (fun u => u ⊆ t ∧ u.Nonempty) (atomise s F).parts ⊆
    image (fun P => filter (fun i => ∀ x ∈ F, x ∈ insert t P ↔ i ∈ x) s) (F.erase t).powerset
state_after: α : Type u_1
inst✝¹ : DecidableEq α
s t u : Finset α
P : Finpartition s
a : α
inst✝ : Fintype α
F : Finset (Finset α)
ht : t ∈ F
⊢ ∀ ⦃x : Finset α⦄,
    x ∈ filter (fun u => u ⊆ t ∧ u.Nonempty) (atomise s F).parts →
      x ∈ image (fun P => filter (fun i => ∀ x ∈ F, x ∈ insert t P ↔ i ∈ x) s) (F.erase t).powerset
tactic: rw [subset_iff]
state_before: α : Type u_1
inst✝¹ : DecidableEq α
s t u : Finset α
P : Finpartition s
a : α
inst✝ : Fintype α
F : Finset (Finset α)
ht : t ∈ F
⊢ ∀ ⦃x : Finset α⦄,
    x ∈ filter (fun u => u ⊆ t ∧ u.Nonempty) (atomise s F).parts →
      x ∈ image (fun P => filter (fun i => ∀ x ∈ F, x ∈ insert t P ↔ i ∈ x) s) (F.erase t).powerset
state_after: α : Type u_1
inst✝¹ : DecidableEq α
s t u : Finset α
P : Finpartition s
a : α
inst✝ : Fintype α
F : Finset (Finset α)
ht : t ∈ F
⊢ ∀ ⦃x : Finset α⦄,
    ∀ x_1 ∈ x,
      ∀ x_2 ⊆ F,
        filter (fun i => ∀ u ∈ F, u ∈ x_2 ↔ i ∈ u) s = x →
          x ⊆ t → ∀ x_3 ∈ x, ∃ a ⊆ F.erase t, filter (fun i => ∀ x ∈ F, x ∈ insert t a ↔ i ∈ x) s = x
tactic: simp_rw [mem_image, mem_powerset, mem_filter, and_imp, Finset.Nonempty, exists_imp, mem_atomise,
    and_imp, Finset.Nonempty, exists_imp, and_imp]
state_before: α : Type u_1
inst✝¹ : DecidableEq α
s t u : Finset α
P : Finpartition s
a : α
inst✝ : Fintype α
F : Finset (Finset α)
ht : t ∈ F
⊢ ∀ ⦃x : Finset α⦄,
    ∀ x_1 ∈ x,
      ∀ x_2 ⊆ F,
        filter (fun i => ∀ u ∈ F, u ∈ x_2 ↔ i ∈ u) s = x →
          x ⊆ t → ∀ x_3 ∈ x, ∃ a ⊆ F.erase t, filter (fun i => ∀ x ∈ F, x ∈ insert t a ↔ i ∈ x) s = x
state_after: α : Type u_1
inst✝¹ : DecidableEq α
s t u : Finset α
P✝ : Finpartition s
a : α
inst✝ : Fintype α
F : Finset (Finset α)
ht : t ∈ F
i : α
P : Finset (Finset α)
PQ : P ⊆ F
hi : i ∈ filter (fun i => ∀ u ∈ F, u ∈ P ↔ i ∈ u) s
hy₂ : filter (fun i => ∀ u ∈ F, u ∈ P ↔ i ∈ u) s ⊆ t
j : α
_hj : j ∈ filter (fun i => ∀ u ∈ F, u ∈ P ↔ i ∈ u) s
⊢ ∃ a ⊆ F.erase t, filter (fun i => ∀ x ∈ F, x ∈ insert t a ↔ i ∈ x) s = filter (fun i => ∀ u ∈ F, u ∈ P ↔ i ∈ u) s
tactic: rintro P' i hi P PQ rfl hy₂ j _hj
state_before: α : Type u_1
inst✝¹ : DecidableEq α
s t u : Finset α
P✝ : Finpartition s
a : α
inst✝ : Fintype α
F : Finset (Finset α)
ht : t ∈ F
i : α
P : Finset (Finset α)
PQ : P ⊆ F
hi : i ∈ filter (fun i => ∀ u ∈ F, u ∈ P ↔ i ∈ u) s
hy₂ : filter (fun i => ∀ u ∈ F, u ∈ P ↔ i ∈ u) s ⊆ t
j : α
_hj : j ∈ filter (fun i => ∀ u ∈ F, u ∈ P ↔ i ∈ u) s
⊢ ∃ a ⊆ F.erase t, filter (fun i => ∀ x ∈ F, x ∈ insert t a ↔ i ∈ x) s = filter (fun i => ∀ u ∈ F, u ∈ P ↔ i ∈ u) s
state_after: α : Type u_1
inst✝¹ : DecidableEq α
s t u : Finset α
P✝ : Finpartition s
a : α
inst✝ : Fintype α
F : Finset (Finset α)
ht : t ∈ F
i : α
P : Finset (Finset α)
PQ : P ⊆ F
hi : i ∈ filter (fun i => ∀ u ∈ F, u ∈ P ↔ i ∈ u) s
hy₂ : filter (fun i => ∀ u ∈ F, u ∈ P ↔ i ∈ u) s ⊆ t
j : α
_hj : j ∈ filter (fun i => ∀ u ∈ F, u ∈ P ↔ i ∈ u) s
⊢ filter (fun i => ∀ x ∈ F, x ∈ insert t (P.erase t) ↔ i ∈ x) s = filter (fun i => ∀ u ∈ F, u ∈ P ↔ i ∈ u) s
tactic: refine ⟨P.erase t, erase_subset_erase _ PQ, ?_⟩
state_before: α : Type u_1
inst✝¹ : DecidableEq α
s t u : Finset α
P✝ : Finpartition s
a : α
inst✝ : Fintype α
F : Finset (Finset α)
ht : t ∈ F
i : α
P : Finset (Finset α)
PQ : P ⊆ F
hi : i ∈ filter (fun i => ∀ u ∈ F, u ∈ P ↔ i ∈ u) s
hy₂ : filter (fun i => ∀ u ∈ F, u ∈ P ↔ i ∈ u) s ⊆ t
j : α
_hj : j ∈ filter (fun i => ∀ u ∈ F, u ∈ P ↔ i ∈ u) s
⊢ filter (fun i => ∀ x ∈ F, x ∈ insert t (P.erase t) ↔ i ∈ x) s = filter (fun i => ∀ u ∈ F, u ∈ P ↔ i ∈ u) s
state_after: no goals
tactic: simp only [insert_erase (((mem_filter.1 hi).2 _ ht).2 <| hy₂ hi)]