{
  "$schema": "../../../schemas/mko-v0.3.schema.json",
  "schema_version": "mko-v0.3",
  "id": "mko-euclid-pythagorean-theorem",
  "semantic_family_id": "sf-pythagorean-theorem",
  "type": "theorem",
  "version": "0.8.0",
  "language": "zh-Hant",
  "titles": { "zh-Hant": "畢達哥拉斯定理", "en": "Pythagorean theorem" },
  "summary": { "zh-Hant": "直角三角形兩股長度的平方和，等於斜邊長度的平方。" },
  "statement": { "zh-Hant": "在歐幾里得平面中的任一直角三角形，若兩股長為 a、b，斜邊長為 c，則 a 的平方加 b 的平方等於 c 的平方。" },
  "formula": {
    "tex": "a^2+b^2=c^2",
    "mathml": "<math xmlns=\"http://www.w3.org/1998/Math/MathML\"><mrow><mrow><msup><mi>a</mi><mn>2</mn></msup><mo>+</mo><msup><mi>b</mi><mn>2</mn></msup></mrow><mo>=</mo><msup><mi>c</mi><mn>2</mn></msup></mrow></math>",
    "semantic_ast": {
      "type": "equation",
      "lhs": {
        "type": "addition",
        "operands": [
          { "type": "power", "base": { "type": "symbol", "name": "a", "glyph": "a" }, "exponent": { "type": "number", "value": 2 } },
          { "type": "power", "base": { "type": "symbol", "name": "b", "glyph": "b" }, "exponent": { "type": "number", "value": 2 } }
        ]
      },
      "rhs": {
        "type": "power",
        "base": { "type": "symbol", "name": "c", "glyph": "c" },
        "exponent": { "type": "number", "value": 2 }
      }
    },
    "compiler": {
      "id": "ocme-formula-core",
      "version": "0.3.0",
      "source_sha256": "586b9ebeb1716b0a613280de2bfdbd96b2cf47ff1239e1a9aa5001709e9cc4b2"
    }
  },
  "assumptions": [
    { "id": "a1", "zh-Hant": "幾何背景為歐幾里得平面。" },
    { "id": "a2", "zh-Hant": "三角形具有一個直角。" },
    { "id": "a3", "zh-Hant": "a 與 b 表示兩股長，c 表示斜邊長。" },
    { "id": "a4", "zh-Hant": "邊長為非負實數。" }
  ],
  "symbols": [
    { "token": "a", "role": "leg_length", "role_zh": "第一股長", "scope": "theorem" },
    { "token": "b", "role": "leg_length", "role_zh": "第二股長", "scope": "theorem" },
    { "token": "c", "role": "hypotenuse_length", "role_zh": "斜邊長", "scope": "theorem" }
  ],
  "dependencies": [
    { "id": "mko-right-triangle", "title_zh": "直角三角形", "reason_zh": "定理的適用對象。" },
    { "id": "mko-euclidean-length", "title_zh": "歐幾里得長度", "reason_zh": "平方關係依賴歐幾里得距離。" }
  ],
  "explanation": {
    "paragraphs_zh": [
      "這個定理不是對所有三角形成立，而是針對直角三角形。斜邊是直角所對的最長邊。",
      "平方和可以視為以三條邊為邊長所建立的正方形面積關係：兩個股上正方形的面積總和，等於斜邊上正方形的面積。",
      "程式可以檢查具體的數值三元組，也可以搜尋整數畢氏三元組；但有限檢查不能取代定理的普遍證明。",
      "Lean／Mathlib 先證明向量夾角版本，再由 IsRightTriangleSideModel 明示綁定 a=‖x‖、b=‖y‖、c=‖x+y‖，推出中文條目使用的 a²+b²=c²。"
    ],
    "common_misconception_zh": "把 a²+b²=c² 套用到任意三角形，或把已形式化的指定向量邊長模型誤認為所有仿射表示法都已自動完成等價證明。"
  },
  "proofs": [
    {
      "id": "proof-area-rearrangement-001",
      "type": "geometric_rearrangement",
      "status": "human_proof_available",
      "summary_zh": "將四個全等直角三角形排列在邊長 a+b 的大正方形中；比較中央區域與分割區域的面積，可推出 a²+b²=c²。"
    }
  ],
  "computational_companions": [
    {
      "id": "cc-python-pythagorean-001",
      "language": "python",
      "relation": "finite_instance_checker_and_triple_generator",
      "status": "reference_only",
      "path": "reference/python/pythagorean.py",
      "warning": "此程式只檢查具體數值與有限整數範圍，不等同於畢達哥拉斯定理本身，也不構成普遍證明。",
      "source": "from math import isclose, sqrt\n\ndef is_right_triangle(a: float, b: float, c: float, *, tol: float = 1e-12) -> bool:\n    if min(a, b, c) <= 0:\n        return False\n    x, y, hyp = sorted((a, b, c))\n    return isclose(x*x + y*y, hyp*hyp, rel_tol=tol, abs_tol=tol)\n\ndef integer_triples(limit: int):\n    for a in range(1, limit + 1):\n        for b in range(a, limit + 1):\n            c = int(sqrt(a*a + b*b))\n            if c <= limit and a*a + b*b == c*c:\n                yield (a, b, c)",
      "non_identity": {
        "preserved": ["具體邊長的平方關係", "正邊長限制", "斜邊為最大邊的角色"],
        "approximated": ["浮點輸入使用有限精度與容差"],
        "omitted": ["全稱量詞的普遍證明", "幾何公理與面積重排證明"]
      }
    }
  ],
  "verification": {
    "computational_status": "finite_cases_and_declared_side_model_formalized",
    "warning_zh": "Python 與 FELRA 提供有限計算證據；Lean／Mathlib 分別證明向量核心及 OCME 宣告的邊長綁定模型。任意仿射三角形表示到此模型的等價仍需另外證明。",
    "evidence_refs": [
      {
        "id": "evidence-sha256-49083d0529f2b530b946fd6f30a313b0341a8989bf0f6de9adcdeb398a2b4466",
        "role": "finite_computational_check",
        "producer_id": "ocme-python-suite"
      },
      {
        "id": "evidence-sha256-97ad4a4b529de8c77662f823ad0966c24cfe1c121af8cbb4320135b9ea849448",
        "role": "finite_computational_check",
        "producer_id": "felra"
      },
      {
        "id": "evidence-sha256-4d31c152012f8b561749e354f3789344c91e1fea26cead1468e95417b2e84752",
        "role": "formal_proof",
        "producer_id": "lean-mathlib"
      },
      {
        "id": "evidence-sha256-701b8066d363dadf2cc1ec21bc0d21f7c680a6eb187a37fd309c0f2e4c86d08e",
        "role": "formal_proof",
        "producer_id": "lean-mathlib"
      }
    ],
    "producers": [
      {
        "id": "ocme-python-suite",
        "adapter": "native_python",
        "config_path": "reference/python/verify_all.py",
        "status": "active"
      },
      {
        "id": "felra",
        "adapter": "felra",
        "config_path": "felra/pythagorean/project.yaml",
        "status": "active"
      },
      {
        "id": "lean-mathlib",
        "adapter": "formal_system",
        "config_path": "formal/lean/lakefile.toml",
        "status": "active"
      }
    ]
  },
  "formalization": {
    "status": "formalized_declared_side_model",
    "target_systems": ["Lean 4", "Mathlib"],
    "next_obligation_zh": "建立任意歐幾里得仿射三角形頂點表示與 IsRightTriangleSideModel 的等價定理，包含頂點排列、邊向量方向與距離保存。"
  },
  "provenance": {
    "origin": "evemisslab_original_mvp",
    "note_zh": "此 MVP 物件為架構示範內容，不是從 Wikipedia 逐字複製；正式匯入器將另行保存來源修訂與授權血統。",
    "content_license": "CC-BY-SA-4.0",
    "code_license": "MIT",
    "created_at": "2026-07-25"
  }
}
