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

full_name: sup_sdiff_injOn
code: /-- UV-compression is injective on the elements it moves. See `UV.compress`. -/
theorem sup_sdiff_injOn [GeneralizedBooleanAlgebra α] (u v : α) :
    { x | Disjoint u x ∧ v ≤ x }.InjOn fun x => (x ⊔ u) \ v 
goal: Set.InjOn (fun x => (x ⊔ u) \ v) {x | Disjoint u x ∧ v ≤ x}

full_name: UV.compress
code: /-- UV-compressing `a` means removing `v` from it and adding `u` if `a` and `u` are disjoint and
`v ≤ a` (it replaces the `v` part of `a` by the `u` part). Else, UV-compressing `a` doesn't do
anything. This is most useful when `u` and `v` are disjoint finsets of the same size. -/
def compress (u v a : α) : α 
goal: α

full_name: UV.compress_of_disjoint_of_le
code: theorem compress_of_disjoint_of_le (hua : Disjoint u a) (hva : v ≤ a) :
    compress u v a = (a ⊔ u) \ v 
goal: UV.compress u v a = (a ⊔ u) \ v

full_name: UV.compress_of_disjoint_of_le'
code: theorem compress_of_disjoint_of_le' (hva : Disjoint v a) (hua : u ≤ a) :
    compress u v ((a ⊔ v) \ u) = a 
goal: UV.compress u v ((a ⊔ v) \ u) = a

full_name: UV.compress_self
code: @[simp]
theorem compress_self (u a : α) : compress u u a = a 
goal: UV.compress u u a = a

full_name: UV.compress_sdiff_sdiff
code: /-- An element can be compressed to any other element by removing/adding the differences. -/
@[simp]
theorem compress_sdiff_sdiff (a b : α) : compress (a \ b) (b \ a) b = a 
goal: UV.compress (a \ b) (b \ a) b = a

full_name: UV.compress_idem
code: /-- Compressing an element is idempotent. -/
@[simp]
theorem compress_idem (u v a : α) : compress u v (compress u v a) = compress u v a 
goal: UV.compress u v (UV.compress u v a) = UV.compress u v a

full_name: UV.compression
code: /-- To UV-compress a set family, we compress each of its elements, except that we don't want to
reduce the cardinality, so we keep all elements whose compression is already present. -/
def compression (u v : α) (s : Finset α) 
goal: Finset α

full_name: FinsetFamily._aux_Mathlib_Combinatorics_SetFamily_Compression_UV___unexpand_UV_compression_1
code: @[inherit_doc]
scoped[FinsetFamily] notation "𝓒 " => UV.compression
goal: Lean.PrettyPrinter.Unexpander

full_name: FinsetFamily._aux_Mathlib_Combinatorics_SetFamily_Compression_UV___macroRules_FinsetFamily_term𝓒_1
code: @[inherit_doc]
scoped[FinsetFamily] notation "𝓒 " => UV.compression
goal: Lean.Macro

full_name: UV.IsCompressed
code: /-- `IsCompressed u v s` expresses that `s` is UV-compressed. -/
def IsCompressed (u v : α) (s : Finset α) 
goal: Prop

full_name: UV.compress_injOn
code: /-- UV-compression is injective on the sets that are not UV-compressed. -/
theorem compress_injOn : Set.InjOn (compress u v) ↑(s.filter (compress u v · ∉ s)) 
goal: Set.InjOn (UV.compress u v) ↑(Finset.filter (fun x => UV.compress u v x ∉ s) s)

full_name: UV.mem_compression
code: /-- `a` is in the UV-compressed family iff it's in the original and its compression is in the
original, or it's not in the original but it's the compression of something in the original. -/
theorem mem_compression :
    a ∈ 𝓒 u v s ↔ a ∈ s ∧ compress u v a ∈ s ∨ a ∉ s ∧ ∃ b ∈ s, compress u v b = a 
goal: a ∈ UV.compression u v s ↔ a ∈ s ∧ UV.compress u v a ∈ s ∨ a ∉ s ∧ ∃ b ∈ s, UV.compress u v b = a

full_name: UV.IsCompressed.eq
code: protected theorem IsCompressed.eq (h : IsCompressed u v s) : 𝓒 u v s = s 
goal: UV.compression u v s = s

full_name: UV.compression_self
code: @[simp]
theorem compression_self (u : α) (s : Finset α) : 𝓒 u u s = s 
goal: UV.compression u u s = s

full_name: UV.isCompressed_self
code: /-- Any family is compressed along two identical elements. -/
theorem isCompressed_self (u : α) (s : Finset α) : IsCompressed u u s 
goal: UV.IsCompressed u u s

full_name: UV.compress_disjoint
code: theorem compress_disjoint :
    Disjoint (s.filter (compress u v · ∈ s)) ((s.image <| compress u v).filter (· ∉ s)) 
goal: Disjoint (Finset.filter (fun x => UV.compress u v x ∈ s) s)
  (Finset.filter (fun x => x ∉ s) (Finset.image (UV.compress u v) s))

