--- id: QuantumShorOrderRecoveryGCD language: en section: quantum-physics source: Verification/QuantumShorOrderRecoveryGCD.lean source_sha256: 7b03dc9718cc36065b2f667d5799fb03d0cd007a38d185f853640f12ac6c1f8b novelty: not-assessed status: reviewed --- # Conditional Shor order recovery by finite LCM and GCD [Section](../quantum-physics/README.md) · [Lean](../../Verification/QuantumShorOrderRecoveryGCD.lean) ## Executable procedure and algebra listLCM accepts only a finite list of natural-number candidates, recurses structurally, and returns one on the empty list. Neither the unknown order r nor spectral numerators are inputs. list_lcm_append proves incremental combination; list_lcm_membership_invariant proves independence from ordering and duplicate occurrences. No running-time or bit complexity bound is asserted. For any qs with every q dividing r, list_lcm_dvd_order proves listLCM qs divides r. When r>0, divisibility excludes zero candidates and makes the LCM positive. For a nonempty list, order_recovery_criterion_quotients proves listLCM qs = r iff foldr (gcd ∘ (r / ·)) 0 qs = 1. Nonemptiness matters: the empty LCM is one but the empty unanchored GCD is zero. Empty input recovers order one only. The proof uses the divisor-lattice complement identity from pinned Mathlib Nat.div_lcm_eq_div_gcd, not a new number-theoretic principle. spectral_lcm_formula proves LCM(map (r / gcd(s,r)) ss) = r / gcd(r, foldr gcd 0 ss), and order_recovery_spectral_gcd gives equality to r exactly when the anchored GCD is one. This holds for all finite lists including empty lists, for r>0. Numerators need not be coprime individually: r=6 and ss=[3,2] give denominators [2,3] and LCM 6. Zero spectral numerators give denominator one and need not reveal the order. ## Connection to measurements and the executable modular check reduced_denominators_eq reuses module 119's canonical rational denominators. shor_order_recovery_criterion instantiates the algebra for the existing Shor Parameters: N≥2, coprime a,N, padded finite target register, and actual positive period r=orderOf(a : ZMod N). It is a deterministic conditional theorem, not a distribution of repeated quantum measurements. measured_candidate_provenance assumes Q=2^n≥N² and the existing modular Nearest condition for each pair of latent spectral label s