The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V03. Sets, finite structures and big operators

Mathlib.Data.Multiset.Antidiagonal

12 declarations. Mathlib docs · Source

def Multiset.antidiagonal E1 #

{α : Type u_1} → Multiset α → Multiset (Multiset α × Multiset α)

The antidiagonal of a multiset s consists of all pairs (t₁, t₂) such that t₁ + t₂ = s. These pairs are counted with multiplicities.

theorem Multiset.antidiagonal_coe E0 #

∀ {α : Type u_1} (l : List α), (↑l).antidiagonal = ↑(Multiset.powersetAux l).revzip

theorem Multiset.antidiagonal_coe' E0 #

∀ {α : Type u_1} (l : List α), (↑l).antidiagonal = ↑(Multiset.powersetAux' l).revzip

theorem Multiset.mem_antidiagonal E0 #

∀ {α : Type u_1} {s : Multiset α} {x : Multiset α × Multiset α}, x ∈ s.antidiagonal ↔ x.1 + x.2 = s

A pair (t₁, t₂) of multisets is contained in antidiagonal s if and only if t₁ + t₂ = s.

theorem Multiset.antidiagonal_map_fst E0 #

∀ {α : Type u_1} (s : Multiset α), Multiset.map Prod.fst s.antidiagonal = s.powerset

theorem Multiset.antidiagonal_map_snd E0 #

∀ {α : Type u_1} (s : Multiset α), Multiset.map Prod.snd s.antidiagonal = s.powerset

theorem Multiset.antidiagonal_zero E0 #

∀ {α : Type u_1}, Multiset.antidiagonal 0 = {(0, 0)}

theorem Multiset.antidiagonal_cons E0 #

∀ {α : Type u_1} (a : α) (s : Multiset α),
  (a ::ₘ s).antidiagonal =
    Multiset.map (Prod.map id (Multiset.cons a)) s.antidiagonal +
      Multiset.map (Prod.map (Multiset.cons a) id) s.antidiagonal

theorem Multiset.antidiagonal_add E1 #

∀ {α : Type u_1} (s t : Multiset α),
  (s + t).antidiagonal = s.antidiagonal.bind fun p ↦ Multiset.map (fun q ↦ (p.1 + q.1, p.2 + q.2)) t.antidiagonal

theorem Multiset.map_swap_antidiagonal E0 #

∀ {α : Type u_1} (s : Multiset α), Multiset.map Prod.swap s.antidiagonal = s.antidiagonal

theorem Multiset.antidiagonal_eq_map_powerset E1 #

∀ {α : Type u_1} [inst : DecidableEq α] (s : Multiset α), s.antidiagonal = Multiset.map (fun t ↦ (s - t, t)) s.powerset

theorem Multiset.card_antidiagonal E0 #

∀ {α : Type u_1} (s : Multiset α), s.antidiagonal.card = 2 ^ s.card