{
  "schema_version": "ocme-derivation-reader-v1",
  "guide_id": "derivation-mko-distance-formula-01",
  "mko_id": "mko-distance-formula",
  "title": {
    "zh-Hant": "歐氏距離公式：計算距離、拒絕負根並以平方比較",
    "en": "Euclidean distance formula: computing, rejecting the negative root and comparing by squares"
  },
  "contract": {
    "schema_version": "ocme-derivation-guide-v0.1",
    "guide_id": "derivation-mko-distance-formula-01",
    "source": {
      "mko_id": "mko-distance-formula",
      "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f",
      "sha256": "153d0d0feabadaf33e08081677be0f81709df28ffa5bffaf0176a0f7875e5904",
      "english_sha256": "d297d8ae3afb0c4aa0a2de4cbd9e17c6355f2ae3f0fbf1510b9dc7cea3b27827"
    },
    "mode": "worked_example",
    "audience_prerequisites": [
      "numeric_evaluation",
      "power_laws",
      "square_nonneg",
      "sqrt_def",
      "order_basics"
    ],
    "goal": {
      "zh-Hant": "在同一個等單位正交座標系中，設 P=(1,2)、Q=(4,6)、R=(6,−1)。求 d(P,Q)，並說明候選值 −5 為何不是距離；求 d(P,R) 的精確形式並判定它不是整數；以平方比較 d(P,Q) 與 d(P,R)；最後核對重合點的距離為零，以及距離與兩點的書寫順序無關。",
      "en": "In one equal-unit orthonormal Cartesian frame let P=(1,2), Q=(4,6) and R=(6,−1). Find d(P,Q) and explain why the candidate −5 is not a distance; find the exact form of d(P,R) and decide that it is not an integer; compare d(P,Q) with d(P,R) through their squares; finally check that coincident points have distance zero and that the distance does not depend on the order in which the two points are written."
    },
    "givens": [
      {
        "id": "G1",
        "statement": {
          "zh-Hant": "框架：所有點的座標都取自同一個正交座標系，兩軸採同一長度單位（MKO 假設 a1）。",
          "en": "Frame: all coordinates are taken in one orthonormal Cartesian frame whose two axes use the same length unit (MKO assumption a1)."
        }
      },
      {
        "id": "G2",
        "statement": {
          "zh-Hant": "P=(1,2)、Q=(4,6)、R=(6,−1)，座標為整數（MKO 假設 a2）。",
          "en": "P=(1,2), Q=(4,6), R=(6,−1), with integer coordinates (MKO assumption a2)."
        }
      },
      {
        "id": "G3",
        "statement": {
          "zh-Hant": "有人提出候選值 c=−5 作為 d(P,Q)，理由是 (−5)²=25。",
          "en": "Someone proposes the candidate value c=−5 for d(P,Q), on the grounds that (−5)²=25."
        }
      }
    ],
    "steps": [
      {
        "id": "S01",
        "uses": [
          "G1"
        ],
        "before_tex": "d(P,Q),\\ P=(p_x,p_y),\\ Q=(q_x,q_y)",
        "after_tex": "d(P,Q)=\\sqrt{(q_x-p_x)^2+(q_y-p_y)^2}",
        "relation": "definition",
        "rule": "mko_distance_def",
        "conditions": [
          "P,Q\\ \\text{in one orthonormal equal-unit frame}"
        ],
        "explanation": {
          "zh-Hant": "先寫出 MKO 的定義。公式只在 G1 的框架中代表歐氏距離：兩軸互相垂直，而且使用同一長度單位。做法是座標差先平方、再相加，最後取主平方根。",
          "en": "First write down the MKO's definition. The formula represents Euclidean distance only in the frame of G1: perpendicular axes using the same length unit. The coordinate differences are squared, then added, and then the principal square root is taken."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "mko_distance_def"
          ],
          "explanation": {
            "zh-Hant": "此步只寫出定義並確認框架條件，不推出新事實；若框架不符合 G1，後面的計算都不適用。",
            "en": "This step only states the definition and checks the frame condition; it derives no new fact. If the frame did not satisfy G1, none of the later computations would apply."
          }
        },
        "leaf_basis": "mko_distance_def + def_unfold"
      },
      {
        "id": "S02",
        "uses": [
          "S01",
          "square_nonneg"
        ],
        "before_tex": "(q_x-p_x)^2+(q_y-p_y)^2",
        "after_tex": "(q_x-p_x)^2+(q_y-p_y)^2\\ge 0,\\ \\ d(P,Q)\\ge 0",
        "relation": "implies",
        "rule": "square_nonneg",
        "conditions": [],
        "explanation": {
          "zh-Hant": "兩個平方各自 ≥0（square_nonneg），兩個非負數之和仍 ≥0（order_basics：由 0≤u 得 0+v≤u+v，再用 0≤v）。所以根號內的數非負，主平方根有定義；依 sqrt_def，主平方根本身 ≥0。因此對任何兩點，d(P,Q) 都有定義而且非負。",
          "en": "Each square is ≥0 (square_nonneg), and a sum of two nonnegative numbers is ≥0 (order_basics: from 0≤u, 0+v≤u+v, and then use 0≤v). So the radicand is nonnegative and its principal square root is defined; by sqrt_def that root is itself ≥0. Hence for any two points d(P,Q) is defined and nonnegative."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S01",
            "square_nonneg",
            "order_basics",
            "sqrt_def"
          ],
          "explanation": {
            "zh-Hant": "只需要實數平方非負與主平方根的定義；反向（由 d≥0 推出任何關於座標的資訊）並未宣稱。",
            "en": "It needs only that real squares are nonnegative and the definition of the principal square root; no converse (recovering anything about the coordinates from d≥0) is claimed."
          }
        },
        "leaf_basis": "square_nonneg + order_basics + sqrt_def"
      },
      {
        "id": "S03",
        "uses": [
          "S01",
          "G2"
        ],
        "before_tex": "Q-P",
        "after_tex": "(4-1,\\ 6-2)=(3,4)",
        "relation": "equivalent",
        "rule": "numeric_evaluation",
        "conditions": [],
        "explanation": {
          "zh-Hant": "代入 P=(1,2)、Q=(4,6)，逐坐標相減：4−1=3、6−2=4。兩個座標差都取自同一框架（G1），所以可以放進同一個公式。",
          "en": "Substitute P=(1,2) and Q=(4,6) and subtract coordinate by coordinate: 4−1=3 and 6−2=4. Both differences come from the same frame (G1), so they may enter the same formula."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "反向：1+3=4、2+4=6，還原 Q 的座標；兩邊是同一對數。",
            "en": "Backward: 1+3=4 and 2+4=6 restore the coordinates of Q; both sides are the same pair of numbers."
          }
        },
        "leaf_basis": "numeric_evaluation + add_inverse"
      },
      {
        "id": "S04",
        "uses": [
          "S03"
        ],
        "before_tex": "(q_x-p_x)^2+(q_y-p_y)^2",
        "after_tex": "3^2+4^2=9+16=25",
        "relation": "equivalent",
        "rule": "numeric_evaluation",
        "conditions": [],
        "explanation": {
          "zh-Hant": "把 S03 的差代入根號內：3²=3·3=9，4²=4·4=16，相加得 25。這就是 d(P,Q)²（MKO：距離平方是座標差平方之和）。",
          "en": "Put the differences of S03 under the root: 3²=3·3=9 and 4²=4·4=16, with sum 25. This is d(P,Q)² (MKO: the squared distance is the sum of the squared coordinate differences)."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "numeric_evaluation",
            "power_laws"
          ],
          "explanation": {
            "zh-Hant": "每一個等號都是精確整數計算，可以獨立重算（N3），雙向成立。",
            "en": "Each equality is an exact integer computation that can be recomputed independently (N3), so it holds both ways."
          }
        },
        "leaf_basis": "numeric_evaluation + power_laws"
      },
      {
        "id": "S05",
        "uses": [
          "S01",
          "S04",
          "sqrt_def"
        ],
        "before_tex": "d(P,Q)=\\sqrt{25}",
        "after_tex": "d(P,Q)=5",
        "relation": "equivalent",
        "rule": "sqrt_def",
        "conditions": [
          "25\\ge 0"
        ],
        "explanation": {
          "zh-Hant": "由 S01、S04，d(P,Q)=√25。依 sqrt_def，√25 是唯一滿足 b≥0 且 b²=25 的實數 b；S05.1 檢查 5 滿足這兩個條件，S05.2 用唯一性得 √25=5。",
          "en": "By S01 and S04, d(P,Q)=√25. By sqrt_def, √25 is the unique real b with b≥0 and b²=25; S05.1 checks that 5 satisfies both conditions, and S05.2 uses uniqueness to get √25=5."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "sqrt_def",
            "eq_replace"
          ],
          "explanation": {
            "zh-Hant": "√25 與 5 是同一個數，以等值代換互換，雙向成立。",
            "en": "√25 and 5 are the same number and replace each other as equals, so the step holds both ways."
          }
        },
        "leaf_basis": "sqrt_def + eq_replace"
      },
      {
        "id": "S05.1",
        "uses": [
          "numeric_evaluation"
        ],
        "before_tex": "b=5",
        "after_tex": "b\\ge 0\\ \\land\\ b^2=25",
        "relation": "implies",
        "rule": "numeric_evaluation",
        "conditions": [],
        "explanation": {
          "zh-Hant": "5>0，所以 5≥0；5²=5·5=25。這兩項正是 sqrt_def 對 √25 的兩個要求。",
          "en": "5>0, so 5≥0; and 5²=5·5=25. These are exactly the two requirements that sqrt_def places on √25."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "numeric_evaluation",
            "order_basics"
          ],
          "explanation": {
            "zh-Hant": "只檢查一個候選值；不宣稱 5 是唯一滿足 b²=25 的實數（−5 也滿足），唯一性還要加上 b≥0。",
            "en": "Only one candidate is checked; it is not claimed that 5 is the only real with b²=25 (−5 also has it): uniqueness needs b≥0 as well."
          }
        },
        "leaf_basis": "numeric_evaluation + order_basics"
      },
      {
        "id": "S05.2",
        "uses": [
          "S05.1",
          "sqrt_def"
        ],
        "before_tex": "5\\ge 0,\\ 5^2=25",
        "after_tex": "\\sqrt{25}=5",
        "relation": "implies",
        "rule": "sqrt_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "sqrt_def 說滿足 b≥0 且 b²=25 的實數恰有一個，記為 √25。S05.1 顯示 5 是這樣的數，所以 √25=5。",
          "en": "sqrt_def says there is exactly one real b with b≥0 and b²=25, written √25. S05.1 shows that 5 is such a number, so √25=5."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S05.1",
            "sqrt_def"
          ],
          "explanation": {
            "zh-Hant": "需要 sqrt_def 的唯一性與 S05.1 的兩個條件；少了 b≥0 就無法排除 −5。",
            "en": "It needs the uniqueness in sqrt_def and both conditions from S05.1; without b≥0, −5 could not be excluded."
          }
        },
        "leaf_basis": "sqrt_def"
      },
      {
        "id": "S06",
        "uses": [
          "G3",
          "S05"
        ],
        "before_tex": "c=-5,\\ c^2=25",
        "after_tex": "c\\neq d(P,Q)",
        "relation": "implies",
        "rule": "sqrt_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "候選值 −5 的平方確實是 (−5)(−5)=25（neg_mul），但 −5<0，不滿足 sqrt_def 的非負條件；而且 S05 已得 d(P,Q)=5，而 −5≠5。所以 −5 不是 d(P,Q)。這正是 MKO 指出的誤解：平方正確不足以成為距離（假設 a3）。",
          "en": "The candidate −5 does have square (−5)(−5)=25 (neg_mul), but −5<0 fails the nonnegativity condition of sqrt_def; moreover S05 gave d(P,Q)=5, and −5≠5. So −5 is not d(P,Q). This is exactly the misconception the MKO names: having the right square is not enough to be a distance (assumption a3)."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S05",
            "sqrt_def",
            "neg_mul"
          ],
          "explanation": {
            "zh-Hant": "拒絕的理由是符號條件與唯一性；不宣稱 −5 與 d(P,Q) 毫無關係，兩者只差一個負號。",
            "en": "The rejection rests on the sign condition and uniqueness; it is not claimed that −5 is unrelated to d(P,Q): the two differ only by a sign."
          }
        },
        "leaf_basis": "sqrt_def + neg_mul + numeric_evaluation"
      },
      {
        "id": "S07",
        "uses": [
          "S01",
          "G2"
        ],
        "before_tex": "R-P",
        "after_tex": "(6-1,\\ -1-2)=(5,-3)",
        "relation": "equivalent",
        "rule": "numeric_evaluation",
        "conditions": [],
        "explanation": {
          "zh-Hant": "對 P=(1,2)、R=(6,−1) 逐坐標相減：6−1=5，−1−2=−3。座標差可以是負數；下一步平方後符號消失。",
          "en": "Subtract coordinatewise for P=(1,2) and R=(6,−1): 6−1=5 and −1−2=−3. A coordinate difference may be negative; squaring in the next step removes the sign."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "反向：1+5=6、2+(−3)=−1，還原 R 的座標。",
            "en": "Backward: 1+5=6 and 2+(−3)=−1 restore the coordinates of R."
          }
        },
        "leaf_basis": "numeric_evaluation + add_inverse"
      },
      {
        "id": "S08",
        "uses": [
          "S07",
          "sqrt_def"
        ],
        "before_tex": "d(P,R)=\\sqrt{5^2+(-3)^2}",
        "after_tex": "d(P,R)=\\sqrt{34},\\ \\ d(P,R)^2=34",
        "relation": "equivalent",
        "rule": "numeric_evaluation",
        "conditions": [
          "34\\ge 0"
        ],
        "explanation": {
          "zh-Hant": "5²=25，(−3)²=(−3)(−3)=9（neg_mul），和為 34，所以 d(P,R)=√34。34≥0，依 sqrt_def，(√34)²=34，即 d(P,R)²=34。",
          "en": "5²=25 and (−3)²=(−3)(−3)=9 (neg_mul), with sum 34, so d(P,R)=√34. Since 34≥0, sqrt_def gives (√34)²=34, that is d(P,R)²=34."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "numeric_evaluation",
            "sqrt_def"
          ],
          "explanation": {
            "zh-Hant": "反向：若 d≥0 且 d²=34，依 sqrt_def 的唯一性 d=√34；根號內的計算可重算（N9）。",
            "en": "Backward: if d≥0 and d²=34, the uniqueness in sqrt_def gives d=√34; the arithmetic under the root can be recomputed (N9)."
          }
        },
        "leaf_basis": "numeric_evaluation + neg_mul + sqrt_def"
      },
      {
        "id": "S09",
        "uses": [
          "S02",
          "S04",
          "S05",
          "S08",
          "L_sq_order"
        ],
        "before_tex": "d(P,Q)^2=25,\\ d(P,R)^2=34,\\ 25<34",
        "after_tex": "d(P,Q)<d(P,R)",
        "relation": "theorem_application",
        "rule": "L_sq_order",
        "conditions": [
          "d(P,Q)\\ge 0",
          "d(P,R)\\ge 0"
        ],
        "explanation": {
          "zh-Hant": "依 S02 兩個距離都非負，所以可用引理 L_sq_order（a=d(P,Q)、b=d(P,R)）：25<34 推出 d(P,Q)<d(P,R)。這正是 MKO 說的「比較兩個距離可比較其非負平方值」；不需要求出 √34 的小數。引理在 S09.1、S09.2 證明。",
          "en": "By S02 both distances are nonnegative, so Lemma L_sq_order applies (a=d(P,Q), b=d(P,R)): 25<34 gives d(P,Q)<d(P,R). This is the MKO's 'two distances can be compared by their squares'; no decimal value of √34 is needed. The lemma is proved in S09.1 and S09.2."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S02",
            "L_sq_order"
          ],
          "explanation": {
            "zh-Hant": "引理的前提是兩邊非負（S02）；對可能為負的數，平方比較不成立（見錯誤控制）。",
            "en": "The lemma's hypothesis is that both sides are nonnegative (S02); for numbers that may be negative, comparing squares fails (see the error controls)."
          }
        },
        "leaf_basis": "L_sq_order + numeric_evaluation"
      },
      {
        "id": "S09.1",
        "uses": [
          "order_basics",
          "distributive"
        ],
        "before_tex": "0\\le a<b",
        "after_tex": "a^2<b^2",
        "relation": "implies",
        "rule": "order_basics",
        "conditions": [
          "a\\ge 0"
        ],
        "explanation": {
          "zh-Hant": "由 a≥0 與 a<b 得 b>0，所以 b+a≥b>0；又 b−a>0。依 order_basics（u<v 且 w>0 ⇒ uw<vw，取 u=0、v=b−a、w=b+a）得 0<(b−a)(b+a)。依分配律 (b−a)(b+a)=b²−a²，所以 b²−a²>0，兩邊同加 a² 得 a²<b²。",
          "en": "From a≥0 and a<b we get b>0, so b+a≥b>0; also b−a>0. By order_basics (u<v and w>0 give uw<vw, with u=0, v=b−a, w=b+a), 0<(b−a)(b+a). By distributivity (b−a)(b+a)=b²−a², so b²−a²>0, and adding a² to both sides gives a²<b²."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "order_basics",
            "distributive",
            "mul_zero"
          ],
          "explanation": {
            "zh-Hant": "需要 a≥0 才能保證 b+a>0；若允許 a 為負，例如 a=−6、b=5，結論 a²<b² 不成立。",
            "en": "a≥0 is needed to make b+a>0; if a could be negative, for example a=−6 and b=5, the conclusion a²<b² fails."
          }
        },
        "leaf_basis": "order_basics + distributive + mul_zero + add_inverse"
      },
      {
        "id": "S09.2",
        "uses": [
          "S09.1",
          "order_basics"
        ],
        "before_tex": "a\\ge 0,\\ b\\ge 0,\\ a^2<b^2",
        "after_tex": "a<b",
        "relation": "implies",
        "rule": "contradiction",
        "conditions": [
          "a\\ge 0",
          "b\\ge 0"
        ],
        "explanation": {
          "zh-Hant": "假設 a<b 不成立。依三分律，b=a 或 b<a。若 b=a，則 b²=a²（eq_congruence），與 a²<b² 矛盾。若 b<a，因 b≥0，可用 S09.1（角色互換）得 b²<a²，也與 a²<b² 矛盾。所以 a<b。S09.1 與 S09.2 合起來證得引理 L_sq_order 的兩個方向。",
          "en": "Suppose a<b fails. By trichotomy, b=a or b<a. If b=a then b²=a² (eq_congruence), contradicting a²<b². If b<a, then since b≥0, S09.1 with the roles exchanged gives b²<a², again contradicting a²<b². Hence a<b. S09.1 and S09.2 together prove both directions of Lemma L_sq_order."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S09.1",
            "order_basics",
            "contradiction",
            "eq_congruence"
          ],
          "explanation": {
            "zh-Hant": "反證需要三分律涵蓋所有情況，並需要 b≥0 才能套用 S09.1。",
            "en": "The argument by contradiction needs trichotomy to cover every case, and needs b≥0 to apply S09.1."
          }
        },
        "leaf_basis": "contradiction + order_basics + eq_congruence + case_analysis"
      },
      {
        "id": "S10",
        "uses": [
          "S08",
          "S09",
          "L_sq_order",
          "sqrt_def"
        ],
        "before_tex": "5^2=25<34<36=6^2",
        "after_tex": "5<\\sqrt{34}<6,\\ \\ \\sqrt{34}\\notin\\mathbb{Z}",
        "relation": "implies",
        "rule": "L_sq_order",
        "conditions": [
          "5\\ge 0",
          "\\sqrt{34}\\ge 0",
          "6\\ge 0"
        ],
        "explanation": {
          "zh-Hant": "5、√34、6 都非負（√34≥0 由 sqrt_def），它們的平方 25、34、36 滿足 25<34<36。用 L_sq_order 兩次得 5<√34<6。5 與 6 之間沒有整數，所以 √34 不是整數；這符合 MKO 假設 a2：要得到整數距離，平方和必須是完全平方，而 34 不是。答案以精確形式 √34 保存，不以浮點值冒充精確值。",
          "en": "5, √34 and 6 are all nonnegative (√34≥0 by sqrt_def), and their squares 25, 34, 36 satisfy 25<34<36. Applying L_sq_order twice gives 5<√34<6. There is no integer strictly between 5 and 6, so √34 is not an integer; this matches MKO assumption a2: an integer distance needs a perfect-square sum, and 34 is not one. The answer is kept in the exact form √34 instead of passing off a floating-point value as exact."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S08",
            "L_sq_order",
            "sqrt_def",
            "order_basics"
          ],
          "explanation": {
            "zh-Hant": "三個數都非負才能用引理；「5 與 6 之間沒有整數」是整數的序性質。只推出 √34 不是整數，不宣稱任何小數展開。",
            "en": "All three numbers must be nonnegative to use the lemma; 'no integer lies strictly between 5 and 6' is an order property of the integers. Only the non-integrality of √34 is derived; no decimal expansion is claimed."
          }
        },
        "leaf_basis": "L_sq_order + sqrt_def + order_basics + numeric_evaluation"
      },
      {
        "id": "S11",
        "uses": [
          "S01",
          "S02",
          "G2"
        ],
        "before_tex": "d(P,P)",
        "after_tex": "\\sqrt{0^2+0^2}=\\sqrt{0}=0",
        "relation": "equivalent",
        "rule": "sqrt_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "對重合點，座標差是 1−1=0 與 2−2=0，根號內為 0。0≥0 且 0²=0，依 sqrt_def 的唯一性 √0=0。所以重合點的距離是 0，這是合法的距離值（假設 a3），不是錯誤。",
          "en": "For coincident points the differences are 1−1=0 and 2−2=0, so the radicand is 0. Since 0≥0 and 0²=0, the uniqueness in sqrt_def gives √0=0. So coincident points have distance 0, a legitimate value of the distance (assumption a3), not an error."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "sqrt_def",
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "每一個等號都是同一個數的不同寫法，雙向成立。",
            "en": "Each equality writes the same number in another way, so it holds both ways."
          }
        },
        "leaf_basis": "sqrt_def + numeric_evaluation"
      },
      {
        "id": "S12",
        "uses": [
          "S01",
          "neg_mul"
        ],
        "before_tex": "(p_x-q_x)^2+(p_y-q_y)^2",
        "after_tex": "(q_x-p_x)^2+(q_y-p_y)^2",
        "relation": "equivalent",
        "rule": "neg_mul",
        "conditions": [],
        "explanation": {
          "zh-Hant": "p_x−q_x=−(q_x−p_x)，依 neg_mul，(−u)(−u)=uu，所以 (p_x−q_x)²=(q_x−p_x)²；y 坐標同理。兩個根號內的數相同，所以 d(Q,P)=d(P,Q)。例如 d(Q,P)²=(1−4)²+(2−6)²=9+16=25。依 MKO 第二段，交換兩點不構成新的計算。",
          "en": "p_x−q_x=−(q_x−p_x), and by neg_mul (−u)(−u)=uu, so (p_x−q_x)²=(q_x−p_x)²; likewise for y. The two radicands agree, so d(Q,P)=d(P,Q). For example d(Q,P)²=(1−4)²+(2−6)²=9+16=25. As the MKO notes, swapping the two points is not a new computation."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "neg_mul",
            "add_inverse"
          ],
          "explanation": {
            "zh-Hant": "這是對所有實數成立的恆等式（N14），兩個方向都成立。",
            "en": "This is an identity for all reals (N14), so both directions hold."
          }
        },
        "leaf_basis": "neg_mul + add_inverse + eq_replace"
      },
      {
        "id": "S13",
        "uses": [
          "S05",
          "S06",
          "S08",
          "S09",
          "S10",
          "S11",
          "S12"
        ],
        "before_tex": "\\text{tasks of the goal}",
        "after_tex": "d(P,Q)=5,\\ d(P,R)=\\sqrt{34},\\ 5<\\sqrt{34}<6,\\ -5\\neq d(P,Q)",
        "relation": "implies",
        "rule": "and_intro_elim",
        "conditions": [],
        "explanation": {
          "zh-Hant": "把各步結論合併：d(P,Q)=5（S05），−5 被拒絕（S06），d(P,R)=√34 不是整數且介於 5 與 6 之間（S08、S10），d(P,Q)<d(P,R)（S09），重合點距離為 0（S11），距離與順序無關（S12）。",
          "en": "Combine the conclusions: d(P,Q)=5 (S05), −5 is rejected (S06), d(P,R)=√34 is not an integer and lies between 5 and 6 (S08, S10), d(P,Q)<d(P,R) (S09), coincident points have distance 0 (S11), and the distance does not depend on order (S12)."
        },
        "reverse_audit": {
          "kind": "sufficient_goal_reduction",
          "required_ids": [
            "S05",
            "S06",
            "S09",
            "S10",
            "S11",
            "S12"
          ],
          "explanation": {
            "zh-Hant": "目標 G：題目要求的各項結論。足夠條件 H：S05 到 S12 的結論同時成立；H⇒G 只用合取。H 都由 G1 到 G3 正向推出，沒有把 G 當作前提。",
            "en": "Goal G: the conclusions asked for in the task. Sufficient condition H: the conclusions of S05 to S12 hold together; H⇒G uses only conjunction. H is derived forwards from G1 to G3; G is never used as a premise."
          }
        },
        "leaf_basis": "and_intro_elim"
      }
    ],
    "result": {
      "zh-Hant": "在同一等單位正交框架中，d(P,Q)=5；候選值 −5 雖然平方為 25，但為負，不是距離。d(P,R)=√34，不是整數，且 5<√34<6；由 25<34 得 d(P,Q)<d(P,R)。重合點距離為 0，且 d(Q,P)=d(P,Q)。",
      "en": "In one equal-unit orthonormal frame, d(P,Q)=5; the candidate −5 has square 25 but is negative, so it is not a distance. d(P,R)=√34, which is not an integer, and 5<√34<6; from 25<34, d(P,Q)<d(P,R). Coincident points have distance 0, and d(Q,P)=d(P,Q)."
    },
    "negative_controls": [
      {
        "claim": {
          "zh-Hant": "因為 (−5)²=25，所以 d(P,Q)=−5 也是正確答案",
          "en": "Since (−5)²=25, d(P,Q)=−5 is also a correct answer"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "距離是主平方根，必須 ≥0；−5<0。",
          "en": "The distance is the principal square root and must be ≥0; −5<0."
        }
      },
      {
        "claim": {
          "zh-Hant": "d(P,Q)=|3|+|4|=7",
          "en": "d(P,Q)=|3|+|4|=7"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "這是曼哈頓（L¹）距離，屬於另一個度量；歐氏距離是 √25=5，而 7≠5。",
          "en": "That is the Manhattan (L¹) distance, a different metric; the Euclidean distance is √25=5, and 7≠5."
        }
      },
      {
        "claim": {
          "zh-Hant": "d(P,R) 恰好等於 5.83",
          "en": "d(P,R) equals 5.83 exactly"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "5.83²=33.9889≠34；精確值是 √34。",
          "en": "5.83²=33.9889≠34; the exact value is √34."
        }
      },
      {
        "claim": {
          "zh-Hant": "−6<5，所以 (−6)²<5²",
          "en": "−6<5, so (−6)²<5²"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "(−6)²=36>25；平方比較只對非負數成立。",
          "en": "(−6)²=36>25; comparing by squares works only for nonnegative numbers."
        }
      }
    ],
    "status": "candidate",
    "gaps": [],
    "verification": {
      "structure": "checked_local_script",
      "mathematics": "candidate_argument",
      "formalization": "not_formalized"
    },
    "rule_glossary": [
      {
        "id": "numeric_evaluation",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "明確整數或有理數算式的精確求值；可以獨立重算。",
          "en": "Exact evaluation of an explicit integer or rational expression; independently recomputable."
        }
      },
      {
        "id": "power_laws",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "整數指數律（底數非零或指數為正整數）：a^m·a^n=a^{m+n}，(a^m)^n=a^{mn}，(ab)^n=a^n b^n，a^0=1。",
          "en": "Integer exponent laws (base nonzero, or exponents positive integers): a^m·a^n=a^{m+n}, (a^m)^n=a^{mn}, (ab)^n=a^n b^n, a^0=1."
        }
      },
      {
        "id": "square_nonneg",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "實數平方非負：對所有實數 u，u²≥0，且 u²=0 ⇔ u=0。",
          "en": "Squares are nonnegative: for every real u, u²≥0, and u²=0 ⇔ u=0."
        }
      },
      {
        "id": "sqrt_def",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "主平方根：對 a≥0，√a 是唯一滿足 b≥0 且 b²=a 的實數 b。負數在實數中沒有平方根。",
          "en": "Principal square root: for a≥0, √a is the unique real b with b≥0 and b²=a. Negative numbers have no real square root."
        }
      },
      {
        "id": "order_basics",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "實數的序：任兩數恰有 u<v、u=v、u>v 之一；u<v 且 v<w 推出 u<w；u<v 推出 u+w<v+w；u<v 且 w>0 推出 uw<vw；u<v 且 w<0 推出 uw>vw。",
          "en": "Order of the reals: exactly one of u<v, u=v, u>v holds; u<v and v<w give u<w; u<v gives u+w<v+w; u<v and w>0 give uw<vw; u<v and w<0 give uw>vw."
        }
      },
      {
        "id": "def_unfold",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "展開定義：把一個已定義的詞換成它的定義內容（或反向收回），命題的真假不變。",
          "en": "Unfolding a definition: replacing a defined term by its definition (or folding it back) does not change whether a statement is true."
        }
      },
      {
        "id": "add_inverse",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "加法反元素：每個 u 都有 −u，使 u+(−u)=0；u−v 定義為 u+(−v)。",
          "en": "Additive inverse: every u has −u with u+(−u)=0; u−v means u+(−v)."
        }
      },
      {
        "id": "eq_replace",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "等值代換：命題中的一個式子可換成與它相等的式子，命題的真假不變。",
          "en": "Replacement of equals: an expression inside a statement may be replaced by an equal expression without changing whether the statement is true."
        }
      },
      {
        "id": "neg_mul",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "負號與乘法：(−u)v=−(uv)，(−u)(−v)=uv。",
          "en": "Signs and multiplication: (−u)v=−(uv) and (−u)(−v)=uv."
        }
      },
      {
        "id": "distributive",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "分配律：u(v+w)=uv+uw；配合乘法交換律也有 (v+w)u=vu+wu。",
          "en": "Distributivity: u(v+w)=uv+uw; with commutativity also (v+w)u=vu+wu."
        }
      },
      {
        "id": "mul_zero",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "乘以零：u·0=0。理由：u·0=u·(0+0)=u·0+u·0，兩邊同減 u·0 得 0=u·0。",
          "en": "Multiplying by zero: u·0=0. Reason: u·0=u·(0+0)=u·0+u·0; subtracting u·0 from both sides gives 0=u·0."
        }
      },
      {
        "id": "contradiction",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "反證法：若假設 ¬P 推出矛盾（某命題與其否定同時成立），則 P 成立。",
          "en": "Proof by contradiction: if assuming ¬P leads to a contradiction (a statement and its negation both hold), then P holds."
        }
      },
      {
        "id": "eq_congruence",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "等式同用：若 u=v，對兩邊做同一個有定義的運算 f，得 f(u)=f(v)。只對一邊做運算不屬於此規則。",
          "en": "Congruence of equality: if u=v, applying the same defined operation f to both sides gives f(u)=f(v). Operating on one side only is not an instance of this rule."
        }
      },
      {
        "id": "case_analysis",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "分情況論證：若 P∨Q 成立，且 P⇒R、Q⇒R 都已證，則 R 成立。所有情況必須涵蓋全部可能。",
          "en": "Proof by cases: if P∨Q holds and both P⇒R and Q⇒R are proved, then R holds. The cases must cover every possibility."
        }
      },
      {
        "id": "and_intro_elim",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "合取：由 P 與 Q 得 P∧Q；由 P∧Q 可分別得 P 與 Q。",
          "en": "Conjunction: from P and Q infer P∧Q; from P∧Q infer P and infer Q."
        }
      },
      {
        "id": "mko_distance_def",
        "kind": "cited",
        "source": {
          "mko_id": "mko-distance-formula",
          "sha256": "153d0d0feabadaf33e08081677be0f81709df28ffa5bffaf0176a0f7875e5904",
          "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f"
        },
        "statement": {
          "zh-Hant": "在平面同一等單位正交座標系，P=(px,py)、Q=(qx,qy) 的歐氏距離為 d(P,Q)=√((qx−px)²+(qy−py)²)≥0。距離平方是兩個座標差平方之和；比較兩個距離可比較其非負平方值。",
          "en": "For P=(x1,y1) and Q=(x2,y2) in the same equal-unit orthonormal Cartesian frame, d(P,Q)=√((x2−x1)²+(y2−y1)²)≥0. Its square is the sum under the root; two such distances can be compared by their squares."
        }
      },
      {
        "id": "L_sq_order",
        "kind": "lemma",
        "proved_in": [
          "S09.1",
          "S09.2"
        ],
        "statement": {
          "zh-Hant": "對實數 a≥0、b≥0：a<b ⇔ a²<b²。",
          "en": "For reals a≥0 and b≥0: a<b ⇔ a²<b²."
        }
      }
    ],
    "revision_log": [],
    "numeric_checks": [
      {
        "id": "N1",
        "step": "S03",
        "lhs": "4-1",
        "rhs": "3"
      },
      {
        "id": "N2",
        "step": "S03",
        "lhs": "6-2",
        "rhs": "4"
      },
      {
        "id": "N3",
        "step": "S04",
        "lhs": "3**2+4**2",
        "rhs": "25"
      },
      {
        "id": "N4",
        "step": "S05.1",
        "lhs": "5**2",
        "rhs": "25"
      },
      {
        "id": "N5",
        "step": "S06",
        "lhs": "(-5)**2",
        "rhs": "25"
      },
      {
        "id": "N6",
        "step": "S06",
        "lhs": "-5",
        "relation": "<",
        "rhs": "0"
      },
      {
        "id": "N7",
        "step": "S07",
        "lhs": "6-1",
        "rhs": "5"
      },
      {
        "id": "N8",
        "step": "S07",
        "lhs": "-1-2",
        "rhs": "-3"
      },
      {
        "id": "N9",
        "step": "S08",
        "lhs": "5**2+(-3)**2",
        "rhs": "34"
      },
      {
        "id": "N10",
        "step": "S09",
        "lhs": "25",
        "relation": "<",
        "rhs": "34"
      },
      {
        "id": "N11",
        "step": "S10",
        "lhs": "6**2",
        "rhs": "36"
      },
      {
        "id": "N12",
        "step": "S10",
        "lhs": "34",
        "relation": "<",
        "rhs": "36"
      },
      {
        "id": "N13",
        "step": "S11",
        "lhs": "(1-1)**2+(2-2)**2",
        "rhs": "0"
      },
      {
        "id": "N14",
        "step": "S12",
        "vars": [
          "a",
          "b"
        ],
        "degree": 2,
        "lhs": "(a-b)**2",
        "rhs": "(b-a)**2"
      },
      {
        "id": "N15",
        "step": "S09.1",
        "vars": [
          "a",
          "b"
        ],
        "degree": 2,
        "lhs": "(b-a)*(b+a)",
        "rhs": "b**2-a**2"
      },
      {
        "id": "N16",
        "step": "S12",
        "lhs": "(1-4)**2+(2-6)**2",
        "rhs": "25"
      },
      {
        "id": "N17",
        "lhs": "abs(3)+abs(4)",
        "relation": "!=",
        "rhs": "5"
      },
      {
        "id": "N18",
        "lhs": "5.83**2",
        "relation": "!=",
        "rhs": "34"
      },
      {
        "id": "N19",
        "lhs": "(-6)**2",
        "relation": ">",
        "rhs": "5**2"
      },
      {
        "id": "N20",
        "lhs": "3**2+(2*4)**2",
        "rhs": "73"
      },
      {
        "id": "N21",
        "lhs": "9+16+2*3*4*(1/2)",
        "rhs": "37"
      }
    ]
  },
  "presentation": {
    "md_scope": {
      "zh-Hant": "只在 MKO 的範圍內工作：平面、兩點位於同一個兩軸同單位的正交座標系、整數座標。完整證明「兩個非負量可用平方比較」的引理；不證明三角不等式或 d 是度量，不處理斜交或不等尺度的框架（只在錯誤控制中說明差異），也不建立 Lean 的 EuclideanSpace 橋接；不改動 canonical MKO 或英文 edition。",
      "en": "Works inside the MKO's scope: the plane, two points in one orthonormal frame whose axes use the same unit, integer coordinates. It fully proves the lemma that two nonnegative quantities can be compared through their squares; it does not prove the triangle inequality or that d is a metric, does not treat skew or unequally scaled frames (their difference is only described in an error control), and does not build the Lean EuclideanSpace bridge; it does not change the canonical MKO or its English edition."
    },
    "md_symbols": [
      [
        "d(P,Q)",
        "P 與 Q 的歐氏距離",
        "the Euclidean distance between P and Q"
      ],
      [
        "(p_x,p_y),\\ (q_x,q_y)",
        "P、Q 在同一框架中的座標",
        "the coordinates of P and Q in the same frame"
      ],
      [
        "Q-P",
        "逐坐標相減得到的座標差",
        "the coordinate differences, taken coordinatewise"
      ],
      [
        "\\sqrt{a}",
        "a≥0 的主平方根（非負）",
        "the principal (nonnegative) square root of a≥0"
      ],
      [
        "a,b",
        "引理中的兩個非負實數",
        "two nonnegative reals in the lemma"
      ]
    ],
    "md_error_controls": [
      {
        "title": "負根不是距離 / A negative root is not a distance",
        "zh": "MKO 指出的第一個誤解是把負平方根當距離。方程 b²=25 有兩個實數解 5 與 −5，但距離是主平方根，必須非負（S02、S06）。檢查候選距離要同時核對兩件事：平方等於平方和，而且值非負。",
        "en": "The first misconception the MKO names is taking a negative square root as the distance. The equation b²=25 has two real solutions, 5 and −5, but the distance is the principal square root and must be nonnegative (S02, S06). A candidate distance must pass two checks: its square equals the sum of squares, and it is nonnegative."
      },
      {
        "title": "先確認框架 / Check the frame first",
        "zh": "公式只在兩軸互相垂直且同單位的框架中給出歐氏距離。若 x 軸一格是 1 cm、y 軸一格是 2 cm，座標差 (3,4) 代表實際位移 3 cm 與 8 cm，實際距離是 √(9+64)=√73 cm，不是 5 cm。若兩軸夾 60° 且同單位，向量 3e₁+4e₂ 的長度平方是 9+16+2·3·4·cos60°=37，也不是 25（這個計算用到內積，本稿不證明）。所以 S01 先確認 G1。",
        "en": "The formula gives Euclidean distance only in a frame with perpendicular axes and a common length unit. If one grid step is 1 cm on the x-axis and 2 cm on the y-axis, the coordinate difference (3,4) is a physical displacement of 3 cm and 8 cm, and the physical distance is √(9+64)=√73 cm, not 5 cm. If the axes meet at 60° with a common length unit, the squared length of 3e₁+4e₂ is 9+16+2·3·4·cos60°=37, again not 25 (this uses the inner product and is not proved here). That is why S01 first checks G1."
      },
      {
        "title": "平方比較需要非負 / Comparing squares needs nonnegative numbers",
        "zh": "引理 L_sq_order 要求 a、b≥0。對一般實數它不成立：−6<5，但 (−6)²=36>25。距離可以用平方比較，是因為 S02 保證距離非負。",
        "en": "Lemma L_sq_order requires a, b≥0. For arbitrary reals it fails: −6<5 but (−6)²=36>25. Distances can be compared by squares because S02 guarantees that they are nonnegative."
      }
    ],
    "md_open_items": [
      {
        "zh-Hant": "本稿不證明三角不等式，也不證明 d 滿足全部度量公理；只用到 d≥0、平方公式與對稱性。",
        "en": "This guide does not prove the triangle inequality or that d satisfies all metric axioms; it uses only d≥0, the squared formula and symmetry."
      },
      {
        "zh-Hant": "錯誤控制中 60° 斜交框架的長度計算用到內積公式，本稿未證明，只作對照說明。",
        "en": "The length computation for the 60° skew frame in the error controls uses the inner-product formula, which is not proved here and serves only as a contrast."
      },
      {
        "zh-Hant": "MKO 的 formal next（綁定 EuclideanSpace ℝ (Fin 2)）未做。",
        "en": "The MKO's formal next step (binding EuclideanSpace ℝ (Fin 2)) is not done."
      }
    ]
  },
  "revision": {
    "id": "production-20261019-adopted-96",
    "source_commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f",
    "adopted_source_sha256": "7504f016b13763fd8c797e2dbf0a09a7117e6f60892b44e03628e66cbaba7743",
    "original_source_sha256": "7504f016b13763fd8c797e2dbf0a09a7117e6f60892b44e03628e66cbaba7743",
    "owner_adopted": true,
    "bilingual_sync": "complete_source_bound",
    "formal_Lean": "NOT_RUN",
    "independent_AI_concurrence": "NOT_MEASURED",
    "issue_ids": [],
    "scope": "Owner-adopted natural-language teaching guide; not a formal proof, canonical MKO rewrite or evidence-status promotion."
  }
}
