{
  "schema_version": "ocme-derivation-reader-v1",
  "guide_id": "derivation-mko-trapezoidal-quadrature-01",
  "mko_id": "mko-trapezoidal-quadrature",
  "title": {
    "zh-Hant": "非均勻梯形值與帶符號誤差",
    "en": "Nonuniform trapezoids and signed error"
  },
  "contract": {
    "schema_version": "ocme-derivation-guide-v0.1",
    "guide_id": "derivation-mko-trapezoidal-quadrature-01",
    "source": {
      "mko_id": "mko-trapezoidal-quadrature",
      "commit": "b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f",
      "sha256": "bd70a77af9c5b1fc3dbca7b29f06de4dbb579be5a6c48bbb16df6141f4f90001",
      "english_sha256": "00cf21dfab1295bd666c4883317d8bf1a960f6d5c2020d9b82fa4147c1779e80"
    },
    "mode": "worked_example",
    "audience_prerequisites": [
      "algebra",
      "polynomial",
      "trap_def",
      "integral_poly"
    ],
    "goal": {
      "zh-Hant": "對 f(x)=x^2、nodes (0,1/2,2) 計算 T、I-T 與絕對誤差。",
      "en": "For f(x)=x^2 and nodes (0,1/2,2), compute T, I-T and absolute error."
    },
    "givens": [
      {
        "id": "G1",
        "statement": {
          "zh-Hant": "f(x)=x^2，[a,b]=[0,2]，nodes (0,1/2,2)，values (0,1/4,4)。",
          "en": "f(x)=x^2 on [0,2], nodes (0,1/2,2), values (0,1/4,4)."
        }
      }
    ],
    "steps": [
      {
        "id": "S01",
        "uses": [
          "G1"
        ],
        "before_tex": "0<1/2<2,\\quad\\#\\text{nodes}=3",
        "after_tex": "n=2,\\quad\\#\\text{values}=3",
        "relation": "implies",
        "rule": "trap_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "合法分割有兩段三節點，值陣列長度相符。",
          "en": "The valid partition has two intervals and three nodes, with a matching value array."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1"
          ],
          "explanation": {
            "zh-Hant": "三個 nodes 不是三個 subintervals。",
            "en": "Three nodes do not make three subintervals."
          }
        },
        "leaf_basis": "trap_def"
      },
      {
        "id": "S02",
        "uses": [
          "G1",
          "S01"
        ],
        "before_tex": "(f(0),f(1/2),f(2))",
        "after_tex": "(0,1/4,4)",
        "relation": "equivalent",
        "rule": "algebra",
        "conditions": [],
        "explanation": {
          "zh-Hant": "由完整函數獨立回算全部端點值。",
          "en": "Independently recompute every endpoint value from the full function."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "G1",
            "S01"
          ],
          "explanation": {
            "zh-Hant": "不是未綁函數的樣本表。",
            "en": "The table is bound to a specified full function."
          }
        },
        "leaf_basis": "algebra"
      },
      {
        "id": "S03",
        "uses": [
          "G1",
          "S01"
        ],
        "before_tex": "h_1=x_1-x_0,\\quad h_2=x_2-x_1",
        "after_tex": "h_1=1/2,\\quad h_2=3/2",
        "relation": "equivalent",
        "rule": "algebra",
        "conditions": [],
        "explanation": {
          "zh-Hant": "兩段寬度不同，不能偷換成單一 h。",
          "en": "The widths differ, so a single h cannot be substituted."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "G1",
            "S01"
          ],
          "explanation": {
            "zh-Hant": "兩寬相加等 2=b-a 作回查。",
            "en": "Their sum is 2=b-a as a consistency check."
          }
        },
        "leaf_basis": "algebra"
      },
      {
        "id": "S04",
        "uses": [
          "S02",
          "S03"
        ],
        "before_tex": "T_1=\\tfrac12\\tfrac{0+1/4}{2},\\quad T_2=\\tfrac32\\tfrac{1/4+4}{2}",
        "after_tex": "T_1=1/16,\\quad T_2=51/16",
        "relation": "implies",
        "rule": "trap_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "每段使用自己的寬度乘自己的端點平均。",
          "en": "Each interval uses its own width times its own endpoint-value average."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S02",
            "S03"
          ],
          "explanation": {
            "zh-Hant": "中節點在兩段各參與一次，是公式本意。",
            "en": "The interior node participates once in each adjacent interval as intended."
          }
        },
        "leaf_basis": "trap_def"
      },
      {
        "id": "S05",
        "uses": [
          "S04"
        ],
        "before_tex": "T=T_1+T_2",
        "after_tex": "T=52/16=13/4",
        "relation": "equivalent",
        "rule": "algebra",
        "conditions": [],
        "explanation": {
          "zh-Hant": "精確加總兩段。",
          "en": "Sum the two intervals exactly."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "S04"
          ],
          "explanation": {
            "zh-Hant": "T 是 quadrature 值，不先稱 exact integral。",
            "en": "T is the quadrature value, not yet called the exact integral."
          }
        },
        "leaf_basis": "algebra"
      },
      {
        "id": "S06",
        "uses": [
          "G1"
        ],
        "before_tex": "I=\\int_0^2x^2\\,dx",
        "after_tex": "I=[x^3/3]_0^2=8/3",
        "relation": "implies",
        "rule": "integral_poly",
        "conditions": [],
        "explanation": {
          "zh-Hant": "完整二次函數允許不依樣本值的獨立 reference integral。",
          "en": "The full quadratic permits an independent reference integral not inferred from samples."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1"
          ],
          "explanation": {
            "zh-Hant": "只給節點表時沒有這個完整 integrand 證書。",
            "en": "A node table alone would not supply this full-integrand certificate."
          }
        },
        "leaf_basis": "integral_poly"
      },
      {
        "id": "S07",
        "uses": [
          "S05",
          "S06"
        ],
        "before_tex": "E=I-T=8/3-13/4",
        "after_tex": "E=-7/12,\\quad|E|=7/12",
        "relation": "equivalent",
        "rule": "algebra",
        "conditions": [],
        "explanation": {
          "zh-Hant": "signed error 固定 exact integral 減梯形值；另外報絕對誤差。",
          "en": "Signed error is fixed as exact integral minus trapezoid value; report its magnitude separately."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "S05",
            "S06"
          ],
          "explanation": {
            "zh-Hant": "負號表示本例梯形值偏大，不把負誤差當負誤差大小。",
            "en": "The negative sign means overestimation; an error magnitude is not negative."
          }
        },
        "leaf_basis": "algebra"
      },
      {
        "id": "S08",
        "uses": [
          "S03"
        ],
        "before_tex": "\\ell(x)=mx+b,\\quad u<v",
        "after_tex": "\\int_u^v\\ell(x)\\,dx=(v-u)\\left(m\\frac{u+v}{2}+b\\right)=(v-u)\\frac{\\ell(u)+\\ell(v)}2",
        "relation": "implies",
        "rule": "integral_poly",
        "conditions": [
          "u<v"
        ],
        "explanation": {
          "zh-Hant": "逐段原始函數恆等式證任意合法分割的 affine exactness，再加總各段；非 affine 本例已給非零誤差。",
          "en": "The per-interval antiderivative identity proves affine exactness on any valid partition; sum the intervals. The nonaffine main example has nonzero error."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S03"
          ],
          "explanation": {
            "zh-Hant": "affine exactness 不是一般二階誤差界或收斂率。",
            "en": "Affine exactness is not a general second-derivative error bound or convergence rate."
          }
        },
        "leaf_basis": "integral_poly"
      }
    ],
    "result": {
      "zh-Hant": "T=13/4，I=8/3，I-T=-7/12、絕對誤差 7/12；affine 函數逐段 exact。",
      "en": "T=13/4, I=8/3, I-T=-7/12 and absolute error 7/12; affine functions are exact on each interval."
    },
    "negative_controls": [
      {
        "claim": {
          "zh-Hant": "三個 nodes 有三段。",
          "en": "Three nodes give three intervals."
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "只有兩對相鄰端點。",
          "en": "There are only two adjacent endpoint pairs."
        }
      },
      {
        "claim": {
          "zh-Hant": "本非均勻分割可用同一 h。",
          "en": "One h applies to this nonuniform partition."
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "兩段分別 1/2、3/2。",
          "en": "The widths are 1/2 and 3/2."
        }
      },
      {
        "claim": {
          "zh-Hant": "給三個值就唯一決定積分。",
          "en": "Three sampled values uniquely determine the integral."
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "可加正倍數 x^2(x-1/2)^2(x-2)^2；節點值不變而積分增加。",
          "en": "Adding a positive multiple of x^2*(x-1/2)^2*(x-2)^2 preserves nodes but increases the integral."
        }
      }
    ],
    "status": "candidate",
    "gaps": [],
    "verification": {
      "structure": "checked_local_script",
      "mathematics": "candidate_argument",
      "formalization": "not_formalized"
    },
    "rule_glossary": [
      {
        "id": "mko_definition",
        "kind": "cited",
        "statement": {
          "zh-Hant": "來源語義轉述：合法非均勻分割的梯形值逐段以各自寬度乘端點值平均後加總；有限表不決定一般積分。",
          "en": "Source semantic paraphrase: on a qualified nonuniform partition, sum each width times its endpoint-value average; a finite table does not determine a general integral."
        },
        "source": {
          "mko_id": "mko-trapezoidal-quadrature",
          "sha256": "bd70a77af9c5b1fc3dbca7b29f06de4dbb579be5a6c48bbb16df6141f4f90001",
          "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": "trap_def",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "複合梯形值為各段 (x_i-x_(i-1))*(y_(i-1)+y_i)/2 之和；nodes 嚴格遞增、端點值對齊，n 段有 n+1 nodes。",
          "en": "The composite trapezoid value sums (x_i-x_(i-1))*(y_(i-1)+y_i)/2; nodes are strictly increasing with aligned endpoint values, and n intervals have n+1 nodes."
        }
      },
      {
        "id": "integral_poly",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "實多項式有限區間積分逐項以 x^(k+1)/(k+1) 原始函數計算。",
          "en": "Integrate real polynomials on finite intervals termwise using antiderivative x^(k+1)/(k+1)."
        }
      }
    ],
    "revision_log": [],
    "numeric_checks": [
      {
        "id": "first-trap",
        "lhs": "(1/2)*(0+1/4)/2",
        "rhs": "1/16",
        "step": "S04"
      },
      {
        "id": "second-trap",
        "lhs": "(3/2)*(1/4+4)/2",
        "rhs": "51/16",
        "step": "S04"
      },
      {
        "id": "signed-error",
        "lhs": "8/3-13/4",
        "rhs": "-7/12",
        "step": "S07"
      }
    ]
  },
  "presentation": {
    "md_scope": {
      "zh-Hant": "允許非均勻分割，完整二次函數給獨立積分；不證一般誤差界或收斂階。",
      "en": "Nonuniform partitions are allowed; the full quadratic gives an independent reference integral, not a general error bound or convergence order."
    },
    "md_symbols": [
      [
        "T",
        "梯形近似值",
        "trapezoid value"
      ],
      [
        "E=I-T",
        "固定符號誤差",
        "fixed signed error"
      ],
      [
        "h_i",
        "每段自己的寬度",
        "individual interval width"
      ]
    ],
    "md_error_controls": [
      {
        "title": "每段寬度 / Each width",
        "zh": "先獨立算每個 h_i 再乘端點平均。",
        "en": "Compute each h_i before multiplying its endpoint average."
      },
      {
        "title": "誤差符號 / Error sign",
        "zh": "固定 I-T，另列絕對值。",
        "en": "Keep I-T fixed and report its absolute value separately."
      }
    ],
    "md_open_items": []
  },
  "revision": {
    "id": "ocme-new142-reader-adoption-20261021",
    "collection": "coverage-20261021",
    "source_commit": "b1b2f1dcf8c50d67a93fe52d95f8eef7b3abba9f",
    "adopted_source_sha256": "0523238679e2cdf17d8dbeaaa405cec37b031589a6c3c5e271550f3786ebdf06",
    "original_source_sha256": "0523238679e2cdf17d8dbeaaa405cec37b031589a6c3c5e271550f3786ebdf06",
    "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."
  }
}
