File: Mathlib/Data/Fin/Tuple/NatAntidiagonal.lean

full_name: List.Nat.antidiagonalTuple
code: /-- `List.antidiagonalTuple k n` is a list of all `k`-tuples which sum to `n`.

This list contains no duplicates (`List.Nat.nodup_antidiagonalTuple`), and is sorted
lexicographically (`List.Nat.antidiagonalTuple_pairwise_pi_lex`), starting with `![0, ..., n]`
and ending with `![n, ..., 0]`.

```
#eval antidiagonalTuple 3 2
-- [![0, 0, 2], ![0, 1, 1], ![0, 2, 0], ![1, 0, 1], ![1, 1, 0], ![2, 0, 0]]
```
-/
def antidiagonalTuple : ∀ k, ℕ → List (Fin k → ℕ)
  
goal: ℕ → List (Fin k → ℕ)

full_name: List.Nat.antidiagonalTuple_zero_zero
code: @[simp]
theorem antidiagonalTuple_zero_zero : antidiagonalTuple 0 0 = [![]] 
goal: List.Nat.antidiagonalTuple 0 0 = [![]]

full_name: List.Nat.antidiagonalTuple_zero_succ
code: @[simp]
theorem antidiagonalTuple_zero_succ (n : ℕ) : antidiagonalTuple 0 (n + 1) = [] 
goal: List.Nat.antidiagonalTuple 0 (n + 1) = []

full_name: List.Nat.mem_antidiagonalTuple
code: theorem mem_antidiagonalTuple {n : ℕ} {k : ℕ} {x : Fin k → ℕ} :
    x ∈ antidiagonalTuple k n ↔ ∑ i, x i = n 
goal: x ∈ List.Nat.antidiagonalTuple k n ↔ ∑ i : Fin k, x i = n

full_name: List.Nat.nodup_antidiagonalTuple
code: /-- The antidiagonal of `n` does not contain duplicate entries. -/
theorem nodup_antidiagonalTuple (k n : ℕ) : List.Nodup (antidiagonalTuple k n) 
goal: (List.Nat.antidiagonalTuple k n).Nodup

full_name: List.Nat.antidiagonalTuple_zero_right
code: theorem antidiagonalTuple_zero_right : ∀ k, antidiagonalTuple k 0 = [0]
  
goal: List.Nat.antidiagonalTuple k 0 = [0]

full_name: List.Nat.antidiagonalTuple_one
code: @[simp]
theorem antidiagonalTuple_one (n : ℕ) : antidiagonalTuple 1 n = [![n]] 
goal: List.Nat.antidiagonalTuple 1 n = [![n]]

full_name: List.Nat.antidiagonalTuple_two
code: theorem antidiagonalTuple_two (n : ℕ) :
    antidiagonalTuple 2 n = (antidiagonal n).map fun i => ![i.1, i.2] 
goal: List.Nat.antidiagonalTuple 2 n = List.map (fun i => ![i.1, i.2]) (List.Nat.antidiagonal n)

full_name: List.Nat.antidiagonalTuple_pairwise_pi_lex
code: theorem antidiagonalTuple_pairwise_pi_lex :
    ∀ k n, (antidiagonalTuple k n).Pairwise (Pi.Lex (· < ·) @fun _ => (· < ·))
  
goal: List.Pairwise (Pi.Lex (fun x x_1 => x < x_1) fun x x x_1 => x < x_1) (List.Nat.antidiagonalTuple k n)

full_name: Multiset.Nat.antidiagonalTuple
code: /-- `Multiset.Nat.antidiagonalTuple k n` is a multiset of `k`-tuples summing to `n` -/
def antidiagonalTuple (k n : ℕ) : Multiset (Fin k → ℕ) 
goal: Multiset (Fin k → ℕ)

full_name: Multiset.Nat.antidiagonalTuple_zero_zero
code: @[simp]
theorem antidiagonalTuple_zero_zero : antidiagonalTuple 0 0 = {![]} 
goal: Multiset.Nat.antidiagonalTuple 0 0 = {![]}

full_name: Multiset.Nat.antidiagonalTuple_zero_succ
code: @[simp]
theorem antidiagonalTuple_zero_succ (n : ℕ) : antidiagonalTuple 0 n.succ = 0 
goal: Multiset.Nat.antidiagonalTuple 0 n.succ = 0

full_name: Multiset.Nat.mem_antidiagonalTuple
code: theorem mem_antidiagonalTuple {n : ℕ} {k : ℕ} {x : Fin k → ℕ} :
    x ∈ antidiagonalTuple k n ↔ ∑ i, x i = n 
goal: x ∈ Multiset.Nat.antidiagonalTuple k n ↔ ∑ i : Fin k, x i = n

full_name: Multiset.Nat.nodup_antidiagonalTuple
code: theorem nodup_antidiagonalTuple (k n : ℕ) : (antidiagonalTuple k n).Nodup 
goal: (Multiset.Nat.antidiagonalTuple k n).Nodup

full_name: Multiset.Nat.antidiagonalTuple_zero_right
code: theorem antidiagonalTuple_zero_right (k : ℕ) : antidiagonalTuple k 0 = {0} 
goal: Multiset.Nat.antidiagonalTuple k 0 = {0}

full_name: Multiset.Nat.antidiagonalTuple_one
code: @[simp]
theorem antidiagonalTuple_one (n : ℕ) : antidiagonalTuple 1 n = {![n]} 
goal: Multiset.Nat.antidiagonalTuple 1 n = {![n]}

