Part A: sextic tails
  ok   L6 = [Xq^6, Xq^5*Yq, Xq^5*Zq, Xq^4*Yq^2]
Part B (sanity): the criterion (L5)-(L3) agrees with direct closedness (random data, both branches; random.seed(7) here)
   trial 0 (delta = 0): conditions True, closed True, H = [1, 3, 6, 4, 2, 2, 1, 1]; perturbed: conditions False, closed False
   trial 1 (delta = 0): conditions True, closed True, H = [1, 3, 6, 4, 2, 2, 1, 1]; perturbed: conditions False, closed False
   trial 2 (delta = 0): conditions True, closed True, H = [1, 3, 6, 4, 2, 2, 1, 1]; perturbed: conditions False, closed False
   trial 3 (delta = 0): conditions True, closed True, H = [1, 3, 6, 4, 2, 2, 1, 1]; perturbed: conditions False, closed False
   trial 4 (delta = -3): conditions True, closed True, H = [1, 3, 6, 4, 2, 2, 1, 1]; perturbed: conditions False, closed False
   trial 5 (delta = 1): conditions True, closed True, H = [1, 3, 6, 4, 2, 2, 1, 1]; perturbed: conditions False, closed False
   trial 6 (delta = 2): conditions True, closed True, H = [1, 3, 6, 4, 2, 2, 1, 1]; perturbed: conditions False, closed False
   trial 7 (delta = -3): conditions True, closed True, H = [1, 3, 6, 4, 2, 2, 1, 1]; perturbed: conditions False, closed False
  ok   criterion agrees with direct closedness, H = (1,3,6,4,2,2,1,1) on 8 solved members
Part C: delta = 0
  ok   (L4) holds identically for Phi5 = Phi5^0(beta,gamma) + <X^5,X^4Y,X^4Z,X^3Y^2>; d = -10/21*be^2 + 2*ep, d' = 0
  ok   homogeneous (L4) (delta = 0): solution space of dimension 4 (= 4)
   X^2 T_1 + C G, g3 not a cube (dim 6) [6], G = Xq*Yq^2 + 2*Xq*Yq*Zq + Yq^2*Zq - Xq*Zq^2 + Yq*Zq^2: r_raw = 10, dim A_D = 6, r_0 = 12; dim + r_raw = 16, dim + r_0 = 18
   X^2 T_1 + C G, g3 not a cube, g2 = 0 (inside dim 6) [6], G = Yq^2*Zq + Yq*Zq^2: r_raw = 10, dim A_D = 6, r_0 = 12; dim + r_raw = 16, dim + r_0 = 18
   X^2 T_1 + C G, g3 = nu L^3 != 0, g2 not mu L^2 (dim 4) [4], G = Xq*Yq*Zq + Zq^3: r_raw = 11, dim A_D = 6, r_0 = 12; dim + r_raw = 15, dim + r_0 = 16
   X^2 T_1 + C G, g3 = nu L^3 != 0, g2 not mu L^2, L = Y (dim 4) [4], G = Yq^3 + Xq*Zq^2: r_raw = 11, dim A_D = 6, r_0 = 12; dim + r_raw = 15, dim + r_0 = 16
   X^2 T_1 + C G, g3 = nu L^3, g2 = mu L^2, nu != 0 (dim 2) [2], G = Xq*Zq^2 + Zq^3: r_raw = 12, dim A_D = 7, r_0 = 14; dim + r_raw = 14, dim + r_0 = 16
   X^2 T_1 + C G, g3 = nu L^3, g2 = 0 (dim 2): F2 [2], G = Zq^3: r_raw = 12, dim A_D = 7, r_0 = 14; dim + r_raw = 14, dim + r_0 = 16
   X^2 T_1 + C G, g3 = nu L^3, g2 = mu L^2, L = Y (dim 2) [2], G = Xq*Yq^2 + Yq^3: r_raw = 12, dim A_D = 7, r_0 = 14; dim + r_raw = 14, dim + r_0 = 16
   X^2 T_1 + C G, g3 = 0, g2 not a square (dim 2) [2], G = Xq*Yq*Zq: r_raw = 12, dim A_D = 6, r_0 = 12; dim + r_raw = 14, dim + r_0 = 14
   X^2 T_1 + C G, g3 = 0, g2 = L^2, L != Y (dim 1): F3 [1], G = Xq*Zq^2: r_raw = 12, dim A_D = 7, r_0 = 14; dim + r_raw = 13, dim + r_0 = 15
   X^2 T_1 + C G, g3 = 0, g2 = Y^2 (dim 0): F3 [0], G = Xq*Yq^2: r_raw = 13, dim A_D = 7, r_0 = 14; dim + r_raw = 13, dim + r_0 = 14
  ok   flags containing X^2 T_1: dim + r_raw <= 17 and dim + r_0 <= 18 on every stratum
   curvilinear 3 at X (z = y^2) + P = [1:2:3] (dim 3): D = [1/6*Xq^3, 1/2*Xq^2*Yq, -4/3*Yq^3 + 1/2*Xq^2*Zq - 6*Xq*Yq*Zq - 6*Yq^2*Zq - 9/2*Xq*Zq^2 - 9*Yq*Zq^2 - 9/2*Zq^3, 1/2*Xq*Yq^2 + 4/3*Yq^3 + 6*Xq*Yq*Zq + 6*Yq^2*Zq + 9/2*Xq*Zq^2 + 9*Yq*Zq^2 + 9/2*Zq^3]: r_raw = 12, r_0 = 12
   curvilinear 3 at X (z = y^2) + P = [1:2:4] (on the conic): D = [1/6*Xq^3, 1/2*Xq^2*Yq, 1/2*Xq*Yq^2 + 1/2*Xq^2*Zq, 1/6*Yq^3 + Xq*Yq*Zq + Yq^2*Zq + Xq*Zq^2 + 2*Yq*Zq^2 + 4/3*Zq^3]: r_raw = 12, r_0 = 12
   curvilinear 3 at X (z = y^2) + P = Z: D = [1/6*Xq^3, 1/2*Xq^2*Yq, 1/2*Xq*Yq^2 + 1/2*Xq^2*Zq, 1/6*Zq^3]: r_raw = 12, r_0 = 12
   curvilinear 3 at X (z = y^2) + P = Y: D = [1/6*Xq^3, 1/2*Xq^2*Yq, 1/2*Xq*Yq^2 + 1/2*Xq^2*Zq, 1/6*Yq^3]: r_raw = 12, r_0 = 12
   curvilinear 3 at X (z = y^2) + P = [1:1:0]: D = [1/6*Xq^3, 1/2*Xq^2*Yq, -1/6*Yq^3 + 1/2*Xq^2*Zq, 1/2*Xq*Yq^2 + 1/6*Yq^3]: r_raw = 12, r_0 = 12
   curvilinear 3 on the line z = 0 + P = Z: D = [1/6*Xq^3, 1/2*Xq^2*Yq, 1/2*Xq*Yq^2, 1/6*Zq^3]: r_raw = 12, r_0 = 12
   curvilinear 3 on the line z = 0 + P = Y: D = [1/6*Xq^3, 1/2*Xq^2*Yq, 1/2*Xq*Yq^2, 1/6*Yq^3]: r_raw = 12, r_0 = 12
   curvilinear 3 on the line z = 0 + P = [1:2:3]: D = [1/6*Xq^3, 1/2*Xq^2*Yq, 4/9*Yq^3 + 1/2*Xq^2*Zq + 2*Xq*Yq*Zq + 2*Yq^2*Zq + 3/2*Xq*Zq^2 + 3*Yq*Zq^2 + 3/2*Zq^3, 1/2*Xq*Yq^2]: r_raw = 12, r_0 = 12
   curvilinear 4 at X, z = y^2 + y^3: D = [1/6*Xq^3, 1/2*Xq^2*Yq, 1/6*Yq^3 + 1/2*Xq^2*Zq + Xq*Yq*Zq, 1/2*Xq*Yq^2 - 1/6*Yq^3 - Xq*Yq*Zq]: r_raw = 12, r_0 = 12
   curvilinear 4 at X, z = y^2: D = [1/6*Xq^3, 1/2*Xq^2*Yq, 1/2*Xq*Yq^2 + 1/2*Xq^2*Zq, 1/6*Yq^3 + Xq*Yq*Zq]: r_raw = 12, r_0 = 12
   curvilinear 4 at X, z = y^3: D = [1/6*Xq^3, 1/2*Xq^2*Yq, 1/6*Yq^3 + 1/2*Xq^2*Zq, 1/2*Xq*Yq^2]: r_raw = 12, r_0 = 12
   curvilinear 4 at X on the line z = 0: D = [1/6*Xq^3, 1/2*Xq^2*Yq, 1/2*Xq*Yq^2, 1/6*Yq^3]: r_raw = 12, r_0 = 12
   D = C[X,Y]_3: r_raw = 12, r_0 = 12
  ok   curvilinear bad flags (dim <= 3) and C[X,Y]_3: the bounds hold
  ok   dim A_D <= 7 on random flags
