Documentation

LeanPool.PentagonalNumberTheoremAnalytic.Franklin.Helpers

Helper lemmas for Franklin's involution #

Helper lemmas about consecutiveTopRun, partition membership, and properties of αOp/βOp.

Main results #

@[simp]

Base case: consecutiveTopRun S 0 = 1 if 0 ∈ S, else 0.

@[simp]

Recurrence: consecutiveTopRun S (m+1) is 1 + consecutiveTopRun S m if m+1 ∈ S, else 0.

If m ∉ S then consecutiveTopRun S m = 0.

If m ∈ S then consecutiveTopRun S m > 0.

If 0 ∉ S then consecutiveTopRun S m ≤ m.

If j < consecutiveTopRun S m then m - j ∈ S.

theorem PentagonalNumberTheorem.Franklin.ctr_ge_of_mem (S : Finset ℕ) (m r : ℕ) (hrm : r ≤ m) (h : ∀ j < r, m - j ∈ S) :

Lower bound for consecutiveTopRun: a run of length r below m forces r ≤ consecutiveTopRun S m.

theorem PentagonalNumberTheorem.Franklin.ctr_eq_of (S : Finset ℕ) (m r : ℕ) (hrm : r ≤ m) (hmem : ∀ j < r, m - j ∈ S) (hnot : m - r ∉ S) :

consecutiveTopRun S m is the unique r ≤ m with m - j ∈ S for every j < r and m - r ∉ S.

theorem PentagonalNumberTheorem.Franklin.ctr_not_mem_boundary (S : Finset ℕ) (m : ℕ) (h0 : 0 ∉ S) (hm : m ∈ S) :
m - consecutiveTopRun S m ∉ S

If 0 ∉ S and m ∈ S then m - consecutiveTopRun S m ∉ S.

S ∈ distinctPartitions n iff S ⊆ Icc 1 n and S.sum id = n.

theorem PentagonalNumberTheorem.Franklin.DP_pos_mem (n : ℕ) (S : Finset ℕ) (hS : S ∈ distinctPartitions n) {x : ℕ} (hx : x ∈ S) :
1 ≤ x

Every element of a distinct partition of n is positive.

theorem PentagonalNumberTheorem.Franklin.DP_le_mem (n : ℕ) (S : Finset ℕ) (hS : S ∈ distinctPartitions n) {x : ℕ} (hx : x ∈ S) :
x ≤ n

Every element of S ∈ distinctPartitions n is at most n.

0 is not in any distinct partition.

The sum of a distinct partition of n equals n.

Every α-partition is a distinct partition.

Every β-partition is a distinct partition.

Every α-partition is nonempty.

Every β-partition is nonempty.

partBase S ∈ S for nonempty S.

partMax S ∈ S for nonempty S.

theorem PentagonalNumberTheorem.Franklin.partBase_le (S : Finset ℕ) (hne : S.Nonempty) {x : ℕ} (hx : x ∈ S) :

partBase S ≤ x for any x ∈ S.

theorem PentagonalNumberTheorem.Franklin.le_partMax (S : Finset ℕ) (hne : S.Nonempty) {x : ℕ} (hx : x ∈ S) :

x ≤ partMax S for any x ∈ S.

partBase S ≤ partMax S for nonempty S.

partSlope S > 0 when S is nonempty.

partSlope S ≤ partMax S when 0 ∉ S.

For S ∈ α(n), partBase S ≤ partSlope S.

For S ∈ β(n), partSlope S < partBase S.

For S ∈ α(n), partMax S ≥ 2 * partBase S.

For S ∈ β(n), partMax S ≥ 2 * partSlope S + 1.

Intervals #

Both pentagonal families are intervals — smkSet k = Icc k (2 * k - 1) and spkSet k = Icc (k + 1) (2 * k) — and a special partition is an interval too (DPspecial_* in Lemmas.lean). The lemmas below compute the sum and the three structural invariants of an arbitrary Finset.Icc a b once and for all.

theorem PentagonalNumberTheorem.Franklin.sum_Icc_id_mul_two (a b : ℕ) :
(∑ i ∈ Finset.Icc a b, i) * 2 = (b + 1 - a) * (a + b)

Gauss' summation formula over Finset.Icc in ℕ, in * 2 form: no division and no truncated subtraction on the left. Unconditional — both sides are 0 when b < a.

theorem PentagonalNumberTheorem.Franklin.sum_Icc_id (a b : ℕ) :
∑ i ∈ Finset.Icc a b, i = (b + 1 - a) * (a + b) / 2

Gauss' summation formula over Finset.Icc in ℕ.

sum_Icc_id_mul_two in Finset.sum _ id phrasing, which is what distinctPartitions uses. rw cannot see through id, so this restatement is what call sites need.

theorem PentagonalNumberTheorem.Franklin.Icc_sum_id (a b : ℕ) :
(Finset.Icc a b).sum id = (b + 1 - a) * (a + b) / 2

sum_Icc_id in Finset.sum _ id phrasing.

The consecutive-run function on an interval: every element of Icc a b continues the run back down to a, and everything outside has run length 0.

The base of a nonempty interval is its left endpoint.

The max of a nonempty interval is its right endpoint.

A nonempty interval is one single run, so its slope is its whole length.

For S ∈ α(n), partMax S - partBase S + 1 ∈ S.

For S ∈ α(n), partBase S ≠ partMax S - partBase S + 1.

partMax S + 1 ∉ S for nonempty S.

Membership in αOp S, with the two lets of the definition unfolded.

The α-operation preserves the sum of parts.

For S ∈ α(n), partMax (αOp S) = partMax S + 1.

For S ∈ α(n), partSlope (αOp S) = partBase S.

For S ∈ β(n), partSlope S ∉ S.

For S ∈ β(n), partMax S - partSlope S ∉ S.

For S ∈ β(n), partSlope S ≠ partMax S - partSlope S.

For S ∈ β(n), βOp S inserts the slope and partMax S - partSlope S into S, after deleting the maximum.

The β-operation preserves the sum of parts.

For S ∈ β(n), partMax (βOp S) = partMax S - 1.

For S ∈ β(n), partBase (βOp S) = partSlope S.