full_name: Multiset.Nat.antidiagonalTuple_two
code: theorem antidiagonalTuple_two (n : ℕ) :
    antidiagonalTuple 2 n = (antidiagonal n).map fun i => ![i.1, i.2] 
goal: Multiset.Nat.antidiagonalTuple 2 n = Multiset.map (fun i => ![i.1, i.2]) (Multiset.Nat.antidiagonal n)

full_name: Finset.Nat.antidiagonalTuple
code: /-- `Finset.Nat.antidiagonalTuple k n` is a finset of `k`-tuples summing to `n` -/
def antidiagonalTuple (k n : ℕ) : Finset (Fin k → ℕ) 
goal: Finset (Fin k → ℕ)

full_name: Finset.Nat.antidiagonalTuple_zero_zero
code: @[simp]
theorem antidiagonalTuple_zero_zero : antidiagonalTuple 0 0 = {![]} 
goal: Finset.Nat.antidiagonalTuple 0 0 = {![]}

full_name: Finset.Nat.antidiagonalTuple_zero_succ
code: @[simp]
theorem antidiagonalTuple_zero_succ (n : ℕ) : antidiagonalTuple 0 n.succ = ∅ 
goal: Finset.Nat.antidiagonalTuple 0 n.succ = ∅

full_name: Finset.Nat.mem_antidiagonalTuple
code: theorem mem_antidiagonalTuple {n : ℕ} {k : ℕ} {x : Fin k → ℕ} :
    x ∈ antidiagonalTuple k n ↔ ∑ i, x i = n 
goal: x ∈ Finset.Nat.antidiagonalTuple k n ↔ ∑ i : Fin k, x i = n

full_name: Finset.Nat.antidiagonalTuple_zero_right
code: theorem antidiagonalTuple_zero_right (k : ℕ) : antidiagonalTuple k 0 = {0} 
goal: Finset.Nat.antidiagonalTuple k 0 = {0}

full_name: Finset.Nat.antidiagonalTuple_one
code: @[simp]
theorem antidiagonalTuple_one (n : ℕ) : antidiagonalTuple 1 n = {![n]} 
goal: Finset.Nat.antidiagonalTuple 1 n = {![n]}

full_name: Finset.Nat.antidiagonalTuple_two
code: theorem antidiagonalTuple_two (n : ℕ) :
    antidiagonalTuple 2 n = (antidiagonal n).map (piFinTwoEquiv fun _ => ℕ).symm.toEmbedding 
goal: Finset.Nat.antidiagonalTuple 2 n = Finset.map (piFinTwoEquiv fun x => ℕ).symm.toEmbedding (Finset.antidiagonal n)

full_name: Finset.Nat.sigmaAntidiagonalTupleEquivTuple_symm_apply_snd_coe
code: /-- The disjoint union of antidiagonal tuples `Σ n, antidiagonalTuple k n` is equivalent to the
`k`-tuple `Fin k → ℕ`. This is such an equivalence, obtained by mapping `(n, x)` to `x`.

This is the tuple version of `Finset.sigmaAntidiagonalEquivProd`. -/
@[simps]
def sigmaAntidiagonalTupleEquivTuple (k : ℕ) : (Σ n, antidiagonalTuple k n) ≃ (Fin k → ℕ) 
goal: ∀ (a : Fin k), ↑((Finset.Nat.sigmaAntidiagonalTupleEquivTuple k).symm x).snd a = x a

full_name: Finset.Nat.sigmaAntidiagonalTupleEquivTuple_apply
code: /-- The disjoint union of antidiagonal tuples `Σ n, antidiagonalTuple k n` is equivalent to the
`k`-tuple `Fin k → ℕ`. This is such an equivalence, obtained by mapping `(n, x)` to `x`.

This is the tuple version of `Finset.sigmaAntidiagonalEquivProd`. -/
@[simps]
def sigmaAntidiagonalTupleEquivTuple (k : ℕ) : (Σ n, antidiagonalTuple k n) ≃ (Fin k → ℕ) 
goal: ∀ (a : Fin k), (Finset.Nat.sigmaAntidiagonalTupleEquivTuple k) x a = ↑x.snd a

full_name: Finset.Nat.sigmaAntidiagonalTupleEquivTuple_symm_apply_fst
code: /-- The disjoint union of antidiagonal tuples `Σ n, antidiagonalTuple k n` is equivalent to the
`k`-tuple `Fin k → ℕ`. This is such an equivalence, obtained by mapping `(n, x)` to `x`.

This is the tuple version of `Finset.sigmaAntidiagonalEquivProd`. -/
@[simps]
def sigmaAntidiagonalTupleEquivTuple (k : ℕ) : (Σ n, antidiagonalTuple k n) ≃ (Fin k → ℕ) 
goal: ((Finset.Nat.sigmaAntidiagonalTupleEquivTuple k).symm x).fst = ∑ i : Fin k, x i

full_name: Finset.Nat.sigmaAntidiagonalTupleEquivTuple
code: /-- The disjoint union of antidiagonal tuples `Σ n, antidiagonalTuple k n` is equivalent to the
`k`-tuple `Fin k → ℕ`. This is such an equivalence, obtained by mapping `(n, x)` to `x`.

This is the tuple version of `Finset.sigmaAntidiagonalEquivProd`. -/
@[simps]
def sigmaAntidiagonalTupleEquivTuple (k : ℕ) : (Σ n, antidiagonalTuple k n) ≃ (Fin k → ℕ) 
goal: (n : ℕ) × { x // x ∈ Finset.Nat.antidiagonalTuple k n } ≃ (Fin k → ℕ)