full_name: UV.compress_mem_compression
code: theorem compress_mem_compression (ha : a ∈ s) : compress u v a ∈ 𝓒 u v s 
goal: UV.compress u v a ∈ UV.compression u v s

full_name: UV.compress_mem_compression_of_mem_compression
code: theorem compress_mem_compression_of_mem_compression (ha : a ∈ 𝓒 u v s) :
    compress u v a ∈ 𝓒 u v s 
goal: UV.compress u v a ∈ UV.compression u v s

full_name: UV.compression_idem
code: /-- Compressing a family is idempotent. -/
@[simp]
theorem compression_idem (u v : α) (s : Finset α) : 𝓒 u v (𝓒 u v s) = 𝓒 u v s 
goal: UV.compression u v (UV.compression u v s) = UV.compression u v s

full_name: UV.card_compression
code: /-- Compressing a family doesn't change its size. -/
@[simp]
theorem card_compression (u v : α) (s : Finset α) : (𝓒 u v s).card = s.card 
goal: (UV.compression u v s).card = s.card

full_name: UV.le_of_mem_compression_of_not_mem
code: theorem le_of_mem_compression_of_not_mem (h : a ∈ 𝓒 u v s) (ha : a ∉ s) : u ≤ a 
goal: u ≤ a

full_name: UV.disjoint_of_mem_compression_of_not_mem
code: theorem disjoint_of_mem_compression_of_not_mem (h : a ∈ 𝓒 u v s) (ha : a ∉ s) : Disjoint v a 
goal: Disjoint v a

full_name: UV.sup_sdiff_mem_of_mem_compression_of_not_mem
code: theorem sup_sdiff_mem_of_mem_compression_of_not_mem (h : a ∈ 𝓒 u v s) (ha : a ∉ s) :
    (a ⊔ v) \ u ∈ s 
goal: (a ⊔ v) \ u ∈ s

full_name: UV.sup_sdiff_mem_of_mem_compression
code: /-- If `a` is in the family compression and can be compressed, then its compression is in the
original family. -/
theorem sup_sdiff_mem_of_mem_compression (ha : a ∈ 𝓒 u v s) (hva : v ≤ a) (hua : Disjoint u a) :
    (a ⊔ u) \ v ∈ s 
goal: (a ⊔ u) \ v ∈ s

full_name: UV.mem_of_mem_compression
code: /-- If `a` is in the `u, v`-compression but `v ≤ a`, then `a` must have been in the original
family. -/
theorem mem_of_mem_compression (ha : a ∈ 𝓒 u v s) (hva : v ≤ a) (hvu : v = ⊥ → u = ⊥) :
    a ∈ s 
goal: a ∈ s

full_name: UV.card_compress
code: /-- Compressing a finset doesn't change its size. -/
theorem card_compress (huv : u.card = v.card) (a : Finset α) : (compress u v a).card = a.card 
goal: (UV.compress u v a).card = a.card

full_name: Set.Sized.uvCompression
code: lemma _root_.Set.Sized.uvCompression (huv : u.card = v.card) (h𝒜 : (𝒜 : Set (Finset α)).Sized r) :
    (𝓒 u v 𝒜 : Set (Finset α)).Sized r 
goal: Set.Sized r ↑(UV.compression u v 𝒜)

full_name: _private.Mathlib.Combinatorics.SetFamily.Compression.UV.0.UV.aux
code: private theorem aux (huv : ∀ x ∈ u, ∃ y ∈ v, IsCompressed (u.erase x) (v.erase y) 𝒜) :
    v = ∅ → u = ∅ 
goal: v = ∅ → u = ∅

full_name: UV.shadow_compression_subset_compression_shadow
code: /-- UV-compression reduces the size of the shadow of `𝒜` if, for all `x ∈ u` there is `y ∈ v` such
that `𝒜` is `(u.erase x, v.erase y)`-compressed. This is the key fact about compression for
Kruskal-Katona. -/
theorem shadow_compression_subset_compression_shadow (u v : Finset α)
    (huv : ∀ x ∈ u, ∃ y ∈ v, IsCompressed (u.erase x) (v.erase y) 𝒜) :
    ∂ (𝓒 u v 𝒜) ⊆ 𝓒 u v (∂ 𝒜) 
goal: (UV.compression u v 𝒜).shadow ⊆ UV.compression u v 𝒜.shadow

full_name: UV.card_shadow_compression_le
code: /-- UV-compression reduces the size of the shadow of `𝒜` if, for all `x ∈ u` there is `y ∈ v`
such that `𝒜` is `(u.erase x, v.erase y)`-compressed. This is the key UV-compression fact needed for
Kruskal-Katona. -/
theorem card_shadow_compression_le (u v : Finset α)
    (huv : ∀ x ∈ u, ∃ y ∈ v, IsCompressed (u.erase x) (v.erase y) 𝒜) :
    (∂ (𝓒 u v 𝒜)).card ≤ (∂ 𝒜).card 
goal: (UV.compression u v 𝒜).shadow.card ≤ 𝒜.shadow.card