Theorem: Finset.card_le_card_shatterer
File: Mathlib/Combinatorics/SetFamily/Shatter.lean

Proof steps:
state_before: α : Type u_1
inst✝ : DecidableEq α
𝒜✝ ℬ : Finset (Finset α)
s t : Finset α
a : α
n : ℕ
𝒜 : Finset (Finset α)
⊢ 𝒜.card ≤ 𝒜.shatterer.card
state_after: case refine_1
α : Type u_1
inst✝ : DecidableEq α
𝒜✝ ℬ : Finset (Finset α)
s t : Finset α
a : α
n : ℕ
𝒜 : Finset (Finset α)
⊢ ∅.card ≤ ∅.shatterer.card

case refine_2
α : Type u_1
inst✝ : DecidableEq α
𝒜✝ ℬ : Finset (Finset α)
s t : Finset α
a : α
n : ℕ
𝒜 : Finset (Finset α)
⊢ {∅}.card ≤ {∅}.shatterer.card

case refine_3
α : Type u_1
inst✝ : DecidableEq α
𝒜✝ ℬ : Finset (Finset α)
s t : Finset α
a : α
n : ℕ
𝒜 : Finset (Finset α)
⊢ ∀ (a : α) ⦃𝒜 : Finset (Finset α)⦄,
    (nonMemberSubfamily a 𝒜).card ≤ (nonMemberSubfamily a 𝒜).shatterer.card →
      (memberSubfamily a 𝒜).card ≤ (memberSubfamily a 𝒜).shatterer.card → 𝒜.card ≤ 𝒜.shatterer.card
tactic: refine memberFamily_induction_on 𝒜 ?_ ?_ ?_
state_before: case refine_3
α : Type u_1
inst✝ : DecidableEq α
𝒜✝ ℬ : Finset (Finset α)
s t : Finset α
a : α
n : ℕ
𝒜 : Finset (Finset α)
⊢ ∀ (a : α) ⦃𝒜 : Finset (Finset α)⦄,
    (nonMemberSubfamily a 𝒜).card ≤ (nonMemberSubfamily a 𝒜).shatterer.card →
      (memberSubfamily a 𝒜).card ≤ (memberSubfamily a 𝒜).shatterer.card → 𝒜.card ≤ 𝒜.shatterer.card
state_after: case refine_3
α : Type u_1
inst✝ : DecidableEq α
𝒜✝¹ ℬ : Finset (Finset α)
s t : Finset α
a✝ : α
n : ℕ
𝒜✝ : Finset (Finset α)
a : α
𝒜 : Finset (Finset α)
ih₀ : (nonMemberSubfamily a 𝒜).card ≤ (nonMemberSubfamily a 𝒜).shatterer.card
ih₁ : (memberSubfamily a 𝒜).card ≤ (memberSubfamily a 𝒜).shatterer.card
⊢ 𝒜.card ≤ 𝒜.shatterer.card
tactic: intros a 𝒜 ih₀ ih₁
state_before: case refine_3
α : Type u_1
inst✝ : DecidableEq α
𝒜✝¹ ℬ : Finset (Finset α)
s t : Finset α
a✝ : α
n : ℕ
𝒜✝ : Finset (Finset α)
a : α
𝒜 : Finset (Finset α)
ih₀ : (nonMemberSubfamily a 𝒜).card ≤ (nonMemberSubfamily a 𝒜).shatterer.card
ih₁ : (memberSubfamily a 𝒜).card ≤ (memberSubfamily a 𝒜).shatterer.card
⊢ 𝒜.card ≤ 𝒜.shatterer.card
state_after: case refine_3
α : Type u_1
inst✝ : DecidableEq α
𝒜✝¹ ℬ✝ : Finset (Finset α)
s t : Finset α
a✝ : α
n : ℕ
𝒜✝ : Finset (Finset α)
a : α
𝒜 : Finset (Finset α)
ih₀ : (nonMemberSubfamily a 𝒜).card ≤ (nonMemberSubfamily a 𝒜).shatterer.card
ih₁ : (memberSubfamily a 𝒜).card ≤ (memberSubfamily a 𝒜).shatterer.card
ℬ : Finset (Finset α) := image (insert a) ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer)
⊢ 𝒜.card ≤ 𝒜.shatterer.card
tactic: set ℬ : Finset (Finset α) :=
    ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer).image (insert a)
