r2_small.py (verification run 2); Python 3.13.5, sympy 1.14.0; parts ABCDEFGHI
A   ok    N = 1: (3),(4) vanish: True; (2) = q(Sigma): True; (1) = (phi alpha Sigma/gamma) P/t_0: True; degrees of c_1, t_0, P: (0, 1, 2); leading coefficient -rho: True; coefficients of c_1, t_0 positive: True
A   ok    N = 2: (3),(4) vanish: True; (2) = q(Sigma): True; (1) = (phi alpha Sigma/gamma) P/t_0: True; degrees of c_1, t_0, P: (1, 2, 3); leading coefficient -rho: True; coefficients of c_1, t_0 positive: True
A   ok    N = 3: (3),(4) vanish: True; (2) = q(Sigma): True; (1) = (phi alpha Sigma/gamma) P/t_0: True; degrees of c_1, t_0, P: (2, 3, 4); leading coefficient -rho: True; coefficients of c_1, t_0 positive: True
A   ok    N = 4: (3),(4) vanish: True; (2) = q(Sigma): True; (1) = (phi alpha Sigma/gamma) P/t_0: True; degrees of c_1, t_0, P: (3, 4, 5); leading coefficient -rho: True; coefficients of c_1, t_0 positive: True
A   ok    N = 5: (3),(4) vanish: True; (2) = q(Sigma): True; (1) = (phi alpha Sigma/gamma) P/t_0: True; degrees of c_1, t_0, P: (4, 5, 6); leading coefficient -rho: True; coefficients of c_1, t_0 positive: True
A   ok    N = 6: (3),(4) vanish: True; (2) = q(Sigma): True; (1) = (phi alpha Sigma/gamma) P/t_0: True; degrees of c_1, t_0, P: (5, 6, 7); leading coefficient -rho: True; coefficients of c_1, t_0 positive: True
B   ok    N = 1: Groebner elimination ideal generated by one polynomial in S of degree 4 = 2(N+1); it equals p_{Sigma*}(S) p_{Sigma'}(S) up to a constant: True; Sigma* = 1/2 in (0, min(L1,R)), Sigma' = 2 > min(L1,R): True; roots of p_{Sigma*} in (0, S_T): 1
B   ok    N = 2: Groebner elimination ideal generated by one polynomial in S of degree 6 = 2(N+1); it equals p_{Sigma*}(S) p_{Sigma'}(S) up to a constant: True; Sigma* = 1/2 in (0, min(L1,R)), Sigma' = 2 > min(L1,R): True; roots of p_{Sigma*} in (0, S_T): 1
B   ok    N = 3: Groebner elimination ideal generated by one polynomial in S of degree 8 = 2(N+1); it equals p_{Sigma*}(S) p_{Sigma'}(S) up to a constant: True; Sigma* = 1/2 in (0, min(L1,R)), Sigma' = 2 > min(L1,R): True; roots of p_{Sigma*} in (0, S_T): 3
B   ok    N = 3: Groebner elimination ideal generated by one polynomial in S of degree 8 = 2(N+1); it equals p_{Sigma*}(S) p_{Sigma'}(S) up to a constant: True; Sigma* = 23/12 - sqrt(97)/12 in (0, min(L1,R)), Sigma' = sqrt(97)/12 + 23/12 > min(L1,R): True; roots of p_{Sigma*} in (0, S_T): 1 (floating point)
C   ok    400 random positive rational parameter points (b = 0 in every eighth), N = 1..10: a_0 > 0, a_N < 0, a_{N+1} < 0, V odd, V <= N (N odd) or N - 1 (N even), number of roots in (0, S_T) <= V and odd (when p is squarefree)
      N =  1: (V, roots in (0,S_T)) -> number of points: {(1, 1): 40}
      N =  2: (V, roots in (0,S_T)) -> number of points: {(1, 1): 40}
      N =  3: (V, roots in (0,S_T)) -> number of points: {(1, 1): 38, (3, 1): 2}
      N =  4: (V, roots in (0,S_T)) -> number of points: {(1, 1): 34, (3, 1): 6}
      N =  5: (V, roots in (0,S_T)) -> number of points: {(1, 1): 31, (3, 1): 6, (3, 3): 3}
      N =  6: (V, roots in (0,S_T)) -> number of points: {(1, 1): 32, (3, 1): 7, (3, 3): 1}
      N =  7: (V, roots in (0,S_T)) -> number of points: {(1, 1): 35, (3, 1): 4, (3, 3): 1}
      N =  8: (V, roots in (0,S_T)) -> number of points: {(1, 1): 33, (3, 1): 5, (3, 3): 2}
      N =  9: (V, roots in (0,S_T)) -> number of points: {(1, 1): 31, (3, 1): 7, (3, 3): 2}
      N = 10: (V, roots in (0,S_T)) -> number of points: {(1, 1): 33, (3, 1): 5, (3, 3): 2}
D   ok    N = 4 example: reduced data as in the proof: True; printed c_1, t_0: True; P(1/20) = -56246376730558049/1000000000000000000000, P(1) = 950630067903020079001/1000000000000000000000 as printed: True; exact number of roots in (x0, X): 3; roots: 0.023857, 0.058879, 1.925803
D   ok    N = 4 example: residuals of (1)-(4) at the three states (40 digits): max 5.7e-42
E   ok    Remark 6.1(2): signs of the coefficients a_0..a_6: + - + - + - -; V = 5; roots of P in (0, X): 1; positive roots: 1
F   ok    N = 1: phi [beta S t_0 - alpha Sigma* c_1 (S_T - S)] is the quadratic of the source: True; N = 2: it is the cubic of the source: True
F   ok    N = 3: coefficients a_0..a_4 as printed equal ours: [True, False, True, False, True]; a_1 and a_3 with the three terms changed as in Remark 3.3 equal ours: (True, True); printed = ours for gamma = phi = 1: True
      degrees in (alpha, beta, gamma, phi, b, nu1) of the terms: ours [[4], [4], [4], [4], [4]]; printed [[4], [4, 5], [4], [3, 4], [4]]
F   ok    example of the source (N = 3, b = 0): roots of P in (0, 10): 3; states (S, C_0..C_3) to four decimals: [(0.0005, 0.0001, 0.0001, 0.0003, 0.4996), (0.286, 0.0085, 0.0294, 0.1028, 0.3593), (1.1769, 0.157, 0.1334, 0.1133, 0.0963)]; equal to the three printed states: True
      with b = 1/100 the values of S would be: 0.0011, 0.2582, 1.1803
G   ok    Lemma 3.4, N = 1..6, 18 random rational parameter points, Jacobian by symbolic differentiation of (1)-(4) at a rational point of the branch: J_CC = A - kappa' e_0 1^T, 1^T A = -nu1 1^T, the identity for det(lambda - J_CC), det J = det J_CC f'(S), f = (phi alpha Sigma*/gamma) P/t_0, the left eigenvector (0; 1^T) for -(nu1 + kappa'), sign det J_CC = (-1)^(N+1), tr J < 0 (all exact); eigenvalues of J_CC real and negative (floating point; largest -0.0824)
H   ok    Lemma 4.3 on 255 and Lemma 4.4 on 273 random integer polynomials with known rational roots (with multiplicities and, in a third of them, a quadratic factor without real roots): number of roots <= number of sign changes, same parity; both back ends of r2_check.py agree
I   ok    Section 9 (floating point): N c_1(x)/t_0(x) - Gamma(xi; lambda) at x = 1 - xi/N, nu = lambda/N^2 for N = 10^3, 10^4, 10^5: (xi, lambda) = (2, 3.5), Gamma = 1.183174: -1.8e-03, -1.8e-04, -1.8e-05; (xi, lambda) = (6, 3.586), Gamma = 0.553562: -4.0e-04, -4.0e-05, -4.0e-06; (xi, lambda) = (10, 3), Gamma = 0.291771: -9.8e-05, -9.8e-06, -9.8e-07; (xi, lambda) = (-1, 1), Gamma = 1.885619: -5.5e-03, -5.5e-04, -5.5e-05
failures: 0 
