PASS D = Q^2 - 4PR = 1-8z+20z^2-24z^3+16z^4-4z^5
PASS D mod 5 = z^5+z^4+z^3+2z+1 (ascending 1,2,0,1,1,1), degree 5
PASS values of D mod 5 at 0,1,2,3,4 are 1,1,1,3,3 (no root)
PASS the monic irreducible quadratics z^2+pz+q over GF(5) are exactly the ten printed ones
PASS remainders of D mod 5 on division by the ten quadratics are as printed (4z, 3z, 2z+1, 3z+4, z+2, 4z+2, 3z+4, 3z, 1, 2z+2)  [{'z^2+0z+2': [0, 4], 'z^2+0z+3': [0, 3], 'z^2+1z+1': [1, 2], 'z^2+1z+2': [4, 3], 'z^2+2z+3': [2, 1], 'z^2+2z+4': [2, 4], 'z^2+3z+3': [4, 3], 'z^2+3z+4': [0, 3], 'z^2+4z+1': [1], 'z^2+4z+2': [2, 2]}]
PASS no remainder is zero, so D mod 5 has no factor of degree 1 or 2 and is irreducible over GF(5)
PASS exhaustive: no monic polynomial of degree 1 or 2 over GF(5) divides D mod 5
PASS 5 does not divide the leading coefficient -4 of D
PASS second prime: D mod 11 has no monic factor of degree 1 or 2 either
PASS gcd(D, ab) = 1 over Q (Euclid)
PASS gcd(D, D') = 1 over Q (D squarefree)
PASS D(1/4) = -17/256, D(1) = 1, D(1/5) = 101/3125 (as printed)
PASS D is not divisible by any of the irreducible factors 1-4z, 1-z, 1-5z of ab
PASS Lemma 4.3: b is not a square in Q(z)
PASS Lemma 4.3: ab is not a square in Q(z)
PASS the classes of 1, a, b, ab are pairwise distinct
    squarefree factorisation of D*1: lc=-4, {1: ['-1/4', '2', '-5', '6', '-4', '1']}
    squarefree factorisation of D*a: lc=16, {1: ['1/16', '-3/4', '13/4', '-13/2', '7', '-17/4', '1']}
    squarefree factorisation of D*b: lc=-20, {1: ['-1/20', '7/10', '-73/20', '46/5', '-13', '11', '-26/5', '1']}
    squarefree factorisation of D*ab: lc=80, {1: ['1/80', '-9/40', '129/80', '-119/20', '249/20', '-63/4', '123/10', '-109/20', '1']}
PASS D lies in none of the square classes of 1, a, b, ab (so sqrt(D) is not in K)
    control a                                      class ['a'] (expected ['a'])
    control b = 1-6z+5z^2                          class ['b'] (expected ['b'])
    control ab                                     class ['ab'] (expected ['ab'])
    control 4a                                     class ['a'] (expected ['a'])
    control -a                                     class [] (expected [])
    control 2a                                     class [] (expected [])
    control a(1+3z)^2                              class ['a'] (expected ['a'])
    control b(2-z)^2/(1+z)^4                       class ['b'] (expected ['b'])
    control ab D^2                                 class ['ab'] (expected ['ab'])
    control D^2 b / (1-4z)^2                       class ['b'] (expected ['b'])
    control a(1-5z)                                class [] (expected [])
    control 1-6z+z^2 (separable permutations)      class [] (expected [])
    control D(1+z)^2 a                             class [] (expected [])
    control D with -4z^5 replaced by -3z^5         class [] (expected [])
    control a/b                                    class ['ab'] (expected ['ab'])
    control 1/(D^2)                                class ['1'] (expected ['1'])
PASS square-class test on 16 positive and negative controls
PASS Catalan: z u^2 - u + 1 = 0 has discriminant a
PASS source example: (1+z)^2 - b = 4z(2-z)
PASS source example: discriminant of z(2-z)g^2-(1+z)g+1 is b, in the class of b only
PASS separable permutations: z s^2 - (1-z) s + 1 = 0 has discriminant 1-6z+z^2, in no class
PASS 1-6z+z^2 has no rational root (discriminant 32 of z^2-6z+1 is not a square) and is coprime to ab
PASS discriminant of P f^2 - Q f + R is D
PASS sympy: D is irreducible over Q  [(-1, [(4*z**5 - 16*z**4 + 24*z**3 - 20*z**2 + 8*z - 1, 1)])]
PASS sympy: disc(D) = -269056, nonzero  [-269056]
    sympy factor_list(D*1) = (-1, [(4*z**5 - 16*z**4 + 24*z**3 - 20*z**2 + 8*z - 1, 1)])
    sympy factor_list(D*a) = (1, [(4*z - 1, 1), (4*z**5 - 16*z**4 + 24*z**3 - 20*z**2 + 8*z - 1, 1)])
    sympy factor_list(D*b) = (-1, [(z - 1, 1), (5*z - 1, 1), (4*z**5 - 16*z**4 + 24*z**3 - 20*z**2 + 8*z - 1, 1)])
    sympy factor_list(D*ab) = (1, [(z - 1, 1), (4*z - 1, 1), (5*z - 1, 1), (4*z**5 - 16*z**4 + 24*z**3 - 20*z**2 + 8*z - 1, 1)])
    roots of D: [0.21421991796924876640, 0.61582226909701596212, 2.0379387861787436824, 0.56600951337749579454 - 0.7807225099386783901*I, 0.56600951337749579454 + 0.7807225099386783901*I]
PASS the roots of D are distinct from 1/4, 1/5, 1 (Remark 4.7)

27 checks, 0 failed
ALL CHECKS PASSED
