r2_exact.py -- sympy 1.14.0

(1) Lemma 2.1, Lemma 4.1, Lemma 4.2 (exact)
  [PASS] Lemma 2.1: the polar of Y meets the conic in T+-, tangents at T+- pass through Y, midpoint = Y/(Y.MY)
  [PASS] Lemma 4.1: S(midpoint polygon) = S/2 + S2/4 for generic N-gons, N = 3..9
  [PASS] S2 = -S for triangles; S2 = 0 if W_{l+2} = -W_l (N = 4); S = S2 = W0xW1 + W1xW2 + W0xW2 if W_{l+3} = -W_l (N = 6)

(2) Lemma 3.1 (with the identity sn(K - Delta) = a''/a), Lemma 3.2, Theorem B residue (exact)
  [PASS] Lemma 3.1: cn^2 D = b''^2/b^2, dn^2 D = a^2 cn^2 D/a''^2, (dn D/cn^2 D)^2 = (ab/(a''b''))^2
  [PASS] identity sn(K - D) = cn D/dn D = a''/a (squares compared; both sides positive for 0 < D < K) : cn^2 D/dn^2 D = (a**2 - lambda)/a**2
  [PASS] Lemma 3.2: P(u + D) . M_C Q(u) = 1 (addition formulas, exact)
  [PASS] Lemma 3.2: P(u - D) . M_C Q(u) = 1 (addition formulas, exact)
  [PASS] Theorem B: singular part of 2F at iK' is 2iab(dn h - 1)/(k^2 eps sn h) : eps * singular part = 2*I*a*b*(dh - 1)/(k**2*sh)

(3) Lemma 6.1 (exact): from the residue quotient to the lambda-form, and 2 + gamma > 0
  [PASS] (1 - dn 2w)/sn 2w = k^2 sn w cn w/dn w (duplication formulas)
  [PASS] gamma = res G/res F = sn h cn h dn D/(dn h sn D cn D) = 2d0^2(c0^2 - s0^2 d0^2)/((1 - k^2 s0^4)(d0^2 - k^2 s0^2 c0^2))
  [PASS] Theorem B form: gamma = sn 2h (1 + dn h)/(sn h (1 + dn 2h))
  [PASS] Lemma 6.1: gamma = 2a^2b^2(a^2b^2 - (a^2+b^2) lambda)/(a^4b^4 - c^4 lambda^2) : derived: 2*a**2*b**2*(a**2*b**2 - a**2*lambda - b**2*lambda)/((a**2*b**2 - a**2*lambda + b**2*lambda)*(a**2*b**2 + a**2*lambda - b**2*lambda))
  [PASS] Lemma 6.1 proof: c0^2 - s0^2 d0^2 as printed
  [PASS] Lemma 6.1 proof: d0^2 - k^2 s0^2 c0^2 as printed
  [PASS] Lemma 6.1 proof: 1 - k^2 s0^4 as printed
  [PASS] Lemma 6.1 proof: a''^2 b^4 - c^2 lambda^2 = (b^2 - lambda)(a^2b^2 + c^2 lambda)
  [PASS] 2 + gamma = 2q(lambda)/(a^4b^4 - c^4 lambda^2)
  [PASS] q(0) = 2a^4b^4, q(b^2) = b^6 c^2, q'' = -2c^4 (concave), den(b^2) = b^6(2a^2 - b^2) > 0, den decreasing on [0, b^2]
  [PASS] limit lambda -> b^2: 2 + gamma -> 2c^2/(2a^2 - b^2)
  [PASS] N = 3: 2 + gamma = 1 at lambda_3 = a^2b^2(2 sqrt(a^4 - a^2b^2 + b^4) - a^2 - b^2)/c^4; product of the two roots = -3a^4b^4/c^4 < 0, so lambda_3 is the only positive root
  [PASS] lambda_3 = a^2 - a''^2 with the classical a'' = a(delta - b^2)/c^2, delta = sqrt(a^4 - a^2b^2 + b^4)

(4) Corollary 7.2(a), N = 4: the rhombus and two members with an irrational vertex, exactly
  [PASS] N = 4: the side -x/a + y/b = 1 touches the caustic iff lambda = a^2b^2/(a^2+b^2)
  [PASS] rhombus (0,+-b), (+-a,0): sides tangent; A = 2ab, A' = 4ab, A'' = 4a^3b^3/(a^2+b^2)^2; k807, k809, k110, k106 = 4a^4b^4/(a^2+b^2)^2, 4a^2b^2, 8a^4b^4/(a^2+b^2)^2, 8a^2b^2
  [PASS] (a, b) = (2, 1), member through P0 = (6/5, 4/5) (P1 = ((-32*sqrt(265) - 318)/265 + 6/5, 3*sqrt(265)/265)): P1 on E, all four sides of P0 P1 -P0 -P1 tangent to the caustic, and the four values of Corollary 7.2(a) : values (k807, k809, k110, k106) = [64/25, 16, 128/25, 32]
  [PASS] (a, b) = (3, 2), member through P0 = (-45/17, 16/17) (P1 = (-18*sqrt(61)/61, -10*sqrt(61)/61)): P1 on E, all four sides of P0 P1 -P0 -P1 tangent to the caustic, and the four values of Corollary 7.2(a) : values (k807, k809, k110, k106) = [5184/169, 144, 10368/169, 288]
  [PASS] Garcia-Reznik print 2a^4b^4/(a^2+b^2)^2 for k110 at N = 4, one quarter of 8a^4b^4/(a^2+b^2)^2

(5) Proposition 7.4 (exact)
  [PASS] the polars (w.r.t. C) of the points of E touch E* (semi-axes a''^2/a, b''^2/b)
  [PASS] common points (x0^2, y0^2) = (a^2a''^2, -b^2b''^2)/c^2 for (E, C), (a''^4, -b''^4)/c^2 for (C, E*); p1q2 - p2q1 = -lambda c^2 (E, C) and -a''^2b''^2 lambda c^2/(a^2b^2) (C, E*)

(6) Lemmas 5.1(c), 5.2(c): the arithmetic, for N <= 60 and every tau
  [PASS] gcd(2 tau, N) = 1 (odd N) or 2 (even N); Delta in (2K/N) gcd(2 tau, N) Z iff N odd; infinite vertices {l0} or {l0, l0 + N/2}
  [PASS] GR N = 6: (3/4) k110 = 3a^3b^3(2a+b)^2(a+2b)^2/(a+b)^6 and (3/4) k106 = 3a^2b^2(2a+b)(a+2b)/(a+b)^2

TOTAL checks: 30, failures: 0
running time: 2 s