state_before: case refine_3
α : Type u_1
inst✝ : DecidableEq α
𝒜✝¹ ℬ✝ : Finset (Finset α)
s t : Finset α
a✝ : α
n : ℕ
𝒜✝ : Finset (Finset α)
a : α
𝒜 : Finset (Finset α)
ih₀ : (nonMemberSubfamily a 𝒜).card ≤ (nonMemberSubfamily a 𝒜).shatterer.card
ih₁ : (memberSubfamily a 𝒜).card ≤ (memberSubfamily a 𝒜).shatterer.card
ℬ : Finset (Finset α) := image (insert a) ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer)
⊢ 𝒜.card ≤ 𝒜.shatterer.card
state_after: case refine_3
α : Type u_1
inst✝ : DecidableEq α
𝒜✝¹ ℬ✝ : Finset (Finset α)
s t : Finset α
a✝ : α
n : ℕ
𝒜✝ : Finset (Finset α)
a : α
𝒜 : Finset (Finset α)
ih₀ : (nonMemberSubfamily a 𝒜).card ≤ (nonMemberSubfamily a 𝒜).shatterer.card
ih₁ : (memberSubfamily a 𝒜).card ≤ (memberSubfamily a 𝒜).shatterer.card
ℬ : Finset (Finset α) := image (insert a) ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer)
hℬ : ℬ.card = ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer).card
⊢ 𝒜.card ≤ 𝒜.shatterer.card
tactic: have hℬ :
      ℬ.card = ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer).card := by
    refine card_image_of_injOn <| insert_erase_invOn.2.injOn.mono ?_
    simp only [coe_inter, Set.subset_def, Set.mem_inter_iff, mem_coe, Set.mem_setOf_eq, and_imp,
      mem_shatterer]
    exact fun s _ ↦ aux (fun t ht ↦ (mem_filter.1 ht).2)
state_before: case refine_3
α : Type u_1
inst✝ : DecidableEq α
𝒜✝¹ ℬ✝ : Finset (Finset α)
s t : Finset α
a✝ : α
n : ℕ
𝒜✝ : Finset (Finset α)
a : α
𝒜 : Finset (Finset α)
ih₀ : (nonMemberSubfamily a 𝒜).card ≤ (nonMemberSubfamily a 𝒜).shatterer.card
ih₁ : (memberSubfamily a 𝒜).card ≤ (memberSubfamily a 𝒜).shatterer.card
ℬ : Finset (Finset α) := image (insert a) ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer)
hℬ : ℬ.card = ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer).card
⊢ 𝒜.card ≤ 𝒜.shatterer.card
state_after: case refine_3
α : Type u_1
inst✝ : DecidableEq α
𝒜✝¹ ℬ✝ : Finset (Finset α)
s t : Finset α
a✝ : α
n : ℕ
𝒜✝ : Finset (Finset α)
a : α
𝒜 : Finset (Finset α)
ih₀ : (nonMemberSubfamily a 𝒜).card ≤ (nonMemberSubfamily a 𝒜).shatterer.card
ih₁ : (memberSubfamily a 𝒜).card ≤ (memberSubfamily a 𝒜).shatterer.card
ℬ : Finset (Finset α) := image (insert a) ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer)
hℬ : ℬ.card = ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer).card
⊢ (memberSubfamily a 𝒜).card + (nonMemberSubfamily a 𝒜).card ≤ 𝒜.shatterer.card
tactic: rw [← card_memberSubfamily_add_card_nonMemberSubfamily a]
state_before: case refine_3
α : Type u_1
inst✝ : DecidableEq α
𝒜✝¹ ℬ✝ : Finset (Finset α)
s t : Finset α
a✝ : α
n : ℕ
𝒜✝ : Finset (Finset α)
a : α
𝒜 : Finset (Finset α)
ih₀ : (nonMemberSubfamily a 𝒜).card ≤ (nonMemberSubfamily a 𝒜).shatterer.card
ih₁ : (memberSubfamily a 𝒜).card ≤ (memberSubfamily a 𝒜).shatterer.card
ℬ : Finset (Finset α) := image (insert a) ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer)
hℬ : ℬ.card = ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer).card
⊢ (memberSubfamily a 𝒜).card + (nonMemberSubfamily a 𝒜).card ≤ 𝒜.shatterer.card
state_after: case refine_3
α : Type u_1
inst✝ : DecidableEq α
𝒜✝¹ ℬ✝ : Finset (Finset α)
s t : Finset α
a✝ : α
n : ℕ
𝒜✝ : Finset (Finset α)
a : α
𝒜 : Finset (Finset α)
ih₀ : (nonMemberSubfamily a 𝒜).card ≤ (nonMemberSubfamily a 𝒜).shatterer.card
ih₁ : (memberSubfamily a 𝒜).card ≤ (memberSubfamily a 𝒜).shatterer.card
ℬ : Finset (Finset α) := image (insert a) ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer)
hℬ : ℬ.card = ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer).card
⊢ (memberSubfamily a 𝒜).shatterer.card + (nonMemberSubfamily a 𝒜).shatterer.card ≤ 𝒜.shatterer.card
tactic: refine (Nat.add_le_add ih₁ ih₀).trans ?_
state_before: case refine_3
α : Type u_1
inst✝ : DecidableEq α
𝒜✝¹ ℬ✝ : Finset (Finset α)
s t : Finset α
a✝ : α
n : ℕ
𝒜✝ : Finset (Finset α)
a : α
𝒜 : Finset (Finset α)
ih₀ : (nonMemberSubfamily a 𝒜).card ≤ (nonMemberSubfamily a 𝒜).shatterer.card
ih₁ : (memberSubfamily a 𝒜).card ≤ (memberSubfamily a 𝒜).shatterer.card
ℬ : Finset (Finset α) := image (insert a) ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer)
hℬ : ℬ.card = ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer).card
⊢ (memberSubfamily a 𝒜).shatterer.card + (nonMemberSubfamily a 𝒜).shatterer.card ≤ 𝒜.shatterer.card
state_after: case refine_3
α : Type u_1
inst✝ : DecidableEq α
𝒜✝¹ ℬ✝ : Finset (Finset α)
s t : Finset α
a✝ : α
n : ℕ
𝒜✝ : Finset (Finset α)
a : α
𝒜 : Finset (Finset α)
ih₀ : (nonMemberSubfamily a 𝒜).card ≤ (nonMemberSubfamily a 𝒜).shatterer.card
ih₁ : (memberSubfamily a 𝒜).card ≤ (memberSubfamily a 𝒜).shatterer.card
ℬ : Finset (Finset α) := image (insert a) ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer)
hℬ : ℬ.card = ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer).card
⊢ ((memberSubfamily a 𝒜).shatterer ∪ (nonMemberSubfamily a 𝒜).shatterer ∪ ℬ).card ≤ 𝒜.shatterer.card

