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.
The finset consisting of 4 and all odd primes at most m.
Equations
- VWPair.fourAndOddPrimes m = insert 4 ({p ∈ Finset.Icc 3 m | Nat.Prime p})
Instances For
crtShift v w m is a number that can be added to v, w such that
This number is calculated through the Chinese remainder theorem.
Equations
- VWPair.crtShift v w m = ↑(Nat.chineseRemainderOfFinset (VWPair.nonDividingShift v w) id (VWPair.fourAndOddPrimes m) ⋯ ⋯)
Instances For
An (n + 3)-tuple reducing to chainTup n m s.
Equations
- vwTup vw i = Fin.addCases (fun (x : Fin n) => ↑(primeChain s ↑x)) (fun (x : Fin 3) => match x with | 0 => ↑vw.v | 1 => -↑vw.w | 2 => ↑m) i