NLA-lib Explorer

NLAlib.SpectralBisection.measureReal_not_isApproxDiagonalization_tapeMachine_le

Library · theorem

Random tape

Under the original explicit numerical hypotheses, the actual rounded tape reference fails to approximately diagonalize the input with probability at most theta. The absolute-error floor is explicit and must satisfy the stated smallness bound. Ops.StdModel.isAccurate_toFloatMachine supplies its zero-floor numerical machine hypothesis from standard scalar rounding, seed-rounding bounds/ranges, multiplication's radius-preservation property, and the same matrix routines' accuracy contracts.

NLAlib.SpectralBisection.measureReal_not_isApproxDiagonalization_tapeMachine_le {K : Type}
  [MeasurableSpace K] [MeasurableSingletonClass K] (M : Ops.Machine K) (dec : K → ℝ)
  (mm : MatMulMap (K × K)) (qr : QRMap (K × K)) (roundUnif roundGaussian : ℝ → K)
  {u floor bound cN : ℝ} {muM muQ : ℕ → ℝ}
  (hAcc :
    (M.toFloatMachine dec (fun {l m n} ↦ mm) (fun {m n} ↦ qr) (M.uniformSample roundUnif)
          (M.normalSample roundGaussian)).IsAccurate
      dec u floor bound muM muQ cN)
  (hUnif : Measurable roundUnif) (hGaussian : Measurable roundGaussian)
  (hUnifRange : (Set.range roundUnif).Countable)
  (hGaussianRange : (Set.range roundGaussian).Countable) (hMuM : Monotone muM) (hMuQ : Monotone muQ)
  (hMuM0 : 0 ≤ muM 0) (hMuQ0 : 0 ≤ muQ 0) (hCN : 0 ≤ cN) {n : ℕ} (hn : 1 ≤ n)
  (A : Matrix (Fin n) (Fin n) (K × K)) (hA : (decodeMatrix dec A).IsHermitian) (R0 eps beta : K)
  {theta : ℝ} (hRadius : specNorm (decodeMatrix dec A) ≤ dec R0) (hRadiusPos : 0 < dec R0)
  (hEps : 0 < dec eps) (hEpsMax : dec eps ≤ 2⁻¹ ^ 15) (hTheta : 0 < theta) (hThetaMax : theta ≤ 1)
  (ell : ℕ) (hDepth : bisectionDepth (dec eps) ≤ ell) (hBeta : 0 < dec beta)
  (hBetaMax :
    dec beta ≤
      (↑ell - 1) ^ 2 * dec eps * √theta /
        (52 * ↑ell ^ 2 * (2 * ↑ell - 1) * √(↑n * min (↑n) (↑ell + 1) * min (↑n) (rexp 1)) *
          (2 * √2 * √↑n + √(Real.log (96 * ↑n * min (↑n) (↑ell + 1) / theta)))))
  {steps : ℝ}
  (hSteps :
    steps = newtonSchulzSteps (theta / (12 * ↑n * ↑ell * (↑ell + 1))) (dec beta / (16 * ↑n)))
  (hSign : 146 * ↑n * ↑ell * (↑ell + 1) * (4 * muM n + 10 + 10 * √↑n) * u ≤ theta * dec beta)
  (hStop : 2048 * (↑n + steps + 1) * (4 * muM n + 10 + 10 * √↑n) * u ≤ dec beta)
  (hDeflate : 16 * (4 * muQ n + 4 * √↑n * (cN + 1) + 2 * muM n + 1) * u ≤ dec beta) (fuel : ℕ)
  (hFuel : steps ≤ ↑fuel) (hFloorNonneg : 0 ≤ floor)
  (hFloor :
    floor * (100 * ↑n * √↑n) ≤
      min (√(theta / (8 * ↑n * min (↑n) (↑ell + 1)))) (dec eps * min (dec R0) 1))
  (hBound :
    16 *
        (2 * dec R0 + ↑n + 2 * ↑ell + 2 * √2 * √↑n +
          √(Real.log (96 * ↑n * min (↑n) (↑ell + 1) / theta))) ≤
      bound)
  {Omega : Type} [MeasurableSpace Omega] {P : Measure Omega} {law : ℕ → Measure ℝ}
  {ideal : Omega → Ops.Tape ℝ} (hTape : Ops.IsTapeLaw law P ideal)
  (hStream : ∀ (d : Computation.Dist), law (SpectralBisection.distributionStream d) = d.law)
  (base : ℕ) :
  P.real
      {omega |
        have T :=
          SpectralBisection.tapeMachine M dec (fun {l m n} ↦ mm) (fun {m n} ↦ qr) n base
            (SpectralBisection.roundTape roundUnif roundGaussian (ideal omega));
        have result :=
          eigh T fuel ell A R0 eps beta
            (eighSlotTree T n fuel R0 beta 0 0 { k := n, A := A, R := R0, ε := eps, ℓ := ell });
        ¬IsApproxDiagonalization (decodeMatrix dec A) (decodeMatrix dec result.1)
            (fun i ↦ dec (result.2 i)) (2 * dec eps * dec R0) (dec eps / 3)} ≤
    theta

Full source on GitHub

Import NLAlib.Eigensolvers.SpectralBisection.Probability.