{
  "schema_version": "ocme-derivation-reader-v1",
  "guide_id": "derivation-mko-bias-variance-decomposition-01",
  "mko_id": "mko-bias-variance-decomposition",
  "title": {
    "zh-Hant": "展開cross term的bias-variance推導",
    "en": "Bias-variance derivation with the cross term visible"
  },
  "contract": {
    "schema_version": "ocme-derivation-guide-v0.1",
    "guide_id": "derivation-mko-bias-variance-decomposition-01",
    "source": {
      "mko_id": "mko-bias-variance-decomposition",
      "commit": "b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f",
      "sha256": "03c45bb05c65b40d9f88d66e9009cd0182117446dd67211eee759fa9e0b2b377",
      "english_sha256": "f96f4ef0ee398bbc7afc47fb6083de94a60ab677ee02c79749ac9b4e06a44499"
    },
    "mode": "theorem_proof",
    "audience_prerequisites": [
      "work"
    ],
    "goal": {
      "zh-Hant": "在同一law逐符號證明分解，並核兩個theta。",
      "en": "Prove the decomposition symbol by symbol in one law and check both theta values."
    },
    "givens": [
      {
        "id": "G1",
        "statement": {
          "zh-Hant": "Θ={1/4,3/4}，Ω={00,01,10,11}；P_(1/4)=(9,3,3,1)/16，P_(3/4)=(1,3,3,9)/16。",
          "en": "Theta={1/4,3/4}, Omega={00,01,10,11}; P_(1/4)=(9,3,3,1)/16 and P_(3/4)=(1,3,3,9)/16."
        }
      },
      {
        "id": "G2",
        "statement": {
          "zh-Hant": "U(x)=(x1+x2)/4，依Ω順序的total table為(0,1/4,1/4,1/2)，目標參數為g(theta)=theta。",
          "en": "U(x)=(x1+x2)/4 has total table(0,1/4,1/4,1/2) in Omega order, with target g(theta)=theta."
        }
      }
    ],
    "steps": [
      {
        "id": "S01",
        "uses": [
          "G1",
          "G2",
          "work"
        ],
        "before_tex": "\\theta\\in\\Theta\\text{ fixed},\\quad m=E_\\theta U",
        "after_tex": "b=m-\\theta,\\quad U-\\theta=(U-m)+b",
        "relation": "implies",
        "rule": "work",
        "conditions": [],
        "explanation": {
          "zh-Hant": "先固定一theta，把誤差拆成中心誤差與常數bias。",
          "en": "Fix one theta and split error into centered error and constant bias."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "G2",
            "work"
          ],
          "explanation": {
            "zh-Hant": "m、b均屬同一Ptheta，不得混law。",
            "en": "Both m and b belong to this Ptheta, not a mixture."
          }
        },
        "leaf_basis": "work"
      },
      {
        "id": "S02",
        "uses": [
          "G1",
          "G2",
          "S01",
          "work"
        ],
        "before_tex": "U-\\theta=(U-m)+b",
        "after_tex": "(U-\\theta)^2=(U-m)^2+2b(U-m)+b^2",
        "relation": "implies",
        "rule": "work",
        "conditions": [],
        "explanation": {
          "zh-Hant": "完整平方展開保留cross term。",
          "en": "Expand the square fully, retaining the cross term."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "G2",
            "S01",
            "work"
          ],
          "explanation": {
            "zh-Hant": "係數2不可省，b不是隨機資料值。",
            "en": "The factor2 is required; b is not a random observed value."
          }
        },
        "leaf_basis": "work"
      },
      {
        "id": "S03",
        "uses": [
          "G1",
          "G2",
          "S02",
          "work"
        ],
        "before_tex": "E_\\theta[U-m]=E_\\theta U-m",
        "after_tex": "E_\\theta[U-m]=0",
        "relation": "implies",
        "rule": "work",
        "conditions": [],
        "explanation": {
          "zh-Hant": "期望線性與m的定義給中心化identity。",
          "en": "Linearity and the definition of m give the centering identity."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "G2",
            "S02",
            "work"
          ],
          "explanation": {
            "zh-Hant": "不能因U-m有正負值就直接說mean零，必須用m定義。",
            "en": "Signs alone do not give mean zero; the definition of m does."
          }
        },
        "leaf_basis": "work"
      },
      {
        "id": "S04",
        "uses": [
          "G1",
          "G2",
          "S03",
          "work"
        ],
        "before_tex": "E_\\theta[2b(U-m)]",
        "after_tex": "2bE_\\theta[U-m]=0",
        "relation": "implies",
        "rule": "work",
        "conditions": [],
        "explanation": {
          "zh-Hant": "固定theta下b是常數，可提出期望，再用中心identity。",
          "en": "At fixed theta b is constant, so factor it out and use centering."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "G2",
            "S03",
            "work"
          ],
          "explanation": {
            "zh-Hant": "這裡不需independence。",
            "en": "No independence is required here."
          }
        },
        "leaf_basis": "work"
      },
      {
        "id": "S05",
        "uses": [
          "G1",
          "G2",
          "S04",
          "work"
        ],
        "before_tex": "E_\\theta[(U-\\theta)^2]",
        "after_tex": "E_\\theta[(U-m)^2]+0+b^2",
        "relation": "implies",
        "rule": "work",
        "conditions": [],
        "explanation": {
          "zh-Hant": "對完整平方式取同law期望，常數平方期望仍自身。",
          "en": "Take expectation of the complete expansion under the same law; b² remains itself."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "G2",
            "S04",
            "work"
          ],
          "explanation": {
            "zh-Hant": "law歸一使Etheta[b²]=b²。",
            "en": "Normalization gives Etheta[b²]=b²."
          }
        },
        "leaf_basis": "work"
      },
      {
        "id": "S06",
        "uses": [
          "G1",
          "G2",
          "S05",
          "work"
        ],
        "before_tex": "\\operatorname{MSE}_\\theta(U)=E_\\theta[(U-m)^2]+b^2",
        "after_tex": "\\operatorname{MSE}_\\theta(U)=\\operatorname{Var}_\\theta(U)+b(\\theta)^2",
        "relation": "implies",
        "rule": "work",
        "conditions": [],
        "explanation": {
          "zh-Hant": "辨認variance與bias定義，完成全體有限law的論證。",
          "en": "Identify variance and bias by definition, completing the finite-law argument."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "G2",
            "S05",
            "work"
          ],
          "explanation": {
            "zh-Hant": "theta原先任意，故對模型每個theta分別成立。",
            "en": "Theta was arbitrary, so the identity holds separately at every model parameter."
          }
        },
        "leaf_basis": "work"
      },
      {
        "id": "S07",
        "uses": [
          "G1",
          "G2",
          "S06",
          "work"
        ],
        "before_tex": "\\theta=1/4,\\quad U\\in\\{0,1/4,1/2\\},\\quad P_{1/4}^U=(9,6,1)/16",
        "after_tex": "m=0(9/16)+(1/4)(6/16)+(1/2)(1/16)=1/8,\\quad b=1/8-1/4=-1/8",
        "relation": "implies",
        "rule": "work",
        "conditions": [],
        "explanation": {
          "zh-Hant": "在此指南重新列完整歸一抽樣law，直接算mean與有號bias。",
          "en": "Relist the complete normalized sampling law in this guide and directly compute its mean and signed bias."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "G2",
            "S06",
            "work"
          ],
          "explanation": {
            "zh-Hant": "三個support值與三個質量按同順序配對。",
            "en": "Pair the three support values with their three masses in the same order."
          }
        },
        "leaf_basis": "work"
      },
      {
        "id": "S08",
        "uses": [
          "G1",
          "G2",
          "S07",
          "work"
        ],
        "before_tex": "v=\\sum_uP_{1/4}^U(u)(u-1/8)^2,\\quad M=\\sum_uP_{1/4}^U(u)(u-1/4)^2",
        "after_tex": "v=\\frac{9(1/8)^2+6(1/8)^2+(3/8)^2}{16}=3/128;\\quad M=\\frac{9(1/4)^2+6(0)^2+(1/4)^2}{16}=5/128",
        "relation": "implies",
        "rule": "work",
        "conditions": [],
        "explanation": {
          "zh-Hant": "中心variance與target loss各自直接加權，完全不借已證分解取值。",
          "en": "Weight the centered variance and target losses independently, without using the proved decomposition to obtain either value."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "G2",
            "S07",
            "work"
          ],
          "explanation": {
            "zh-Hant": "variance中心為1/8，MSE目標為1/4，兩者不同。",
            "en": "The variance center is 1/8 while the MSE target is 1/4; they differ."
          }
        },
        "leaf_basis": "work"
      },
      {
        "id": "S09",
        "uses": [
          "G1",
          "G2",
          "S08",
          "work"
        ],
        "before_tex": "\\theta=1/4:\\quad M=5/128,\\ b=-1/8,\\ v=3/128",
        "after_tex": "5/128=3/128+(-1/8)^2",
        "relation": "implies",
        "rule": "work",
        "conditions": [],
        "explanation": {
          "zh-Hant": "將兩條直接sum的結果與一般分解交叉核對。",
          "en": "Cross-check the two direct-sum results against the general decomposition."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "G2",
            "S08",
            "work"
          ],
          "explanation": {
            "zh-Hant": "bias先平方，所以不會把負偏誤減掉。",
            "en": "Square bias first; negative bias is not subtracted."
          }
        },
        "leaf_basis": "work"
      },
      {
        "id": "S10",
        "uses": [
          "G1",
          "G2",
          "S09",
          "work"
        ],
        "before_tex": "\\theta=3/4,\\quad P_{3/4}^U=(1,6,9)/16",
        "after_tex": "m=0(1/16)+(1/4)(6/16)+(1/2)(9/16)=3/8,\\quad b=3/8-3/4=-3/8",
        "relation": "implies",
        "rule": "work",
        "conditions": [],
        "explanation": {
          "zh-Hant": "第二個完整law也獨立算mean與bias，不沿用第一law的權重。",
          "en": "Independently compute the second law's mean and bias without reusing first-law weights."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "G2",
            "S09",
            "work"
          ],
          "explanation": {
            "zh-Hant": "此law的末support質量為9/16。",
            "en": "The final support mass under this law is 9/16."
          }
        },
        "leaf_basis": "work"
      },
      {
        "id": "S11",
        "uses": [
          "G1",
          "G2",
          "S10",
          "work"
        ],
        "before_tex": "v=\\sum_uP_{3/4}^U(u)(u-3/8)^2,\\quad M=\\sum_uP_{3/4}^U(u)(u-3/4)^2",
        "after_tex": "v=\\frac{(3/8)^2+6(1/8)^2+9(1/8)^2}{16}=3/128;\\quad M=\\frac{(3/4)^2+6(1/2)^2+9(1/4)^2}{16}=21/128",
        "relation": "implies",
        "rule": "work",
        "conditions": [],
        "explanation": {
          "zh-Hant": "第二law的中心平方和與target loss和分開求值。",
          "en": "Evaluate the second law's centered-square sum and target-loss sum separately."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "G2",
            "S10",
            "work"
          ],
          "explanation": {
            "zh-Hant": "MSE直接sum三項為9/256、24/256、9/256。",
            "en": "The three direct MSE contributions are 9/256,24/256,9/256."
          }
        },
        "leaf_basis": "work"
      },
      {
        "id": "S12",
        "uses": [
          "G1",
          "G2",
          "S11",
          "work"
        ],
        "before_tex": "\\theta=3/4:\\quad M=21/128,\\ b=-3/8,\\ v=3/128",
        "after_tex": "21/128=3/128+(-3/8)^2",
        "relation": "implies",
        "rule": "work",
        "conditions": [],
        "explanation": {
          "zh-Hant": "第二law的直接值核分解，兩theta不混合。",
          "en": "The second law's direct values verify the decomposition without mixing parameters."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "G2",
            "S11",
            "work"
          ],
          "explanation": {
            "zh-Hant": "unbiased僅使bias平方零，不使variance零。",
            "en": "Unbiasedness only removes squared bias, not variance."
          }
        },
        "leaf_basis": "work"
      }
    ],
    "result": {
      "zh-Hant": "MSEtheta=Vartheta+bias(theta)²；兩theta直接數值分別為5/128與21/128。",
      "en": "MSEtheta=Vartheta+bias(theta)²; direct values are 5/128 and 21/128 at the two theta values."
    },
    "negative_controls": [
      {
        "claim": {
          "zh-Hant": "cross term靠獨立才為零。",
          "en": "The cross term vanishes only by independence."
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "b是常數且Etheta[U-m]=0即可。",
          "en": "b is constant and Etheta[U-m]=0 suffices."
        }
      },
      {
        "claim": {
          "zh-Hant": "無偏使MSE=0。",
          "en": "Unbiasedness makes MSE zero."
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "只得到MSE=variance；例如Bernoulli觀察無偏但variance正。",
          "en": "It only gives MSE=variance; an unbiased Bernoulli observation has positive variance."
        }
      },
      {
        "claim": {
          "zh-Hant": "MSE=variance+bias。",
          "en": "MSE=variance+bias."
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "平方展開給bias平方；第一law若不平方會成負值。",
          "en": "Expansion gives squared bias; unsquared bias would even give a negative value in the first law."
        }
      }
    ],
    "status": "candidate",
    "gaps": [],
    "verification": {
      "structure": "checked_local_script",
      "mathematics": "candidate_argument",
      "formalization": "not_formalized"
    },
    "rule_glossary": [
      {
        "id": "mko_definition",
        "kind": "cited",
        "statement": {
          "zh-Hant": "每個theta須給完整finite sampling law，主端分別直接計算mean、bias=E_theta[T]-theta、variance=E_theta[(T-E_theta[T])^2]與MSE=E_theta[(T-theta)^2]。展開T-theta=(T-E[T])+bias後，cross term以E[T-E[T]]=0消失，得到MSE=variance+bias^2。多theta逐law核對。unbiased只推出MSE=variance，不推出zero MSE或consistency；單一observed squared error不是MSE。",
          "en": "For every theta supply a complete normalized finite sampling law. Under that same law separately compute the mean, bias=E_theta[T]−theta, variance=E_theta[(T−E_theta[T])^2] and MSE=E_theta[(T−theta)^2]. Expanding T−theta=(T−E_theta[T])+bias gives a cross term that vanishes because E_theta[T−E_theta[T]]=0. Thus MSE=variance+bias^2 pointwise in theta. Do not pool different theta laws. Unbiasedness gives MSE=variance, not zero MSE or consistency. One observed squared error is not the definition of expected loss, even if its numerical value coincides with MSE."
        },
        "source": {
          "mko_id": "mko-bias-variance-decomposition",
          "sha256": "03c45bb05c65b40d9f88d66e9009cd0182117446dd67211eee759fa9e0b2b377",
          "commit": "b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f"
        }
      },
      {
        "id": "work",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "期望線性、歸一law下常數期望及平方展開；固定theta時m=EthetaU，bias=m-theta，variance=Etheta[(U-m)²]，MSE=Etheta[(U-theta)²]。本節不把分解本身當前提。",
          "en": "Linearity, constant expectations under normalized laws and square expansion; at fixed theta, m=EthetaU, bias=m-theta, variance=Etheta[(U-m)²] and MSE=Etheta[(U-theta)²]. The decomposition itself is not assumed."
        }
      }
    ],
    "revision_log": [],
    "numeric_checks": [
      {
        "id": "N01",
        "lhs": "3/128+(-1/8)**2",
        "rhs": "5/128"
      },
      {
        "id": "N02",
        "lhs": "3/128+(-3/8)**2",
        "rhs": "21/128"
      },
      {
        "id": "N03",
        "lhs": "(9*(1/8)**2+6*(1/8)**2+(3/8)**2)/16",
        "rhs": "3/128"
      },
      {
        "id": "N04",
        "lhs": "(9*(1/4)**2+(1/4)**2)/16",
        "rhs": "5/128"
      },
      {
        "id": "N05",
        "lhs": "((3/8)**2+6*(1/8)**2+9*(1/8)**2)/16",
        "rhs": "3/128"
      },
      {
        "id": "N06",
        "lhs": "((3/4)**2+6*(1/2)**2+9*(1/4)**2)/16",
        "rhs": "21/128"
      }
    ]
  },
  "presentation": {
    "md_scope": {
      "zh-Hant": "有限scalar law；各theta分開不pool。",
      "en": "Finite scalar laws, kept separate at each theta."
    },
    "md_symbols": [
      [
        "θ",
        "固定但未知參數",
        "fixed unknown parameter"
      ],
      [
        "U",
        "同一total statistic",
        "one total statistic"
      ],
      [
        "m,b",
        "同law mean與bias",
        "same-law mean and bias"
      ]
    ],
    "md_error_controls": [
      {
        "title": "顯式cross term / Visible cross term",
        "zh": "先保留2b(U-m)，再由中心期望零消去。",
        "en": "Retain2b(U-m) before eliminating it by centered expectation zero."
      },
      {
        "title": "直接MSE核對 / Direct MSE audit",
        "zh": "兩個直接loss和分別與3/128加bias平方比對。",
        "en": "Compare both direct loss sums with 3/128 plus squared bias."
      }
    ],
    "md_open_items": []
  },
  "revision": {
    "id": "ocme-new142-reader-adoption-20261021",
    "collection": "coverage-20261021",
    "source_commit": "b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f",
    "adopted_source_sha256": "684c90c6e4cc67e67bac21d84d6391f4ac7df58ae8a555e711b2c67724a97dc5",
    "original_source_sha256": "8b7541177d92f5388c355193b85c8de3a5067e1f823493728c074e77a687ec37",
    "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": [
      "BR142-S211",
      "BR142-S210",
      "BR142-S209",
      "BR142-S207",
      "BR142-S208"
    ],
    "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."
  }
}
