Theorem: UV.card_compression
File: Mathlib/Combinatorics/SetFamily/Compression/UV.lean

tactic: rw [compression, card_disjoint_union (compress_disjoint _ _), image_filter, card_image_of_injOn,
  ← card_disjoint_union]
state_before: α : Type u_1
inst✝² : GeneralizedBooleanAlgebra α
inst✝¹ : DecidableRel Disjoint
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
s✝ : Finset α
u✝ v✝ a b u v : α
s : Finset α
⊢ card (𝓒 u v s) = card s

tactic: simp_rw [Function.comp]
state_before: α : Type u_1
inst✝² : GeneralizedBooleanAlgebra α
inst✝¹ : DecidableRel Disjoint
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
s✝ : Finset α
u✝ v✝ a b u v : α
s : Finset α
⊢ card (filter (fun a => compress u v a ∈ s) s ∪ filter ((fun a => ¬a ∈ s) ∘ compress u v) s) = card s

α : Type u_1
inst✝² : GeneralizedBooleanAlgebra α
inst✝¹ : DecidableRel Disjoint
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
s✝ : Finset α
u✝ v✝ a b u v : α
s : Finset α
⊢ Disjoint (filter (fun a => compress u v a ∈ s) s) (filter ((fun a => ¬a ∈ s) ∘ compress u v) s)

α : Type u_1
inst✝² : GeneralizedBooleanAlgebra α
inst✝¹ : DecidableRel Disjoint
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
s✝ : Finset α
u✝ v✝ a b u v : α
s : Finset α
⊢ Set.InjOn (compress u v) ↑(filter ((fun a => ¬a ∈ s) ∘ compress u v) s)

tactic: rw [filter_union_filter_neg_eq]
state_before: α : Type u_1
inst✝² : GeneralizedBooleanAlgebra α
inst✝¹ : DecidableRel Disjoint
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
s✝ : Finset α
u✝ v✝ a b u v : α
s : Finset α
⊢ card (filter (fun a => compress u v a ∈ s) s ∪ filter (fun x => ¬compress u v x ∈ s) s) = card s

α : Type u_1
inst✝² : GeneralizedBooleanAlgebra α
inst✝¹ : DecidableRel Disjoint
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
s✝ : Finset α
u✝ v✝ a b u v : α
s : Finset α
⊢ Disjoint (filter (fun a => compress u v a ∈ s) s) (filter ((fun a => ¬a ∈ s) ∘ compress u v) s)

α : Type u_1
inst✝² : GeneralizedBooleanAlgebra α
inst✝¹ : DecidableRel Disjoint
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
s✝ : Finset α
u✝ v✝ a b u v : α
s : Finset α
⊢ Set.InjOn (compress u v) ↑(filter ((fun a => ¬a ∈ s) ∘ compress u v) s)

tactic: intro a ha b hb hab
state_before: α : Type u_1
inst✝² : GeneralizedBooleanAlgebra α
inst✝¹ : DecidableRel Disjoint
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
s✝ : Finset α
u✝ v✝ a b u v : α
s : Finset α
⊢ Set.InjOn (compress u v) ↑(filter ((fun a => ¬a ∈ s) ∘ compress u v) s)

tactic: dsimp at hab
state_before: α : Type u_1
inst✝² : GeneralizedBooleanAlgebra α
inst✝¹ : DecidableRel Disjoint
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
s✝ : Finset α
u✝ v✝ a✝ b✝ u v : α
s : Finset α
a : α
ha : a ∈ ↑(filter ((fun a => ¬a ∈ s) ∘ compress u v) s)
b : α
hb : b ∈ ↑(filter ((fun a => ¬a ∈ s) ∘ compress u v) s)
hab : compress u v a = compress u v b
⊢ a = b

tactic: rw [mem_coe, mem_filter, Function.comp_apply] at ha hb
state_before: α : Type u_1
inst✝² : GeneralizedBooleanAlgebra α
inst✝¹ : DecidableRel Disjoint
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
s✝ : Finset α
u✝ v✝ a✝ b✝ u v : α
s : Finset α
a : α
ha : a ∈ ↑(filter ((fun a => ¬a ∈ s) ∘ compress u v) s)
b : α
hb : b ∈ ↑(filter ((fun a => ¬a ∈ s) ∘ compress u v) s)
hab : compress u v a = compress u v b
⊢ a = b

tactic: rw [compress] at ha hab
state_before: α : Type u_1
inst✝² : GeneralizedBooleanAlgebra α
inst✝¹ : DecidableRel Disjoint
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
s✝ : Finset α
u✝ v✝ a✝ b✝ u v : α
s : Finset α
a : α
ha : a ∈ s ∧ ¬compress u v a ∈ s
b : α
hb : b ∈ s ∧ ¬compress u v b ∈ s
hab : compress u v a = compress u v b
⊢ a = b

