# Re-run of release/reproducibility/check_note.py (version 1 of the package), verification run 2, 2026-10-16
# source: release/source.zip (sha256 3f01585ac89044bf9a87c116a6a35d298b6791bda0f9d2cd7d8335dd1e44591b), unpacked into an empty scratch folder;
# command: python3 -I reproducibility/check_note.py (Python 3.13.5, numpy 2.5.2, sympy 1.14.0), run from another folder.
# diff with the recorded check_note_output.txt: only the line 'total time' differs (8.2 s here, 8.1 s recorded).
# exit code 0; 29 checks, all PASS.

check_note.py: Python 3.13.5, numpy 2.5.2, sympy 1.14.0
(i) brute force over all permutations, n = 1..10 (2.0 s)
    |C_n|                                        [1, 2, 6, 21, 77, 290, 1118, 4398, 17595, 71385]
    sum-indecomposable members of C              [1, 1, 3, 10, 34, 120, 440, 1665, 6460, 25570]
    skew-indecomposable members of C             [1, 1, 3, 11, 43, 170, 678, 2733, 11135, 45815]
    separable permutations                       [1, 2, 6, 22, 90, 394, 1806, 8558, 41586, 206098]
    Av(231)                                      [1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796]
    Av(2143,2413,3142)                           [1, 2, 6, 21, 79, 311, 1265, 5275, 22431, 96900]
    skew-indecomposable separable 123-avoiders   [1, 1, 2, 3, 4, 5, 6, 7, 8, 9]
PASS  (i) every array row is a permutation, n! rows, all distinct (n <= 10)
PASS  (i) control: |Av(231)_n| = Catalan numbers (n <= 10)
PASS  (i) Av(231) is contained in C (n <= 10)
PASS  (i) Lemma 3.3: 1 of length 1 and n-1 of length n >= 2 (n <= 10)
(i) generating tree, n = 1..12 (5.9 s): [1, 2, 6, 21, 77, 290, 1118, 4398, 17595, 71385, 293042, 1215035]
PASS  (i) generating tree = brute force for n <= 10
(ii) specification to order 15:
    f: [1, 1, 2, 6, 21, 77, 290, 1118, 4398, 17595, 71385, 293042, 1215035, 5081259, 21408350, 90786332]
    E: [0, 1, 1, 3, 10, 34, 120, 440, 1665, 6460, 25570, 102868, 419418, 1729346, 7198540, 30209860]
    I: [0, 1, 1, 3, 11, 43, 170, 678, 2733, 11135, 45815, 190174, 795617, 3351913, 14209810, 60576472]
PASS  (ii) specification = brute force for n <= 10 (f, E and I)
PASS  (ii) specification = generating tree for n <= 12
PASS  (ii) (S1), (S2), (S3) separately on the brute-force series (order 10)
PASS  (ii) eliminating I from (S2), (S3) gives +-[(1-z)^2 E^2 - (1-2z) E + z(1-z)^2]
PASS  (ii) E = 1 - 1/f turns it into +-(P f^2 - Q f + R)
PASS  (ii) D = Q^2 - 4PR = 1 - 8z + 20z^2 - 24z^3 + 16z^4 - 4z^5
PASS  (ii) P f^2 - Q f + R = O(z^16) on the series
PASS  (ii) (Q - 2Pf)^2 = D + O(z^16) on the series
PASS  (ii) closed form (Q - sqrt(D))/(2P) re-expands to the series to order 15
    factor_list(D) over Q: (-1, [(4*z**5 - 16*z**4 + 24*z**3 - 20*z**2 + 8*z - 1, 1)])
PASS  (ii) D is irreducible over Q
    D mod 5 = z**5 + z**4 + z**3 + 2*z + 1
    D mod 5 at z = 0..4: [1, 1, 1, 3, 3]
    remainders of D mod 5 by the 10 monic irreducible quadratics over GF(5):
        z**2 + 2       -> -z
        z**2 - 2       -> -2*z
        z**2 + z + 1   -> 2*z + 1
        z**2 + z + 2   -> -2*z - 1
        z**2 + 2*z - 2 -> z + 2
        z**2 + 2*z - 1 -> 2 - z
        z**2 - 2*z - 2 -> -2*z - 1
        z**2 - 2*z - 1 -> -2*z
        z**2 - z + 1   -> 1
        z**2 - z + 2   -> 2*z + 2
PASS  (ii) D mod 5 has degree 5, no root and no monic irreducible quadratic factor (so it is irreducible)
    the same remainders with coefficients in 0..4: [((0, 2), (4, 0)), ((0, 3), (3, 0)), ((1, 1), (2, 1)), ((1, 2), (3, 4)), ((2, 3), (1, 2)), ((2, 4), (4, 2)), ((3, 3), (3, 4)), ((3, 4), (3, 0)), ((4, 1), (0, 1)), ((4, 2), (2, 2))]
PASS  (ii) the ten quadratics and remainders printed in Proposition 4.6
PASS  (ii) gcd(D, (1-4z)(1-z)(1-5z)) = 1
    D(1/4) = -17/256,  D(1/5) = 101/3125,  D(1) = 1
PASS  (ii) D(1/4) = -17/256, D(1/5) = 101/3125, D(1) = 1 (as printed)
    D/c for c = 1               : factor_list(D*c) = (-1, [(4*z**5 - 16*z**4 + 24*z**3 - 20*z**2 + 8*z - 1, 1)])
    D/c for c = a = 1-4z        : factor_list(D*c) = (1, [(4*z - 1, 1), (4*z**5 - 16*z**4 + 24*z**3 - 20*z**2 + 8*z - 1, 1)])
    D/c for c = b = (1-z)(1-5z) : factor_list(D*c) = (-1, [(z - 1, 1), (5*z - 1, 1), (4*z**5 - 16*z**4 + 24*z**3 - 20*z**2 + 8*z - 1, 1)])
    D/c for c = ab              : factor_list(D*c) = (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)])
PASS  (ii) D/c is not a square in Q(z) for c in {1, a, b, ab} (so sqrt(D) is not in K)
PASS  (ii) control: Catalan discriminant 1-4z is a square in K (class a)
PASS  (ii) control: the source's discriminant 1-6z+5z^2 is a square in K (class b)
PASS  (ii) control: the separable discriminant 1-6z+z^2 is not a square in K
PASS  (ii) normalisation: [z^n] (1-z-sqrt(1-6z+z^2))/(2z) = number of separable permutations of length n+1
PASS  (ii) Table 1 as printed (brute force and specification)
PASS  (ii) |C_n| for n = 11..15 as printed: 293042, 1215035, 5081259, 21408350, 90786332
PASS  (ii) small containment claims of Theorem 1.1(a), Lemma 3.3 and Sections 5.1, 5.2, 5.4
(iii) series of 2/(1+z+sqrt(1-6z+5z^2)): [1, 1, 2, 6, 21, 79, 311, 1265, 5275, 22431, 96900]
PASS  (iii) brute-force counts of Av(2143,2413,3142) = series of 2/(1+z+sqrt(1-6z+5z^2)) for n <= 10
PASS  (iii) z(z-2) g^2 + (z+1) g - 1 = O(z^11), discriminant (z+1)^2 + 4z(z-2) = b
total time 8.2 s
ALL CHECKS PASSED