case refine_3
α : Type u_1
inst✝ : DecidableEq α
𝒜✝¹ ℬ✝ : Finset (Finset α)
s t : Finset α
a✝ : α
n : ℕ
𝒜✝ : Finset (Finset α)
a : α
𝒜 : Finset (Finset α)
ih₀ : (nonMemberSubfamily a 𝒜).card ≤ (nonMemberSubfamily a 𝒜).shatterer.card
ih₁ : (memberSubfamily a 𝒜).card ≤ (memberSubfamily a 𝒜).shatterer.card
ℬ : Finset (Finset α) := image (insert a) ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer)
hℬ : ℬ.card = ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer).card
⊢ Disjoint ((memberSubfamily a 𝒜).shatterer ∪ (nonMemberSubfamily a 𝒜).shatterer) ℬ
tactic: rw [← card_union_add_card_inter, ← hℬ, ← card_union_of_disjoint]
state_before: case refine_3
α : Type u_1
inst✝ : DecidableEq α
𝒜✝¹ ℬ✝ : Finset (Finset α)
s t : Finset α
a✝ : α
n : ℕ
𝒜✝ : Finset (Finset α)
a : α
𝒜 : Finset (Finset α)
ih₀ : (nonMemberSubfamily a 𝒜).card ≤ (nonMemberSubfamily a 𝒜).shatterer.card
ih₁ : (memberSubfamily a 𝒜).card ≤ (memberSubfamily a 𝒜).shatterer.card
ℬ : Finset (Finset α) := image (insert a) ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer)
hℬ : ℬ.card = ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer).card
⊢ ((memberSubfamily a 𝒜).shatterer ∪ (nonMemberSubfamily a 𝒜).shatterer ∪ ℬ).card ≤ 𝒜.shatterer.card

