Documentation

LeanPool.Redhill.Common.VWPair

VW pairs #

The paper stipulates u < 0 < m and w ≤ 0 < v. These bounds are formalised by typing all four variables as natural numbers, negating u and w as needed.

The bound w ≤ (m + 1) * primorial m is not used in any proof and has been removed. The bound primorial m < v has been simplified to m < v.

Note that the paper's algorithm does not necessarily guarantee q < v (without the negations performed in this file). For example, take m = 5, q = 30, u = -2, then step 1 sets v = 29, w = -31 and both numbers are unchanged in the rest of the algorithm because 29 and 31 are big primes.

The coprimality condition only requires 0 < u ≤ m and is proved separately.

structure VWPair (u m : ) :

VWPair u m holds v and w and states that -u, m, v, -w satisfy the conditions in Lemma 2.2.

Instances For
    theorem VWPair.nonempty_double_not_dvd (v w p : ) (hp : 3 p) :
    {i : Fin p | ¬p v + i ¬p w + i}.Nonempty
    theorem VWPair.nonempty_double_not_dvd_four (v w : ) :
    {i : Fin 4 | ¬4 v + i ¬2 w + i}.Nonempty

    Note the divisor of 2 and not 4 for w.

    The finset consisting of 4 and all odd primes at most m.

    Equations
    Instances For

      Produce a number i < p such that v + i and w + i are both not divisible by p. When p = 4, w + i is additionally guaranteed to be odd. Return 0 for p ≤ 2.

      Equations
      Instances For
        def VWPair.crtShift (v w m : ) :

        crtShift v w m is a number that can be added to v, w such that

        • no number in [3,m] divides the resulting v or w
        • the resulting w is odd.

        This number is calculated through the Chinese remainder theorem.

        Equations
        Instances For
          theorem VWPair.crtShift_not_dvd {v w m k : } (hk : k Finset.Icc 3 m) :
          ¬k v + crtShift v w m ¬k w + crtShift v w m
          theorem VWPair.odd_add_crtShift {v w m : } :
          Odd (w + crtShift v w m)
          def VWPair.of (u m : ) :
          VWPair u m

          Lemma 2.2. A VWPair u m always exists.

          Equations
          Instances For
            theorem VWPair.of_coprime {u m : } (hu : 0 < u) (hm : u m) :
            (of u m).v.Coprime (of u m).w

            When 0 < u ≤ m, v and w are coprime.

            def vwTup {n m s B : } (vw : VWPair (m + iFinset.range n, primeChain s i) B) (i : Fin (n + 3)) :

            An (n + 3)-tuple reducing to chainTup n m s.

            Equations
            Instances For
              theorem isSubsumBlock_vwTup {n m s B : } {vw : VWPair (m + iFinset.range n, primeChain s i) B} (hB : m + iFinset.range n, primeChain s i B) :
              theorem tupReduce_vwTup {n m s B : } {vw : VWPair (m + iFinset.range n, primeChain s i) B} {c₂ : n + 1 = n + 3 - {Fin.natAdd n 0, Fin.natAdd n 1}.card} :
              theorem strongSSC_vwTup {n m s B : } {vw : VWPair (m + iFinset.range n, primeChain s i) B} (hm : 0 < m) (hs : m s) (hB : m + iFinset.range n, primeChain s i B) :