tactic: split_ifs at ha hab with has
state_before: α : Type u_1
inst✝² : GeneralizedBooleanAlgebra α
inst✝¹ : DecidableRel Disjoint
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
s✝ : Finset α
u✝ v✝ a✝ b✝ u v : α
s : Finset α
a : α
ha : a ∈ s ∧ ¬(if Disjoint u a ∧ v ≤ a then (a ⊔ u) \ v else a) ∈ s
b : α
hb : b ∈ s ∧ ¬compress u v b ∈ s
hab : (if Disjoint u a ∧ v ≤ a then (a ⊔ u) \ v else a) = compress u v b
⊢ a = b

tactic: rw [disjoint_iff_inter_eq_empty]
state_before: α : Type u_1
inst✝² : GeneralizedBooleanAlgebra α
inst✝¹ : DecidableRel Disjoint
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
s✝ : Finset α
u✝ v✝ a b u v : α
s : Finset α
⊢ Disjoint (filter (fun a => compress u v a ∈ s) s) (filter ((fun a => ¬a ∈ s) ∘ compress u v) s)

tactic: exact filter_inter_filter_neg_eq _ _ _
state_before: α : Type u_1
inst✝² : GeneralizedBooleanAlgebra α
inst✝¹ : DecidableRel Disjoint
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
s✝ : Finset α
u✝ v✝ a b u v : α
s : Finset α
⊢ filter (fun a => compress u v a ∈ s) s ∩ filter ((fun a => ¬a ∈ s) ∘ compress u v) s = ∅

tactic: rw [compress] at hb hab
state_before: case inl
α : Type u_1
inst✝² : GeneralizedBooleanAlgebra α
inst✝¹ : DecidableRel Disjoint
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
s✝ : Finset α
u✝ v✝ a✝ b✝ u v : α
s : Finset α
a b : α
hb : b ∈ s ∧ ¬compress u v b ∈ s
has : Disjoint u a ∧ v ≤ a
ha : a ∈ s ∧ ¬(a ⊔ u) \ v ∈ s
hab : (a ⊔ u) \ v = compress u v b
⊢ a = b

tactic: split_ifs at hb hab with hbs
state_before: case inl
α : Type u_1
inst✝² : GeneralizedBooleanAlgebra α
inst✝¹ : DecidableRel Disjoint
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
s✝ : Finset α
u✝ v✝ a✝ b✝ u v : α
s : Finset α
a b : α
hb : b ∈ s ∧ ¬(if Disjoint u b ∧ v ≤ b then (b ⊔ u) \ v else b) ∈ s
has : Disjoint u a ∧ v ≤ a
ha : a ∈ s ∧ ¬(a ⊔ u) \ v ∈ s
hab : (a ⊔ u) \ v = if Disjoint u b ∧ v ≤ b then (b ⊔ u) \ v else b
⊢ a = b

tactic: exact sup_sdiff_injOn u v has hbs hab
state_before: case inl.inl
α : Type u_1
inst✝² : GeneralizedBooleanAlgebra α
inst✝¹ : DecidableRel Disjoint
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
s✝ : Finset α
u✝ v✝ a✝ b✝ u v : α
s : Finset α
a b : α
has : Disjoint u a ∧ v ≤ a
ha : a ∈ s ∧ ¬(a ⊔ u) \ v ∈ s
hbs : Disjoint u b ∧ v ≤ b
hb : b ∈ s ∧ ¬(b ⊔ u) \ v ∈ s
hab : (a ⊔ u) \ v = (b ⊔ u) \ v
⊢ a = b

tactic: exact (hb.2 hb.1).elim
state_before: case inl.inr
α : Type u_1
inst✝² : GeneralizedBooleanAlgebra α
inst✝¹ : DecidableRel Disjoint
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
s✝ : Finset α
u✝ v✝ a✝ b✝ u v : α
s : Finset α
a b : α
has : Disjoint u a ∧ v ≤ a
ha : a ∈ s ∧ ¬(a ⊔ u) \ v ∈ s
hbs : ¬(Disjoint u b ∧ v ≤ b)
hb : b ∈ s ∧ ¬b ∈ s
hab : (a ⊔ u) \ v = b
⊢ a = b

tactic: exact (ha.2 ha.1).elim
state_before: case inr
α : Type u_1
inst✝² : GeneralizedBooleanAlgebra α
inst✝¹ : DecidableRel Disjoint
inst✝ : DecidableRel fun x x_1 => x ≤ x_1
s✝ : Finset α
u✝ v✝ a✝ b✝ u v : α
s : Finset α
a b : α
hb : b ∈ s ∧ ¬compress u v b ∈ s
has : ¬(Disjoint u a ∧ v ≤ a)
ha : a ∈ s ∧ ¬a ∈ s
hab : a = compress u v b
⊢ a = b