Documentation

CslibFrontier.Foundations.Data.Nat.BigOperators

Sums and products of natural numbers #

A finite sum of m i - 1 over positive natural numbers is at most ∏ m i - 1 (Nat.sum_sub_one_le_prod_sub_one). The CRT reconstruction of CslibFrontier/Crypto/Primitives/Garbling/Arithmetic/CRT.lean uses it to bound a linear combination of residues.

A finite sum of quotients by d is at most the quotient of the sum (Nat.sum_div_le_sum_div).

Main results #

theorem Nat.sum_sub_one_le_prod_sub_one {ι : Type u_1} (t : Finset ι) {m : ι → ℕ} (hm : ∀ i ∈ t, 0 < m i) :
∑ i ∈ t, (m i - 1) ≤ ∏ i ∈ t, m i - 1

For positive m i, the sum of the m i - 1 is at most the product of the m i, minus one.

theorem Nat.sum_div_le_sum_div {ι : Type u_1} (s : Finset ι) (f : ι → ℕ) (d : ℕ) :
∑ i ∈ s, f i / d ≤ (∑ i ∈ s, f i) / d

A sum of quotients by d is at most the quotient of the sum, the case of finite sums of Nat.div_add_div_le_add_div.