Antidiagonals in ℕ × ℕ as finsets #
This file defines the antidiagonals of ℕ × ℕ as finsets: the n
-th antidiagonal is the finset of
pairs (i, j)
such that i + j = n
. This is useful for polynomial multiplication and more
generally for sums going from 0
to n
.
Notes #
This refines files data.list.nat_antidiagonal
and data.multiset.nat_antidiagonal
.
The antidiagonal of a natural number n
is
the finset of pairs (i, j)
such that i + j = n
.
Equations
- finset.nat.antidiagonal n = {val := multiset.nat.antidiagonal n, nodup := _}
@[simp]
The cardinality of the antidiagonal of n
is n + 1
.
@[simp]
The antidiagonal of 0
is the list [(0, 0)]
theorem
finset.nat.antidiagonal_succ
{n : ℕ} :
finset.nat.antidiagonal (n + 1) = insert (0, n + 1) (finset.map ({to_fun := nat.succ, inj' := nat.succ_injective}.prod_map (function.embedding.refl ℕ)) (finset.nat.antidiagonal n))
theorem
finset.nat.antidiagonal_succ'
{n : ℕ} :
finset.nat.antidiagonal (n + 1) = insert (n + 1, 0) (finset.map ((function.embedding.refl ℕ).prod_map {to_fun := nat.succ, inj' := nat.succ_injective}) (finset.nat.antidiagonal n))
theorem
finset.nat.antidiagonal_succ_succ'
{n : ℕ} :
finset.nat.antidiagonal (n + 2) = insert (0, n + 2) (insert (n + 2, 0) (finset.map ({to_fun := nat.succ, inj' := nat.succ_injective}.prod_map {to_fun := nat.succ, inj' := nat.succ_injective}) (finset.nat.antidiagonal n)))
theorem
finset.nat.map_swap_antidiagonal
{n : ℕ} :
finset.map {to_fun := prod.swap ℕ, inj' := _} (finset.nat.antidiagonal n) = finset.nat.antidiagonal n
theorem
finset.nat.antidiagonal_congr
{n : ℕ}
{p q : ℕ × ℕ}
(hp : p ∈ finset.nat.antidiagonal n)
(hq : q ∈ finset.nat.antidiagonal n) :
A point in the antidiagonal is determined by its first co-ordinate.
theorem
finset.nat.antidiagonal.fst_le
{n : ℕ}
{kl : ℕ × ℕ}
(hlk : kl ∈ finset.nat.antidiagonal n) :
theorem
finset.nat.antidiagonal.snd_le
{n : ℕ}
{kl : ℕ × ℕ}
(hlk : kl ∈ finset.nat.antidiagonal n) :
The disjoint union of antidiagonals Σ (n : ℕ), antidiagonal n
is equivalent to the product
ℕ × ℕ
. This is such an equivalence, obtained by mapping (n, (k, l))
to (k, l)
.
Equations
@[simp]
theorem
finset.nat.sigma_antidiagonal_equiv_prod_apply
(x : Σ (n : ℕ), ↥(finset.nat.antidiagonal n)) :