case refine_3
α : Type u_1
inst✝ : DecidableEq α
𝒜✝¹ ℬ✝ : Finset (Finset α)
s t : Finset α
a✝ : α
n : ℕ
𝒜✝ : Finset (Finset α)
a : α
𝒜 : Finset (Finset α)
ih₀ : (nonMemberSubfamily a 𝒜).card ≤ (nonMemberSubfamily a 𝒜).shatterer.card
ih₁ : (memberSubfamily a 𝒜).card ≤ (memberSubfamily a 𝒜).shatterer.card
ℬ : Finset (Finset α) := image (insert a) ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer)
hℬ : ℬ.card = ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer).card
⊢ Disjoint ((memberSubfamily a 𝒜).shatterer ∪ (nonMemberSubfamily a 𝒜).shatterer) ℬ
state_after: case refine_3
α : Type u_1
inst✝ : DecidableEq α
𝒜✝¹ ℬ✝ : Finset (Finset α)
s t : Finset α
a✝ : α
n : ℕ
𝒜✝ : Finset (Finset α)
a : α
𝒜 : Finset (Finset α)
ih₀ : (nonMemberSubfamily a 𝒜).card ≤ (nonMemberSubfamily a 𝒜).shatterer.card
ih₁ : (memberSubfamily a 𝒜).card ≤ (memberSubfamily a 𝒜).shatterer.card
ℬ : Finset (Finset α) := image (insert a) ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer)
hℬ : ℬ.card = ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer).card
⊢ Disjoint ((memberSubfamily a 𝒜).shatterer ∪ (nonMemberSubfamily a 𝒜).shatterer) ℬ

case refine_3
α : Type u_1
inst✝ : DecidableEq α
𝒜✝¹ ℬ✝ : Finset (Finset α)
s t : Finset α
a✝ : α
n : ℕ
𝒜✝ : Finset (Finset α)
a : α
𝒜 : Finset (Finset α)
ih₀ : (nonMemberSubfamily a 𝒜).card ≤ (nonMemberSubfamily a 𝒜).shatterer.card
ih₁ : (memberSubfamily a 𝒜).card ≤ (memberSubfamily a 𝒜).shatterer.card
ℬ : Finset (Finset α) := image (insert a) ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer)
hℬ : ℬ.card = ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer).card
⊢ ((memberSubfamily a 𝒜).shatterer ∪ (nonMemberSubfamily a 𝒜).shatterer ∪ ℬ).card ≤ 𝒜.shatterer.card
tactic: swap
state_before: case refine_3
α : Type u_1
inst✝ : DecidableEq α
𝒜✝¹ ℬ✝ : Finset (Finset α)
s t : Finset α
a✝ : α
n : ℕ
𝒜✝ : Finset (Finset α)
a : α
𝒜 : Finset (Finset α)
ih₀ : (nonMemberSubfamily a 𝒜).card ≤ (nonMemberSubfamily a 𝒜).shatterer.card
ih₁ : (memberSubfamily a 𝒜).card ≤ (memberSubfamily a 𝒜).shatterer.card
ℬ : Finset (Finset α) := image (insert a) ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer)
hℬ : ℬ.card = ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer).card
⊢ ((memberSubfamily a 𝒜).shatterer ∪ (nonMemberSubfamily a 𝒜).shatterer ∪ ℬ).card ≤ 𝒜.shatterer.card
state_after: case refine_3.refine_1
α : Type u_1
inst✝ : DecidableEq α
𝒜✝¹ ℬ✝ : Finset (Finset α)
s t : Finset α
a✝ : α
n : ℕ
𝒜✝ : Finset (Finset α)
a : α
𝒜 : Finset (Finset α)
ih₀ : (nonMemberSubfamily a 𝒜).card ≤ (nonMemberSubfamily a 𝒜).shatterer.card
ih₁ : (memberSubfamily a 𝒜).card ≤ (memberSubfamily a 𝒜).shatterer.card
ℬ : Finset (Finset α) := image (insert a) ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer)
hℬ : ℬ.card = ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer).card
⊢ (memberSubfamily a 𝒜).shatterer ⊆ 𝒜.shatterer

case refine_3.refine_2
α : Type u_1
inst✝ : DecidableEq α
𝒜✝¹ ℬ✝ : Finset (Finset α)
s t : Finset α
a✝ : α
n : ℕ
𝒜✝ : Finset (Finset α)
a : α
𝒜 : Finset (Finset α)
ih₀ : (nonMemberSubfamily a 𝒜).card ≤ (nonMemberSubfamily a 𝒜).shatterer.card
ih₁ : (memberSubfamily a 𝒜).card ≤ (memberSubfamily a 𝒜).shatterer.card
ℬ : Finset (Finset α) := image (insert a) ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer)
hℬ : ℬ.card = ((memberSubfamily a 𝒜).shatterer ∩ (nonMemberSubfamily a 𝒜).shatterer).card
⊢ ℬ ⊆ 𝒜.shatterer
tactic: refine card_mono <| union_subset (union_subset ?_ <| shatterer_mono <| filter_subset _ _) ?_