Documentation

LeanPool.ParameterFreeGradient.O3.Stage9Execution

Stage 9: actual finite-data OGM-G execution #

This module implements the literal deterministic recursion from TeX Lemma lem:ogmg. It contains no convergence conclusion and no algebraic certificate: its only job is to expose the actual queried data, the complete ordered-pair interpolation checks, and the final descent query.

The phase-B trace deliberately omits u₀ = U, which is reused from Phase A, and contains exactly the newly queried points u₁, …, uₙ, vₙ.

Data fixed before running the finite OGM-G phase. The coefficient function is kept explicit here so the execution algebra can also be reused by the coefficient auditor; the source run below instantiates it by the frozen backward theta sequence.

  • horizon : ℕ

    The number of iterations in the OGM-G execution.

  • oracle : PairOracle d

    The value-gradient oracle queried by the execution.

  • M : ℝ

    The smoothness estimate used to scale the gradient steps.

  • U : Vec d

    The starting point of the OGM-G execution.

  • theta : ℕ → ℝ

    The momentum coefficient sequence supplied to the execution.

Instances For
    noncomputable def O3.stage9ExecutionConfig {d : ℕ} (n : ℕ) (oracle : PairOracle d) (M : ℝ) (U : Vec d) :

    The source-exact configuration: no theta sequence is supplied by the caller; it is the frozen special-zero/backward-tail sequence for horizon n.

    Equations
    Instances For
      @[simp]
      theorem O3.stage9ExecutionConfig_horizon {d : ℕ} (n : ℕ) (oracle : PairOracle d) (M : ℝ) (U : Vec d) :
      @[simp]
      theorem O3.stage9ExecutionConfig_theta {d : ℕ} (n i : ℕ) (oracle : PairOracle d) (M : ℝ) (U : Vec d) :
      structure O3.OGMGExecutionState (d : ℕ) :

      At the beginning of iteration i, current is u_i and previousV is v_(i-1). Thus the initial previous point is literally v_(-1)=U.

      • current : Vec d

        The current query point u_i at the beginning of an iteration.

      • previousV : Vec d

        The previous gradient-step point v_(i-1), initialized at the starting point.

      Instances For
        noncomputable def O3.ogmgExecutionStep {d : ℕ} (cfg : OGMGExecutionConfig d) (i : ℕ) (state : OGMGExecutionState d) :

        One literal source step.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          noncomputable def O3.ogmgState {d : ℕ} (cfg : OGMGExecutionConfig d) :

          Primitive-recursive actual execution, beginning from u_0=U, v_(-1)=U.

          Equations
          Instances For
            noncomputable def O3.ogmgObservation {d : ℕ} (cfg : OGMGExecutionConfig d) (i : ℕ) :

            The actual observation at u_i.

            Equations
            Instances For
              noncomputable def O3.ogmgGradient {d : ℕ} (cfg : OGMGExecutionConfig d) (i : ℕ) :
              Vec d

              The actual queried gradient g_i.

              Equations
              Instances For
                noncomputable def O3.ogmgV {d : ℕ} (cfg : OGMGExecutionConfig d) (i : ℕ) :
                Vec d

                The literal gradient point v_i=u_i-g_i/M.

                Equations
                Instances For
                  @[simp]
                  @[simp]
                  @[simp]
                  @[simp]
                  @[simp]
                  theorem O3.ogmgGradient_eq {d : ℕ} (cfg : OGMGExecutionConfig d) (i : ℕ) :
                  theorem O3.ogmgV_eq {d : ℕ} (cfg : OGMGExecutionConfig d) (i : ℕ) :
                  ogmgV cfg i = (ogmgState cfg i).current - cfg.M⁻¹ • ogmgGradient cfg i
                  @[simp]
                  theorem O3.ogmgState_succ_previousV {d : ℕ} (cfg : OGMGExecutionConfig d) (i : ℕ) :
                  (ogmgState cfg (i + 1)).previousV = ogmgV cfg i
                  theorem O3.ogmgState_succ_current {d : ℕ} (cfg : OGMGExecutionConfig d) (i : ℕ) :
                  (ogmgState cfg (i + 1)).current = ogmgV cfg i + ((cfg.theta i - 1) * (2 * cfg.theta (i + 1) - 1) / (cfg.theta i * (2 * cfg.theta i - 1))) • (ogmgV cfg i - (ogmgState cfg i).previousV) + ((2 * cfg.theta (i + 1) - 1) / (2 * cfg.theta i - 1)) • (ogmgV cfg i - (ogmgState cfg i).current)

                  The actual source recurrence with its coefficients unchanged.

                  theorem O3.stage9Execution_succ_current {d : ℕ} (n : ℕ) (oracle : PairOracle d) (M : ℝ) (U : Vec d) (i : ℕ) :
                  (ogmgState (stage9ExecutionConfig n oracle M U) (i + 1)).current = ogmgV (stage9ExecutionConfig n oracle M U) i + ((stage9Theta n i - 1) * (2 * stage9Theta n (i + 1) - 1) / (stage9Theta n i * (2 * stage9Theta n i - 1))) • (ogmgV (stage9ExecutionConfig n oracle M U) i - (ogmgState (stage9ExecutionConfig n oracle M U) i).previousV) + ((2 * stage9Theta n (i + 1) - 1) / (2 * stage9Theta n i - 1)) • (ogmgV (stage9ExecutionConfig n oracle M U) i - (ogmgState (stage9ExecutionConfig n oracle M U) i).current)

                  The recurrence specialized to the non-user-supplied, source-exact theta coefficients.

                  theorem O3.stage9Execution_theta_denominators_pos {d : ℕ} (n i : ℕ) (oracle : PairOracle d) (M : ℝ) (U : Vec d) :
                  0 < (stage9ExecutionConfig n oracle M U).theta i ∧ 0 < 2 * (stage9ExecutionConfig n oracle M U).theta i - 1
                  theorem O3.ogmg_velocity_p_relation {d : ℕ} (cfg : OGMGExecutionConfig d) (hM : cfg.M ≠ 0) (hθ : ∀ (i : ℕ), cfg.theta i ≠ 0) (hden : ∀ (i : ℕ), 2 * cfg.theta i - 1 ≠ 0) (i : ℕ) :
                  cfg.M • (ogmgV cfg i - (ogmgState cfg i).previousV) = -cfg.theta i • (stage9P cfg.theta (ogmgGradient cfg) i + stage9P cfg.theta (ogmgGradient cfg) (i + 1))

                  The actual iterate recursion produces the precise velocity identity used by the frozen quadratic telescoping proof. This is proved for every natural index, hence in particular at the terminal endpoint i=n; no extrapolated iterate hypothesis is introduced.

                  theorem O3.stage9Execution_velocity_p_relation {d : ℕ} (n : ℕ) (oracle : PairOracle d) (M : ℝ) (U : Vec d) (hM : M ≠ 0) (i : ℕ) :
                  have cfg := stage9ExecutionConfig n oracle M U; M • (ogmgV cfg i - (ogmgState cfg i).previousV) = -stage9Theta n i • (stage9P (stage9Theta n) (ogmgGradient cfg) i + stage9P (stage9Theta n) (ogmgGradient cfg) (i + 1))

                  Source-exact specialization of the velocity identity.

                  theorem O3.ogmgState_previousV {d : ℕ} (cfg : OGMGExecutionConfig d) (i : ℕ) :
                  (ogmgState cfg (i + 1)).previousV = ogmgV cfg i

                  For every positive index the stored predecessor is the actual preceding gradient point.

                  noncomputable def O3.ogmgNewIterates {d : ℕ} (cfg : OGMGExecutionConfig d) :
                  Fin cfg.horizon → Vec d

                  The n new iterate queries u_1,…,u_n, indexed without a phantom query.

                  Equations
                  Instances For
                    noncomputable def O3.ogmgTerminalObservation {d : ℕ} (cfg : OGMGExecutionConfig d) :

                    The final extra query is at exactly v_n.

                    Equations
                    Instances For
                      noncomputable def O3.ogmgExecutionTrace {d : ℕ} (cfg : OGMGExecutionConfig d) :

                      Phase-B calls only: u_1,…,u_n,v_n.

                      Equations
                      Instances For

                        The additional terminal point v_n is genuinely queried.

                        For a nonzero horizon, u_n is one of the newly queried iterates.

                        noncomputable def O3.ogmgDataObservation {d : ℕ} (cfg : OGMGExecutionConfig d) (i : Fin (cfg.horizon + 1)) :

                        The reused point u₀=U and every subsequently queried u_i, including u_n, as an actual oracle observation.

                        Equations
                        Instances For
                          noncomputable def O3.ogmgFunctionValue {d : ℕ} (cfg : OGMGExecutionConfig d) (i : ℕ) :

                          Scalar/vector projections of the actual finite data, ready for the algebraic certificate. These are definitions, not freely supplied arrays.

                          Equations
                          Instances For
                            noncomputable def O3.ogmgGradientSq {d : ℕ} (cfg : OGMGExecutionConfig d) (i : ℕ) :

                            The squared Euclidean norm of the gradient at an execution query.

                            Equations
                            Instances For
                              noncomputable def O3.ogmgPairTerm {d : ℕ} (cfg : OGMGExecutionConfig d) (i j : ℕ) :

                              The gradient at query j paired with the difference of gradient-step points i and j.

                              Equations
                              Instances For
                                @[simp]
                                theorem O3.ogmgPairTerm_self {d : ℕ} (cfg : OGMGExecutionConfig d) (i : ℕ) :
                                ogmgPairTerm cfg i i = 0
                                noncomputable def O3.ogmgInterpolationCheck {d : ℕ} (cfg : OGMGExecutionConfig d) (i j : Fin (cfg.horizon + 1)) :

                                The observable ordered interpolation check for (i,j).

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For

                                  A concrete list containing all (n+1)^2 ordered interpolation checks.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For

                                    All ordered-pair finite-data interpolation guards pass.

                                    Equations
                                    Instances For

                                      The source terminal guard is the actual upper-model check at the extra query v_n.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For

                                        Exact displacement of the queried terminal gradient point.

                                        With M>0, the actual queried upper-model check at v_n=u_n-g_n/M is exactly the terminal descent inequality printed in the source.

                                        noncomputable def O3.ogmgExecutionGuards {d : ℕ} (cfg : OGMGExecutionConfig d) :

                                        All Stage-9 observable guards, without any algebraic certificate field.

                                        Equations
                                        Instances For