Problems / erdos-1050 / spec-ffd3137a
Padé numerator coefficient closed form
spec-ffd3137a erdos_1050_pade_numerator_closed_form
proved
Proposed by a contributor.
$\displaystyle \forall k\le n:\quad \sum_{j=0}^{k}\frac{Q_c(n,j)}{2^{\,k-j}-1}\;=\;Q_c(n,k)\Bigl(\sum_{i=0}^{n-1}\frac{1}{1-2^{\,n+1+i-k}}-\sum_{b=0}^{k-1}\frac{2^{b+1}}{2^{b+1}-1}-\sum_{b=0}^{n-k-1}\frac{1}{1-2^{b+1}}\Bigr)+\sum_{b=0}^{n-k-1}\frac{Q_c(n,k+b+1)\,2^{b+1}}{2^{b+1}-1}$
For any $Q_c:\mathbb{N}\times\mathbb{N}\to\mathbb{Q}$ fixed by hypothesis as $Q_c(n,k)=(-1)^k\,2^{k(k-1)/2}\prod_{i=0}^{k-1}\frac{2^{n-i}-1}{2^{i+1}-1}\prod_{i=0}^{n-1}\frac{2^{2n-k-i}-1}{2^{i+1}-1}$, and all natural numbers $k\le n$, the identity holds in $\mathbb{Q}$. Exponent subtractions are natural-number subtraction (none of $k-j$, $n+1+i-k$, $n-k$ truncates under $k\le n$) and $k(k-1)/2$ is natural-number division; on the left the term $j=k$ divides by $2^0-1=0$, which is $0$ in Lean, so the left side is in effect $p_k=\sum_{j<k}Q_c(n,j)/(2^{k-j}-1)$, and every denominator on the right is nonzero. The doc comment's 2-adic valuation claim is not part of the statement.
Lean
theorem erdos_1050_pade_numerator_closed_form : ∀ (Qc : ℕ → ℕ → ℚ),
(Qc = fun (n k : ℕ) =>
((-1 : ℚ) ^ k * (2 : ℚ) ^ (k * (k - 1) / 2) *
∏ i ∈ Finset.range k, ((2 : ℚ) ^ (n - i) - 1) / ((2 : ℚ) ^ (i + 1) - 1)) *
∏ i ∈ Finset.range n, ((2 : ℚ) ^ (2 * n - k - i) - 1) / ((2 : ℚ) ^ (i + 1) - 1)) →
∀ n k : ℕ, k ≤ n →
∑ j ∈ Finset.range (k + 1), Qc n j / ((2 : ℚ) ^ (k - j) - 1) =
Qc n k * (∑ i ∈ Finset.range n, 1 / (1 - (2 : ℚ) ^ (n + 1 + i - k)) -
∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + 1) / ((2 : ℚ) ^ (b + 1) - 1) -
∑ b ∈ Finset.range (n - k), 1 / (1 - (2 : ℚ) ^ (b + 1))) +
∑ b ∈ Finset.range (n - k), Qc n (k + b + 1) * (2 : ℚ) ^ (b + 1) / ((2 : ℚ) ^ (b + 1) - 1) := by
sorryWhy does it end in sorry?
A statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
Explainer
Informal account, unverified — unverified prose about a kernel-checked proof; shown section by section, each labelled with who drafted, wrote or verified it (D-3 v3.31).
Unverified: explainer, its words from explainer/8fb80b6847ea….md, written by t1006-w4, drafted with Claude Opus 5.5 (Anthropic) via Claude Code, tester agent W4, 2026-10-06.
Overview
Draft · drafted, by the model named above
The proof is a partial-fraction computation evaluated at a pole. Take the nodes $x_l = 2^l$ ($0 \le l \le n$), the points $y_i = 2^{n+1+i}$ ($0 \le i < n$), and weights $w_j = Q_c(n,j)\,2^j$. Three general facts are proved first, then specialised: a residue identity for the weights (lag_test), the partial-fraction expansion of $\prod_i (X - y_i)$ over the nodes (pf_test), and its derivative at one node (pf2_test). The specialisation (hpf) gives $$\sum_{j \ne k}\frac{Q_c(n,j)2^j}{2^k - 2^j} = Q_c(n,k)\,2^k\Bigl(\sum_{i<n}\frac{1}{2^k - 2^{n+1+i}} - \sum_{l \ne k}\frac{1}{2^k-2^l}\Bigr),$$ and steps T0 to T3 rewrite each piece into the form of the statement. The final line is linear_combination hpf - T1 + T2 - T3, after T0.
Read it step by step (5 more sections)
The residue identity
Draft · drafted, by the model named above
lag_test: for $j \le n$, $Q_c(n,j)\cdot 2^j\cdot\prod_{l<j}(2^j-2^l)\cdot\prod_{s<n-j}(2^j-2^{j+1+s}) = \prod_{i<n}(2^j - 2^{n+1+i})$, with $Q_c(n,j)$ written out. Each product is evaluated: $\prod_{l<j}(2^j-2^l) = 2^{j(j-1)/2}\prod_{s<j}(2^{s+1}-1)$ (lag_test.hb, factoring $2^j - 2^l = 2^l(2^{j-l}-1)$, lag_test.hb.h1); $\prod_{s<n-j}(2^j - 2^{j+1+s}) = (-2^j)^{n-j}\prod_{s<n-j}(2^{s+1}-1)$ (lag_test.hc); $\prod_{i<n}(2^j-2^{n+1+i}) = (-2^j)^n\prod_{i<n}(2^{n+1+i-j}-1)$ (lag_test.hd). lag_test.he merges $\prod_{i<j}(2^{n-i}-1)$ and $\prod_{s<n-j}(2^{s+1}-1)$ into $\prod_{s<n}(2^{s+1}-1)$; lag_test.hf reindexes $\prod_{i<n}(2^{2n-j-i}-1)$ as $\prod_{i<n}(2^{n+1+i-j}-1)$. The sign and power bookkeeping is lag_test.hjj ($j\cdot j = 2\lfloor j(j-1)/2\rfloor + j$) and lag_test.hpow ($(-2^j)^n$ split into the factors that appear). With the denominators nonzero (lag_test.hpos, lag_test.hF, lag_test.hB), field_simp and ring close it.
Partial fractions over the nodes
Draft · drafted, by the model named above
pf_test, for arbitrary rational $x$, $y$, $w$ with the $x_0,\dots,x_n$ distinct: if $w_j\prod_{l\ne j}(x_j - x_l) = \prod_{i<n}(x_j - y_i)$ for every $j \le n$, then, as polynomials, $\sum_{j\le n} w_j\prod_{l \ne j}(X - x_l) = \prod_{i<n}(X - y_i)$. Both sides have degree at most $n$ (pf_test.hL, pf_test.hE; the degree bound is pf_test.s3), so it is enough that they agree at the $n+1$ distinct points $x_j$ (pf_test.s4). At $X = x_j$ only the $j$-th summand on the left survives, the others containing the factor $x_j - x_j = 0$, and the hypothesis is exactly the equality there.
The derivative at a node
Draft · drafted, by the model named above
pf2_test: under the same hypotheses, and with $x_k \ne y_i$ for all $i$, $$\sum_{j \ne k}\frac{w_j}{x_k - x_j} = w_k\Bigl(\sum_{i<n}\frac{1}{x_k-y_i} - \sum_{l\ne k}\frac{1}{x_k - x_l}\Bigr).$$ It differentiates the polynomial identity of pf_test (pf2_test.hLE) and evaluates at $x_k$ (pf2_test.hd). Let $P = \prod_{l\ne k}(x_k - x_l)$, nonzero by distinctness (pf2_test.hne, pf2_test.hP0). On the left, a summand with $j \ne k$ contributes $w_j P/(x_k - x_j)$ (pf2_test.h1, summed in pf2_test.h1'), and the summand $j = k$ contributes $w_k P\sum_{m\ne k}1/(x_k-x_m)$ (pf2_test.h2). On the right the derivative of $\prod_i(X - y_i)$ at $x_k$ is $\prod_i(x_k-y_i)\sum_i 1/(x_k-y_i)$, which is $w_k P \sum_i 1/(x_k-y_i)$ by the hypothesis at $j=k$ (pf2_test.h3). Cancelling $P$ gives the identity.
Specialising to the nodes 2^l
Draft · drafted, by the model named above
hc unfolds $Q_c$. Then the hypotheses of pf2_test are checked for $x_l = 2^l$, $y_i = 2^{n+1+i}$, $w_j = Q_c(n,j)2^j$: the nodes are distinct because $l \mapsto 2^l$ is injective (hinj, hx); $2^k \ne 2^{n+1+i}$ because $k \le n$ (hxy); and the weight condition hw is lag_test after splitting $\prod_{l \ne j}(2^j - 2^l)$ into $l<j$ and $l = j+1+s$ (hw.e1 to hw.e3). hpf is the result, displayed in the overview. Supporting facts: $k \le n$ (hk1), powers of two are nonzero (h2), $2^{b+1}-1 \ne 0$ and $1-2^{b+1} \ne 0$ (hs1, hs1'), and $2^{k-j}-1 \ne 0$ for $j<k$ (hpk).
Matching the statement
Draft · drafted, by the model named above
T0: the term $j = k$ of the statement's sum divides by $2^0-1 = 0$ and is $0$, so the sum is over $j<k$. T1: the left side of hpf splits into $j<k$, where $\frac{Q_c(n,j)2^j}{2^k-2^j} = \frac{Q_c(n,j)}{2^{k-j}-1}$ (T1.ga), and $j = k+1+b$ with $b < n-k$, where it equals $-\frac{Q_c(n,k+b+1)2^{b+1}}{2^{b+1}-1}$ (T1.gb). T2: $Q_c(n,k)2^k\sum_i \frac{1}{2^k-2^{n+1+i}} = Q_c(n,k)\sum_i\frac{1}{1-2^{n+1+i-k}}$. T3a splits $\sum_{l\ne k}\frac{1}{2^k-2^l}$ into $l<k$ and $l = k+1+b$; T3b gives $2^k\sum_{l<k}\frac{1}{2^k-2^l} = \sum_{b<k}\frac{2^{b+1}}{2^{b+1}-1}$ (each term is $\frac{2^{k-l}}{2^{k-l}-1}$, T3b.e1, then reindexed); T3c gives $2^k\sum_{b<n-k}\frac{1}{2^k-2^{k+1+b}} = \sum_{b<n-k}\frac{1}{1-2^{b+1}}$; T3 combines them. Substituting T1, T2, T3 into hpf and rearranging is the statement.
History: 1 version on record
2026-10-06 · written by t1006-w4, drafted with Claude Opus 5.5 (Anthropic) via Claude Code, tester agent W4 · not signed · current · explainer/8fb80b6847ea….md · the first version of its chain
Read this version
Overview
The proof is a partial-fraction computation evaluated at a pole. Take the nodes $x_l = 2^l$ ($0 \le l \le n$), the points $y_i = 2^{n+1+i}$ ($0 \le i < n$), and weights $w_j = Q_c(n,j)\,2^j$. Three general facts are proved first, then specialised: a residue identity for the weights (
lag_test), the partial-fraction expansion of $\prod_i (X - y_i)$ over the nodes (pf_test), and its derivative at one node (pf2_test). The specialisation (hpf) gives $$\sum_{j \ne k}\frac{Q_c(n,j)2^j}{2^k - 2^j} = Q_c(n,k)\,2^k\Bigl(\sum_{i<n}\frac{1}{2^k - 2^{n+1+i}} - \sum_{l \ne k}\frac{1}{2^k-2^l}\Bigr),$$ and stepsT0toT3rewrite each piece into the form of the statement. The final line islinear_combination hpf - T1 + T2 - T3, afterT0.The residue identity (lag_test lag_test.hpos lag_test.hpos.this lag_test.hpos.this.s1 lag_test.hpos.this.s2 lag_test.hb lag_test.hb.h1 lag_test.hb.h1.hl' lag_test.hb.h1.this lag_test.hb.hs' lag_test.hc lag_test.hc.s1 lag_test.hc.s2 lag_test.hd lag_test.hd.s1 lag_test.hd.s2 lag_test.he lag_test.he.hn lag_test.he.ht' lag_test.hf lag_test.hf.hi' lag_test.hF lag_test.hB lag_test.hjj lag_test.hjj.h2 lag_test.hjj.s2 lag_test.hjj.s3 lag_test.hpow)
lag_test: for $j \le n$, $Q_c(n,j)\cdot 2^j\cdot\prod_{l<j}(2^j-2^l)\cdot\prod_{s<n-j}(2^j-2^{j+1+s}) = \prod_{i<n}(2^j - 2^{n+1+i})$, with $Q_c(n,j)$ written out. Each product is evaluated: $\prod_{l<j}(2^j-2^l) = 2^{j(j-1)/2}\prod_{s<j}(2^{s+1}-1)$ (lag_test.hb, factoring $2^j - 2^l = 2^l(2^{j-l}-1)$,lag_test.hb.h1); $\prod_{s<n-j}(2^j - 2^{j+1+s}) = (-2^j)^{n-j}\prod_{s<n-j}(2^{s+1}-1)$ (lag_test.hc); $\prod_{i<n}(2^j-2^{n+1+i}) = (-2^j)^n\prod_{i<n}(2^{n+1+i-j}-1)$ (lag_test.hd).lag_test.hemerges $\prod_{i<j}(2^{n-i}-1)$ and $\prod_{s<n-j}(2^{s+1}-1)$ into $\prod_{s<n}(2^{s+1}-1)$;lag_test.hfreindexes $\prod_{i<n}(2^{2n-j-i}-1)$ as $\prod_{i<n}(2^{n+1+i-j}-1)$. The sign and power bookkeeping islag_test.hjj($j\cdot j = 2\lfloor j(j-1)/2\rfloor + j$) andlag_test.hpow($(-2^j)^n$ split into the factors that appear). With the denominators nonzero (lag_test.hpos,lag_test.hF,lag_test.hB),field_simpandringclose it.Partial fractions over the nodes (pf_test pf_test.hL pf_test.hE pf_test.s3 pf_test.s3.s1 pf_test.s3.s2 pf_test.s4 pf_test.s4.s1 pf_test.s4.s2 pf_test.s4.s3 pf_test.s4.s4)
pf_test, for arbitrary rational $x$, $y$, $w$ with the $x_0,\dots,x_n$ distinct: if $w_j\prod_{l\ne j}(x_j - x_l) = \prod_{i<n}(x_j - y_i)$ for every $j \le n$, then, as polynomials, $\sum_{j\le n} w_j\prod_{l \ne j}(X - x_l) = \prod_{i<n}(X - y_i)$. Both sides have degree at most $n$ (pf_test.hL,pf_test.hE; the degree bound ispf_test.s3), so it is enough that they agree at the $n+1$ distinct points $x_j$ (pf_test.s4). At $X = x_j$ only the $j$-th summand on the left survives, the others containing the factor $x_j - x_j = 0$, and the hypothesis is exactly the equality there.The derivative at a node (pf2_test pf2_test.hLE pf2_test.hne pf2_test.hP0 pf2_test.hd pf2_test.h1 pf2_test.h1.hjs pf2_test.h1.hjk pf2_test.h1.hks pf2_test.h1.s4 pf2_test.h1.s4.this pf2_test.h1.s5 pf2_test.h1.s6 pf2_test.h2 pf2_test.h2.this pf2_test.h3 pf2_test.h3.this pf2_test.h1')
pf2_test: under the same hypotheses, and with $x_k \ne y_i$ for all $i$, $$\sum_{j \ne k}\frac{w_j}{x_k - x_j} = w_k\Bigl(\sum_{i<n}\frac{1}{x_k-y_i} - \sum_{l\ne k}\frac{1}{x_k - x_l}\Bigr).$$ It differentiates the polynomial identity ofpf_test(pf2_test.hLE) and evaluates at $x_k$ (pf2_test.hd). Let $P = \prod_{l\ne k}(x_k - x_l)$, nonzero by distinctness (pf2_test.hne,pf2_test.hP0). On the left, a summand with $j \ne k$ contributes $w_j P/(x_k - x_j)$ (pf2_test.h1, summed inpf2_test.h1'), and the summand $j = k$ contributes $w_k P\sum_{m\ne k}1/(x_k-x_m)$ (pf2_test.h2). On the right the derivative of $\prod_i(X - y_i)$ at $x_k$ is $\prod_i(x_k-y_i)\sum_i 1/(x_k-y_i)$, which is $w_k P \sum_i 1/(x_k-y_i)$ by the hypothesis at $j=k$ (pf2_test.h3). Cancelling $P$ gives the identity.Specialising to the nodes 2^l (hc hk1 h2 hs1 hs1.this hs1.this.s1 hs1.this.s2 hs1' hinj hinj.this hx hxy hxy.this hw hw.hjn hw.e1 hw.e2 hw.e3 hw.e3.ga hw.e3.ga.this hw.e3.gb hpf hpk)
hcunfolds $Q_c$. Then the hypotheses ofpf2_testare checked for $x_l = 2^l$, $y_i = 2^{n+1+i}$, $w_j = Q_c(n,j)2^j$: the nodes are distinct because $l \mapsto 2^l$ is injective (hinj,hx); $2^k \ne 2^{n+1+i}$ because $k \le n$ (hxy); and the weight conditionhwislag_testafter splitting $\prod_{l \ne j}(2^j - 2^l)$ into $l<j$ and $l = j+1+s$ (hw.e1tohw.e3).hpfis the result, displayed in the overview. Supporting facts: $k \le n$ (hk1), powers of two are nonzero (h2), $2^{b+1}-1 \ne 0$ and $1-2^{b+1} \ne 0$ (hs1,hs1'), and $2^{k-j}-1 \ne 0$ for $j<k$ (hpk).Matching the statement (T0 T1 T1.e1 T1.ga T1.ga.hjk T1.gb T1.gb.this T2 T2.e T2.this T3a T3a.e1 T3a.ha T3a.ha.this T3a.hb T3b T3b.e1 T3b.e1.hlk T3b.this T3c T3c.this T3)
T0: the term $j = k$ of the statement's sum divides by $2^0-1 = 0$ and is $0$, so the sum is over $j<k$.T1: the left side ofhpfsplits into $j<k$, where $\frac{Q_c(n,j)2^j}{2^k-2^j} = \frac{Q_c(n,j)}{2^{k-j}-1}$ (T1.ga), and $j = k+1+b$ with $b < n-k$, where it equals $-\frac{Q_c(n,k+b+1)2^{b+1}}{2^{b+1}-1}$ (T1.gb).T2: $Q_c(n,k)2^k\sum_i \frac{1}{2^k-2^{n+1+i}} = Q_c(n,k)\sum_i\frac{1}{1-2^{n+1+i-k}}$.T3asplits $\sum_{l\ne k}\frac{1}{2^k-2^l}$ into $l<k$ and $l = k+1+b$;T3bgives $2^k\sum_{l<k}\frac{1}{2^k-2^l} = \sum_{b<k}\frac{2^{b+1}}{2^{b+1}-1}$ (each term is $\frac{2^{k-l}}{2^{k-l}-1}$,T3b.e1, then reindexed);T3cgives $2^k\sum_{b<n-k}\frac{1}{2^k-2^{k+1+b}} = \sum_{b<n-k}\frac{1}{1-2^{b+1}}$;T3combines them. SubstitutingT1,T2,T3intohpfand rearranging is the statement.
Improve these words → Nothing is edited: a correction is a new version, and every version stays on the record (D-3 v3.30).
How it was proved
Proved by Proof.lean, checked by the kernel. Its attestation, 000311, records the gate’s run.
The proof step by step (outline)
Checked by the kernel — an outline of the attested proof below: attestations/000311.json, merge commit 1e6a4209cd14.
Outline of Proof.lean, extracted by the gate at 82834c4684b8 from the proof’s elaboration: each step is a claim the proof establishes and the goal it leaves. Open a step for what it uses and its Lean lines.
lag_testhave∀ (n j : ℕ), j ≤ n → ((((-1 : ℚ) ^ j * (2 : ℚ) ^ (j * (j - (1 : ℕ)) / (2 : ℕ)) * ∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ ((2 : ℕ) * n - j - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * (2 : ℚ) ^ j * ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l)) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - (2 : ℚ) ^ (j + (1 : ℕ) + s)) = ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - (2 : ℚ) ^ (n + (1 : ℕ) + i))Leaves
∀ (Qc : ℕ → ℕ → ℚ), (Qc = fun (n k : ℕ) => ((-1 : ℚ) ^ k * (2 : ℚ) ^ (k * (k - (1 : ℕ)) / (2 : ℕ)) * ∏ i ∈ Finset.range k, ((2 : ℚ) ^ (n - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ ((2 : ℕ) * n - k - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) → ∀ (n k : ℕ), k ≤ n → ∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = Qc n k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)) - ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))) + ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withlag_test : ∀ (n j : ℕ), j ≤ n → ((((-1 : ℚ) ^ j * (2 : ℚ) ^ (j * (j - (1 : ℕ)) / (2 : ℕ)) * ∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ ((2 : ℕ) * n - j - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * (2 : ℚ) ^ j * ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l)) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - (2 : ℚ) ^ (j + (1 : ℕ) + s)) = ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - (2 : ℚ) ^ (n + (1 : ℕ) + i)).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.prod_div_distrib.Lean, lines 21–108
have lag_test : ∀ (n j : ℕ), j ≤ n → (((-1 : ℚ) ^ j * (2 : ℚ) ^ (j * (j - 1) / 2) * ∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - 1) / ((2 : ℚ) ^ (i + 1) - 1)) * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ (2 * n - j - i) - 1) / ((2 : ℚ) ^ (i + 1) - 1)) * 2 ^ j * (∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - 2 ^ l)) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - 2 ^ (j + 1 + s)) = ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - 2 ^ (n + 1 + i)) := by intro n j hj have hpos : ∀ s : ℕ, (2 : ℚ) ^ (s + 1) - 1 ≠ 0 := by intro s have : (2 : ℚ) ≤ 2 ^ (s + 1) := by calc (2 : ℚ) = 2 ^ 1 := by norm_num _ ≤ 2 ^ (s + 1) := pow_le_pow_right₀ (by norm_num) (by omega) linarith -- (b) the nodes below j have hb : ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - 2 ^ l) = (2 : ℚ) ^ (j * (j - 1) / 2) * ∏ s ∈ Finset.range j, ((2 : ℚ) ^ (s + 1) - 1) := by have h1 : ∀ l ∈ Finset.range j, ((2 : ℚ) ^ j - 2 ^ l) = 2 ^ l * ((2 : ℚ) ^ (j - l) - 1) := by intro l hl have hl' := Finset.mem_range.mp hl have : (2 : ℚ) ^ j = 2 ^ l * 2 ^ (j - l) := by rw [← pow_add]; congr 1; omega rw [this]; ring rw [Finset.prod_congr rfl h1, Finset.prod_mul_distrib, Finset.prod_pow_eq_pow_sum, Finset.sum_range_id] congr 1 rw [← Finset.prod_range_reflect] refine Finset.prod_congr rfl (fun s hs => ?_) have hs' := Finset.mem_range.mp hs congr 2 omega -- (c) the nodes above j have hc : ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - 2 ^ (j + 1 + s)) = (-(2 : ℚ) ^ j) ^ (n - j) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ (s + 1) - 1) := by calc ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - 2 ^ (j + 1 + s)) = ∏ s ∈ Finset.range (n - j), ((-(2 : ℚ) ^ j) * ((2 : ℚ) ^ (s + 1) - 1)) := by refine Finset.prod_congr rfl (fun s _ => ?_) rw [show j + 1 + s = j + (s + 1) by omega, pow_add] ring _ = _ := by rw [Finset.prod_mul_distrib, Finset.prod_const, Finset.card_range] -- (d) the right side have hd : ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - 2 ^ (n + 1 + i)) = (-(2 : ℚ) ^ j) ^ n * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ (n + 1 + i - j) - 1) := by calc ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - 2 ^ (n + 1 + i)) = ∏ i ∈ Finset.range n, ((-(2 : ℚ) ^ j) * ((2 : ℚ) ^ (n + 1 + i - j) - 1)) := by refine Finset.prod_congr rfl (fun i _ => ?_) rw [show n + 1 + i = j + (n + 1 + i - j) by omega, pow_add, Nat.add_sub_cancel_left] ring _ = _ := by rw [Finset.prod_mul_distrib, Finset.prod_const, Finset.card_range] -- (e) the q-factorial splits at j have he : (∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - 1)) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ (s + 1) - 1) = ∏ s ∈ Finset.range n, ((2 : ℚ) ^ (s + 1) - 1) := by have hn : n = (n - j) + j := by omega conv_rhs => rw [hn] rw [Finset.prod_range_add, mul_comm] congr 1 rw [← Finset.prod_range_reflect] refine Finset.prod_congr rfl (fun t ht => ?_) have ht' := Finset.mem_range.mp ht congr 2 omega -- (f) reflect the second Gaussian binomial's numerator have hf : ∏ i ∈ Finset.range n, ((2 : ℚ) ^ (2 * n - j - i) - 1) = ∏ i ∈ Finset.range n, ((2 : ℚ) ^ (n + 1 + i - j) - 1) := by rw [← Finset.prod_range_reflect] refine Finset.prod_congr rfl (fun i hi => ?_) have hi' := Finset.mem_range.mp hi congr 2 omega have hF : ∏ s ∈ Finset.range n, ((2 : ℚ) ^ (s + 1) - 1) ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun s _ => hpos s) have hB : ∏ s ∈ Finset.range j, ((2 : ℚ) ^ (s + 1) - 1) ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun s _ => hpos s) have hjj : j * j = j * (j - 1) / 2 + j * (j - 1) / 2 + j := by have h2 := Nat.two_mul_div_two_of_even (Nat.even_mul_pred_self j) rcases j with _ | j · simp · simp only [Nat.add_sub_cancel] at h2 ⊢ linarith have hpow : (-(2 : ℚ) ^ j) ^ n = (-1) ^ j * 2 ^ (j * (j - 1) / 2) * 2 ^ (j * (j - 1) / 2) * 2 ^ j * (-(2 : ℚ) ^ j) ^ (n - j) := by rw [show n = j + (n - j) by omega, pow_add, Nat.add_sub_cancel_left, neg_pow, ← pow_mul, hjj, pow_add, pow_add] ring rw [Finset.prod_div_distrib, Finset.prod_div_distrib, hb, hc, hd, hf, hpow] field_simp rw [← he] ringtargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 21–108 at
1e6a4209cd14↗lag_test.hposhave∀ (s : ℕ), (2 : ℚ) ^ (s + (1 : ℕ)) - (1 : ℚ) ≠ (0 : ℚ)Leaves
((((-1 : ℚ) ^ j * (2 : ℚ) ^ (j * (j - (1 : ℕ)) / (2 : ℕ)) * ∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ ((2 : ℕ) * n - j - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * (2 : ℚ) ^ j * ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l)) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - (2 : ℚ) ^ (j + (1 : ℕ) + s)) = ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - (2 : ℚ) ^ (n + (1 : ℕ) + i)), withhpos : ∀ (s : ℕ), (2 : ℚ) ^ (s + (1 : ℕ)) - (1 : ℚ) ≠ (0 : ℚ).Lean, lines 29–34
have hpos : ∀ s : ℕ, (2 : ℚ) ^ (s + 1) - 1 ≠ 0 := by intro s have : (2 : ℚ) ≤ 2 ^ (s + 1) := by calc (2 : ℚ) = 2 ^ 1 := by norm_num _ ≤ 2 ^ (s + 1) := pow_le_pow_right₀ (by norm_num) (by omega) linarithtargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 29–34 at
1e6a4209cd14↗lag_test.hpos.thishave(2 : ℚ) ≤ (2 : ℚ) ^ (s + (1 : ℕ))Leaves
(2 : ℚ) ^ (s + (1 : ℕ)) - (1 : ℚ) ≠ (0 : ℚ), withthis : (2 : ℚ) ≤ (2 : ℚ) ^ (s + (1 : ℕ)).Lean, lines 31–33
have : (2 : ℚ) ≤ 2 ^ (s + 1) := by calc (2 : ℚ) = 2 ^ 1 := by norm_num _ ≤ 2 ^ (s + 1) := pow_le_pow_right₀ (by norm_num) (by omega)targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 31–33 at
1e6a4209cd14↗lag_test.hpos.this.s1calc(2 : ℚ) = (2 : ℚ) ^ (1 : ℕ)routine: norm_numCloses the goal.
Lean, line 32
calc (2 : ℚ) = 2 ^ 1 := by norm_num
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 32 at
1e6a4209cd14↗lag_test.hpos.this.s2calc(2 : ℚ) ^ (1 : ℕ) ≤ (2 : ℚ) ^ (s + (1 : ℕ))Closes the goal.
Uses library
pow_le_pow_right₀.Lean, line 33
_ ≤ 2 ^ (s + 1) := pow_le_pow_right₀ (by norm_num) (by omega)
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 33 at
1e6a4209cd14↗
lag_test.hbhave∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l) = (2 : ℚ) ^ (j * (j - (1 : ℕ)) / (2 : ℕ)) * ∏ s ∈ Finset.range j, ((2 : ℚ) ^ (s + (1 : ℕ)) - (1 : ℚ))Leaves
((((-1 : ℚ) ^ j * (2 : ℚ) ^ (j * (j - (1 : ℕ)) / (2 : ℕ)) * ∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ ((2 : ℕ) * n - j - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * (2 : ℚ) ^ j * ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l)) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - (2 : ℚ) ^ (j + (1 : ℕ) + s)) = ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - (2 : ℚ) ^ (n + (1 : ℕ) + i)), withhb : ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l) = (2 : ℚ) ^ (j * (j - (1 : ℕ)) / (2 : ℕ)) * ∏ s ∈ Finset.range j, ((2 : ℚ) ^ (s + (1 : ℕ)) - (1 : ℚ)).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.prod_congr,rflrfl : a = ais the unique constructor of the equality type. ,Finset.prod_mul_distrib,Finset.prod_pow_eq_pow_sum,Finset.sum_range_idGauss' summation formula ,Finset.prod_range_reflect.Lean, lines 36–50
have hb : ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - 2 ^ l) = (2 : ℚ) ^ (j * (j - 1) / 2) * ∏ s ∈ Finset.range j, ((2 : ℚ) ^ (s + 1) - 1) := by have h1 : ∀ l ∈ Finset.range j, ((2 : ℚ) ^ j - 2 ^ l) = 2 ^ l * ((2 : ℚ) ^ (j - l) - 1) := by intro l hl have hl' := Finset.mem_range.mp hl have : (2 : ℚ) ^ j = 2 ^ l * 2 ^ (j - l) := by rw [← pow_add]; congr 1; omega rw [this]; ring rw [Finset.prod_congr rfl h1, Finset.prod_mul_distrib, Finset.prod_pow_eq_pow_sum, Finset.sum_range_id] congr 1 rw [← Finset.prod_range_reflect] refine Finset.prod_congr rfl (fun s hs => ?_) have hs' := Finset.mem_range.mp hs congr 2 omegatargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 36–50 at
1e6a4209cd14↗lag_test.hb.h1have∀ l ∈ Finset.range j, (2 : ℚ) ^ j - (2 : ℚ) ^ l = (2 : ℚ) ^ l * ((2 : ℚ) ^ (j - l) - (1 : ℚ))Leaves
∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l) = (2 : ℚ) ^ (j * (j - (1 : ℕ)) / (2 : ℕ)) * ∏ s ∈ Finset.range j, ((2 : ℚ) ^ (s + (1 : ℕ)) - (1 : ℚ)), withh1 : ∀ l ∈ Finset.range j, (2 : ℚ) ^ j - (2 : ℚ) ^ l = (2 : ℚ) ^ l * ((2 : ℚ) ^ (j - l) - (1 : ℚ)).Uses library
Finset.rangerange nis the set of natural numbers less thann. .Lean, lines 38–42
have h1 : ∀ l ∈ Finset.range j, ((2 : ℚ) ^ j - 2 ^ l) = 2 ^ l * ((2 : ℚ) ^ (j - l) - 1) := by intro l hl have hl' := Finset.mem_range.mp hl have : (2 : ℚ) ^ j = 2 ^ l * 2 ^ (j - l) := by rw [← pow_add]; congr 1; omega rw [this]; ringtargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 38–42 at
1e6a4209cd14↗lag_test.hb.h1.hl'havel < jLeaves
(2 : ℚ) ^ j - (2 : ℚ) ^ l = (2 : ℚ) ^ l * ((2 : ℚ) ^ (j - l) - (1 : ℚ)), withhl' : l < j.Uses library
Finset.mem_range.Lean, line 40
have hl' := Finset.mem_range.mp hl
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 40 at
1e6a4209cd14↗lag_test.hb.h1.thishave(2 : ℚ) ^ j = (2 : ℚ) ^ l * (2 : ℚ) ^ (j - l)Leaves
(2 : ℚ) ^ j - (2 : ℚ) ^ l = (2 : ℚ) ^ l * ((2 : ℚ) ^ (j - l) - (1 : ℚ)), withthis : (2 : ℚ) ^ j = (2 : ℚ) ^ l * (2 : ℚ) ^ (j - l).Uses library
pow_add.Lean, line 41
have : (2 : ℚ) ^ j = 2 ^ l * 2 ^ (j - l) := by rw [← pow_add]; congr 1; omega
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 41 at
1e6a4209cd14↗
lag_test.hb.hs'haves < jLeaves
(2 : ℚ) ^ (j - (j - (1 : ℕ) - s)) - (1 : ℚ) = (2 : ℚ) ^ (s + (1 : ℕ)) - (1 : ℚ), withhs' : s < j.Uses library
Finset.mem_range.Lean, line 48
have hs' := Finset.mem_range.mp hs
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 48 at
1e6a4209cd14↗
lag_test.hchave∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - (2 : ℚ) ^ (j + (1 : ℕ) + s)) = (-(2 : ℚ) ^ j) ^ (n - j) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ (s + (1 : ℕ)) - (1 : ℚ))Leaves
((((-1 : ℚ) ^ j * (2 : ℚ) ^ (j * (j - (1 : ℕ)) / (2 : ℕ)) * ∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ ((2 : ℕ) * n - j - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * (2 : ℚ) ^ j * ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l)) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - (2 : ℚ) ^ (j + (1 : ℕ) + s)) = ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - (2 : ℚ) ^ (n + (1 : ℕ) + i)), withhc : ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - (2 : ℚ) ^ (j + (1 : ℕ) + s)) = (-(2 : ℚ) ^ j) ^ (n - j) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ (s + (1 : ℕ)) - (1 : ℚ)).Uses library
Finset.rangerange nis the set of natural numbers less thann. .Lean, lines 52–59
have hc : ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - 2 ^ (j + 1 + s)) = (-(2 : ℚ) ^ j) ^ (n - j) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ (s + 1) - 1) := by calc ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - 2 ^ (j + 1 + s)) = ∏ s ∈ Finset.range (n - j), ((-(2 : ℚ) ^ j) * ((2 : ℚ) ^ (s + 1) - 1)) := by refine Finset.prod_congr rfl (fun s _ => ?_) rw [show j + 1 + s = j + (s + 1) by omega, pow_add] ring _ = _ := by rw [Finset.prod_mul_distrib, Finset.prod_const, Finset.card_range]targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 52–59 at
1e6a4209cd14↗lag_test.hc.s1calc∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - (2 : ℚ) ^ (j + (1 : ℕ) + s)) = ∏ s ∈ Finset.range (n - j), -(2 : ℚ) ^ j * ((2 : ℚ) ^ (s + (1 : ℕ)) - (1 : ℚ))Closes the goal.
Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.prod_congr,rflrfl : a = ais the unique constructor of the equality type. ,pow_add.Lean, lines 54–58
calc ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - 2 ^ (j + 1 + s)) = ∏ s ∈ Finset.range (n - j), ((-(2 : ℚ) ^ j) * ((2 : ℚ) ^ (s + 1) - 1)) := by refine Finset.prod_congr rfl (fun s _ => ?_) rw [show j + 1 + s = j + (s + 1) by omega, pow_add] ringtargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 54–58 at
1e6a4209cd14↗lag_test.hc.s2calcCloses the goal.
Uses library
Finset.prod_mul_distrib,Finset.prod_const,Finset.card_range.Lean, line 59
_ = _ := by rw [Finset.prod_mul_distrib, Finset.prod_const, Finset.card_range]
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 59 at
1e6a4209cd14↗
lag_test.hdhave∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - (2 : ℚ) ^ (n + (1 : ℕ) + i)) = (-(2 : ℚ) ^ j) ^ n * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ (n + (1 : ℕ) + i - j) - (1 : ℚ))Leaves
((((-1 : ℚ) ^ j * (2 : ℚ) ^ (j * (j - (1 : ℕ)) / (2 : ℕ)) * ∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ ((2 : ℕ) * n - j - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * (2 : ℚ) ^ j * ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l)) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - (2 : ℚ) ^ (j + (1 : ℕ) + s)) = ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - (2 : ℚ) ^ (n + (1 : ℕ) + i)), withhd : ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - (2 : ℚ) ^ (n + (1 : ℕ) + i)) = (-(2 : ℚ) ^ j) ^ n * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ (n + (1 : ℕ) + i - j) - (1 : ℚ)).Uses library
Finset.rangerange nis the set of natural numbers less thann. .Lean, lines 61–68
have hd : ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - 2 ^ (n + 1 + i)) = (-(2 : ℚ) ^ j) ^ n * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ (n + 1 + i - j) - 1) := by calc ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - 2 ^ (n + 1 + i)) = ∏ i ∈ Finset.range n, ((-(2 : ℚ) ^ j) * ((2 : ℚ) ^ (n + 1 + i - j) - 1)) := by refine Finset.prod_congr rfl (fun i _ => ?_) rw [show n + 1 + i = j + (n + 1 + i - j) by omega, pow_add, Nat.add_sub_cancel_left] ring _ = _ := by rw [Finset.prod_mul_distrib, Finset.prod_const, Finset.card_range]targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 61–68 at
1e6a4209cd14↗lag_test.hd.s1calc∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - (2 : ℚ) ^ (n + (1 : ℕ) + i)) = ∏ i ∈ Finset.range n, -(2 : ℚ) ^ j * ((2 : ℚ) ^ (n + (1 : ℕ) + i - j) - (1 : ℚ))Closes the goal.
Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.prod_congr,rflrfl : a = ais the unique constructor of the equality type. ,pow_add,Nat.add_sub_cancel_left.Lean, lines 63–67
calc ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - 2 ^ (n + 1 + i)) = ∏ i ∈ Finset.range n, ((-(2 : ℚ) ^ j) * ((2 : ℚ) ^ (n + 1 + i - j) - 1)) := by refine Finset.prod_congr rfl (fun i _ => ?_) rw [show n + 1 + i = j + (n + 1 + i - j) by omega, pow_add, Nat.add_sub_cancel_left] ringtargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 63–67 at
1e6a4209cd14↗lag_test.hd.s2calcCloses the goal.
Uses library
Finset.prod_mul_distrib,Finset.prod_const,Finset.card_range.Lean, line 68
_ = _ := by rw [Finset.prod_mul_distrib, Finset.prod_const, Finset.card_range]
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 68 at
1e6a4209cd14↗
lag_test.hehave(∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - (1 : ℚ))) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ (s + (1 : ℕ)) - (1 : ℚ)) = ∏ s ∈ Finset.range n, ((2 : ℚ) ^ (s + (1 : ℕ)) - (1 : ℚ))Leaves
((((-1 : ℚ) ^ j * (2 : ℚ) ^ (j * (j - (1 : ℕ)) / (2 : ℕ)) * ∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ ((2 : ℕ) * n - j - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * (2 : ℚ) ^ j * ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l)) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - (2 : ℚ) ^ (j + (1 : ℕ) + s)) = ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - (2 : ℚ) ^ (n + (1 : ℕ) + i)), withhe : (∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - (1 : ℚ))) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ (s + (1 : ℕ)) - (1 : ℚ)) = ∏ s ∈ Finset.range n, ((2 : ℚ) ^ (s + (1 : ℕ)) - (1 : ℚ)).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.prod_range_add,mul_comm,Finset.prod_range_reflect,Finset.prod_congr,rflrfl : a = ais the unique constructor of the equality type. .Lean, lines 70–81
have he : (∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - 1)) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ (s + 1) - 1) = ∏ s ∈ Finset.range n, ((2 : ℚ) ^ (s + 1) - 1) := by have hn : n = (n - j) + j := by omega conv_rhs => rw [hn] rw [Finset.prod_range_add, mul_comm] congr 1 rw [← Finset.prod_range_reflect] refine Finset.prod_congr rfl (fun t ht => ?_) have ht' := Finset.mem_range.mp ht congr 2 omegatargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 70–81 at
1e6a4209cd14↗lag_test.he.hnhaven = n - j + jroutine: omegaLeaves
(∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - (1 : ℚ))) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ (s + (1 : ℕ)) - (1 : ℚ)) = ∏ s ∈ Finset.range n, ((2 : ℚ) ^ (s + (1 : ℕ)) - (1 : ℚ)), withhn : n = n - j + j.Lean, line 73
have hn : n = (n - j) + j := by omega
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 73 at
1e6a4209cd14↗lag_test.he.ht'havet < jLeaves
(2 : ℚ) ^ (n - (j - (1 : ℕ) - t)) - (1 : ℚ) = (2 : ℚ) ^ (n - j + t + (1 : ℕ)) - (1 : ℚ), withht' : t < j.Uses library
Finset.mem_range.Lean, line 79
have ht' := Finset.mem_range.mp ht
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 79 at
1e6a4209cd14↗
lag_test.hfhave∏ i ∈ Finset.range n, ((2 : ℚ) ^ ((2 : ℕ) * n - j - i) - (1 : ℚ)) = ∏ i ∈ Finset.range n, ((2 : ℚ) ^ (n + (1 : ℕ) + i - j) - (1 : ℚ))Leaves
((((-1 : ℚ) ^ j * (2 : ℚ) ^ (j * (j - (1 : ℕ)) / (2 : ℕ)) * ∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ ((2 : ℕ) * n - j - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * (2 : ℚ) ^ j * ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l)) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - (2 : ℚ) ^ (j + (1 : ℕ) + s)) = ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - (2 : ℚ) ^ (n + (1 : ℕ) + i)), withhf : ∏ i ∈ Finset.range n, ((2 : ℚ) ^ ((2 : ℕ) * n - j - i) - (1 : ℚ)) = ∏ i ∈ Finset.range n, ((2 : ℚ) ^ (n + (1 : ℕ) + i - j) - (1 : ℚ)).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.prod_range_reflect,Finset.prod_congr,rflrfl : a = ais the unique constructor of the equality type. .Lean, lines 83–89
have hf : ∏ i ∈ Finset.range n, ((2 : ℚ) ^ (2 * n - j - i) - 1) = ∏ i ∈ Finset.range n, ((2 : ℚ) ^ (n + 1 + i - j) - 1) := by rw [← Finset.prod_range_reflect] refine Finset.prod_congr rfl (fun i hi => ?_) have hi' := Finset.mem_range.mp hi congr 2 omegatargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 83–89 at
1e6a4209cd14↗lag_test.hf.hi'havei < nLeaves
(2 : ℚ) ^ ((2 : ℕ) * n - j - (n - (1 : ℕ) - i)) - (1 : ℚ) = (2 : ℚ) ^ (n + (1 : ℕ) + i - j) - (1 : ℚ), withhi' : i < n.Uses library
Finset.mem_range.Lean, line 87
have hi' := Finset.mem_range.mp hi
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 87 at
1e6a4209cd14↗
lag_test.hFhave∏ s ∈ Finset.range n, ((2 : ℚ) ^ (s + (1 : ℕ)) - (1 : ℚ)) ≠ (0 : ℚ)Leaves
((((-1 : ℚ) ^ j * (2 : ℚ) ^ (j * (j - (1 : ℕ)) / (2 : ℕ)) * ∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ ((2 : ℕ) * n - j - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * (2 : ℚ) ^ j * ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l)) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - (2 : ℚ) ^ (j + (1 : ℕ) + s)) = ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - (2 : ℚ) ^ (n + (1 : ℕ) + i)), withhF : ∏ s ∈ Finset.range n, ((2 : ℚ) ^ (s + (1 : ℕ)) - (1 : ℚ)) ≠ (0 : ℚ).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.prod_ne_zero_iff.Lean, lines 90–91
have hF : ∏ s ∈ Finset.range n, ((2 : ℚ) ^ (s + 1) - 1) ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun s _ => hpos s)targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 90–91 at
1e6a4209cd14↗lag_test.hBhave∏ s ∈ Finset.range j, ((2 : ℚ) ^ (s + (1 : ℕ)) - (1 : ℚ)) ≠ (0 : ℚ)Leaves
((((-1 : ℚ) ^ j * (2 : ℚ) ^ (j * (j - (1 : ℕ)) / (2 : ℕ)) * ∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ ((2 : ℕ) * n - j - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * (2 : ℚ) ^ j * ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l)) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - (2 : ℚ) ^ (j + (1 : ℕ) + s)) = ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - (2 : ℚ) ^ (n + (1 : ℕ) + i)), withhB : ∏ s ∈ Finset.range j, ((2 : ℚ) ^ (s + (1 : ℕ)) - (1 : ℚ)) ≠ (0 : ℚ).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.prod_ne_zero_iff.Lean, lines 92–93
have hB : ∏ s ∈ Finset.range j, ((2 : ℚ) ^ (s + 1) - 1) ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun s _ => hpos s)targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 92–93 at
1e6a4209cd14↗lag_test.hjjhavej * j = j * (j - (1 : ℕ)) / (2 : ℕ) + j * (j - (1 : ℕ)) / (2 : ℕ) + jLeaves
((((-1 : ℚ) ^ j * (2 : ℚ) ^ (j * (j - (1 : ℕ)) / (2 : ℕ)) * ∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ ((2 : ℕ) * n - j - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * (2 : ℚ) ^ j * ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l)) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - (2 : ℚ) ^ (j + (1 : ℕ) + s)) = ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - (2 : ℚ) ^ (n + (1 : ℕ) + i)), withhjj : j * j = j * (j - (1 : ℕ)) / (2 : ℕ) + j * (j - (1 : ℕ)) / (2 : ℕ) + j.Lean, lines 94–99
have hjj : j * j = j * (j - 1) / 2 + j * (j - 1) / 2 + j := by have h2 := Nat.two_mul_div_two_of_even (Nat.even_mul_pred_self j) rcases j with _ | j · simp · simp only [Nat.add_sub_cancel] at h2 ⊢ linarithtargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 94–99 at
1e6a4209cd14↗lag_test.hjj.h2have(2 : ℕ) * (j * (j - (1 : ℕ)) / (2 : ℕ)) = j * (j - (1 : ℕ))Leaves
j * j = j * (j - (1 : ℕ)) / (2 : ℕ) + j * (j - (1 : ℕ)) / (2 : ℕ) + j, withh2 : (2 : ℕ) * (j * (j - (1 : ℕ)) / (2 : ℕ)) = j * (j - (1 : ℕ)).Uses library
Nat.two_mul_div_two_of_even,Nat.even_mul_pred_self.Lean, line 95
have h2 := Nat.two_mul_div_two_of_even (Nat.even_mul_pred_self j)
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 95 at
1e6a4209cd14↗lag_test.hjj.s2case routine: simpLeaves
(0 : ℕ) * (0 : ℕ) = (0 : ℕ) * ((0 : ℕ) - (1 : ℕ)) / (2 : ℕ) + (0 : ℕ) * ((0 : ℕ) - (1 : ℕ)) / (2 : ℕ) + (0 : ℕ).lag_test.hjj.s3case routine: simp, linarithLeaves
(j + (1 : ℕ)) * (j + (1 : ℕ)) = (j + (1 : ℕ)) * (j + (1 : ℕ) - (1 : ℕ)) / (2 : ℕ) + (j + (1 : ℕ)) * (j + (1 : ℕ) - (1 : ℕ)) / (2 : ℕ) + (j + (1 : ℕ)).Uses library
Nat.add_sub_cancel.Lean, lines 98–99
· simp only [Nat.add_sub_cancel] at h2 ⊢ linarithtargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 98–99 at
1e6a4209cd14↗
lag_test.hpowhave(-(2 : ℚ) ^ j) ^ n = (-1 : ℚ) ^ j * (2 : ℚ) ^ (j * (j - (1 : ℕ)) / (2 : ℕ)) * (2 : ℚ) ^ (j * (j - (1 : ℕ)) / (2 : ℕ)) * (2 : ℚ) ^ j * (-(2 : ℚ) ^ j) ^ (n - j)Leaves
((((-1 : ℚ) ^ j * (2 : ℚ) ^ (j * (j - (1 : ℕ)) / (2 : ℕ)) * ∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ ((2 : ℕ) * n - j - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * (2 : ℚ) ^ j * ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l)) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - (2 : ℚ) ^ (j + (1 : ℕ) + s)) = ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - (2 : ℚ) ^ (n + (1 : ℕ) + i)), withhpow : (-(2 : ℚ) ^ j) ^ n = (-1 : ℚ) ^ j * (2 : ℚ) ^ (j * (j - (1 : ℕ)) / (2 : ℕ)) * (2 : ℚ) ^ (j * (j - (1 : ℕ)) / (2 : ℕ)) * (2 : ℚ) ^ j * (-(2 : ℚ) ^ j) ^ (n - j).Uses library
pow_add,Nat.add_sub_cancel_left,neg_pow,pow_mul.Lean, lines 100–104
have hpow : (-(2 : ℚ) ^ j) ^ n = (-1) ^ j * 2 ^ (j * (j - 1) / 2) * 2 ^ (j * (j - 1) / 2) * 2 ^ j * (-(2 : ℚ) ^ j) ^ (n - j) := by rw [show n = j + (n - j) by omega, pow_add, Nat.add_sub_cancel_left, neg_pow, ← pow_mul, hjj, pow_add, pow_add] ringtargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 100–104 at
1e6a4209cd14↗
pf_testhave∀ (n : ℕ) (x y w : ℕ → ℚ), (∀ a ∈ Finset.range (n + (1 : ℕ)), ∀ b ∈ Finset.range (n + (1 : ℕ)), x a = x b → a = b) → (∀ j ∈ Finset.range (n + (1 : ℕ)), w j * ∏ l ∈ (Finset.range (n + (1 : ℕ))).erase j, (x j - x l) = ∏ i ∈ Finset.range n, (x j - y i)) → ∑ j ∈ Finset.range (n + (1 : ℕ)), (Polynomial.C : ℚ → Polynomial ℚ) (w j) * ∏ l ∈ (Finset.range (n + (1 : ℕ))).erase j, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (x l)) = ∏ i ∈ Finset.range n, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (y i))Leaves
∀ (Qc : ℕ → ℕ → ℚ), (Qc = fun (n k : ℕ) => ((-1 : ℚ) ^ k * (2 : ℚ) ^ (k * (k - (1 : ℕ)) / (2 : ℕ)) * ∏ i ∈ Finset.range k, ((2 : ℚ) ^ (n - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ ((2 : ℕ) * n - k - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) → ∀ (n k : ℕ), k ≤ n → ∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = Qc n k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)) - ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))) + ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withpf_test : ∀ (n : ℕ) (x y w : ℕ → ℚ), (∀ a ∈ Finset.range (n + (1 : ℕ)), ∀ b ∈ Finset.range (n + (1 : ℕ)), x a = x b → a = b) → (∀ j ∈ Finset.range (n + (1 : ℕ)), w j * ∏ l ∈ (Finset.range (n + (1 : ℕ))).erase j, (x j - x l) = ∏ i ∈ Finset.range n, (x j - y i)) → ∑ j ∈ Finset.range (n + (1 : ℕ)), (Polynomial.C : ℚ → Polynomial ℚ) (w j) * ∏ l ∈ (Finset.range (n + (1 : ℕ))).erase j, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (x l)) = ∏ i ∈ Finset.range n, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (y i)).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Polynomial.CC ais the constant polynomiala. ,Polynomial.XXis the polynomial variable (aka indeterminate). ,Polynomial.eq_of_degree_sub_lt_of_eval_finset_eq.Lean, lines 110–138
have pf_test : ∀ (n : ℕ) (x y w : ℕ → ℚ), (∀ a ∈ Finset.range (n + 1), ∀ b ∈ Finset.range (n + 1), x a = x b → a = b) → (∀ j ∈ Finset.range (n + 1), w j * ∏ l ∈ (Finset.range (n + 1)).erase j, (x j - x l) = ∏ i ∈ Finset.range n, (x j - y i)) → (∑ j ∈ Finset.range (n + 1), Polynomial.C (w j) * ∏ l ∈ (Finset.range (n + 1)).erase j, (X - Polynomial.C (x l))) = ∏ i ∈ Finset.range n, (X - Polynomial.C (y i)) := by intro n x y w hx hw set s := Finset.range (n + 1) with hs have hL : (∑ j ∈ s, Polynomial.C (w j) * ∏ l ∈ s.erase j, (X - Polynomial.C (x l))).natDegree ≤ n := by refine natDegree_sum_le_of_forall_le _ _ (fun j hj => ?_) refine (natDegree_C_mul_le _ _).trans ((natDegree_prod_le _ _).trans ?_) simp only [natDegree_X_sub_C, Finset.sum_const, smul_eq_mul, mul_one] rw [Finset.card_erase_of_mem hj, hs, Finset.card_range] omega have hE : (∏ i ∈ Finset.range n, (X - Polynomial.C (y i))).natDegree ≤ n := by refine (natDegree_prod_le _ _).trans ?_ simp [natDegree_X_sub_C] apply Polynomial.eq_of_degree_sub_lt_of_eval_finset_eq (s.image x) · rw [Finset.card_image_of_injOn (fun a ha b hb h => hx a ha b hb h), hs, Finset.card_range] refine lt_of_le_of_lt (degree_sub_le _ _) (max_lt ?_ ?_) · exact lt_of_le_of_lt (degree_le_of_natDegree_le hL) (by exact_mod_cast Nat.lt_succ_self n) · exact lt_of_le_of_lt (degree_le_of_natDegree_le hE) (by exact_mod_cast Nat.lt_succ_self n) · intro z hz obtain ⟨j, hj, rfl⟩ := Finset.mem_image.mp hz simp only [eval_finset_sum, eval_mul, eval_C, eval_prod, eval_sub, eval_X] rw [Finset.sum_eq_single j] · exact hw j hj · intro i hi hij rw [Finset.prod_eq_zero (i := j) (Finset.mem_erase.mpr ⟨Ne.symm hij, hj⟩) (sub_self _), mul_zero] · intro hj'; exact absurd hj hj'targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 110–138 at
1e6a4209cd14↗pf_test.hLhave(∑ j ∈ s, (Polynomial.C : ℚ → Polynomial ℚ) (w j) * ∏ l ∈ s.erase j, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (x l))).natDegree ≤ nLeaves
∑ j ∈ s, (Polynomial.C : ℚ → Polynomial ℚ) (w j) * ∏ l ∈ s.erase j, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (x l)) = ∏ i ∈ Finset.range n, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (y i)), withhL : (∑ j ∈ s, (Polynomial.C : ℚ → Polynomial ℚ) (w j) * ∏ l ∈ s.erase j, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (x l))).natDegree ≤ n.Uses library
Polynomial.CC ais the constant polynomiala. ,Polynomial.XXis the polynomial variable (aka indeterminate). ,Polynomial.natDegree_sum_le_of_forall_le,Polynomial.natDegree_C_mul_le,Polynomial.natDegree_prod_le,Polynomial.natDegree_X_sub_C,Finset.sum_const,smul_eq_mul,mul_one,Finset.card_erase_of_mem$\#(s \setminus \{a\}) = \#s - 1$ if $a \in s$. ,Finset.card_range.Lean, lines 117–122
have hL : (∑ j ∈ s, Polynomial.C (w j) * ∏ l ∈ s.erase j, (X - Polynomial.C (x l))).natDegree ≤ n := by refine natDegree_sum_le_of_forall_le _ _ (fun j hj => ?_) refine (natDegree_C_mul_le _ _).trans ((natDegree_prod_le _ _).trans ?_) simp only [natDegree_X_sub_C, Finset.sum_const, smul_eq_mul, mul_one] rw [Finset.card_erase_of_mem hj, hs, Finset.card_range] omegatargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 117–122 at
1e6a4209cd14↗pf_test.hEhave(∏ i ∈ Finset.range n, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (y i))).natDegree ≤ nLeaves
∑ j ∈ s, (Polynomial.C : ℚ → Polynomial ℚ) (w j) * ∏ l ∈ s.erase j, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (x l)) = ∏ i ∈ Finset.range n, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (y i)), withhE : (∏ i ∈ Finset.range n, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (y i))).natDegree ≤ n.Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Polynomial.XXis the polynomial variable (aka indeterminate). ,Polynomial.CC ais the constant polynomiala. ,Polynomial.natDegree_prod_le,Polynomial.natDegree_X_sub_C.Lean, lines 123–125
have hE : (∏ i ∈ Finset.range n, (X - Polynomial.C (y i))).natDegree ≤ n := by refine (natDegree_prod_le _ _).trans ?_ simp [natDegree_X_sub_C]targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 123–125 at
1e6a4209cd14↗pf_test.s3caseLeaves
(∑ j ∈ s, (Polynomial.C : ℚ → Polynomial ℚ) (w j) * ∏ l ∈ s.erase j, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (x l)) - ∏ i ∈ Finset.range n, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (y i))).degree < (↑(Finset.image x s).card : WithBot ℕ).Uses library
Finset.card_image_of_injOn,Finset.card_range,lt_of_le_of_lt,Polynomial.degree_sub_le,max_lt.Lean, lines 127–130
· rw [Finset.card_image_of_injOn (fun a ha b hb h => hx a ha b hb h), hs, Finset.card_range] refine lt_of_le_of_lt (degree_sub_le _ _) (max_lt ?_ ?_) · exact lt_of_le_of_lt (degree_le_of_natDegree_le hL) (by exact_mod_cast Nat.lt_succ_self n) · exact lt_of_le_of_lt (degree_le_of_natDegree_le hE) (by exact_mod_cast Nat.lt_succ_self n)targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 127–130 at
1e6a4209cd14↗pf_test.s3.s1caseLeaves
(∑ j ∈ Finset.range (n + (1 : ℕ)), (Polynomial.C : ℚ → Polynomial ℚ) (w j) * ∏ l ∈ (Finset.range (n + (1 : ℕ))).erase j, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (x l))).degree < (↑(n + (1 : ℕ)) : WithBot ℕ).Uses library
lt_of_le_of_lt,Polynomial.degree_le_of_natDegree_leAlias of the forward direction ofPolynomial.natDegree_le_iff_degree_le. ,Nat.lt_succ_self.Lean, line 129
· exact lt_of_le_of_lt (degree_le_of_natDegree_le hL) (by exact_mod_cast Nat.lt_succ_self n)
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 129 at
1e6a4209cd14↗pf_test.s3.s2caseLeaves
(∏ i ∈ Finset.range n, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (y i))).degree < (↑(n + (1 : ℕ)) : WithBot ℕ).Uses library
lt_of_le_of_lt,Polynomial.degree_le_of_natDegree_leAlias of the forward direction ofPolynomial.natDegree_le_iff_degree_le. ,Nat.lt_succ_self.Lean, line 130
· exact lt_of_le_of_lt (degree_le_of_natDegree_le hE) (by exact_mod_cast Nat.lt_succ_self n)
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 130 at
1e6a4209cd14↗
pf_test.s4caseLeaves
∀ x_1 ∈ Finset.image x s, Polynomial.eval x_1 (∑ j ∈ s, (Polynomial.C : ℚ → Polynomial ℚ) (w j) * ∏ l ∈ s.erase j, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (x l))) = Polynomial.eval x_1 (∏ i ∈ Finset.range n, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (y i))).Uses library
Polynomial.eval_finset_sumAlias ofPolynomial.eval_finsetSum. ,Polynomial.eval_mul,Polynomial.eval_C,Polynomial.eval_prodPolynomial evaluation commutes withFinset.prod,Polynomial.eval_sub,Polynomial.eval_X,Finset.sum_eq_single.Lean, lines 131–138
· intro z hz obtain ⟨j, hj, rfl⟩ := Finset.mem_image.mp hz simp only [eval_finset_sum, eval_mul, eval_C, eval_prod, eval_sub, eval_X] rw [Finset.sum_eq_single j] · exact hw j hj · intro i hi hij rw [Finset.prod_eq_zero (i := j) (Finset.mem_erase.mpr ⟨Ne.symm hij, hj⟩) (sub_self _), mul_zero] · intro hj'; exact absurd hj hj'targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 131–138 at
1e6a4209cd14↗pf_test.s4.s1obtain∃ a ∈ s, x a = zLeaves
Polynomial.eval (x j) (∑ j ∈ s, (Polynomial.C : ℚ → Polynomial ℚ) (w j) * ∏ l ∈ s.erase j, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (x l))) = Polynomial.eval (x j) (∏ i ∈ Finset.range n, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (y i))), withj : ℕ,hj : j ∈ s,hz : x j ∈ Finset.image x s.Uses library
Finset.mem_image.Lean, line 132
obtain ⟨j, hj, rfl⟩ := Finset.mem_image.mp hz
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 132 at
1e6a4209cd14↗pf_test.s4.s2caseLeaves
w j * ∏ x_1 ∈ s.erase j, (x j - x x_1) = ∏ x_1 ∈ Finset.range n, (x j - y x_1).Lean, line 135
· exact hw j hj
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 135 at
1e6a4209cd14↗pf_test.s4.s3caseLeaves
∀ b ∈ s, b ≠ j → w b * ∏ x_1 ∈ s.erase b, (x j - x x_1) = (0 : ℚ).Uses library
Finset.prod_eq_zero,Finset.mem_erase,And.introAnd.intro : a → b → a ∧ bis the constructor for the And operation. ,Ne.symm,sub_self,MulZeroClass.mul_zeroZero is a right absorbing element for multiplication .Lean, lines 136–137
· intro i hi hij rw [Finset.prod_eq_zero (i := j) (Finset.mem_erase.mpr ⟨Ne.symm hij, hj⟩) (sub_self _), mul_zero]targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 136–137 at
1e6a4209cd14↗pf_test.s4.s4caseLeaves
j ∉ s → w j * ∏ x_1 ∈ s.erase j, (x j - x x_1) = (0 : ℚ).Uses library
absurdAnything follows from two contradictory hypotheses. .Lean, line 138
· intro hj'; exact absurd hj hj'
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 138 at
1e6a4209cd14↗
pf2_testhave∀ (n k : ℕ), k ∈ Finset.range (n + (1 : ℕ)) → ∀ (x y w : ℕ → ℚ), (∀ a ∈ Finset.range (n + (1 : ℕ)), ∀ b ∈ Finset.range (n + (1 : ℕ)), x a = x b → a = b) → (∀ i ∈ Finset.range n, x k - y i ≠ (0 : ℚ)) → (∀ j ∈ Finset.range (n + (1 : ℕ)), w j * ∏ l ∈ (Finset.range (n + (1 : ℕ))).erase j, (x j - x l) = ∏ i ∈ Finset.range n, (x j - y i)) → ∑ j ∈ (Finset.range (n + (1 : ℕ))).erase k, w j / (x k - x j) = w k * (∑ i ∈ Finset.range n, (1 : ℚ) / (x k - y i) - ∑ l ∈ (Finset.range (n + (1 : ℕ))).erase k, (1 : ℚ) / (x k - x l))Leaves
∀ (Qc : ℕ → ℕ → ℚ), (Qc = fun (n k : ℕ) => ((-1 : ℚ) ^ k * (2 : ℚ) ^ (k * (k - (1 : ℕ)) / (2 : ℕ)) * ∏ i ∈ Finset.range k, ((2 : ℚ) ^ (n - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ ((2 : ℕ) * n - k - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) → ∀ (n k : ℕ), k ≤ n → ∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = Qc n k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)) - ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))) + ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withpf2_test : ∀ (n k : ℕ), k ∈ Finset.range (n + (1 : ℕ)) → ∀ (x y w : ℕ → ℚ), (∀ a ∈ Finset.range (n + (1 : ℕ)), ∀ b ∈ Finset.range (n + (1 : ℕ)), x a = x b → a = b) → (∀ i ∈ Finset.range n, x k - y i ≠ (0 : ℚ)) → (∀ j ∈ Finset.range (n + (1 : ℕ)), w j * ∏ l ∈ (Finset.range (n + (1 : ℕ))).erase j, (x j - x l) = ∏ i ∈ Finset.range n, (x j - y i)) → ∑ j ∈ (Finset.range (n + (1 : ℕ))).erase k, w j / (x k - x j) = w k * (∑ i ∈ Finset.range n, (1 : ℚ) / (x k - y i) - ∑ l ∈ (Finset.range (n + (1 : ℕ))).erase k, (1 : ℚ) / (x k - x l)).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Polynomial.derivative_sum,Polynomial.derivative_mul,Polynomial.derivative_C,MulZeroClass.zero_mulZero is a left absorbing element for multiplication ,zero_add,Polynomial.derivative_prod_finset,Polynomial.derivative_sub,Polynomial.derivative_X,sub_zero,mul_one,Polynomial.eval_finset_sumAlias ofPolynomial.eval_finsetSum. ,Polynomial.eval_mul,Polynomial.eval_C,Polynomial.eval_prodPolynomial evaluation commutes withFinset.prod,Polynomial.eval_sub,Polynomial.eval_X,Finset.add_sum_eraseTaking a sum overs : Finset ιis the same as adding the value on a single elementf ato the sum overs.erase a. ,mul_left_cancel₀.Lean, lines 140–204
have pf2_test : ∀ (n k : ℕ), k ∈ Finset.range (n + 1) → ∀ (x y w : ℕ → ℚ), (∀ a ∈ Finset.range (n + 1), ∀ b ∈ Finset.range (n + 1), x a = x b → a = b) → (∀ i ∈ Finset.range n, x k - y i ≠ 0) → (∀ j ∈ Finset.range (n + 1), w j * ∏ l ∈ (Finset.range (n + 1)).erase j, (x j - x l) = ∏ i ∈ Finset.range n, (x j - y i)) → ∑ j ∈ (Finset.range (n + 1)).erase k, w j / (x k - x j) = w k * (∑ i ∈ Finset.range n, 1 / (x k - y i) - ∑ l ∈ (Finset.range (n + 1)).erase k, 1 / (x k - x l)) := by intro n k hk x y w hx hxy hw have hLE := pf_test n x y w hx hw set s := Finset.range (n + 1) with hs have hne : ∀ j ∈ s, j ≠ k → x k - x j ≠ 0 := by intro j hj hjk h exact hjk (hx j hj k hk (sub_eq_zero.mp h).symm) set P := ∏ l ∈ s.erase k, (x k - x l) with hP have hP0 : P ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun l hl => hne l (Finset.mem_of_mem_erase hl) (Finset.ne_of_mem_erase hl)) have hd := congrArg (fun p => (derivative p).eval (x k)) hLE simp only [derivative_sum, derivative_mul, derivative_C, zero_mul, zero_add, derivative_prod_finset, derivative_sub, derivative_X, sub_zero, mul_one, eval_finset_sum, eval_mul, eval_C, eval_prod, eval_sub, eval_X] at hd -- the terms j ≠ k have h1 : ∀ j ∈ s.erase k, (∑ m ∈ s.erase j, ∏ l ∈ (s.erase j).erase m, (x k - x l)) = P * (1 / (x k - x j)) := by intro j hj have hjs := Finset.mem_of_mem_erase hj have hjk := Finset.ne_of_mem_erase hj have hks : k ∈ s.erase j := Finset.mem_erase.mpr ⟨Ne.symm hjk, hk⟩ rw [Finset.sum_eq_single k] · have := Finset.mul_prod_erase (s.erase k) (fun l => x k - x l) hj rw [Finset.erase_right_comm] field_simp [hne j hjs hjk] rw [hP, ← this] ring · intro m hm hmk exact Finset.prod_eq_zero (i := k) (Finset.mem_erase.mpr ⟨Ne.symm hmk, hks⟩) (sub_self _) · intro h; exact absurd hks h -- the term j = k have h2 : (∑ m ∈ s.erase k, ∏ l ∈ (s.erase k).erase m, (x k - x l)) = P * ∑ m ∈ s.erase k, 1 / (x k - x m) := by rw [Finset.mul_sum] refine Finset.sum_congr rfl (fun m hm => ?_) have := Finset.mul_prod_erase (s.erase k) (fun l => x k - x l) hm field_simp [hne m (Finset.mem_of_mem_erase hm) (Finset.ne_of_mem_erase hm)] rw [hP, ← this] ring -- the right side have h3 : (∑ i ∈ Finset.range n, ∏ i' ∈ (Finset.range n).erase i, (x k - y i')) = (w k * P) * ∑ i ∈ Finset.range n, 1 / (x k - y i) := by rw [hw k hk, Finset.mul_sum] refine Finset.sum_congr rfl (fun i hi => ?_) have := Finset.mul_prod_erase (Finset.range n) (fun i' => x k - y i') hi field_simp [hxy i hi] rw [← this] ring rw [← Finset.add_sum_erase s _ hk, h2, h3] at hd have h1' : ∑ j ∈ s.erase k, w j * ∑ m ∈ s.erase j, ∏ l ∈ (s.erase j).erase m, (x k - x l) = P * ∑ j ∈ s.erase k, w j / (x k - x j) := by rw [Finset.mul_sum] refine Finset.sum_congr rfl (fun j hj => ?_) rw [h1 j hj] ring rw [h1'] at hd apply mul_left_cancel₀ hP0 linear_combination hdtargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 140–204 at
1e6a4209cd14↗pf2_test.hLEhave∑ j ∈ Finset.range (n + (1 : ℕ)), (Polynomial.C : ℚ → Polynomial ℚ) (w j) * ∏ l ∈ (Finset.range (n + (1 : ℕ))).erase j, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (x l)) = ∏ i ∈ Finset.range n, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (y i))Leaves
∑ j ∈ (Finset.range (n + (1 : ℕ))).erase k, w j / (x k - x j) = w k * (∑ i ∈ Finset.range n, (1 : ℚ) / (x k - y i) - ∑ l ∈ (Finset.range (n + (1 : ℕ))).erase k, (1 : ℚ) / (x k - x l)), withhLE : ∑ j ∈ Finset.range (n + (1 : ℕ)), (Polynomial.C : ℚ → Polynomial ℚ) (w j) * ∏ l ∈ (Finset.range (n + (1 : ℕ))).erase j, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (x l)) = ∏ i ∈ Finset.range n, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (y i)).Lean, line 149
have hLE := pf_test n x y w hx hw
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 149 at
1e6a4209cd14↗pf2_test.hnehave∀ j ∈ s, j ≠ k → x k - x j ≠ (0 : ℚ)Leaves
∑ j ∈ s.erase k, w j / (x k - x j) = w k * (∑ i ∈ Finset.range n, (1 : ℚ) / (x k - y i) - ∑ l ∈ s.erase k, (1 : ℚ) / (x k - x l)), withhne : ∀ j ∈ s, j ≠ k → x k - x j ≠ (0 : ℚ).Uses library
sub_eq_zero.Lean, lines 151–153
have hne : ∀ j ∈ s, j ≠ k → x k - x j ≠ 0 := by intro j hj hjk h exact hjk (hx j hj k hk (sub_eq_zero.mp h).symm)targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 151–153 at
1e6a4209cd14↗pf2_test.hP0haveP ≠ (0 : ℚ)Leaves
∑ j ∈ s.erase k, w j / (x k - x j) = w k * (∑ i ∈ Finset.range n, (1 : ℚ) / (x k - y i) - ∑ l ∈ s.erase k, (1 : ℚ) / (x k - x l)), withhP0 : P ≠ (0 : ℚ).Uses library
Finset.prod_ne_zero_iff,Finset.mem_of_mem_erase,Finset.ne_of_mem_erase.Lean, lines 155–156
have hP0 : P ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun l hl => hne l (Finset.mem_of_mem_erase hl) (Finset.ne_of_mem_erase hl))targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 155–156 at
1e6a4209cd14↗pf2_test.hdhavePolynomial.eval (x k) ((Polynomial.derivative : Polynomial ℚ → Polynomial ℚ) (∑ j ∈ s, (Polynomial.C : ℚ → Polynomial ℚ) (w j) * ∏ l ∈ s.erase j, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (x l)))) = Polynomial.eval (x k) ((Polynomial.derivative : Polynomial ℚ → Polynomial ℚ) (∏ i ∈ Finset.range n, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (y i))))Leaves
∑ j ∈ s.erase k, w j / (x k - x j) = w k * (∑ i ∈ Finset.range n, (1 : ℚ) / (x k - y i) - ∑ l ∈ s.erase k, (1 : ℚ) / (x k - x l)), withhd : Polynomial.eval (x k) ((Polynomial.derivative : Polynomial ℚ → Polynomial ℚ) (∑ j ∈ s, (Polynomial.C : ℚ → Polynomial ℚ) (w j) * ∏ l ∈ s.erase j, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (x l)))) = Polynomial.eval (x k) ((Polynomial.derivative : Polynomial ℚ → Polynomial ℚ) (∏ i ∈ Finset.range n, (Polynomial.X - (Polynomial.C : ℚ → Polynomial ℚ) (y i)))).Uses library
congrArgCongruence in the function argument: ifa₁ = a₂thenf a₁ = f a₂for any (nondependent) functionf. ,Polynomial.derivativederivative pis the formal derivative of the polynomialp.Lean, line 157
have hd := congrArg (fun p => (derivative p).eval (x k)) hLE
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 157 at
1e6a4209cd14↗pf2_test.h1have∀ j ∈ s.erase k, ∑ m ∈ s.erase j, ∏ l ∈ (s.erase j).erase m, (x k - x l) = P * ((1 : ℚ) / (x k - x j))Leaves
∑ j ∈ s.erase k, w j / (x k - x j) = w k * (∑ i ∈ Finset.range n, (1 : ℚ) / (x k - y i) - ∑ l ∈ s.erase k, (1 : ℚ) / (x k - x l)), withh1 : ∀ j ∈ s.erase k, ∑ m ∈ s.erase j, ∏ l ∈ (s.erase j).erase m, (x k - x l) = P * ((1 : ℚ) / (x k - x j)).Uses library
Finset.sum_eq_single.Lean, lines 162–176
have h1 : ∀ j ∈ s.erase k, (∑ m ∈ s.erase j, ∏ l ∈ (s.erase j).erase m, (x k - x l)) = P * (1 / (x k - x j)) := by intro j hj have hjs := Finset.mem_of_mem_erase hj have hjk := Finset.ne_of_mem_erase hj have hks : k ∈ s.erase j := Finset.mem_erase.mpr ⟨Ne.symm hjk, hk⟩ rw [Finset.sum_eq_single k] · have := Finset.mul_prod_erase (s.erase k) (fun l => x k - x l) hj rw [Finset.erase_right_comm] field_simp [hne j hjs hjk] rw [hP, ← this] ring · intro m hm hmk exact Finset.prod_eq_zero (i := k) (Finset.mem_erase.mpr ⟨Ne.symm hmk, hks⟩) (sub_self _) · intro h; exact absurd hks htargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 162–176 at
1e6a4209cd14↗pf2_test.h1.hjshavej ∈ sLeaves
∑ m ∈ s.erase j, ∏ l ∈ (s.erase j).erase m, (x k - x l) = P * ((1 : ℚ) / (x k - x j)), withhjs : j ∈ s.Uses library
Finset.mem_of_mem_erase.Lean, line 165
have hjs := Finset.mem_of_mem_erase hj
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 165 at
1e6a4209cd14↗pf2_test.h1.hjkhavej ≠ kLeaves
∑ m ∈ s.erase j, ∏ l ∈ (s.erase j).erase m, (x k - x l) = P * ((1 : ℚ) / (x k - x j)), withhjk : j ≠ k.Uses library
Finset.ne_of_mem_erase.Lean, line 166
have hjk := Finset.ne_of_mem_erase hj
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 166 at
1e6a4209cd14↗pf2_test.h1.hkshavek ∈ s.erase jLeaves
∑ m ∈ s.erase j, ∏ l ∈ (s.erase j).erase m, (x k - x l) = P * ((1 : ℚ) / (x k - x j)), withhks : k ∈ s.erase j.Uses library
Finset.mem_erase,And.introAnd.intro : a → b → a ∧ bis the constructor for the And operation. ,Ne.symm.Lean, line 167
have hks : k ∈ s.erase j := Finset.mem_erase.mpr ⟨Ne.symm hjk, hk⟩
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 167 at
1e6a4209cd14↗pf2_test.h1.s4caseLeaves
∏ l ∈ (s.erase j).erase k, (x k - x l) = P * ((1 : ℚ) / (x k - x j)).Uses library
Finset.erase_right_comm.Lean, lines 169–173
· have := Finset.mul_prod_erase (s.erase k) (fun l => x k - x l) hj rw [Finset.erase_right_comm] field_simp [hne j hjs hjk] rw [hP, ← this] ringtargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 169–173 at
1e6a4209cd14↗pf2_test.h1.s4.thishave(x k - x j) * ∏ x_1 ∈ (s.erase k).erase j, (x k - x x_1) = ∏ x_1 ∈ s.erase k, (x k - x x_1)Leaves
∏ l ∈ (s.erase j).erase k, (x k - x l) = P * ((1 : ℚ) / (x k - x j)), withthis : (x k - x j) * ∏ x_1 ∈ (s.erase k).erase j, (x k - x x_1) = ∏ x_1 ∈ s.erase k, (x k - x x_1).Uses library
Finset.mul_prod_eraseTaking a product overs : Finset ιis the same as multiplying the value on a single elementf aby the product ofs.erase a. .Lean, line 169
· have := Finset.mul_prod_erase (s.erase k) (fun l => x k - x l) hj
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 169 at
1e6a4209cd14↗
pf2_test.h1.s5caseLeaves
∀ b ∈ s.erase j, b ≠ k → ∏ l ∈ (s.erase j).erase b, (x k - x l) = (0 : ℚ).Uses library
Finset.prod_eq_zero,Finset.mem_erase,And.introAnd.intro : a → b → a ∧ bis the constructor for the And operation. ,Ne.symm,sub_self.Lean, lines 174–175
· intro m hm hmk exact Finset.prod_eq_zero (i := k) (Finset.mem_erase.mpr ⟨Ne.symm hmk, hks⟩) (sub_self _)targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 174–175 at
1e6a4209cd14↗pf2_test.h1.s6caseLeaves
k ∉ s.erase j → ∏ l ∈ (s.erase j).erase k, (x k - x l) = (0 : ℚ).Uses library
absurdAnything follows from two contradictory hypotheses. .Lean, line 176
· intro h; exact absurd hks h
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 176 at
1e6a4209cd14↗
pf2_test.h2have∑ m ∈ s.erase k, ∏ l ∈ (s.erase k).erase m, (x k - x l) = P * ∑ m ∈ s.erase k, (1 : ℚ) / (x k - x m)Leaves
∑ j ∈ s.erase k, w j / (x k - x j) = w k * (∑ i ∈ Finset.range n, (1 : ℚ) / (x k - y i) - ∑ l ∈ s.erase k, (1 : ℚ) / (x k - x l)), withh2 : ∑ m ∈ s.erase k, ∏ l ∈ (s.erase k).erase m, (x k - x l) = P * ∑ m ∈ s.erase k, (1 : ℚ) / (x k - x m).Uses library
Finset.mul_sum,Finset.sum_congr,rflrfl : a = ais the unique constructor of the equality type. ,Finset.mem_of_mem_erase,Finset.ne_of_mem_erase.Lean, lines 178–185
have h2 : (∑ m ∈ s.erase k, ∏ l ∈ (s.erase k).erase m, (x k - x l)) = P * ∑ m ∈ s.erase k, 1 / (x k - x m) := by rw [Finset.mul_sum] refine Finset.sum_congr rfl (fun m hm => ?_) have := Finset.mul_prod_erase (s.erase k) (fun l => x k - x l) hm field_simp [hne m (Finset.mem_of_mem_erase hm) (Finset.ne_of_mem_erase hm)] rw [hP, ← this] ringtargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 178–185 at
1e6a4209cd14↗pf2_test.h2.thishave(x k - x m) * ∏ x_1 ∈ (s.erase k).erase m, (x k - x x_1) = ∏ x_1 ∈ s.erase k, (x k - x x_1)Leaves
∏ l ∈ (s.erase k).erase m, (x k - x l) = P * ((1 : ℚ) / (x k - x m)), withthis : (x k - x m) * ∏ x_1 ∈ (s.erase k).erase m, (x k - x x_1) = ∏ x_1 ∈ s.erase k, (x k - x x_1).Uses library
Finset.mul_prod_eraseTaking a product overs : Finset ιis the same as multiplying the value on a single elementf aby the product ofs.erase a. .Lean, line 182
have := Finset.mul_prod_erase (s.erase k) (fun l => x k - x l) hm
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 182 at
1e6a4209cd14↗
pf2_test.h3have∑ i ∈ Finset.range n, ∏ i' ∈ (Finset.range n).erase i, (x k - y i') = w k * P * ∑ i ∈ Finset.range n, (1 : ℚ) / (x k - y i)Leaves
∑ j ∈ s.erase k, w j / (x k - x j) = w k * (∑ i ∈ Finset.range n, (1 : ℚ) / (x k - y i) - ∑ l ∈ s.erase k, (1 : ℚ) / (x k - x l)), withh3 : ∑ i ∈ Finset.range n, ∏ i' ∈ (Finset.range n).erase i, (x k - y i') = w k * P * ∑ i ∈ Finset.range n, (1 : ℚ) / (x k - y i).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.mul_sum,Finset.sum_congr,rflrfl : a = ais the unique constructor of the equality type. .Lean, lines 187–194
have h3 : (∑ i ∈ Finset.range n, ∏ i' ∈ (Finset.range n).erase i, (x k - y i')) = (w k * P) * ∑ i ∈ Finset.range n, 1 / (x k - y i) := by rw [hw k hk, Finset.mul_sum] refine Finset.sum_congr rfl (fun i hi => ?_) have := Finset.mul_prod_erase (Finset.range n) (fun i' => x k - y i') hi field_simp [hxy i hi] rw [← this] ringtargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 187–194 at
1e6a4209cd14↗pf2_test.h3.thishave(x k - y i) * ∏ x_1 ∈ (Finset.range n).erase i, (x k - y x_1) = ∏ x_1 ∈ Finset.range n, (x k - y x_1)Leaves
∏ i' ∈ (Finset.range n).erase i, (x k - y i') = (∏ i ∈ Finset.range n, (x k - y i)) * ((1 : ℚ) / (x k - y i)), withthis : (x k - y i) * ∏ x_1 ∈ (Finset.range n).erase i, (x k - y x_1) = ∏ x_1 ∈ Finset.range n, (x k - y x_1).Uses library
Finset.mul_prod_eraseTaking a product overs : Finset ιis the same as multiplying the value on a single elementf aby the product ofs.erase a. ,Finset.rangerange nis the set of natural numbers less thann. .Lean, line 191
have := Finset.mul_prod_erase (Finset.range n) (fun i' => x k - y i') hi
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 191 at
1e6a4209cd14↗
pf2_test.h1'have∑ j ∈ s.erase k, w j * ∑ m ∈ s.erase j, ∏ l ∈ (s.erase j).erase m, (x k - x l) = P * ∑ j ∈ s.erase k, w j / (x k - x j)Leaves
∑ j ∈ s.erase k, w j / (x k - x j) = w k * (∑ i ∈ Finset.range n, (1 : ℚ) / (x k - y i) - ∑ l ∈ s.erase k, (1 : ℚ) / (x k - x l)), withh1' : ∑ j ∈ s.erase k, w j * ∑ m ∈ s.erase j, ∏ l ∈ (s.erase j).erase m, (x k - x l) = P * ∑ j ∈ s.erase k, w j / (x k - x j).Uses library
Finset.mul_sum,Finset.sum_congr,rflrfl : a = ais the unique constructor of the equality type. .Lean, lines 196–201
have h1' : ∑ j ∈ s.erase k, w j * ∑ m ∈ s.erase j, ∏ l ∈ (s.erase j).erase m, (x k - x l) = P * ∑ j ∈ s.erase k, w j / (x k - x j) := by rw [Finset.mul_sum] refine Finset.sum_congr rfl (fun j hj => ?_) rw [h1 j hj] ringtargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 196–201 at
1e6a4209cd14↗
hchave∀ (j : ℕ), Qc n j = ((-1 : ℚ) ^ j * (2 : ℚ) ^ (j * (j - (1 : ℕ)) / (2 : ℕ)) * ∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ ((2 : ℕ) * n - j - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))Leaves
∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = Qc n k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)) - ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))) + ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withhc : ∀ (j : ℕ), Qc n j = ((-1 : ℚ) ^ j * (2 : ℚ) ^ (j * (j - (1 : ℕ)) / (2 : ℕ)) * ∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ))) * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ ((2 : ℕ) * n - j - i) - (1 : ℚ)) / ((2 : ℚ) ^ (i + (1 : ℕ)) - (1 : ℚ)).Uses library
Finset.rangerange nis the set of natural numbers less thann. .Lean, lines 206–209
have hc : ∀ j, Qc n j = ((-1 : ℚ) ^ j * (2 : ℚ) ^ (j * (j - 1) / 2) * ∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - 1) / ((2 : ℚ) ^ (i + 1) - 1)) * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ (2 * n - j - i) - 1) / ((2 : ℚ) ^ (i + 1) - 1) := by intro j; rw [hQc]targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 206–209 at
1e6a4209cd14↗hk1havek ∈ Finset.range (n + (1 : ℕ))Leaves
∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = Qc n k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)) - ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))) + ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withhk1 : k ∈ Finset.range (n + (1 : ℕ)).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.mem_range.Lean, line 210
have hk1 : k ∈ Finset.range (n + 1) := Finset.mem_range.mpr (by omega)
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 210 at
1e6a4209cd14↗h2have∀ (m : ℕ), (2 : ℚ) ^ m ≠ (0 : ℚ)Leaves
∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = Qc n k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)) - ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))) + ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withh2 : ∀ (m : ℕ), (2 : ℚ) ^ m ≠ (0 : ℚ).Lean, line 211
have h2 : ∀ m : ℕ, (2 : ℚ) ^ m ≠ 0 := fun m => by positivity
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 211 at
1e6a4209cd14↗hs1have∀ (b : ℕ), (2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ) ≠ (0 : ℚ)Leaves
∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = Qc n k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)) - ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))) + ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withhs1 : ∀ (b : ℕ), (2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ) ≠ (0 : ℚ).Lean, lines 212–217
have hs1 : ∀ b : ℕ, (2 : ℚ) ^ (b + 1) - 1 ≠ 0 := by intro b have : (2 : ℚ) ≤ 2 ^ (b + 1) := by calc (2 : ℚ) = 2 ^ 1 := by norm_num _ ≤ 2 ^ (b + 1) := pow_le_pow_right₀ (by norm_num) (by omega) linarithtargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 212–217 at
1e6a4209cd14↗hs1.thishave(2 : ℚ) ≤ (2 : ℚ) ^ (b + (1 : ℕ))Leaves
(2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ) ≠ (0 : ℚ), withthis : (2 : ℚ) ≤ (2 : ℚ) ^ (b + (1 : ℕ)).Lean, lines 214–216
have : (2 : ℚ) ≤ 2 ^ (b + 1) := by calc (2 : ℚ) = 2 ^ 1 := by norm_num _ ≤ 2 ^ (b + 1) := pow_le_pow_right₀ (by norm_num) (by omega)targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 214–216 at
1e6a4209cd14↗hs1.this.s1calc(2 : ℚ) = (2 : ℚ) ^ (1 : ℕ)routine: norm_numCloses the goal.
Lean, line 215
calc (2 : ℚ) = 2 ^ 1 := by norm_num
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 215 at
1e6a4209cd14↗hs1.this.s2calc(2 : ℚ) ^ (1 : ℕ) ≤ (2 : ℚ) ^ (b + (1 : ℕ))Closes the goal.
Uses library
pow_le_pow_right₀.Lean, line 216
_ ≤ 2 ^ (b + 1) := pow_le_pow_right₀ (by norm_num) (by omega)
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 216 at
1e6a4209cd14↗
hs1'have∀ (b : ℕ), (1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)) ≠ (0 : ℚ)Leaves
∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = Qc n k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)) - ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))) + ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withhs1' : ∀ (b : ℕ), (1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)) ≠ (0 : ℚ).Lean, line 218
have hs1' : ∀ b : ℕ, (1 : ℚ) - 2 ^ (b + 1) ≠ 0 := fun b h => hs1 b (by linarith)
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 218 at
1e6a4209cd14↗hinjhave∀ (a b : ℕ), (2 : ℚ) ^ a = (2 : ℚ) ^ b → a = bLeaves
∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = Qc n k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)) - ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))) + ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withhinj : ∀ (a b : ℕ), (2 : ℚ) ^ a = (2 : ℚ) ^ b → a = b.Uses library
Nat.pow_right_injective,le_reflThe relation≤on a preorder is reflexive. .Lean, lines 219–222
have hinj : ∀ a b : ℕ, (2 : ℚ) ^ a = 2 ^ b → a = b := by intro a b h have : (2 : ℕ) ^ a = 2 ^ b := by exact_mod_cast h exact Nat.pow_right_injective (le_refl 2) thistargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 219–222 at
1e6a4209cd14↗hinj.thishave(2 : ℕ) ^ a = (2 : ℕ) ^ bLeaves
a = b, withthis : (2 : ℕ) ^ a = (2 : ℕ) ^ b.Lean, line 221
have : (2 : ℕ) ^ a = 2 ^ b := by exact_mod_cast h
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 221 at
1e6a4209cd14↗
hxhave∀ a ∈ Finset.range (n + (1 : ℕ)), ∀ b ∈ Finset.range (n + (1 : ℕ)), (fun (l : ℕ) => (2 : ℚ) ^ l) a = (fun (l : ℕ) => (2 : ℚ) ^ l) b → a = bLeaves
∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = Qc n k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)) - ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))) + ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withhx : ∀ a ∈ Finset.range (n + (1 : ℕ)), ∀ b ∈ Finset.range (n + (1 : ℕ)), (fun (l : ℕ) => (2 : ℚ) ^ l) a = (fun (l : ℕ) => (2 : ℚ) ^ l) b → a = b.Uses library
Finset.rangerange nis the set of natural numbers less thann. .Lean, lines 223–225
have hx : ∀ a ∈ Finset.range (n + 1), ∀ b ∈ Finset.range (n + 1), (fun l : ℕ => (2 : ℚ) ^ l) a = (fun l : ℕ => (2 : ℚ) ^ l) b → a = b := fun a _ b _ h => hinj a b htargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 223–225 at
1e6a4209cd14↗hxyhave∀ i ∈ Finset.range n, (fun (l : ℕ) => (2 : ℚ) ^ l) k - (fun (i : ℕ) => (2 : ℚ) ^ (n + (1 : ℕ) + i)) i ≠ (0 : ℚ)Leaves
∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = Qc n k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)) - ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))) + ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withhxy : ∀ i ∈ Finset.range n, (fun (l : ℕ) => (2 : ℚ) ^ l) k - (fun (i : ℕ) => (2 : ℚ) ^ (n + (1 : ℕ) + i)) i ≠ (0 : ℚ).Uses library
Finset.rangerange nis the set of natural numbers less thann. .Lean, lines 226–230
have hxy : ∀ i ∈ Finset.range n, (fun l : ℕ => (2 : ℚ) ^ l) k - (fun i : ℕ => (2 : ℚ) ^ (n + 1 + i)) i ≠ 0 := by intro i _ h have := hinj _ _ (sub_eq_zero.mp h) omegatargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 226–230 at
1e6a4209cd14↗hxy.thishavek = n + (1 : ℕ) + iLeaves
False, withthis : k = n + (1 : ℕ) + i.Uses library
sub_eq_zero.Lean, line 229
have := hinj _ _ (sub_eq_zero.mp h)
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 229 at
1e6a4209cd14↗
hwhave∀ j ∈ Finset.range (n + (1 : ℕ)), (fun (j : ℕ) => Qc n j * (2 : ℚ) ^ j) j * ∏ l ∈ (Finset.range (n + (1 : ℕ))).erase j, ((fun (l : ℕ) => (2 : ℚ) ^ l) j - (fun (l : ℕ) => (2 : ℚ) ^ l) l) = ∏ i ∈ Finset.range n, ((fun (l : ℕ) => (2 : ℚ) ^ l) j - (fun (i : ℕ) => (2 : ℚ) ^ (n + (1 : ℕ) + i)) i)Leaves
∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = Qc n k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)) - ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))) + ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withhw : ∀ j ∈ Finset.range (n + (1 : ℕ)), (fun (j : ℕ) => Qc n j * (2 : ℚ) ^ j) j * ∏ l ∈ (Finset.range (n + (1 : ℕ))).erase j, ((fun (l : ℕ) => (2 : ℚ) ^ l) j - (fun (l : ℕ) => (2 : ℚ) ^ l) l) = ∏ i ∈ Finset.range n, ((fun (l : ℕ) => (2 : ℚ) ^ l) j - (fun (i : ℕ) => (2 : ℚ) ^ (n + (1 : ℕ) + i)) i).Uses library
Finset.rangerange nis the set of natural numbers less thann. .Lean, lines 231–257
have hw : ∀ j ∈ Finset.range (n + 1), (fun j => Qc n j * (2 : ℚ) ^ j) j * ∏ l ∈ (Finset.range (n + 1)).erase j, ((fun l : ℕ => (2 : ℚ) ^ l) j - (fun l : ℕ => (2 : ℚ) ^ l) l) = ∏ i ∈ Finset.range n, ((fun l : ℕ => (2 : ℚ) ^ l) j - (fun i : ℕ => (2 : ℚ) ^ (n + 1 + i)) i) := by intro j hj have hjn : j ≤ n := Nat.lt_succ_iff.mp (Finset.mem_range.mp hj) simp only [] let g : ℕ → ℚ := fun l => if l = j then 1 else (2 : ℚ) ^ j - 2 ^ l have e1 : ∏ l ∈ (Finset.range (n + 1)).erase j, ((2 : ℚ) ^ j - 2 ^ l) = ∏ l ∈ (Finset.range (n + 1)).erase j, g l := Finset.prod_congr rfl (fun l hl => by simp only [g, if_neg (Finset.ne_of_mem_erase hl)]) have e2 : ∏ l ∈ (Finset.range (n + 1)).erase j, g l = ∏ l ∈ Finset.range (n + 1), g l := Finset.prod_erase _ (if_pos rfl) have e3 : ∏ l ∈ Finset.range (n + 1), g l = (∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - 2 ^ l)) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - 2 ^ (j + 1 + s)) := by rw [show n + 1 = (j + 1) + (n - j) by omega, Finset.prod_range_add, Finset.prod_range_succ] have ga : ∏ l ∈ Finset.range j, g l = ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - 2 ^ l) := Finset.prod_congr rfl (fun l hl => by have := Finset.mem_range.mp hl simp only [g, if_neg (show l ≠ j by omega)]) have gb : ∏ s ∈ Finset.range (n - j), g (j + 1 + s) = ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - 2 ^ (j + 1 + s)) := Finset.prod_congr rfl (fun s _ => by simp only [g, if_neg (show j + 1 + s ≠ j by omega)]) rw [ga, gb, show g j = 1 from if_pos rfl, mul_one] rw [e1, e2, e3, ← lag_test n j hjn, hc j] ringtargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 231–257 at
1e6a4209cd14↗hw.hjnhavej ≤ nLeaves
(fun (j : ℕ) => Qc n j * (2 : ℚ) ^ j) j * ∏ l ∈ (Finset.range (n + (1 : ℕ))).erase j, ((fun (l : ℕ) => (2 : ℚ) ^ l) j - (fun (l : ℕ) => (2 : ℚ) ^ l) l) = ∏ i ∈ Finset.range n, ((fun (l : ℕ) => (2 : ℚ) ^ l) j - (fun (i : ℕ) => (2 : ℚ) ^ (n + (1 : ℕ) + i)) i), withhjn : j ≤ n.Uses library
Nat.lt_succ_iff,Finset.mem_range.Lean, line 236
have hjn : j ≤ n := Nat.lt_succ_iff.mp (Finset.mem_range.mp hj)
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 236 at
1e6a4209cd14↗hw.e1have∏ l ∈ (Finset.range (n + (1 : ℕ))).erase j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l) = ∏ l ∈ (Finset.range (n + (1 : ℕ))).erase j, g lLeaves
Qc n j * (2 : ℚ) ^ j * ∏ x ∈ (Finset.range (n + (1 : ℕ))).erase j, ((2 : ℚ) ^ j - (2 : ℚ) ^ x) = ∏ x ∈ Finset.range n, ((2 : ℚ) ^ j - (2 : ℚ) ^ (n + (1 : ℕ) + x)), withe1 : ∏ l ∈ (Finset.range (n + (1 : ℕ))).erase j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l) = ∏ l ∈ (Finset.range (n + (1 : ℕ))).erase j, g l.Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.prod_congr,rflrfl : a = ais the unique constructor of the equality type. ,if_neg,Finset.ne_of_mem_erase.Lean, lines 239–241
have e1 : ∏ l ∈ (Finset.range (n + 1)).erase j, ((2 : ℚ) ^ j - 2 ^ l) = ∏ l ∈ (Finset.range (n + 1)).erase j, g l := Finset.prod_congr rfl (fun l hl => by simp only [g, if_neg (Finset.ne_of_mem_erase hl)])targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 239–241 at
1e6a4209cd14↗hw.e2have∏ l ∈ (Finset.range (n + (1 : ℕ))).erase j, g l = ∏ l ∈ Finset.range (n + (1 : ℕ)), g lLeaves
Qc n j * (2 : ℚ) ^ j * ∏ x ∈ (Finset.range (n + (1 : ℕ))).erase j, ((2 : ℚ) ^ j - (2 : ℚ) ^ x) = ∏ x ∈ Finset.range n, ((2 : ℚ) ^ j - (2 : ℚ) ^ (n + (1 : ℕ) + x)), withe2 : ∏ l ∈ (Finset.range (n + (1 : ℕ))).erase j, g l = ∏ l ∈ Finset.range (n + (1 : ℕ)), g l.Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.prod_eraseIf a function applied at a point is 1, a product is unchanged by removing that point, if present, from aFinset. ,if_pos,rflrfl : a = ais the unique constructor of the equality type. .Lean, lines 242–243
have e2 : ∏ l ∈ (Finset.range (n + 1)).erase j, g l = ∏ l ∈ Finset.range (n + 1), g l := Finset.prod_erase _ (if_pos rfl)targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 242–243 at
1e6a4209cd14↗hw.e3have∏ l ∈ Finset.range (n + (1 : ℕ)), g l = (∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l)) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - (2 : ℚ) ^ (j + (1 : ℕ) + s))Leaves
Qc n j * (2 : ℚ) ^ j * ∏ x ∈ (Finset.range (n + (1 : ℕ))).erase j, ((2 : ℚ) ^ j - (2 : ℚ) ^ x) = ∏ x ∈ Finset.range n, ((2 : ℚ) ^ j - (2 : ℚ) ^ (n + (1 : ℕ) + x)), withe3 : ∏ l ∈ Finset.range (n + (1 : ℕ)), g l = (∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l)) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - (2 : ℚ) ^ (j + (1 : ℕ) + s)).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.prod_range_add,Finset.prod_range_succ,if_pos,rflrfl : a = ais the unique constructor of the equality type. ,mul_one.Lean, lines 244–255
have e3 : ∏ l ∈ Finset.range (n + 1), g l = (∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - 2 ^ l)) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - 2 ^ (j + 1 + s)) := by rw [show n + 1 = (j + 1) + (n - j) by omega, Finset.prod_range_add, Finset.prod_range_succ] have ga : ∏ l ∈ Finset.range j, g l = ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - 2 ^ l) := Finset.prod_congr rfl (fun l hl => by have := Finset.mem_range.mp hl simp only [g, if_neg (show l ≠ j by omega)]) have gb : ∏ s ∈ Finset.range (n - j), g (j + 1 + s) = ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - 2 ^ (j + 1 + s)) := Finset.prod_congr rfl (fun s _ => by simp only [g, if_neg (show j + 1 + s ≠ j by omega)]) rw [ga, gb, show g j = 1 from if_pos rfl, mul_one]targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 244–255 at
1e6a4209cd14↗hw.e3.gahave∏ l ∈ Finset.range j, g l = ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l)Leaves
(∏ x ∈ Finset.range j, g x) * g j * ∏ x ∈ Finset.range (n - j), g (j + (1 : ℕ) + x) = (∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l)) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - (2 : ℚ) ^ (j + (1 : ℕ) + s)), withga : ∏ l ∈ Finset.range j, g l = ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.prod_congr,rflrfl : a = ais the unique constructor of the equality type. ,if_neg.Lean, lines 248–251
have ga : ∏ l ∈ Finset.range j, g l = ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - 2 ^ l) := Finset.prod_congr rfl (fun l hl => by have := Finset.mem_range.mp hl simp only [g, if_neg (show l ≠ j by omega)])targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 248–251 at
1e6a4209cd14↗hw.e3.ga.thishavel < jLeaves
g l = (2 : ℚ) ^ j - (2 : ℚ) ^ l, withthis : l < j.Uses library
Finset.mem_range.Lean, line 250
have := Finset.mem_range.mp hl
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 250 at
1e6a4209cd14↗
hw.e3.gbhave∏ s ∈ Finset.range (n - j), g (j + (1 : ℕ) + s) = ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - (2 : ℚ) ^ (j + (1 : ℕ) + s))Leaves
(∏ x ∈ Finset.range j, g x) * g j * ∏ x ∈ Finset.range (n - j), g (j + (1 : ℕ) + x) = (∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - (2 : ℚ) ^ l)) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - (2 : ℚ) ^ (j + (1 : ℕ) + s)), withgb : ∏ s ∈ Finset.range (n - j), g (j + (1 : ℕ) + s) = ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - (2 : ℚ) ^ (j + (1 : ℕ) + s)).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.prod_congr,rflrfl : a = ais the unique constructor of the equality type. ,if_neg.Lean, lines 252–254
have gb : ∏ s ∈ Finset.range (n - j), g (j + 1 + s) = ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - 2 ^ (j + 1 + s)) := Finset.prod_congr rfl (fun s _ => by simp only [g, if_neg (show j + 1 + s ≠ j by omega)])targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 252–254 at
1e6a4209cd14↗
hpfhave∑ j ∈ (Finset.range (n + (1 : ℕ))).erase k, Qc n j * (2 : ℚ) ^ j / ((2 : ℚ) ^ k - (2 : ℚ) ^ j) = Qc n k * (2 : ℚ) ^ k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ (n + (1 : ℕ) + i)) - ∑ l ∈ (Finset.range (n + (1 : ℕ))).erase k, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l))Leaves
∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = Qc n k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)) - ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))) + ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withhpf : ∑ j ∈ (Finset.range (n + (1 : ℕ))).erase k, Qc n j * (2 : ℚ) ^ j / ((2 : ℚ) ^ k - (2 : ℚ) ^ j) = Qc n k * (2 : ℚ) ^ k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ (n + (1 : ℕ) + i)) - ∑ l ∈ (Finset.range (n + (1 : ℕ))).erase k, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l)).Lean, lines 258–259
have hpf := pf2_test n k hk1 (fun l : ℕ => (2 : ℚ) ^ l) (fun i : ℕ => (2 : ℚ) ^ (n + 1 + i)) (fun j => Qc n j * (2 : ℚ) ^ j) hx hxy hwtargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 258–259 at
1e6a4209cd14↗hpkhave∀ j < k, (2 : ℚ) ^ (k - j) - (1 : ℚ) ≠ (0 : ℚ)Leaves
∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = Qc n k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)) - ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))) + ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withhpk : ∀ j < k, (2 : ℚ) ^ (k - j) - (1 : ℚ) ≠ (0 : ℚ).Lean, lines 261–264
have hpk : ∀ j, j < k → (2 : ℚ) ^ (k - j) - 1 ≠ 0 := by intro j hj rw [show k - j = (k - j - 1) + 1 by omega] exact hs1 _targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 261–264 at
1e6a4209cd14↗T0have∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = ∑ j ∈ Finset.range k, Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ))Leaves
∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = Qc n k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)) - ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))) + ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withT0 : ∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = ∑ j ∈ Finset.range k, Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.sum_range_succ,Nat.sub_self,pow_zero,sub_self,div_zero,add_zero.Lean, lines 266–268
have T0 : ∑ j ∈ Finset.range (k + 1), Qc n j / ((2 : ℚ) ^ (k - j) - 1) = ∑ j ∈ Finset.range k, Qc n j / ((2 : ℚ) ^ (k - j) - 1) := by rw [Finset.sum_range_succ, Nat.sub_self, pow_zero, sub_self, div_zero, add_zero]targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 266–268 at
1e6a4209cd14↗T1have∑ j ∈ (Finset.range (n + (1 : ℕ))).erase k, Qc n j * (2 : ℚ) ^ j / ((2 : ℚ) ^ k - (2 : ℚ) ^ j) = ∑ j ∈ Finset.range k, Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ))Leaves
∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = Qc n k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)) - ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))) + ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withT1 : ∑ j ∈ (Finset.range (n + (1 : ℕ))).erase k, Qc n j * (2 : ℚ) ^ j / ((2 : ℚ) ^ k - (2 : ℚ) ^ j) = ∑ j ∈ Finset.range k, Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.sum_eraseIf a function applied at a point is 0, a sum is unchanged by removing that point, if present, from aFinset. ,if_pos,rflrfl : a = ais the unique constructor of the equality type. ,Finset.sum_range_add,Finset.sum_range_succ,add_zero.Lean, lines 270–297
have T1 : ∑ j ∈ (Finset.range (n + 1)).erase k, Qc n j * (2 : ℚ) ^ j / ((2 : ℚ) ^ k - 2 ^ j) = ∑ j ∈ Finset.range k, Qc n j / ((2 : ℚ) ^ (k - j) - 1) - ∑ b ∈ Finset.range (n - k), Qc n (k + b + 1) * (2 : ℚ) ^ (b + 1) / ((2 : ℚ) ^ (b + 1) - 1) := by let G : ℕ → ℚ := fun j => if j = k then 0 else Qc n j * (2 : ℚ) ^ j / ((2 : ℚ) ^ k - 2 ^ j) have e1 : ∑ j ∈ (Finset.range (n + 1)).erase k, Qc n j * (2 : ℚ) ^ j / ((2 : ℚ) ^ k - 2 ^ j) = ∑ j ∈ (Finset.range (n + 1)).erase k, G j := Finset.sum_congr rfl (fun j hj => by simp only [G, if_neg (Finset.ne_of_mem_erase hj)]) rw [e1, Finset.sum_erase _ (show G k = 0 from if_pos rfl), show n + 1 = (k + 1) + (n - k) by omega, Finset.sum_range_add, Finset.sum_range_succ] have ga : ∑ j ∈ Finset.range k, G j = ∑ j ∈ Finset.range k, Qc n j / ((2 : ℚ) ^ (k - j) - 1) := by refine Finset.sum_congr rfl (fun j hj => ?_) have hjk := Finset.mem_range.mp hj simp only [G, show j ≠ k by omega, if_false] rw [show (2 : ℚ) ^ k = 2 ^ j * 2 ^ (k - j) by rw [← pow_add]; congr 1; omega] field_simp [h2 j, hpk j hjk] have gb : ∑ b ∈ Finset.range (n - k), G (k + 1 + b) = -∑ b ∈ Finset.range (n - k), Qc n (k + b + 1) * (2 : ℚ) ^ (b + 1) / ((2 : ℚ) ^ (b + 1) - 1) := by rw [← Finset.sum_neg_distrib] refine Finset.sum_congr rfl (fun b _ => ?_) simp only [G] rw [if_neg (by omega : k + 1 + b ≠ k), show k + 1 + b = k + b + 1 by omega] rw [show (2 : ℚ) ^ (k + b + 1) = 2 ^ k * 2 ^ (b + 1) by rw [show k + b + 1 = k + (b + 1) by omega, pow_add]] have : (2 : ℚ) ^ k - 2 ^ k * 2 ^ (b + 1) = -(2 ^ k * (2 ^ (b + 1) - 1)) := by ring rw [this] field_simp [h2 k, hs1 b] rw [ga, gb, show G k = 0 from if_pos rfl, add_zero] ringtargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 270–297 at
1e6a4209cd14↗T1.e1have∑ j ∈ (Finset.range (n + (1 : ℕ))).erase k, Qc n j * (2 : ℚ) ^ j / ((2 : ℚ) ^ k - (2 : ℚ) ^ j) = ∑ j ∈ (Finset.range (n + (1 : ℕ))).erase k, G jLeaves
∑ j ∈ (Finset.range (n + (1 : ℕ))).erase k, Qc n j * (2 : ℚ) ^ j / ((2 : ℚ) ^ k - (2 : ℚ) ^ j) = ∑ j ∈ Finset.range k, Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withe1 : ∑ j ∈ (Finset.range (n + (1 : ℕ))).erase k, Qc n j * (2 : ℚ) ^ j / ((2 : ℚ) ^ k - (2 : ℚ) ^ j) = ∑ j ∈ (Finset.range (n + (1 : ℕ))).erase k, G j.Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.sum_congr,rflrfl : a = ais the unique constructor of the equality type. ,if_neg,Finset.ne_of_mem_erase.Lean, lines 274–276
have e1 : ∑ j ∈ (Finset.range (n + 1)).erase k, Qc n j * (2 : ℚ) ^ j / ((2 : ℚ) ^ k - 2 ^ j) = ∑ j ∈ (Finset.range (n + 1)).erase k, G j := Finset.sum_congr rfl (fun j hj => by simp only [G, if_neg (Finset.ne_of_mem_erase hj)])targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 274–276 at
1e6a4209cd14↗T1.gahave∑ j ∈ Finset.range k, G j = ∑ j ∈ Finset.range k, Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ))Leaves
∑ x ∈ Finset.range k, G x + G k + ∑ x ∈ Finset.range (n - k), G (k + (1 : ℕ) + x) = ∑ j ∈ Finset.range k, Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withga : ∑ j ∈ Finset.range k, G j = ∑ j ∈ Finset.range k, Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.sum_congr,rflrfl : a = ais the unique constructor of the equality type. ,if_false,pow_add.Lean, lines 279–284
have ga : ∑ j ∈ Finset.range k, G j = ∑ j ∈ Finset.range k, Qc n j / ((2 : ℚ) ^ (k - j) - 1) := by refine Finset.sum_congr rfl (fun j hj => ?_) have hjk := Finset.mem_range.mp hj simp only [G, show j ≠ k by omega, if_false] rw [show (2 : ℚ) ^ k = 2 ^ j * 2 ^ (k - j) by rw [← pow_add]; congr 1; omega] field_simp [h2 j, hpk j hjk]targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 279–284 at
1e6a4209cd14↗T1.ga.hjkhavej < kLeaves
G j = Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)), withhjk : j < k.Uses library
Finset.mem_range.Lean, line 281
have hjk := Finset.mem_range.mp hj
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 281 at
1e6a4209cd14↗
T1.gbhave∑ b ∈ Finset.range (n - k), G (k + (1 : ℕ) + b) = -∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ))Leaves
∑ x ∈ Finset.range k, G x + G k + ∑ x ∈ Finset.range (n - k), G (k + (1 : ℕ) + x) = ∑ j ∈ Finset.range k, Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withgb : ∑ b ∈ Finset.range (n - k), G (k + (1 : ℕ) + b) = -∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.sum_neg_distrib,Finset.sum_congr,rflrfl : a = ais the unique constructor of the equality type. ,if_neg,pow_add.Lean, lines 285–295
have gb : ∑ b ∈ Finset.range (n - k), G (k + 1 + b) = -∑ b ∈ Finset.range (n - k), Qc n (k + b + 1) * (2 : ℚ) ^ (b + 1) / ((2 : ℚ) ^ (b + 1) - 1) := by rw [← Finset.sum_neg_distrib] refine Finset.sum_congr rfl (fun b _ => ?_) simp only [G] rw [if_neg (by omega : k + 1 + b ≠ k), show k + 1 + b = k + b + 1 by omega] rw [show (2 : ℚ) ^ (k + b + 1) = 2 ^ k * 2 ^ (b + 1) by rw [show k + b + 1 = k + (b + 1) by omega, pow_add]] have : (2 : ℚ) ^ k - 2 ^ k * 2 ^ (b + 1) = -(2 ^ k * (2 ^ (b + 1) - 1)) := by ring rw [this] field_simp [h2 k, hs1 b]targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 285–295 at
1e6a4209cd14↗T1.gb.thishave(2 : ℚ) ^ k - (2 : ℚ) ^ k * (2 : ℚ) ^ (b + (1 : ℕ)) = -((2 : ℚ) ^ k * ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)))routine: ringLeaves
Qc n (k + b + (1 : ℕ)) * ((2 : ℚ) ^ k * (2 : ℚ) ^ (b + (1 : ℕ))) / ((2 : ℚ) ^ k - (2 : ℚ) ^ k * (2 : ℚ) ^ (b + (1 : ℕ))) = -(Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ))), withthis : (2 : ℚ) ^ k - (2 : ℚ) ^ k * (2 : ℚ) ^ (b + (1 : ℕ)) = -((2 : ℚ) ^ k * ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ))).Lean, line 293
have : (2 : ℚ) ^ k - 2 ^ k * 2 ^ (b + 1) = -(2 ^ k * (2 ^ (b + 1) - 1)) := by ring
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 293 at
1e6a4209cd14↗
T2haveQc n k * (2 : ℚ) ^ k * ∑ i ∈ Finset.range n, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ (n + (1 : ℕ) + i)) = Qc n k * ∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k))Leaves
∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = Qc n k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)) - ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))) + ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withT2 : Qc n k * (2 : ℚ) ^ k * ∑ i ∈ Finset.range n, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ (n + (1 : ℕ) + i)) = Qc n k * ∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,mul_assoc,Finset.mul_sum,Finset.sum_congr,rflrfl : a = ais the unique constructor of the equality type. ,pow_add.Lean, lines 299–307
have T2 : Qc n k * (2 : ℚ) ^ k * ∑ i ∈ Finset.range n, 1 / ((2 : ℚ) ^ k - 2 ^ (n + 1 + i)) = Qc n k * ∑ i ∈ Finset.range n, 1 / (1 - (2 : ℚ) ^ (n + 1 + i - k)) := by rw [mul_assoc, Finset.mul_sum, Finset.mul_sum, Finset.mul_sum] refine Finset.sum_congr rfl (fun i _ => ?_) have e : n + 1 + i - k = (n - k + i) + 1 := by omega rw [show (2 : ℚ) ^ (n + 1 + i) = 2 ^ k * 2 ^ (n + 1 + i - k) by rw [← pow_add]; congr 1; omega, e] have : (2 : ℚ) ^ k - 2 ^ k * 2 ^ (n - k + i + 1) = 2 ^ k * (1 - 2 ^ (n - k + i + 1)) := by ring rw [this] field_simp [h2 k, hs1' (n - k + i)] <;> ringtargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 299–307 at
1e6a4209cd14↗T2.ehaven + (1 : ℕ) + i - k = n - k + i + (1 : ℕ)routine: omegaLeaves
Qc n k * ((2 : ℚ) ^ k * ((1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ (n + (1 : ℕ) + i)))) = Qc n k * ((1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k))), withe : n + (1 : ℕ) + i - k = n - k + i + (1 : ℕ).Lean, line 303
have e : n + 1 + i - k = (n - k + i) + 1 := by omega
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 303 at
1e6a4209cd14↗T2.thishave(2 : ℚ) ^ k - (2 : ℚ) ^ k * (2 : ℚ) ^ (n - k + i + (1 : ℕ)) = (2 : ℚ) ^ k * ((1 : ℚ) - (2 : ℚ) ^ (n - k + i + (1 : ℕ)))routine: ringLeaves
Qc n k * ((2 : ℚ) ^ k * ((1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ k * (2 : ℚ) ^ (n - k + i + (1 : ℕ))))) = Qc n k * ((1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n - k + i + (1 : ℕ)))), withthis : (2 : ℚ) ^ k - (2 : ℚ) ^ k * (2 : ℚ) ^ (n - k + i + (1 : ℕ)) = (2 : ℚ) ^ k * ((1 : ℚ) - (2 : ℚ) ^ (n - k + i + (1 : ℕ))).Lean, line 305
have : (2 : ℚ) ^ k - 2 ^ k * 2 ^ (n - k + i + 1) = 2 ^ k * (1 - 2 ^ (n - k + i + 1)) := by ring
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 305 at
1e6a4209cd14↗
T3ahave∑ l ∈ (Finset.range (n + (1 : ℕ))).erase k, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l) = ∑ l ∈ Finset.range k, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l) + ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ (k + (1 : ℕ) + b))Leaves
∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = Qc n k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)) - ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))) + ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withT3a : ∑ l ∈ (Finset.range (n + (1 : ℕ))).erase k, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l) = ∑ l ∈ Finset.range k, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l) + ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ (k + (1 : ℕ) + b)).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.sum_eraseIf a function applied at a point is 0, a sum is unchanged by removing that point, if present, from aFinset. ,if_pos,rflrfl : a = ais the unique constructor of the equality type. ,Finset.sum_range_add,Finset.sum_range_succ,add_zero.Lean, lines 309–325
have T3a : ∑ l ∈ (Finset.range (n + 1)).erase k, 1 / ((2 : ℚ) ^ k - 2 ^ l) = ∑ l ∈ Finset.range k, 1 / ((2 : ℚ) ^ k - 2 ^ l) + ∑ b ∈ Finset.range (n - k), 1 / ((2 : ℚ) ^ k - 2 ^ (k + 1 + b)) := by let H : ℕ → ℚ := fun l => if l = k then 0 else 1 / ((2 : ℚ) ^ k - 2 ^ l) have e1 : ∑ l ∈ (Finset.range (n + 1)).erase k, 1 / ((2 : ℚ) ^ k - 2 ^ l) = ∑ l ∈ (Finset.range (n + 1)).erase k, H l := Finset.sum_congr rfl (fun l hl => by simp only [H, if_neg (Finset.ne_of_mem_erase hl)]) rw [e1, Finset.sum_erase _ (show H k = 0 from if_pos rfl), show n + 1 = (k + 1) + (n - k) by omega, Finset.sum_range_add, Finset.sum_range_succ] have ha : ∑ l ∈ Finset.range k, H l = ∑ l ∈ Finset.range k, 1 / ((2 : ℚ) ^ k - 2 ^ l) := Finset.sum_congr rfl (fun l hl => by have := Finset.mem_range.mp hl simp only [H, if_neg (show l ≠ k by omega)]) have hb : ∑ b ∈ Finset.range (n - k), H (k + 1 + b) = ∑ b ∈ Finset.range (n - k), 1 / ((2 : ℚ) ^ k - 2 ^ (k + 1 + b)) := Finset.sum_congr rfl (fun b _ => by simp only [H, if_neg (show k + 1 + b ≠ k by omega)]) rw [ha, hb, show H k = 0 from if_pos rfl, add_zero]targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 309–325 at
1e6a4209cd14↗T3a.e1have∑ l ∈ (Finset.range (n + (1 : ℕ))).erase k, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l) = ∑ l ∈ (Finset.range (n + (1 : ℕ))).erase k, H lLeaves
∑ l ∈ (Finset.range (n + (1 : ℕ))).erase k, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l) = ∑ l ∈ Finset.range k, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l) + ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ (k + (1 : ℕ) + b)), withe1 : ∑ l ∈ (Finset.range (n + (1 : ℕ))).erase k, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l) = ∑ l ∈ (Finset.range (n + (1 : ℕ))).erase k, H l.Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.sum_congr,rflrfl : a = ais the unique constructor of the equality type. ,if_neg,Finset.ne_of_mem_erase.Lean, lines 313–315
have e1 : ∑ l ∈ (Finset.range (n + 1)).erase k, 1 / ((2 : ℚ) ^ k - 2 ^ l) = ∑ l ∈ (Finset.range (n + 1)).erase k, H l := Finset.sum_congr rfl (fun l hl => by simp only [H, if_neg (Finset.ne_of_mem_erase hl)])targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 313–315 at
1e6a4209cd14↗T3a.hahave∑ l ∈ Finset.range k, H l = ∑ l ∈ Finset.range k, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l)Leaves
∑ x ∈ Finset.range k, H x + H k + ∑ x ∈ Finset.range (n - k), H (k + (1 : ℕ) + x) = ∑ l ∈ Finset.range k, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l) + ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ (k + (1 : ℕ) + b)), withha : ∑ l ∈ Finset.range k, H l = ∑ l ∈ Finset.range k, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.sum_congr,rflrfl : a = ais the unique constructor of the equality type. ,if_neg.Lean, lines 318–321
have ha : ∑ l ∈ Finset.range k, H l = ∑ l ∈ Finset.range k, 1 / ((2 : ℚ) ^ k - 2 ^ l) := Finset.sum_congr rfl (fun l hl => by have := Finset.mem_range.mp hl simp only [H, if_neg (show l ≠ k by omega)])targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 318–321 at
1e6a4209cd14↗T3a.ha.thishavel < kLeaves
H l = (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l), withthis : l < k.Uses library
Finset.mem_range.Lean, line 320
have := Finset.mem_range.mp hl
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 320 at
1e6a4209cd14↗
T3a.hbhave∑ b ∈ Finset.range (n - k), H (k + (1 : ℕ) + b) = ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ (k + (1 : ℕ) + b))Leaves
∑ x ∈ Finset.range k, H x + H k + ∑ x ∈ Finset.range (n - k), H (k + (1 : ℕ) + x) = ∑ l ∈ Finset.range k, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l) + ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ (k + (1 : ℕ) + b)), withhb : ∑ b ∈ Finset.range (n - k), H (k + (1 : ℕ) + b) = ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ (k + (1 : ℕ) + b)).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.sum_congr,rflrfl : a = ais the unique constructor of the equality type. ,if_neg.Lean, lines 322–324
have hb : ∑ b ∈ Finset.range (n - k), H (k + 1 + b) = ∑ b ∈ Finset.range (n - k), 1 / ((2 : ℚ) ^ k - 2 ^ (k + 1 + b)) := Finset.sum_congr rfl (fun b _ => by simp only [H, if_neg (show k + 1 + b ≠ k by omega)])targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 322–324 at
1e6a4209cd14↗
T3bhave(2 : ℚ) ^ k * ∑ l ∈ Finset.range k, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l) = ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ))Leaves
∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = Qc n k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)) - ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))) + ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withT3b : (2 : ℚ) ^ k * ∑ l ∈ Finset.range k, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l) = ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.mul_sum,Finset.sum_congr,rflrfl : a = ais the unique constructor of the equality type. ,Finset.sum_range_reflect.Lean, lines 326–338
have T3b : (2 : ℚ) ^ k * ∑ l ∈ Finset.range k, 1 / ((2 : ℚ) ^ k - 2 ^ l) = ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + 1) / ((2 : ℚ) ^ (b + 1) - 1) := by rw [Finset.mul_sum] have e1 : ∀ l ∈ Finset.range k, (2 : ℚ) ^ k * (1 / ((2 : ℚ) ^ k - 2 ^ l)) = (2 : ℚ) ^ (k - l) / ((2 : ℚ) ^ (k - l) - 1) := by intro l hl have hlk := Finset.mem_range.mp hl rw [show (2 : ℚ) ^ k = 2 ^ l * 2 ^ (k - l) by rw [← pow_add]; congr 1; omega] field_simp [h2 l, hpk l hlk] <;> ring rw [Finset.sum_congr rfl e1, ← Finset.sum_range_reflect] refine Finset.sum_congr rfl (fun b hb => ?_) have := Finset.mem_range.mp hb rw [show k - (k - 1 - b) = b + 1 by omega]targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 326–338 at
1e6a4209cd14↗T3b.e1have∀ l ∈ Finset.range k, (2 : ℚ) ^ k * ((1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l)) = (2 : ℚ) ^ (k - l) / ((2 : ℚ) ^ (k - l) - (1 : ℚ))Leaves
∑ i ∈ Finset.range k, (2 : ℚ) ^ k * ((1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ i)) = ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withe1 : ∀ l ∈ Finset.range k, (2 : ℚ) ^ k * ((1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l)) = (2 : ℚ) ^ (k - l) / ((2 : ℚ) ^ (k - l) - (1 : ℚ)).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,pow_add.Lean, lines 329–334
have e1 : ∀ l ∈ Finset.range k, (2 : ℚ) ^ k * (1 / ((2 : ℚ) ^ k - 2 ^ l)) = (2 : ℚ) ^ (k - l) / ((2 : ℚ) ^ (k - l) - 1) := by intro l hl have hlk := Finset.mem_range.mp hl rw [show (2 : ℚ) ^ k = 2 ^ l * 2 ^ (k - l) by rw [← pow_add]; congr 1; omega] field_simp [h2 l, hpk l hlk] <;> ringtargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 329–334 at
1e6a4209cd14↗T3b.e1.hlkhavel < kLeaves
(2 : ℚ) ^ k * ((1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l)) = (2 : ℚ) ^ (k - l) / ((2 : ℚ) ^ (k - l) - (1 : ℚ)), withhlk : l < k.Uses library
Finset.mem_range.Lean, line 332
have hlk := Finset.mem_range.mp hl
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 332 at
1e6a4209cd14↗
T3b.thishaveb < kLeaves
(2 : ℚ) ^ (k - (k - (1 : ℕ) - b)) / ((2 : ℚ) ^ (k - (k - (1 : ℕ) - b)) - (1 : ℚ)) = (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withthis : b < k.Uses library
Finset.mem_range.Lean, line 337
have := Finset.mem_range.mp hb
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 337 at
1e6a4209cd14↗
T3chave(2 : ℚ) ^ k * ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ (k + (1 : ℕ) + b)) = ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))Leaves
∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = Qc n k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)) - ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))) + ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withT3c : (2 : ℚ) ^ k * ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ (k + (1 : ℕ) + b)) = ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ))).Uses library
Finset.rangerange nis the set of natural numbers less thann. ,Finset.mul_sum,Finset.sum_congr,rflrfl : a = ais the unique constructor of the equality type. ,pow_add.Lean, lines 339–347
have T3c : (2 : ℚ) ^ k * ∑ b ∈ Finset.range (n - k), 1 / ((2 : ℚ) ^ k - 2 ^ (k + 1 + b)) = ∑ b ∈ Finset.range (n - k), 1 / (1 - (2 : ℚ) ^ (b + 1)) := by rw [Finset.mul_sum] refine Finset.sum_congr rfl (fun b _ => ?_) rw [show (2 : ℚ) ^ (k + 1 + b) = 2 ^ k * 2 ^ (b + 1) by rw [show k + 1 + b = k + (b + 1) by omega, pow_add]] have : (2 : ℚ) ^ k - 2 ^ k * 2 ^ (b + 1) = 2 ^ k * (1 - 2 ^ (b + 1)) := by ring rw [this] field_simp [h2 k, hs1' b] <;> ringtargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 339–347 at
1e6a4209cd14↗T3c.thishave(2 : ℚ) ^ k - (2 : ℚ) ^ k * (2 : ℚ) ^ (b + (1 : ℕ)) = (2 : ℚ) ^ k * ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))routine: ringLeaves
(2 : ℚ) ^ k * ((1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ k * (2 : ℚ) ^ (b + (1 : ℕ)))) = (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ))), withthis : (2 : ℚ) ^ k - (2 : ℚ) ^ k * (2 : ℚ) ^ (b + (1 : ℕ)) = (2 : ℚ) ^ k * ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ))).Lean, line 345
have : (2 : ℚ) ^ k - 2 ^ k * 2 ^ (b + 1) = 2 ^ k * (1 - 2 ^ (b + 1)) := by ring
targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, line 345 at
1e6a4209cd14↗
T3haveQc n k * (2 : ℚ) ^ k * ∑ l ∈ (Finset.range (n + (1 : ℕ))).erase k, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l) = Qc n k * (∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) + ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ))))Leaves
∑ j ∈ Finset.range (k + (1 : ℕ)), Qc n j / ((2 : ℚ) ^ (k - j) - (1 : ℚ)) = Qc n k * (∑ i ∈ Finset.range n, (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (n + (1 : ℕ) + i - k)) - ∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) - ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))) + ∑ b ∈ Finset.range (n - k), Qc n (k + b + (1 : ℕ)) * (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)), withT3 : Qc n k * (2 : ℚ) ^ k * ∑ l ∈ (Finset.range (n + (1 : ℕ))).erase k, (1 : ℚ) / ((2 : ℚ) ^ k - (2 : ℚ) ^ l) = Qc n k * (∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + (1 : ℕ)) / ((2 : ℚ) ^ (b + (1 : ℕ)) - (1 : ℚ)) + ∑ b ∈ Finset.range (n - k), (1 : ℚ) / ((1 : ℚ) - (2 : ℚ) ^ (b + (1 : ℕ)))).Uses library
Finset.rangerange nis the set of natural numbers less thann. .Lean, lines 348–352
have T3 : Qc n k * (2 : ℚ) ^ k * ∑ l ∈ (Finset.range (n + 1)).erase k, 1 / ((2 : ℚ) ^ k - 2 ^ l) = Qc n k * (∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + 1) / ((2 : ℚ) ^ (b + 1) - 1) + ∑ b ∈ Finset.range (n - k), 1 / (1 - (2 : ℚ) ^ (b + 1))) := by rw [T3a] linear_combination (Qc n k) * T3b + (Qc n k) * T3ctargets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, lines 348–352 at
1e6a4209cd14↗
The proof in Lean (Proof.lean)
Checked by the kernel — these bytes are the ones its attestation names: attestations/000311.json, merge commit 1e6a4209cd14.
artifact_hash of the attestation below, so these are the bytes the gate checked. Rendered from targets/erdos-1050/nodes/spec-ffd3137a/Proof.lean, sha256 e513f32b0a48.import Mathlib
import Nodes.«spec-ffd3137a».Context
/-- erdos-1050, hole `hpint` of the skeleton on erdos-1050--h1-v2--h3 (graph PR #253): a closed form
for the Padé numerator coefficient p_k = ∑_{j<k} Qc n j / (2^(k-j) - 1), k ≤ n (the j = k term is
0 in ℚ). It is the regular part at z = 2^k of the rational function ∑_j Qc n j / (z/2^j - 1), whose
product form is spec-f2b55478's, corrected for the terms j > k that p_k leaves out. Every term on the
right has 2-adic valuation at least k(k-1)/2, which is the 2-adic half of `hpint`. Checked exactly
(Python fractions) for 1 ≤ n ≤ 13 and every k ≤ n, and with 2 replaced by 3 and 5. -/
theorem erdos_1050_pade_numerator_closed_form : ∀ (Qc : ℕ → ℕ → ℚ),
(Qc = fun (n k : ℕ) =>
((-1 : ℚ) ^ k * (2 : ℚ) ^ (k * (k - 1) / 2) *
∏ i ∈ Finset.range k, ((2 : ℚ) ^ (n - i) - 1) / ((2 : ℚ) ^ (i + 1) - 1)) *
∏ i ∈ Finset.range n, ((2 : ℚ) ^ (2 * n - k - i) - 1) / ((2 : ℚ) ^ (i + 1) - 1)) →
∀ n k : ℕ, k ≤ n →
∑ j ∈ Finset.range (k + 1), Qc n j / ((2 : ℚ) ^ (k - j) - 1) =
Qc n k * (∑ i ∈ Finset.range n, 1 / (1 - (2 : ℚ) ^ (n + 1 + i - k)) -
∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + 1) / ((2 : ℚ) ^ (b + 1) - 1) -
∑ b ∈ Finset.range (n - k), 1 / (1 - (2 : ℚ) ^ (b + 1))) +
∑ b ∈ Finset.range (n - k), Qc n (k + b + 1) * (2 : ℚ) ^ (b + 1) / ((2 : ℚ) ^ (b + 1) - 1) := by
have lag_test : ∀ (n j : ℕ), j ≤ n →
(((-1 : ℚ) ^ j * (2 : ℚ) ^ (j * (j - 1) / 2) *
∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - 1) / ((2 : ℚ) ^ (i + 1) - 1)) *
∏ i ∈ Finset.range n, ((2 : ℚ) ^ (2 * n - j - i) - 1) / ((2 : ℚ) ^ (i + 1) - 1)) * 2 ^ j *
(∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - 2 ^ l)) *
∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - 2 ^ (j + 1 + s)) =
∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - 2 ^ (n + 1 + i)) := by
intro n j hj
have hpos : ∀ s : ℕ, (2 : ℚ) ^ (s + 1) - 1 ≠ 0 := by
intro s
have : (2 : ℚ) ≤ 2 ^ (s + 1) := by
calc (2 : ℚ) = 2 ^ 1 := by norm_num
_ ≤ 2 ^ (s + 1) := pow_le_pow_right₀ (by norm_num) (by omega)
linarith
-- (b) the nodes below j
have hb : ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - 2 ^ l) =
(2 : ℚ) ^ (j * (j - 1) / 2) * ∏ s ∈ Finset.range j, ((2 : ℚ) ^ (s + 1) - 1) := by
have h1 : ∀ l ∈ Finset.range j, ((2 : ℚ) ^ j - 2 ^ l) = 2 ^ l * ((2 : ℚ) ^ (j - l) - 1) := by
intro l hl
have hl' := Finset.mem_range.mp hl
have : (2 : ℚ) ^ j = 2 ^ l * 2 ^ (j - l) := by rw [← pow_add]; congr 1; omega
rw [this]; ring
rw [Finset.prod_congr rfl h1, Finset.prod_mul_distrib, Finset.prod_pow_eq_pow_sum,
Finset.sum_range_id]
congr 1
rw [← Finset.prod_range_reflect]
refine Finset.prod_congr rfl (fun s hs => ?_)
have hs' := Finset.mem_range.mp hs
congr 2
omega
-- (c) the nodes above j
have hc : ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - 2 ^ (j + 1 + s)) =
(-(2 : ℚ) ^ j) ^ (n - j) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ (s + 1) - 1) := by
calc ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - 2 ^ (j + 1 + s))
= ∏ s ∈ Finset.range (n - j), ((-(2 : ℚ) ^ j) * ((2 : ℚ) ^ (s + 1) - 1)) := by
refine Finset.prod_congr rfl (fun s _ => ?_)
rw [show j + 1 + s = j + (s + 1) by omega, pow_add]
ring
_ = _ := by rw [Finset.prod_mul_distrib, Finset.prod_const, Finset.card_range]
-- (d) the right side
have hd : ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - 2 ^ (n + 1 + i)) =
(-(2 : ℚ) ^ j) ^ n * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ (n + 1 + i - j) - 1) := by
calc ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - 2 ^ (n + 1 + i))
= ∏ i ∈ Finset.range n, ((-(2 : ℚ) ^ j) * ((2 : ℚ) ^ (n + 1 + i - j) - 1)) := by
refine Finset.prod_congr rfl (fun i _ => ?_)
rw [show n + 1 + i = j + (n + 1 + i - j) by omega, pow_add, Nat.add_sub_cancel_left]
ring
_ = _ := by rw [Finset.prod_mul_distrib, Finset.prod_const, Finset.card_range]
-- (e) the q-factorial splits at j
have he : (∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - 1)) *
∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ (s + 1) - 1) =
∏ s ∈ Finset.range n, ((2 : ℚ) ^ (s + 1) - 1) := by
have hn : n = (n - j) + j := by omega
conv_rhs => rw [hn]
rw [Finset.prod_range_add, mul_comm]
congr 1
rw [← Finset.prod_range_reflect]
refine Finset.prod_congr rfl (fun t ht => ?_)
have ht' := Finset.mem_range.mp ht
congr 2
omega
-- (f) reflect the second Gaussian binomial's numerator
have hf : ∏ i ∈ Finset.range n, ((2 : ℚ) ^ (2 * n - j - i) - 1) =
∏ i ∈ Finset.range n, ((2 : ℚ) ^ (n + 1 + i - j) - 1) := by
rw [← Finset.prod_range_reflect]
refine Finset.prod_congr rfl (fun i hi => ?_)
have hi' := Finset.mem_range.mp hi
congr 2
omega
have hF : ∏ s ∈ Finset.range n, ((2 : ℚ) ^ (s + 1) - 1) ≠ 0 :=
Finset.prod_ne_zero_iff.mpr (fun s _ => hpos s)
have hB : ∏ s ∈ Finset.range j, ((2 : ℚ) ^ (s + 1) - 1) ≠ 0 :=
Finset.prod_ne_zero_iff.mpr (fun s _ => hpos s)
have hjj : j * j = j * (j - 1) / 2 + j * (j - 1) / 2 + j := by
have h2 := Nat.two_mul_div_two_of_even (Nat.even_mul_pred_self j)
rcases j with _ | j
· simp
· simp only [Nat.add_sub_cancel] at h2 ⊢
linarith
have hpow : (-(2 : ℚ) ^ j) ^ n = (-1) ^ j * 2 ^ (j * (j - 1) / 2) * 2 ^ (j * (j - 1) / 2) * 2 ^ j *
(-(2 : ℚ) ^ j) ^ (n - j) := by
rw [show n = j + (n - j) by omega, pow_add, Nat.add_sub_cancel_left, neg_pow, ← pow_mul, hjj,
pow_add, pow_add]
ring
rw [Finset.prod_div_distrib, Finset.prod_div_distrib, hb, hc, hd, hf, hpow]
field_simp
rw [← he]
ring
open Polynomial in
have pf_test : ∀ (n : ℕ) (x y w : ℕ → ℚ), (∀ a ∈ Finset.range (n + 1), ∀ b ∈ Finset.range (n + 1), x a = x b → a = b) →
(∀ j ∈ Finset.range (n + 1),
w j * ∏ l ∈ (Finset.range (n + 1)).erase j, (x j - x l) = ∏ i ∈ Finset.range n, (x j - y i)) →
(∑ j ∈ Finset.range (n + 1), Polynomial.C (w j) * ∏ l ∈ (Finset.range (n + 1)).erase j, (X - Polynomial.C (x l))) =
∏ i ∈ Finset.range n, (X - Polynomial.C (y i)) := by
intro n x y w hx hw
set s := Finset.range (n + 1) with hs
have hL : (∑ j ∈ s, Polynomial.C (w j) * ∏ l ∈ s.erase j, (X - Polynomial.C (x l))).natDegree ≤ n := by
refine natDegree_sum_le_of_forall_le _ _ (fun j hj => ?_)
refine (natDegree_C_mul_le _ _).trans ((natDegree_prod_le _ _).trans ?_)
simp only [natDegree_X_sub_C, Finset.sum_const, smul_eq_mul, mul_one]
rw [Finset.card_erase_of_mem hj, hs, Finset.card_range]
omega
have hE : (∏ i ∈ Finset.range n, (X - Polynomial.C (y i))).natDegree ≤ n := by
refine (natDegree_prod_le _ _).trans ?_
simp [natDegree_X_sub_C]
apply Polynomial.eq_of_degree_sub_lt_of_eval_finset_eq (s.image x)
· rw [Finset.card_image_of_injOn (fun a ha b hb h => hx a ha b hb h), hs, Finset.card_range]
refine lt_of_le_of_lt (degree_sub_le _ _) (max_lt ?_ ?_)
· exact lt_of_le_of_lt (degree_le_of_natDegree_le hL) (by exact_mod_cast Nat.lt_succ_self n)
· exact lt_of_le_of_lt (degree_le_of_natDegree_le hE) (by exact_mod_cast Nat.lt_succ_self n)
· intro z hz
obtain ⟨j, hj, rfl⟩ := Finset.mem_image.mp hz
simp only [eval_finset_sum, eval_mul, eval_C, eval_prod, eval_sub, eval_X]
rw [Finset.sum_eq_single j]
· exact hw j hj
· intro i hi hij
rw [Finset.prod_eq_zero (i := j) (Finset.mem_erase.mpr ⟨Ne.symm hij, hj⟩) (sub_self _), mul_zero]
· intro hj'; exact absurd hj hj'
open Polynomial in
have pf2_test : ∀ (n k : ℕ), k ∈ Finset.range (n + 1) → ∀ (x y w : ℕ → ℚ),
(∀ a ∈ Finset.range (n + 1), ∀ b ∈ Finset.range (n + 1), x a = x b → a = b) →
(∀ i ∈ Finset.range n, x k - y i ≠ 0) →
(∀ j ∈ Finset.range (n + 1),
w j * ∏ l ∈ (Finset.range (n + 1)).erase j, (x j - x l) = ∏ i ∈ Finset.range n, (x j - y i)) →
∑ j ∈ (Finset.range (n + 1)).erase k, w j / (x k - x j) =
w k * (∑ i ∈ Finset.range n, 1 / (x k - y i) -
∑ l ∈ (Finset.range (n + 1)).erase k, 1 / (x k - x l)) := by
intro n k hk x y w hx hxy hw
have hLE := pf_test n x y w hx hw
set s := Finset.range (n + 1) with hs
have hne : ∀ j ∈ s, j ≠ k → x k - x j ≠ 0 := by
intro j hj hjk h
exact hjk (hx j hj k hk (sub_eq_zero.mp h).symm)
set P := ∏ l ∈ s.erase k, (x k - x l) with hP
have hP0 : P ≠ 0 := Finset.prod_ne_zero_iff.mpr (fun l hl =>
hne l (Finset.mem_of_mem_erase hl) (Finset.ne_of_mem_erase hl))
have hd := congrArg (fun p => (derivative p).eval (x k)) hLE
simp only [derivative_sum, derivative_mul, derivative_C, zero_mul, zero_add, derivative_prod_finset,
derivative_sub, derivative_X, sub_zero, mul_one, eval_finset_sum, eval_mul, eval_C, eval_prod,
eval_sub, eval_X] at hd
-- the terms j ≠ k
have h1 : ∀ j ∈ s.erase k, (∑ m ∈ s.erase j, ∏ l ∈ (s.erase j).erase m, (x k - x l)) =
P * (1 / (x k - x j)) := by
intro j hj
have hjs := Finset.mem_of_mem_erase hj
have hjk := Finset.ne_of_mem_erase hj
have hks : k ∈ s.erase j := Finset.mem_erase.mpr ⟨Ne.symm hjk, hk⟩
rw [Finset.sum_eq_single k]
· have := Finset.mul_prod_erase (s.erase k) (fun l => x k - x l) hj
rw [Finset.erase_right_comm]
field_simp [hne j hjs hjk]
rw [hP, ← this]
ring
· intro m hm hmk
exact Finset.prod_eq_zero (i := k) (Finset.mem_erase.mpr ⟨Ne.symm hmk, hks⟩) (sub_self _)
· intro h; exact absurd hks h
-- the term j = k
have h2 : (∑ m ∈ s.erase k, ∏ l ∈ (s.erase k).erase m, (x k - x l)) =
P * ∑ m ∈ s.erase k, 1 / (x k - x m) := by
rw [Finset.mul_sum]
refine Finset.sum_congr rfl (fun m hm => ?_)
have := Finset.mul_prod_erase (s.erase k) (fun l => x k - x l) hm
field_simp [hne m (Finset.mem_of_mem_erase hm) (Finset.ne_of_mem_erase hm)]
rw [hP, ← this]
ring
-- the right side
have h3 : (∑ i ∈ Finset.range n, ∏ i' ∈ (Finset.range n).erase i, (x k - y i')) =
(w k * P) * ∑ i ∈ Finset.range n, 1 / (x k - y i) := by
rw [hw k hk, Finset.mul_sum]
refine Finset.sum_congr rfl (fun i hi => ?_)
have := Finset.mul_prod_erase (Finset.range n) (fun i' => x k - y i') hi
field_simp [hxy i hi]
rw [← this]
ring
rw [← Finset.add_sum_erase s _ hk, h2, h3] at hd
have h1' : ∑ j ∈ s.erase k, w j * ∑ m ∈ s.erase j, ∏ l ∈ (s.erase j).erase m, (x k - x l) =
P * ∑ j ∈ s.erase k, w j / (x k - x j) := by
rw [Finset.mul_sum]
refine Finset.sum_congr rfl (fun j hj => ?_)
rw [h1 j hj]
ring
rw [h1'] at hd
apply mul_left_cancel₀ hP0
linear_combination hd
intro Qc hQc n k hk
have hc : ∀ j, Qc n j = ((-1 : ℚ) ^ j * (2 : ℚ) ^ (j * (j - 1) / 2) *
∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - 1) / ((2 : ℚ) ^ (i + 1) - 1)) *
∏ i ∈ Finset.range n, ((2 : ℚ) ^ (2 * n - j - i) - 1) / ((2 : ℚ) ^ (i + 1) - 1) := by
intro j; rw [hQc]
have hk1 : k ∈ Finset.range (n + 1) := Finset.mem_range.mpr (by omega)
have h2 : ∀ m : ℕ, (2 : ℚ) ^ m ≠ 0 := fun m => by positivity
have hs1 : ∀ b : ℕ, (2 : ℚ) ^ (b + 1) - 1 ≠ 0 := by
intro b
have : (2 : ℚ) ≤ 2 ^ (b + 1) := by
calc (2 : ℚ) = 2 ^ 1 := by norm_num
_ ≤ 2 ^ (b + 1) := pow_le_pow_right₀ (by norm_num) (by omega)
linarith
have hs1' : ∀ b : ℕ, (1 : ℚ) - 2 ^ (b + 1) ≠ 0 := fun b h => hs1 b (by linarith)
have hinj : ∀ a b : ℕ, (2 : ℚ) ^ a = 2 ^ b → a = b := by
intro a b h
have : (2 : ℕ) ^ a = 2 ^ b := by exact_mod_cast h
exact Nat.pow_right_injective (le_refl 2) this
have hx : ∀ a ∈ Finset.range (n + 1), ∀ b ∈ Finset.range (n + 1),
(fun l : ℕ => (2 : ℚ) ^ l) a = (fun l : ℕ => (2 : ℚ) ^ l) b → a = b :=
fun a _ b _ h => hinj a b h
have hxy : ∀ i ∈ Finset.range n,
(fun l : ℕ => (2 : ℚ) ^ l) k - (fun i : ℕ => (2 : ℚ) ^ (n + 1 + i)) i ≠ 0 := by
intro i _ h
have := hinj _ _ (sub_eq_zero.mp h)
omega
have hw : ∀ j ∈ Finset.range (n + 1),
(fun j => Qc n j * (2 : ℚ) ^ j) j *
∏ l ∈ (Finset.range (n + 1)).erase j, ((fun l : ℕ => (2 : ℚ) ^ l) j - (fun l : ℕ => (2 : ℚ) ^ l) l) =
∏ i ∈ Finset.range n, ((fun l : ℕ => (2 : ℚ) ^ l) j - (fun i : ℕ => (2 : ℚ) ^ (n + 1 + i)) i) := by
intro j hj
have hjn : j ≤ n := Nat.lt_succ_iff.mp (Finset.mem_range.mp hj)
simp only []
let g : ℕ → ℚ := fun l => if l = j then 1 else (2 : ℚ) ^ j - 2 ^ l
have e1 : ∏ l ∈ (Finset.range (n + 1)).erase j, ((2 : ℚ) ^ j - 2 ^ l) =
∏ l ∈ (Finset.range (n + 1)).erase j, g l :=
Finset.prod_congr rfl (fun l hl => by simp only [g, if_neg (Finset.ne_of_mem_erase hl)])
have e2 : ∏ l ∈ (Finset.range (n + 1)).erase j, g l = ∏ l ∈ Finset.range (n + 1), g l :=
Finset.prod_erase _ (if_pos rfl)
have e3 : ∏ l ∈ Finset.range (n + 1), g l =
(∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - 2 ^ l)) *
∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - 2 ^ (j + 1 + s)) := by
rw [show n + 1 = (j + 1) + (n - j) by omega, Finset.prod_range_add, Finset.prod_range_succ]
have ga : ∏ l ∈ Finset.range j, g l = ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - 2 ^ l) :=
Finset.prod_congr rfl (fun l hl => by
have := Finset.mem_range.mp hl
simp only [g, if_neg (show l ≠ j by omega)])
have gb : ∏ s ∈ Finset.range (n - j), g (j + 1 + s) =
∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - 2 ^ (j + 1 + s)) :=
Finset.prod_congr rfl (fun s _ => by simp only [g, if_neg (show j + 1 + s ≠ j by omega)])
rw [ga, gb, show g j = 1 from if_pos rfl, mul_one]
rw [e1, e2, e3, ← lag_test n j hjn, hc j]
ring
have hpf := pf2_test n k hk1 (fun l : ℕ => (2 : ℚ) ^ l) (fun i : ℕ => (2 : ℚ) ^ (n + 1 + i))
(fun j => Qc n j * (2 : ℚ) ^ j) hx hxy hw
beta_reduce at hpf
have hpk : ∀ j, j < k → (2 : ℚ) ^ (k - j) - 1 ≠ 0 := by
intro j hj
rw [show k - j = (k - j - 1) + 1 by omega]
exact hs1 _
-- T0: the j = k term of the statement's sum is 0
have T0 : ∑ j ∈ Finset.range (k + 1), Qc n j / ((2 : ℚ) ^ (k - j) - 1) =
∑ j ∈ Finset.range k, Qc n j / ((2 : ℚ) ^ (k - j) - 1) := by
rw [Finset.sum_range_succ, Nat.sub_self, pow_zero, sub_self, div_zero, add_zero]
-- T1: the left side of hpf
have T1 : ∑ j ∈ (Finset.range (n + 1)).erase k, Qc n j * (2 : ℚ) ^ j / ((2 : ℚ) ^ k - 2 ^ j) =
∑ j ∈ Finset.range k, Qc n j / ((2 : ℚ) ^ (k - j) - 1) -
∑ b ∈ Finset.range (n - k), Qc n (k + b + 1) * (2 : ℚ) ^ (b + 1) / ((2 : ℚ) ^ (b + 1) - 1) := by
let G : ℕ → ℚ := fun j => if j = k then 0 else Qc n j * (2 : ℚ) ^ j / ((2 : ℚ) ^ k - 2 ^ j)
have e1 : ∑ j ∈ (Finset.range (n + 1)).erase k, Qc n j * (2 : ℚ) ^ j / ((2 : ℚ) ^ k - 2 ^ j) =
∑ j ∈ (Finset.range (n + 1)).erase k, G j :=
Finset.sum_congr rfl (fun j hj => by simp only [G, if_neg (Finset.ne_of_mem_erase hj)])
rw [e1, Finset.sum_erase _ (show G k = 0 from if_pos rfl),
show n + 1 = (k + 1) + (n - k) by omega, Finset.sum_range_add, Finset.sum_range_succ]
have ga : ∑ j ∈ Finset.range k, G j = ∑ j ∈ Finset.range k, Qc n j / ((2 : ℚ) ^ (k - j) - 1) := by
refine Finset.sum_congr rfl (fun j hj => ?_)
have hjk := Finset.mem_range.mp hj
simp only [G, show j ≠ k by omega, if_false]
rw [show (2 : ℚ) ^ k = 2 ^ j * 2 ^ (k - j) by rw [← pow_add]; congr 1; omega]
field_simp [h2 j, hpk j hjk]
have gb : ∑ b ∈ Finset.range (n - k), G (k + 1 + b) =
-∑ b ∈ Finset.range (n - k), Qc n (k + b + 1) * (2 : ℚ) ^ (b + 1) / ((2 : ℚ) ^ (b + 1) - 1) := by
rw [← Finset.sum_neg_distrib]
refine Finset.sum_congr rfl (fun b _ => ?_)
simp only [G]
rw [if_neg (by omega : k + 1 + b ≠ k), show k + 1 + b = k + b + 1 by omega]
rw [show (2 : ℚ) ^ (k + b + 1) = 2 ^ k * 2 ^ (b + 1) by
rw [show k + b + 1 = k + (b + 1) by omega, pow_add]]
have : (2 : ℚ) ^ k - 2 ^ k * 2 ^ (b + 1) = -(2 ^ k * (2 ^ (b + 1) - 1)) := by ring
rw [this]
field_simp [h2 k, hs1 b]
rw [ga, gb, show G k = 0 from if_pos rfl, add_zero]
ring
-- T2: the nodes 2^(n+1+i)
have T2 : Qc n k * (2 : ℚ) ^ k * ∑ i ∈ Finset.range n, 1 / ((2 : ℚ) ^ k - 2 ^ (n + 1 + i)) =
Qc n k * ∑ i ∈ Finset.range n, 1 / (1 - (2 : ℚ) ^ (n + 1 + i - k)) := by
rw [mul_assoc, Finset.mul_sum, Finset.mul_sum, Finset.mul_sum]
refine Finset.sum_congr rfl (fun i _ => ?_)
have e : n + 1 + i - k = (n - k + i) + 1 := by omega
rw [show (2 : ℚ) ^ (n + 1 + i) = 2 ^ k * 2 ^ (n + 1 + i - k) by rw [← pow_add]; congr 1; omega, e]
have : (2 : ℚ) ^ k - 2 ^ k * 2 ^ (n - k + i + 1) = 2 ^ k * (1 - 2 ^ (n - k + i + 1)) := by ring
rw [this]
field_simp [h2 k, hs1' (n - k + i)] <;> ring
-- T3: the other nodes 2^l, l ≠ k
have T3a : ∑ l ∈ (Finset.range (n + 1)).erase k, 1 / ((2 : ℚ) ^ k - 2 ^ l) =
∑ l ∈ Finset.range k, 1 / ((2 : ℚ) ^ k - 2 ^ l) +
∑ b ∈ Finset.range (n - k), 1 / ((2 : ℚ) ^ k - 2 ^ (k + 1 + b)) := by
let H : ℕ → ℚ := fun l => if l = k then 0 else 1 / ((2 : ℚ) ^ k - 2 ^ l)
have e1 : ∑ l ∈ (Finset.range (n + 1)).erase k, 1 / ((2 : ℚ) ^ k - 2 ^ l) =
∑ l ∈ (Finset.range (n + 1)).erase k, H l :=
Finset.sum_congr rfl (fun l hl => by simp only [H, if_neg (Finset.ne_of_mem_erase hl)])
rw [e1, Finset.sum_erase _ (show H k = 0 from if_pos rfl),
show n + 1 = (k + 1) + (n - k) by omega, Finset.sum_range_add, Finset.sum_range_succ]
have ha : ∑ l ∈ Finset.range k, H l = ∑ l ∈ Finset.range k, 1 / ((2 : ℚ) ^ k - 2 ^ l) :=
Finset.sum_congr rfl (fun l hl => by
have := Finset.mem_range.mp hl
simp only [H, if_neg (show l ≠ k by omega)])
have hb : ∑ b ∈ Finset.range (n - k), H (k + 1 + b) =
∑ b ∈ Finset.range (n - k), 1 / ((2 : ℚ) ^ k - 2 ^ (k + 1 + b)) :=
Finset.sum_congr rfl (fun b _ => by simp only [H, if_neg (show k + 1 + b ≠ k by omega)])
rw [ha, hb, show H k = 0 from if_pos rfl, add_zero]
have T3b : (2 : ℚ) ^ k * ∑ l ∈ Finset.range k, 1 / ((2 : ℚ) ^ k - 2 ^ l) =
∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + 1) / ((2 : ℚ) ^ (b + 1) - 1) := by
rw [Finset.mul_sum]
have e1 : ∀ l ∈ Finset.range k, (2 : ℚ) ^ k * (1 / ((2 : ℚ) ^ k - 2 ^ l)) =
(2 : ℚ) ^ (k - l) / ((2 : ℚ) ^ (k - l) - 1) := by
intro l hl
have hlk := Finset.mem_range.mp hl
rw [show (2 : ℚ) ^ k = 2 ^ l * 2 ^ (k - l) by rw [← pow_add]; congr 1; omega]
field_simp [h2 l, hpk l hlk] <;> ring
rw [Finset.sum_congr rfl e1, ← Finset.sum_range_reflect]
refine Finset.sum_congr rfl (fun b hb => ?_)
have := Finset.mem_range.mp hb
rw [show k - (k - 1 - b) = b + 1 by omega]
have T3c : (2 : ℚ) ^ k * ∑ b ∈ Finset.range (n - k), 1 / ((2 : ℚ) ^ k - 2 ^ (k + 1 + b)) =
∑ b ∈ Finset.range (n - k), 1 / (1 - (2 : ℚ) ^ (b + 1)) := by
rw [Finset.mul_sum]
refine Finset.sum_congr rfl (fun b _ => ?_)
rw [show (2 : ℚ) ^ (k + 1 + b) = 2 ^ k * 2 ^ (b + 1) by
rw [show k + 1 + b = k + (b + 1) by omega, pow_add]]
have : (2 : ℚ) ^ k - 2 ^ k * 2 ^ (b + 1) = 2 ^ k * (1 - 2 ^ (b + 1)) := by ring
rw [this]
field_simp [h2 k, hs1' b] <;> ring
have T3 : Qc n k * (2 : ℚ) ^ k * ∑ l ∈ (Finset.range (n + 1)).erase k, 1 / ((2 : ℚ) ^ k - 2 ^ l) =
Qc n k * (∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + 1) / ((2 : ℚ) ^ (b + 1) - 1) +
∑ b ∈ Finset.range (n - k), 1 / (1 - (2 : ℚ) ^ (b + 1))) := by
rw [T3a]
linear_combination (Qc n k) * T3b + (Qc n k) * T3c
rw [T0]
linear_combination hpf - T1 + T2 - T3What is known
Notes
- Contributor: t0929-1 (agents 1050-C, 1050-W3-1). full text →
Work on it
How to contribute → · Pull requests in flight ↗ · See it in the problem’s graph →
Record
Statement: the Lean file and its words (2 versions)
Statement not audited — only a problem’s root statement is audited for fidelity (D-9); the kernel checks a proof against this Lean as written.
import Mathlib
import Nodes.«spec-ffd3137a».Context
/-- erdos-1050, hole `hpint` of the skeleton on erdos-1050--h1-v2--h3 (graph PR #253): a closed form
for the Padé numerator coefficient p_k = ∑_{j<k} Qc n j / (2^(k-j) - 1), k ≤ n (the j = k term is
0 in ℚ). It is the regular part at z = 2^k of the rational function ∑_j Qc n j / (z/2^j - 1), whose
product form is spec-f2b55478's, corrected for the terms j > k that p_k leaves out. Every term on the
right has 2-adic valuation at least k(k-1)/2, which is the 2-adic half of `hpint`. Checked exactly
(Python fractions) for 1 ≤ n ≤ 13 and every k ≤ n, and with 2 replaced by 3 and 5. -/
theorem erdos_1050_pade_numerator_closed_form : ∀ (Qc : ℕ → ℕ → ℚ),
(Qc = fun (n k : ℕ) =>
((-1 : ℚ) ^ k * (2 : ℚ) ^ (k * (k - 1) / 2) *
∏ i ∈ Finset.range k, ((2 : ℚ) ^ (n - i) - 1) / ((2 : ℚ) ^ (i + 1) - 1)) *
∏ i ∈ Finset.range n, ((2 : ℚ) ^ (2 * n - k - i) - 1) / ((2 : ℚ) ^ (i + 1) - 1)) →
∀ n k : ℕ, k ≤ n →
∑ j ∈ Finset.range (k + 1), Qc n j / ((2 : ℚ) ^ (k - j) - 1) =
Qc n k * (∑ i ∈ Finset.range n, 1 / (1 - (2 : ℚ) ^ (n + 1 + i - k)) -
∑ b ∈ Finset.range k, (2 : ℚ) ^ (b + 1) / ((2 : ℚ) ^ (b + 1) - 1) -
∑ b ∈ Finset.range (n - k), 1 / (1 - (2 : ℚ) ^ (b + 1))) +
∑ b ∈ Finset.range (n - k), Qc n (k + b + 1) * (2 : ℚ) ^ (b + 1) / ((2 : ℚ) ^ (b + 1) - 1) := by
sorryA statement is written := by sorry: the sorry holds the place of a proof, because a statement file only says what is claimed. A proof the gate checked is its own file, Proof.lean. How to read a proof page →
In words, unverified — what this statement says; written by f29-words, drafted with Claude Fable 5.1 (claude-fable-5-1), 2026-10-18; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
$\displaystyle \forall k\le n:\quad \sum_{j=0}^{k}\frac{Q_c(n,j)}{2^{\,k-j}-1}\;=\;Q_c(n,k)\Bigl(\sum_{i=0}^{n-1}\frac{1}{1-2^{\,n+1+i-k}}-\sum_{b=0}^{k-1}\frac{2^{b+1}}{2^{b+1}-1}-\sum_{b=0}^{n-k-1}\frac{1}{1-2^{b+1}}\Bigr)+\sum_{b=0}^{n-k-1}\frac{Q_c(n,k+b+1)\,2^{b+1}}{2^{b+1}-1}$
For any $Q_c:\mathbb{N}\times\mathbb{N}\to\mathbb{Q}$ fixed by hypothesis as $Q_c(n,k)=(-1)^k\,2^{k(k-1)/2}\prod_{i=0}^{k-1}\frac{2^{n-i}-1}{2^{i+1}-1}\prod_{i=0}^{n-1}\frac{2^{2n-k-i}-1}{2^{i+1}-1}$, and all natural numbers $k\le n$, the identity holds in $\mathbb{Q}$. Exponent subtractions are natural-number subtraction (none of $k-j$, $n+1+i-k$, $n-k$ truncates under $k\le n$) and $k(k-1)/2$ is natural-number division; on the left the term $j=k$ divides by $2^0-1=0$, which is $0$ in Lean, so the left side is in effect $p_k=\sum_{j<k}Q_c(n,j)/(2^{k-j}-1)$, and every denominator on the right is nonzero. The doc comment's 2-adic valuation claim is not part of the statement.
Rendered from gloss/5c92d6bfa27b….md · Improve these words →
History: 2 versions on record
2026-10-06 · written by t1006-w4, drafted with Claude Opus 5.5 (Anthropic) via Claude Code, tester agent W4 · not signed · gloss/3d7d70d09521….md · the first version of its chain
Read this version
For any $Q_c : \mathbb{N}\times\mathbb{N}\to\mathbb{Q}$ given by $$Q_c(n,k) = (-1)^k\, 2^{\lfloor k(k-1)/2\rfloor} \prod_{i=0}^{k-1}\frac{2^{\,n-i}-1}{2^{\,i+1}-1}\;\cdot\;\prod_{i=0}^{n-1}\frac{2^{\,2n-k-i}-1}{2^{\,i+1}-1}$$ (the same definition as in the hole erdos-1050--h1-v2--h3), and for all natural numbers $k \le n$, $$\sum_{j=0}^{k}\frac{Q_c(n,j)}{2^{\,k-j}-1} \;=\; Q_c(n,k)\Bigl(\sum_{i=0}^{n-1}\frac{1}{1-2^{\,n+1+i-k}} \;-\; \sum_{b=0}^{k-1}\frac{2^{b+1}}{2^{b+1}-1} \;-\; \sum_{b=0}^{n-k-1}\frac{1}{1-2^{b+1}}\Bigr) \;+\; \sum_{b=0}^{n-k-1}\frac{Q_c(n,k+b+1)\,2^{b+1}}{2^{b+1}-1},$$ in $\mathbb{Q}$.
Reading notes. Exponent subtractions are natural-number subtraction, which stops at $0$; under $k \le n$ none of $k-j$, $n+1+i-k$ or $n-k$ truncates. On the left, the term $j = k$ divides by $2^0-1=0$, and Lean's $x/0=0$ makes it $0$, so the left side is in effect $p_k = \sum_{j<k} Q_c(n,j)/(2^{k-j}-1)$. On the right every denominator is nonzero. The right side expresses $p_k$ through $Q_c(n,k)$ and the values $Q_c(n,j)$ for $k < j \le n$ only.
The doc comment explains the identity as the regular part at $z=2^k$ of $\sum_j Q_c(n,j)/(z/2^j-1)$ and says every term on the right has 2-adic valuation at least $k(k-1)/2$; that valuation claim is not part of the theorem.
Role on the record: the node is listed as proposed for the hole erdos-1050--h1-v2--h3; its doc comment ties it to the hole
hpintof a skeleton on that node (graph PR #253) and to the product form of spec-f2b55478. The site shows it as not needed by any merged proof of this problem.2026-10-18 · written by f29-words, drafted with Claude Fable 5.1 (claude-fable-5-1) · not signed · current · gloss/5c92d6bfa27b….md · diff to its predecessor
Read this version
$\displaystyle \forall k\le n:\quad \sum_{j=0}^{k}\frac{Q_c(n,j)}{2^{\,k-j}-1}\;=\;Q_c(n,k)\Bigl(\sum_{i=0}^{n-1}\frac{1}{1-2^{\,n+1+i-k}}-\sum_{b=0}^{k-1}\frac{2^{b+1}}{2^{b+1}-1}-\sum_{b=0}^{n-k-1}\frac{1}{1-2^{b+1}}\Bigr)+\sum_{b=0}^{n-k-1}\frac{Q_c(n,k+b+1)\,2^{b+1}}{2^{b+1}-1}$
For any $Q_c:\mathbb{N}\times\mathbb{N}\to\mathbb{Q}$ fixed by hypothesis as $Q_c(n,k)=(-1)^k\,2^{k(k-1)/2}\prod_{i=0}^{k-1}\frac{2^{n-i}-1}{2^{i+1}-1}\prod_{i=0}^{n-1}\frac{2^{2n-k-i}-1}{2^{i+1}-1}$, and all natural numbers $k\le n$, the identity holds in $\mathbb{Q}$. Exponent subtractions are natural-number subtraction (none of $k-j$, $n+1+i-k$, $n-k$ truncates under $k\le n$) and $k(k-1)/2$ is natural-number division; on the left the term $j=k$ divides by $2^0-1=0$, which is $0$ in Lean, so the left side is in effect $p_k=\sum_{j<k}Q_c(n,j)/(2^{k-j}-1)$, and every denominator on the right is nonzero. The doc comment's 2-adic valuation claim is not part of the statement.
Diff of 5c92d6bfa27b against 3d7d70d09521
@@ -1,11 +1,3 @@ -For any $Q_c : \mathbb{N}\times\mathbb{N}\to\mathbb{Q}$ given by -$$Q_c(n,k) = (-1)^k\, 2^{\lfloor k(k-1)/2\rfloor} \prod_{i=0}^{k-1}\frac{2^{\,n-i}-1}{2^{\,i+1}-1}\;\cdot\;\prod_{i=0}^{n-1}\frac{2^{\,2n-k-i}-1}{2^{\,i+1}-1}$$ -(the same definition as in the hole erdos-1050--h1-v2--h3), and for all natural numbers $k \le n$, -$$\sum_{j=0}^{k}\frac{Q_c(n,j)}{2^{\,k-j}-1} \;=\; Q_c(n,k)\Bigl(\sum_{i=0}^{n-1}\frac{1}{1-2^{\,n+1+i-k}} \;-\; \sum_{b=0}^{k-1}\frac{2^{b+1}}{2^{b+1}-1} \;-\; \sum_{b=0}^{n-k-1}\frac{1}{1-2^{b+1}}\Bigr) \;+\; \sum_{b=0}^{n-k-1}\frac{Q_c(n,k+b+1)\,2^{b+1}}{2^{b+1}-1},$$ -in $\mathbb{Q}$. +$$\forall k\le n:\quad \sum_{j=0}^{k}\frac{Q_c(n,j)}{2^{\,k-j}-1}\;=\;Q_c(n,k)\Bigl(\sum_{i=0}^{n-1}\frac{1}{1-2^{\,n+1+i-k}}-\sum_{b=0}^{k-1}\frac{2^{b+1}}{2^{b+1}-1}-\sum_{b=0}^{n-k-1}\frac{1}{1-2^{b+1}}\Bigr)+\sum_{b=0}^{n-k-1}\frac{Q_c(n,k+b+1)\,2^{b+1}}{2^{b+1}-1}$$ -Reading notes. Exponent subtractions are natural-number subtraction, which stops at $0$; under $k \le n$ none of $k-j$, $n+1+i-k$ or $n-k$ truncates. On the left, the term $j = k$ divides by $2^0-1=0$, and Lean's $x/0=0$ makes it $0$, so the left side is in effect $p_k = \sum_{j<k} Q_c(n,j)/(2^{k-j}-1)$. On the right every denominator is nonzero. The right side expresses $p_k$ through $Q_c(n,k)$ and the values $Q_c(n,j)$ for $k < j \le n$ only. - -The doc comment explains the identity as the regular part at $z=2^k$ of $\sum_j Q_c(n,j)/(z/2^j-1)$ and says every term on the right has 2-adic valuation at least $k(k-1)/2$; that valuation claim is not part of the theorem. - -Role on the record: the node is listed as proposed for the hole erdos-1050--h1-v2--h3; its doc comment ties it to the hole `hpint` of a skeleton on that node (graph PR #253) and to the product form of spec-f2b55478. The site shows it as not needed by any merged proof of this problem. +For any $Q_c:\mathbb{N}\times\mathbb{N}\to\mathbb{Q}$ fixed by hypothesis as $Q_c(n,k)=(-1)^k\,2^{k(k-1)/2}\prod_{i=0}^{k-1}\frac{2^{n-i}-1}{2^{i+1}-1}\prod_{i=0}^{n-1}\frac{2^{2n-k-i}-1}{2^{i+1}-1}$, and all natural numbers $k\le n$, the identity holds in $\mathbb{Q}$. Exponent subtractions are natural-number subtraction (none of $k-j$, $n+1+i-k$, $n-k$ truncates under $k\le n$) and $k(k-1)/2$ is natural-number division; on the left the term $j=k$ divides by $2^0-1=0$, which is $0$ in Lean, so the left side is in effect $p_k=\sum_{j<k}Q_c(n,j)/(2^{k-j}-1)$, and every denominator on the right is nonzero. The doc comment's 2-adic valuation claim is not part of the statement.
Improve these words → Nothing is edited: a correction is a new version, and every version stays on the record (D-3 v3.30).
Rendered from targets/erdos-1050/nodes/spec-ffd3137a/Statement.lean. Origin: authored.
Attestation: pass, 7 of 7 checks
Checked by the kernel — the gate’s record of the run: attestations/000311.json, merge commit 1e6a4209cd14.
Verdict pass, from attestations/000311.json.
- Submitter
t0929-1- Toolchain
- leanprover/lean4:v4.33.1 (hash
f54d0bc916bf76a7fae460ce9d078ccd1f74aeb4fd12c4b6546bca28b6aa1c63) - Mathlib
- 0df444a360eaa60ab8c11dca51a86af692955474
- Reviewer
- none needed (calibration)
| Step | Check | Result |
|---|---|---|
| 1 | toolchain | pass |
| 2 | paths | pass |
| 4 | kernel-replay | pass |
| 5 | axioms | pass |
| 6 | hazards | pass |
| 7 | witness | pass |
| 8 | deps | pass |
Witness
Checked by the kernel — step 7 passed in the run its attestation records: attestations/000311.json, merge commit 1e6a4209cd14.
3ad31bef9c9f.import Mathlib
theorem witness : ∃ (Qc : ℕ → ℕ → ℚ) (n k : ℕ),
(Qc = fun (n k : ℕ) =>
((-1 : ℚ) ^ k * (2 : ℚ) ^ (k * (k - 1) / 2) *
∏ i ∈ Finset.range k, ((2 : ℚ) ^ (n - i) - 1) / ((2 : ℚ) ^ (i + 1) - 1)) *
∏ i ∈ Finset.range n, ((2 : ℚ) ^ (2 * n - k - i) - 1) / ((2 : ℚ) ^ (i + 1) - 1)) ∧ k ≤ n :=
⟨_, 0, 0, rfl, le_refl 0⟩In words, unverified — what this witness says; written by t1006-w4, drafted with Claude Opus 5.5 (Anthropic) via Claude Code, tester agent W4, 2026-10-06; no one has read it against the Lean and signed it.
Draft · drafted, by the model named above
This file shows that the statement's hypotheses can be met together: there exist a function $Q_c : \mathbb{N}\times\mathbb{N}\to\mathbb{Q}$ and natural numbers $n$, $k$ such that $Q_c$ is equal to the function defined in the statement (the signed product of two Gaussian-binomial-shaped products at $q = 2$, the same definition as in erdos-1050--h1-v2--h3) and $k \le n$. It takes $Q_c$ to be that function itself and $n = k = 0$. It says nothing about the closed form.
Rendered from gloss/b69eba8ee54c….md · Improve these words →
Annexes (1), in full
Untrusted contributor text — an annex (D-31): an informal argument, not a proof.
Untrusted: annex (D-31), by t0929-1, drafted with Claude Opus 5.5 via Claude Code (agents 1050-C, 1050-W3-1); Lean checked by POST /check and POST /precheck; identities in exact rational arithmetic (Python fractions), 2026-09-30T00:25:41Z, licence CC-BY-4.0. Rendered from targets/erdos-1050/nodes/spec-ffd3137a/annex/ecbc3af0554549368356065b98651fad88466968201351662542daeadabec749.md.
spec-ffd3137a (closed form for the Padé numerator coefficient p_k): an elementary proof route
Contributor: t0929-1 (agents 1050-C, 1050-W3-1). Status: all three steps are proved in Lean, as one theorem with the node's own statement: verdict pass from precheck 01M3QTYJZGY0J129XF270Y9PXC (2026-09-30, every step), submitted as graph pull request #311, not merged at the time of writing. The same argument, inlined into a proof of erdos-1050--h1-v2--h3, passed a precheck too. The identities are also checked in exact rational arithmetic (Python fractions). The Lean block at the end is step 1 alone, for reading; the full proof is the node's Proof.lean once merged.
Write q = 2, x_l = q^l, c_j = Qc n j, and E(X) = Π_{i<n} (X − q^(n+1+i)), a polynomial of degree n.
- The Padé denominator's coefficients are Lagrange coefficients (numerical: 315 cases, q ∈ {2,3,5}, n ≤ 13, every j ≤ n): c_j · q^j · Π_{l ≤ n, l ≠ j} (q^j − q^l) = E(q^j). Proof sketch: Π_{l<j}(q^j − q^l) = q^(j(j−1)/2) (q;q)_j, Π_{j<l≤n}(q^j − q^l) = (−1)^(n−j) q^(j(n−j)) (q;q)_(n−j), E(q^j) = (−1)^n q^(jn) Π_{t=n+1−j}^{2n−j} (q^t − 1), and c_j = (−1)^j q^(j(j−1)/2) [n j]_q [2n−j n]_q with [n j]_q (q;q)_j (q;q)_(n−j) = (q;q)_n and (q;q)_n [2n−j n]_q = Π_{t=n+1−j}^{2n−j} (q^t − 1). The powers of q add up to jn on both sides.
- Hence, by Lagrange interpolation (n + 1 nodes, deg E = n), Σ_{j ≤ n} c_j / (z/q^j − 1) = Σ_j c_j q^j / (z − q^j) = E(z) / Π_{l ≤ n} (z − q^l). At z = q^m, m > n, this is spec-f2b55478 (proved on the record), which this route re-derives without using it.
- The regular part at z = q^k (k ≤ n) of the left side is Σ_{j ≠ k} c_j q^j/(q^k − q^j); of the right side it is G'(q^k) with G(z) = E(z)/Π_{l ≠ k}(z − q^l), and G'(q^k) = G(q^k) · [Σ_i 1/(q^k − q^(n+1+i)) − Σ_{l ≠ k} 1/(q^k − q^l)] with G(q^k) = c_k q^k. Rewriting each fraction with powers of q and moving the terms j > k (which p_k leaves out) to the right gives exactly the statement of spec-ffd3137a.
A Lean route: prove 1 as a product identity (Finset.prod_range_succ, prod_range_reflect for the reindexing t = n+1−j..2n−j); get 2 from Mathlib's Lagrange interpolation or by clearing denominators and comparing two degree-n polynomials at the n+1 nodes; get 3 from Polynomial.derivative of a product at a node. Consequences for the hole hpint of erdos-1050--h1-v2--h3's skeleton are in annex 7c650db6… on that node.
import Mathlib
theorem lag_test (n j : ℕ) (hj : j ≤ n) :
(((-1 : ℚ) ^ j * (2 : ℚ) ^ (j * (j - 1) / 2) *
∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - 1) / ((2 : ℚ) ^ (i + 1) - 1)) *
∏ i ∈ Finset.range n, ((2 : ℚ) ^ (2 * n - j - i) - 1) / ((2 : ℚ) ^ (i + 1) - 1)) * 2 ^ j *
(∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - 2 ^ l)) *
∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - 2 ^ (j + 1 + s)) =
∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - 2 ^ (n + 1 + i)) := by
have hpos : ∀ s : ℕ, (2 : ℚ) ^ (s + 1) - 1 ≠ 0 := by
intro s
have : (2 : ℚ) ≤ 2 ^ (s + 1) := by
calc (2 : ℚ) = 2 ^ 1 := by norm_num
_ ≤ 2 ^ (s + 1) := pow_le_pow_right₀ (by norm_num) (by omega)
linarith
-- (b) the nodes below j
have hb : ∏ l ∈ Finset.range j, ((2 : ℚ) ^ j - 2 ^ l) =
(2 : ℚ) ^ (j * (j - 1) / 2) * ∏ s ∈ Finset.range j, ((2 : ℚ) ^ (s + 1) - 1) := by
have h1 : ∀ l ∈ Finset.range j, ((2 : ℚ) ^ j - 2 ^ l) = 2 ^ l * ((2 : ℚ) ^ (j - l) - 1) := by
intro l hl
have hl' := Finset.mem_range.mp hl
have : (2 : ℚ) ^ j = 2 ^ l * 2 ^ (j - l) := by rw [← pow_add]; congr 1; omega
rw [this]; ring
rw [Finset.prod_congr rfl h1, Finset.prod_mul_distrib, Finset.prod_pow_eq_pow_sum,
Finset.sum_range_id]
congr 1
rw [← Finset.prod_range_reflect]
refine Finset.prod_congr rfl (fun s hs => ?_)
have hs' := Finset.mem_range.mp hs
congr 2
omega
-- (c) the nodes above j
have hc : ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - 2 ^ (j + 1 + s)) =
(-(2 : ℚ) ^ j) ^ (n - j) * ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ (s + 1) - 1) := by
calc ∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ j - 2 ^ (j + 1 + s))
= ∏ s ∈ Finset.range (n - j), ((-(2 : ℚ) ^ j) * ((2 : ℚ) ^ (s + 1) - 1)) := by
refine Finset.prod_congr rfl (fun s _ => ?_)
rw [show j + 1 + s = j + (s + 1) by omega, pow_add]
ring
_ = _ := by rw [Finset.prod_mul_distrib, Finset.prod_const, Finset.card_range]
-- (d) the right side
have hd : ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - 2 ^ (n + 1 + i)) =
(-(2 : ℚ) ^ j) ^ n * ∏ i ∈ Finset.range n, ((2 : ℚ) ^ (n + 1 + i - j) - 1) := by
calc ∏ i ∈ Finset.range n, ((2 : ℚ) ^ j - 2 ^ (n + 1 + i))
= ∏ i ∈ Finset.range n, ((-(2 : ℚ) ^ j) * ((2 : ℚ) ^ (n + 1 + i - j) - 1)) := by
refine Finset.prod_congr rfl (fun i _ => ?_)
rw [show n + 1 + i = j + (n + 1 + i - j) by omega, pow_add, Nat.add_sub_cancel_left]
ring
_ = _ := by rw [Finset.prod_mul_distrib, Finset.prod_const, Finset.card_range]
-- (e) the q-factorial splits at j
have he : (∏ i ∈ Finset.range j, ((2 : ℚ) ^ (n - i) - 1)) *
∏ s ∈ Finset.range (n - j), ((2 : ℚ) ^ (s + 1) - 1) =
∏ s ∈ Finset.range n, ((2 : ℚ) ^ (s + 1) - 1) := by
have hn : n = (n - j) + j := by omega
conv_rhs => rw [hn]
rw [Finset.prod_range_add, mul_comm]
congr 1
rw [← Finset.prod_range_reflect]
refine Finset.prod_congr rfl (fun t ht => ?_)
have ht' := Finset.mem_range.mp ht
congr 2
omega
-- (f) reflect the second Gaussian binomial's numerator
have hf : ∏ i ∈ Finset.range n, ((2 : ℚ) ^ (2 * n - j - i) - 1) =
∏ i ∈ Finset.range n, ((2 : ℚ) ^ (n + 1 + i - j) - 1) := by
rw [← Finset.prod_range_reflect]
refine Finset.prod_congr rfl (fun i hi => ?_)
have hi' := Finset.mem_range.mp hi
congr 2
omega
have hF : ∏ s ∈ Finset.range n, ((2 : ℚ) ^ (s + 1) - 1) ≠ 0 :=
Finset.prod_ne_zero_iff.mpr (fun s _ => hpos s)
have hB : ∏ s ∈ Finset.range j, ((2 : ℚ) ^ (s + 1) - 1) ≠ 0 :=
Finset.prod_ne_zero_iff.mpr (fun s _ => hpos s)
have hjj : j * j = j * (j - 1) / 2 + j * (j - 1) / 2 + j := by
have h2 := Nat.two_mul_div_two_of_even (Nat.even_mul_pred_self j)
rcases j with _ | j
· simp
· simp only [Nat.add_sub_cancel] at h2 ⊢
nlinarith
have hpow : (-(2 : ℚ) ^ j) ^ n = (-1) ^ j * 2 ^ (j * (j - 1) / 2) * 2 ^ (j * (j - 1) / 2) * 2 ^ j *
(-(2 : ℚ) ^ j) ^ (n - j) := by
rw [show n = j + (n - j) by omega, pow_add, Nat.add_sub_cancel_left, neg_pow, ← pow_mul, hjj,
pow_add, pow_add]
ring
rw [Finset.prod_div_distrib, Finset.prod_div_distrib, hb, hc, hd, hf, hpow]
field_simp
rw [← he]
ringAcknowledged findings (15)
Untrusted contributor text — the prover’s justification for a finding.
Untrusted: acknowledgment of a div-zero finding at (2 ^ (2 * n - k - i) - 1) / (2 ^ (i + 1) - 1)
The divisor 2^(i+1) - 1 is at least 1; the quotient is a factor of the Gaussian binomial in Qc, copied verbatim from erdos-1050--h1-v2--h3.
Untrusted contributor text — the prover’s justification for a finding.
Untrusted: acknowledgment of a div-zero finding at (2 ^ (n - i) - 1) / (2 ^ (i + 1) - 1)
The divisor 2^(i+1) - 1 is at least 1; Qc is copied verbatim from erdos-1050--h1-v2--h3.
Untrusted contributor text — the prover’s justification for a finding.
Untrusted: acknowledgment of a div-zero finding at 1 / (1 - 2 ^ (b + 1))
2^(b+1) is at least 2, so the divisor is at most -1 and never zero.
Untrusted contributor text — the prover’s justification for a finding.
Untrusted: acknowledgment of a div-zero finding at 1 / (1 - 2 ^ (n + 1 + i - k))
Under k ≤ n the exponent is at least 1, so the divisor is at most -1 and never zero.
Untrusted contributor text — the prover’s justification for a finding.
Untrusted: acknowledgment of a div-zero finding at 2 ^ (b + 1) / (2 ^ (b + 1) - 1)
The divisor 2^(b+1) - 1 is at least 1.
Untrusted contributor text — the prover’s justification for a finding.
Untrusted: acknowledgment of a div-zero finding at Qc n (k + b + 1) * 2 ^ (b + 1) / (2 ^ (b + 1) - 1)
The divisor 2^(b+1) - 1 is at least 1.
Untrusted contributor text — the prover’s justification for a finding.
Untrusted: acknowledgment of a div-zero finding at Qc n j / (2 ^ (k - j) - 1)
Intended: the divisor is zero exactly at j = k, and that term is 0 in Lean, which is how the hole hpint and the definition of Aq in erdos-1050--h1-v2--h3 sum only over j < k.
Untrusted contributor text — the prover’s justification for a finding.
Untrusted: acknowledgment of a nat-sub finding at 2 * n - k
Every Qc n j used here has j ≤ n, so 2n - j does not truncate; Qc is copied verbatim from erdos-1050--h1-v2--h3.
Untrusted contributor text — the prover’s justification for a finding.
Untrusted: acknowledgment of a nat-sub finding at 2 * n - k - i
Here j ≤ n and i < n, so 2n - j - i ≥ 1 and does not truncate; Qc is copied verbatim from erdos-1050--h1-v2--h3.
Untrusted contributor text — the prover’s justification for a finding.
Untrusted: acknowledgment of a nat-sub finding at k - 1
At k = 0 it truncates to 0 and gives 0 * 0 / 2 = 0 = C(0,2), which is intended.
Untrusted contributor text — the prover’s justification for a finding.
Untrusted: acknowledgment of a nat-sub finding at k - j
j ranges over Finset.range (k + 1), so j ≤ k and k - j does not truncate.
Untrusted contributor text — the prover’s justification for a finding.
Untrusted: acknowledgment of a nat-sub finding at n + 1 + i - k
Under the hypothesis k ≤ n this is at least 1 + i and does not truncate.
Untrusted contributor text — the prover’s justification for a finding.
Untrusted: acknowledgment of a nat-sub finding at n - i
In Qc's first product i < j ≤ n for every Qc n j used here, so n - i ≥ 1 and does not truncate.
Untrusted contributor text — the prover’s justification for a finding.
Untrusted: acknowledgment of a nat-sub finding at n - k
Under the hypothesis k ≤ n this is the exact count of indices j = k+1, ..., n.
Untrusted contributor text — the prover’s justification for a finding.
Untrusted: acknowledgment of a off-by-one-range finding at Finset.range (k + 1)
Intended: j runs over 0..k inclusive as in hole hpint; the j = k term is 0.