{
  "schema_version": "ocme-derivation-reader-v1",
  "guide_id": "derivation-mko-gradient-descent-01",
  "mko_id": "mko-gradient-descent",
  "title": {
    "zh-Hant": "正對角二次函數的安全下降步",
    "en": "Safe descent steps for a positive diagonal quadratic"
  },
  "contract": {
    "schema_version": "ocme-derivation-guide-v0.1",
    "guide_id": "derivation-mko-gradient-descent-01",
    "source": {
      "mko_id": "mko-gradient-descent",
      "commit": "b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f",
      "sha256": "b886e6f39050667744f8b88cc6e5d065b39d33d9bbcaf87612a4129ae035973b",
      "english_sha256": "0e010c35c5db93d7d0e7c33c6218d6f9ae774248a498ad97fc98c2be454a1fef"
    },
    "mode": "algorithm_trace",
    "audience_prerequisites": [
      "algebra",
      "polynomial",
      "gd_update"
    ],
    "goal": {
      "zh-Hant": "以 alpha=1/4 對指定二次函數做兩步並證每步下降條件。",
      "en": "Take two steps with alpha=1/4 for a specified quadratic and prove the per-step descent condition."
    },
    "givens": [
      {
        "id": "G1",
        "statement": {
          "zh-Hant": "f(x,y)=x^2+2y^2-2x+4y，d=(2,4)>0，線性係數 b=(-2,4)，起點 z_0=(0,0)，alpha=1/4。",
          "en": "f(x,y)=x^2+2*y^2-2*x+4*y, d=(2,4)>0, linear b=(-2,4), start z_0=(0,0), alpha=1/4."
        }
      }
    ],
    "steps": [
      {
        "id": "S01",
        "uses": [
          "G1"
        ],
        "before_tex": "f=\\tfrac12(2x^2+4y^2)-2x+4y",
        "after_tex": "\\nabla f=(2x-2,4y+4),\\quad\\text{coordinate order }(x,y)",
        "relation": "implies",
        "rule": "polynomial",
        "conditions": [],
        "explanation": {
          "zh-Hant": "維度、正對角、線性向量與座標全部對齊，完整多項式全域可微。",
          "en": "Dimension, positive diagonal, linear vector and coordinates align, and the full polynomial is globally differentiable."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1"
          ],
          "explanation": {
            "zh-Hant": "不是只依某個偏導更新兩個座標。",
            "en": "Both coordinates use the complete gradient, not one partial."
          }
        },
        "leaf_basis": "polynomial"
      },
      {
        "id": "S02",
        "uses": [
          "G1",
          "S01"
        ],
        "before_tex": "L=\\max\\{2,4\\}=4",
        "after_tex": "0<\\alpha=1/4<2/L=1/2",
        "relation": "implies",
        "rule": "algebra",
        "conditions": [],
        "explanation": {
          "zh-Hant": "本 safe trace 明確核額外安全區間，不以 alpha>0 替代。",
          "en": "Explicitly check the additional safe interval rather than substituting alpha>0."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S01"
          ],
          "explanation": {
            "zh-Hant": "one-step 定義與下降條件分開。",
            "en": "The update definition and descent condition are separate."
          }
        },
        "leaf_basis": "algebra"
      },
      {
        "id": "S03",
        "uses": [
          "G1",
          "S01",
          "S02"
        ],
        "before_tex": "\\nabla f(z_0)=(-2,4)",
        "after_tex": "z_1=(0,0)-(1/4)(-2,4)=(1/2,-1)",
        "relation": "implies",
        "rule": "gd_update",
        "conditions": [],
        "explanation": {
          "zh-Hant": "兩座標同時使用同一 alpha，逐項精確算。",
          "en": "Update both coordinates with the same alpha using exact arithmetic."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S01",
            "S02"
          ],
          "explanation": {
            "zh-Hant": "沒有投影回任何未指定限制集合。",
            "en": "No projection onto an unspecified constraint set occurs."
          }
        },
        "leaf_basis": "gd_update"
      },
      {
        "id": "S04",
        "uses": [
          "G1",
          "S03"
        ],
        "before_tex": "f(z_0)=0,\\quad f(z_1)=1/4+2-1-4",
        "after_tex": "f(z_1)=-11/4<0",
        "relation": "implies",
        "rule": "algebra",
        "conditions": [],
        "explanation": {
          "zh-Hant": "獨立回算 objective 確認第一步下降。",
          "en": "Independently recompute the objective to verify the first decrease."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S03"
          ],
          "explanation": {
            "zh-Hant": "iterate 改變與 objective 下降兩項分開核。",
            "en": "The changed iterate and decreased objective are separately verified."
          }
        },
        "leaf_basis": "algebra"
      },
      {
        "id": "S05",
        "uses": [
          "S01",
          "S03",
          "S04"
        ],
        "before_tex": "\\nabla f(z_1)=(-1,0)",
        "after_tex": "z_2=(3/4,-1),\\quad f(z_2)=-47/16<-11/4",
        "relation": "implies",
        "rule": "gd_update",
        "conditions": [],
        "explanation": {
          "zh-Hant": "重算新梯度再更新，第二座標保持 -1，objective 再下降。",
          "en": "Recompute the new gradient; the second coordinate stays -1 and the objective decreases again."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S01",
            "S03",
            "S04"
          ],
          "explanation": {
            "zh-Hant": "不是沿用起點梯度再走同一步。",
            "en": "The starting gradient is not reused for another identical step."
          }
        },
        "leaf_basis": "gd_update"
      },
      {
        "id": "S06",
        "uses": [
          "G1",
          "S01",
          "S02"
        ],
        "before_tex": "g_i=d_i z_i+b_i,\\quad z_i'=z_i-\\alpha g_i",
        "after_tex": "f(z')-f(z)=-\\alpha\\sum_{i=1}^2(1-\\alpha d_i/2)g_i^2\\le0",
        "relation": "implies",
        "rule": "algebra",
        "conditions": [
          "d_i>0,\\quad0<\\alpha<2/L"
        ],
        "explanation": {
          "zh-Hant": "展開每個二次項，線性一階項合成 -alpha*g_i^2，二階項為 alpha^2*d_i*g_i^2/2；安全界使各係數正。",
          "en": "Expand each quadratic: first-order terms combine into -alpha*g_i^2 and second-order terms into alpha^2*d_i*g_i^2/2. The safe interval makes every coefficient positive."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S01",
            "S02"
          ],
          "explanation": {
            "zh-Hant": "全點的一步恆等式可證每個合法 safe step，但有限 trace 仍不等於一般收斂率。",
            "en": "The all-point one-step identity certifies each safe step, but a finite trace still gives no general convergence rate."
          }
        },
        "leaf_basis": "algebra"
      },
      {
        "id": "S07",
        "uses": [
          "G1"
        ],
        "before_tex": "q(u)=u^2/2,\\quad u_0=1,\\quad\\alpha=3>0",
        "after_tex": "u_1=1-3=-2,\\quad q(u_1)=2>1/2=q(u_0)",
        "relation": "implies",
        "rule": "algebra",
        "conditions": [],
        "explanation": {
          "zh-Hant": "正步長若超安全界也可上升，明確反駁 alpha>0 就下降。",
          "en": "A positive step beyond the safe interval can increase the objective, refuting positivity alone as descent."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1"
          ],
          "explanation": {
            "zh-Hant": "反例與主 safe alpha 不混用。",
            "en": "The counterexample's step size is kept separate from the main safe one."
          }
        },
        "leaf_basis": "algebra"
      },
      {
        "id": "S08",
        "uses": [
          "S03",
          "S04",
          "S05",
          "S06",
          "S07"
        ],
        "before_tex": "z_0,z_1,z_2\\text{ exact and descending}",
        "after_tex": "\\text{two verified steps; no general convergence or constrained certificate}",
        "relation": "implies",
        "rule": "gd_update",
        "conditions": [],
        "explanation": {
          "zh-Hant": "報告完整有限結果與此對角族的一步界，不把駐點或有限下降升為任意 global optimum。",
          "en": "Report the complete finite trace and the diagonal family's one-step bound without promoting stationarity or finite descent to arbitrary global optimality."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S03",
            "S04",
            "S05",
            "S06",
            "S07"
          ],
          "explanation": {
            "zh-Hant": "constrained、stochastic 與一般 nonconvex 收斂均不在本證書。",
            "en": "Constrained, stochastic and general nonconvex convergence are outside this certificate."
          }
        },
        "leaf_basis": "gd_update"
      }
    ],
    "result": {
      "zh-Hant": "兩步為 (1/2,-1)、(3/4,-1)，值 -11/4、-47/16；safe 界保本對角族每步不增。",
      "en": "The two iterates are (1/2,-1) and (3/4,-1), with values -11/4 and -47/16; the safe bound ensures nonincrease per step in this diagonal family."
    },
    "negative_controls": [
      {
        "claim": {
          "zh-Hant": "alpha>0 就保下降。",
          "en": "alpha>0 guarantees descent."
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "S07 的 alpha=3 使值增加。",
          "en": "alpha=3 increases the value at S07."
        }
      },
      {
        "claim": {
          "zh-Hant": "零梯度在一般函數必最小。",
          "en": "Zero gradient always means a minimum."
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "x^2-y^2 原點為 saddle，梯度卻零。",
          "en": "The origin is a zero-gradient saddle for x^2-y^2."
        }
      },
      {
        "claim": {
          "zh-Hant": "本更新也自動是 projected descent。",
          "en": "This update is automatically projected descent."
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "沒有投影或限制集合。",
          "en": "No projection or constraint set is present."
        }
      }
    ],
    "status": "candidate",
    "gaps": [],
    "verification": {
      "structure": "checked_local_script",
      "mathematics": "candidate_argument",
      "formalization": "not_formalized"
    },
    "rule_glossary": [
      {
        "id": "mko_definition",
        "kind": "cited",
        "statement": {
          "zh-Hant": "對可微f:R^d到R及明示alpha_k>0，unconstrained gradient descent更新x_{k+1}=x_k-alpha_k grad f(x_k)。本輪exact slice固定coordinate order，使用positive diagonal quadratic f(x)=1/2 sum d_i x_i^2+sum b_i x_i，逐步重算gradient、iterate與objective。若0<alpha<2/L且L=max d_i，有限trace可逐項核objective nonincrease；這仍不是一般函數或未驗證無限序列的收斂證書。positive step本身不保證下降，zero gradient可出現在maximum或saddle，且unconstrained step不得冒充projected或constrained descent。",
          "en": "For differentiable f:R^d→R and explicit alpha_k>0, unconstrained gradient descent updates x_(k+1)=x_k−alpha_k*grad f(x_k). The exact family fixes coordinate order and a positive diagonal quadratic f(x)=1/2*sum_i d_i*x_i^2+sum_i b_i*x_i, recalculating every gradient, iterate and objective. A safe finite trace additionally checks strictly0<alpha<2/L with L=max_i d_i and audits each objective comparison. This is not a convergence certificate for arbitrary functions or an unverified infinite sequence. A positive step alone need not descend, a zero gradient may occur at a maximum or saddle, and an unconstrained step is not projected or constrained descent."
        },
        "source": {
          "mko_id": "mko-gradient-descent",
          "sha256": "b886e6f39050667744f8b88cc6e5d065b39d33d9bbcaf87612a4129ae035973b",
          "commit": "b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f"
        }
      },
      {
        "id": "algebra",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "實數域的等式運算；除法前分母必非零，不等式乘正數保持方向。",
          "en": "Use real-field identities; division requires a nonzero denominator and multiplication by a positive number preserves inequalities."
        }
      },
      {
        "id": "polynomial",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "多項式在實數上連續且可逐項微分；d(x^k)/dx=k x^(k-1)，常數導數為零。",
          "en": "Real polynomials are continuous and differentiate termwise: the derivative of x^k is k*x^(k-1), and constants differentiate to zero."
        }
      },
      {
        "id": "gd_update",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "unconstrained gradient descent 在可微域內以正步長更新 z_new=z-alpha*gradient f(z)，不做 projection。",
          "en": "Unconstrained gradient descent updates z_new=z-alpha*gradient f(z) with a positive step in the differentiable domain, without projection."
        }
      }
    ],
    "revision_log": [],
    "numeric_checks": [
      {
        "id": "GD-value-one",
        "lhs": "(1/2)**2+2*(-1)**2-2*(1/2)+4*(-1)",
        "rhs": "-11/4",
        "step": "S04"
      },
      {
        "id": "GD-value-two",
        "lhs": "(3/4)**2+2*(-1)**2-2*(3/4)+4*(-1)",
        "rhs": "-47/16",
        "step": "S05"
      },
      {
        "id": "GD-decrease-two",
        "lhs": "-47/16",
        "rhs": "-11/4",
        "step": "S05",
        "relation": "<"
      }
    ]
  },
  "presentation": {
    "md_scope": {
      "zh-Hant": "只處理 deterministic unconstrained exact trace，不宣稱一般收斂率、projection 或 stochastic update。",
      "en": "Only a deterministic unconstrained exact trace, without general convergence rates, projection or stochastic updates."
    },
    "md_symbols": [
      [
        "z_k",
        "固定座標 iterate",
        "iterate in fixed coordinates"
      ],
      [
        "L",
        "最大正對角係數",
        "largest positive diagonal coefficient"
      ]
    ],
    "md_error_controls": [
      {
        "title": "安全步長 / Safe step size",
        "zh": "L 與 alpha 由同一正對角 objective 計算。",
        "en": "Compute L and alpha qualification for the same positive-diagonal objective."
      },
      {
        "title": "objective 回算 / Recompute objective",
        "zh": "每步重算梯度、iterate 與值，不只列點。",
        "en": "Recompute the gradient, iterate and objective at every step."
      }
    ],
    "md_open_items": []
  },
  "revision": {
    "id": "ocme-new142-reader-adoption-20261021",
    "collection": "coverage-20261021",
    "source_commit": "b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f",
    "adopted_source_sha256": "203ed1d75baf3bb16ab3c4d9aa75ac8e27e764539e99f40da34f9f9d72d6de1b",
    "original_source_sha256": "203ed1d75baf3bb16ab3c4d9aa75ac8e27e764539e99f40da34f9f9d72d6de1b",
    "owner_adopted": true,
    "bilingual_sync": "complete_source_bound",
    "formal_Lean": "NOT_RUN",
    "reader_review": "142_of_142_source_bound",
    "wording_review": "original_Lead_decisions_resolved",
    "glossary_reader_paraphrases": [],
    "independent_AI_concurrence": "SCOPED_LEAD_AND_BILINGUAL_CONTEXT_REVIEW",
    "issue_ids": [],
    "parent_manifest_sha256": "d29f4cae8229ebd24f60d496cb1d3cd4ad8c0a4dca9d44daab0c3245c544283a",
    "scope": "Owner-adopted reader revision. Lead and bilingual review concern the recorded text and premises; no new universal or Lean proof, canonical promotion or historical-label rewrite."
  }
}