Part D: delta != 0
  ok   (L4z) holds identically for Phi5 = Phi5^0 + phi, phi in C[X,Y]_5 + <X^4Z, X^3YZ>
  ok   (L3Psi z): z o Psi4 lies in E0 identically: (1/(2*de)*q2 + (-5*be*ga)/(21*de))*XD^3 + (2*ga)/7*XD^2*YD
   wbar = class of (L3Psi y) modulo E0 = (6/de*p4 + (-4*de)/35)*XD*YD^2 + 10/de*p5*YD^3
  ok   wbar lies in <XY^2, Y^3> and equals ((12 p4 - 8 de^2/35) X Y^2 + 20 p5 Y^3)/(2 de)
Part E: members of the two delta != 0 families with certified complete intersections
   first family (wbar = 0): D = <X^3, X^2Y, XZ^2, YZ^2>, Phi = X^7 + X^4Y^2 + X^3Y^2 + (2/105) XY^4: closed True, H = [1, 3, 6, 4, 2, 2, 1, 1], delta = 1, wbar = 0
      complete intersection (1/420*x^4*y - 1/105*x^3*y + y^3, x^2*z, -1/420*x^5 - 1/105*x^4 + x*y^2 + y^2*z + z^3): local length 32 (dim S/(C + m^N) = 32 for N = 10 and N = 11)
  ok   first family (wbar = 0): D = <X^3, X^2Y, XZ^2, YZ^2>, Phi = X^7 + X^4Y^2 + X^3Y^2 + (2/105) XY^4: member of the family, all three generators in Ann(M), local length 32 = 32 < 40
   second family (wbar != 0, wbar in D/E0): D = <X^3, X^2Y, XY^2, XZ^2>, Phi = X^7 + X^4Y^2: closed True, H = [1, 3, 6, 4, 2, 2, 1, 1], delta = 1, wbar = -4/35*Xq*Yq^2
      complete intersection (y^3, x^2*z, -1/105*x^5 + x^2*y^2 + y^2*z + z^3): local length 33 (dim S/(C + m^N) = 33 for N = 10 and N = 11)
  ok   second family (wbar != 0, wbar in D/E0): D = <X^3, X^2Y, XY^2, XZ^2>, Phi = X^7 + X^4Y^2: member of the family, all three generators in Ann(M), local length 33 = 33 < 40
total time 18.3 s
ALL CHECKS PASSED
