{
  "schema_version": "ocme-derivation-reader-v1",
  "guide_id": "derivation-mko-graph-01",
  "mko_id": "mko-graph",
  "title": {
    "zh-Hant": "有限簡單無向圖：鄰居、度數與握手公式",
    "en": "Finite simple undirected graphs: neighbours, degrees and the handshake formula"
  },
  "contract": {
    "schema_version": "ocme-derivation-guide-v0.1",
    "guide_id": "derivation-mko-graph-01",
    "source": {
      "mko_id": "mko-graph",
      "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f",
      "sha256": "47d40107cd3836bb878ae46e5c4766288abb1b91e480c38ed14f61f749d27d55",
      "english_sha256": "985d93ed708f51da0e885228658ca76c7075f5bf67bb09b35d10745db33dc847"
    },
    "mode": "worked_example",
    "audience_prerequisites": [
      "set_extensionality",
      "set_builder",
      "finite_counting_basics",
      "finite_sum_rules",
      "numeric_evaluation",
      "graph_defs"
    ],
    "goal": {
      "zh-Hant": "設 V={1,2,3,4,5}，邊以端點對清單輸入：(1,2)、(2,1)、(2,3)、(3,4)、(2,4)、(4,2)，每一項表示一條無向邊。把輸入正規化為邊集合 E，求每個頂點的鄰居集合 N(v) 與度數 deg(v)，核對度數和等於 2|E|，並對每個有限簡單無向圖證明握手公式 Σ_{v∈V} deg(v)=2|E|。",
      "en": "Let V={1,2,3,4,5}, with edges entered as a list of endpoint pairs: (1,2), (2,1), (2,3), (3,4), (2,4), (4,2), each entry denoting an undirected edge. Normalize the input to the edge set E, find the neighbour set N(v) and degree deg(v) of every vertex, check that the degree sum equals 2|E|, and prove the handshake formula Σ_{v∈V} deg(v)=2|E| for every finite simple undirected graph."
    },
    "givens": [
      {
        "id": "G1",
        "statement": {
          "zh-Hant": "V={1,2,3,4,5}，頂點標籤互異（MKO 假設 a1）。",
          "en": "V={1,2,3,4,5}, with distinct vertex labels (MKO assumption a1)."
        }
      },
      {
        "id": "G2",
        "statement": {
          "zh-Hant": "輸入清單依序為 (1,2)、(2,1)、(2,3)、(3,4)、(2,4)、(4,2)；每一項 (u,v) 表示無向邊 {u,v}，無向邊不區分端點順序（MKO 假設 a2）。",
          "en": "The input list is, in order, (1,2), (2,1), (2,3), (3,4), (2,4), (4,2); each entry (u,v) denotes the undirected edge {u,v}, and an undirected edge ignores endpoint order (MKO assumption a2)."
        }
      },
      {
        "id": "G3",
        "statement": {
          "zh-Hant": "另一個圖 G₀=({1,2,3},∅) 用來檢查空邊集合的邊界。",
          "en": "A second graph G₀=({1,2,3},∅) is used to check the boundary case of an empty edge set."
        }
      }
    ],
    "steps": [
      {
        "id": "S01",
        "uses": [
          "G1",
          "G2",
          "mko_graph_def"
        ],
        "before_tex": "(1,2),(2,1),(2,3),(3,4),(2,4),(4,2)",
        "after_tex": "\\text{each entry has two distinct endpoints in}\\ V",
        "relation": "implies",
        "rule": "mko_graph_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "依 MKO 假設 a1，每條邊的兩個端點都要在 V 中且相異。逐項檢查：出現的端點 1、2、3、4 都在 V 中，六項的兩端分別是 1≠2、2≠1、2≠3、3≠4、2≠4、4≠2。所以每一項都表示一條合法的無向邊，沒有自環。",
          "en": "By MKO assumption a1, both endpoints of every edge must lie in V and be distinct. Check each entry: the endpoints that occur, 1, 2, 3, 4, are in V, and the six entries have endpoints 1≠2, 2≠1, 2≠3, 3≠4, 2≠4, 4≠2. So every entry denotes a legitimate undirected edge, and there are no loops."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "G2",
            "mko_graph_def",
            "two_element_set"
          ],
          "explanation": {
            "zh-Hant": "若某項是 (3,3)，它對應 {3,3}={3}，只有一個元素，不是邊；本輸入沒有這種項。此步只核對資格，不計數。",
            "en": "An entry (3,3) would correspond to {3,3}={3}, a one-element set, which is not an edge; this input has no such entry. This step only checks eligibility and does not count."
          }
        },
        "leaf_basis": "mko_graph_def + roster_membership + two_element_set"
      },
      {
        "id": "S02",
        "uses": [
          "S01",
          "two_element_set",
          "set_extensionality"
        ],
        "before_tex": "\\{1,2\\},\\{2,1\\},\\{2,3\\},\\{3,4\\},\\{2,4\\},\\{4,2\\}",
        "after_tex": "E=\\{\\{1,2\\},\\{2,3\\},\\{3,4\\},\\{2,4\\}\\}",
        "relation": "equivalent",
        "rule": "set_extensionality",
        "conditions": [],
        "explanation": {
          "zh-Hant": "把每一項換成無向邊 {u,v}。{1,2} 與 {2,1} 有相同元素，依集合相等是同一條邊；{2,4} 與 {4,2} 也一樣。E 是集合，重複的元素只算一次，所以 E={{1,2},{2,3},{3,4},{2,4}}。正規化不製造新邊，也不刪掉任何不同的邊。",
          "en": "Replace each entry by the undirected edge {u,v}. {1,2} and {2,1} have the same elements, so by set equality they are the same edge; likewise {2,4} and {4,2}. E is a set, in which repeated elements count once, so E={{1,2},{2,3},{3,4},{2,4}}. Normalization creates no new edge and deletes no distinct edge."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "set_extensionality",
            "two_element_set"
          ],
          "explanation": {
            "zh-Hant": "清單與 E 描述同一個邊集合：清單的每一項都在 E 中，E 的每條邊都出現在清單中，兩向成立。",
            "en": "The list and E describe the same edge set: every entry of the list is in E and every edge of E appears in the list, so it holds both ways."
          }
        },
        "leaf_basis": "set_extensionality + two_element_set"
      },
      {
        "id": "S03",
        "uses": [
          "S02",
          "set_extensionality",
          "finite_counting_basics"
        ],
        "before_tex": "E=\\{\\{1,2\\},\\{2,3\\},\\{3,4\\},\\{2,4\\}\\}",
        "after_tex": "|E|=4",
        "relation": "implies",
        "rule": "finite_counting_basics",
        "conditions": [],
        "explanation": {
          "zh-Hant": "四條邊兩兩不同：{1,2} 含 1 而其他三條都不含 1；{2,3} 含 3 而不含 4；{3,4} 含 4 而不含 2；{2,4} 含 2 而不含 3。所以四者是不同的集合，|E|=4，不是輸入清單的 6 項。|E| 也不超過 V 的二元素子集合個數 C(5,2)=10（N4）。",
          "en": "The four edges are pairwise distinct: {1,2} contains 1 while the other three do not; {2,3} contains 3 but not 4; {3,4} contains 4 but not 2; {2,4} contains 2 but not 3. So they are four different sets and |E|=4, not the 6 entries of the input list. |E| also does not exceed the number C(5,2)=10 of two-element subsets of V (N4)."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "set_extensionality",
            "finite_counting_basics"
          ],
          "explanation": {
            "zh-Hant": "計數前必須先確認元素互異；這正是 MKO 第一段強調的重點。",
            "en": "Distinctness must be confirmed before counting; this is exactly the point stressed in MKO paragraph one."
          }
        },
        "leaf_basis": "set_extensionality + finite_counting_basics"
      },
      {
        "id": "S04",
        "uses": [
          "S02",
          "graph_defs"
        ],
        "before_tex": "N(1)=\\{u\\in V\\mid\\{u,1\\}\\in E\\}",
        "after_tex": "N(1)=\\{2\\}",
        "relation": "equivalent",
        "rule": "graph_defs",
        "conditions": [],
        "explanation": {
          "zh-Hant": "u∈N(1) 當且僅當 {u,1}∈E。E 中含 1 的邊只有 {1,2}，而 {u,1}={1,2} 且 u≠1 推出 u=2。所以 N(1)={2}。",
          "en": "u∈N(1) exactly when {u,1}∈E. The only edge of E containing 1 is {1,2}, and {u,1}={1,2} with u≠1 forces u=2. So N(1)={2}."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "graph_defs",
            "set_extensionality"
          ],
          "explanation": {
            "zh-Hant": "兩個包含都已核對：2∈N(1) 因 {2,1}∈E；其他 u 沒有同時含 1 與 u 的邊。",
            "en": "Both inclusions are checked: 2∈N(1) because {2,1}∈E; no other u has an edge containing both 1 and u."
          }
        },
        "leaf_basis": "graph_defs + set_extensionality + two_element_set"
      },
      {
        "id": "S05",
        "uses": [
          "S02",
          "graph_defs"
        ],
        "before_tex": "N(2)=\\{u\\in V\\mid\\{u,2\\}\\in E\\}",
        "after_tex": "N(2)=\\{1,3,4\\}",
        "relation": "equivalent",
        "rule": "graph_defs",
        "conditions": [],
        "explanation": {
          "zh-Hant": "E 中含 2 的邊是 {1,2}、{2,3}、{2,4}，另一端分別是 1、3、4；{3,4} 不含 2，而 {2,5} 不在 E 中。所以 N(2)={1,3,4}。清單中 (2,4) 與 (4,2) 都出現，但 4 在 N(2) 中只算一次。",
          "en": "The edges of E containing 2 are {1,2}, {2,3}, {2,4}, with other endpoints 1, 3, 4; {3,4} does not contain 2, and {2,5} is not in E. So N(2)={1,3,4}. Both (2,4) and (4,2) appear in the list, but 4 counts once in N(2)."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "graph_defs",
            "set_extensionality"
          ],
          "explanation": {
            "zh-Hant": "逐一檢查 V 中 u≠2 的四個候選 1、3、4、5，兩向的包含都成立。",
            "en": "Checking the four candidates u≠2 in V, namely 1, 3, 4, 5, gives both inclusions."
          }
        },
        "leaf_basis": "graph_defs + set_extensionality + two_element_set"
      },
      {
        "id": "S06",
        "uses": [
          "S02",
          "graph_defs"
        ],
        "before_tex": "N(3),\\ N(4)",
        "after_tex": "N(3)=\\{2,4\\},\\ N(4)=\\{2,3\\}",
        "relation": "equivalent",
        "rule": "graph_defs",
        "conditions": [],
        "explanation": {
          "zh-Hant": "含 3 的邊是 {2,3}、{3,4}，所以 N(3)={2,4}；含 4 的邊是 {3,4}、{2,4}，所以 N(4)={2,3}。",
          "en": "The edges containing 3 are {2,3} and {3,4}, so N(3)={2,4}; the edges containing 4 are {3,4} and {2,4}, so N(4)={2,3}."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "graph_defs",
            "set_extensionality"
          ],
          "explanation": {
            "zh-Hant": "同 S05，對每個候選頂點逐一核對，兩向成立。",
            "en": "As in S05, each candidate vertex is checked, so both directions hold."
          }
        },
        "leaf_basis": "graph_defs + set_extensionality + two_element_set"
      },
      {
        "id": "S07",
        "uses": [
          "S02",
          "graph_defs"
        ],
        "before_tex": "N(5)=\\{u\\in V\\mid\\{u,5\\}\\in E\\}",
        "after_tex": "N(5)=\\varnothing",
        "relation": "equivalent",
        "rule": "graph_defs",
        "conditions": [],
        "explanation": {
          "zh-Hant": "E 的四條邊都不含 5，所以沒有 u 使 {u,5}∈E，N(5)=∅。5 是孤立頂點，但它仍是 V 的元素，也是圖的一部分。",
          "en": "None of the four edges of E contains 5, so no u has {u,5}∈E, and N(5)=∅. 5 is an isolated vertex, but it is still an element of V and part of the graph."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "graph_defs",
            "set_extensionality"
          ],
          "explanation": {
            "zh-Hant": "兩個集合都沒有元素，相等；這需要檢查 E 的全部四條邊。",
            "en": "Both sets have no elements, so they are equal; this needs all four edges of E to be checked."
          }
        },
        "leaf_basis": "graph_defs + set_extensionality"
      },
      {
        "id": "S08",
        "uses": [
          "S04",
          "S05",
          "S06",
          "S07",
          "graph_defs"
        ],
        "before_tex": "N(1),N(2),N(3),N(4),N(5)",
        "after_tex": "\\deg(1)=1,\\ \\deg(2)=3,\\ \\deg(3)=2,\\ \\deg(4)=2,\\ \\deg(5)=0",
        "relation": "implies",
        "rule": "graph_defs",
        "conditions": [],
        "explanation": {
          "zh-Hant": "deg(v)=|N(v)|，即不同鄰居的個數：|{2}|=1、|{1,3,4}|=3、|{2,4}|=2、|{2,3}|=2、|∅|=0。孤立頂點的度數為零。",
          "en": "deg(v)=|N(v)|, the number of distinct neighbours: |{2}|=1, |{1,3,4}|=3, |{2,4}|=2, |{2,3}|=2, |∅|=0. An isolated vertex has degree zero."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S04",
            "S05",
            "S06",
            "S07",
            "graph_defs"
          ],
          "explanation": {
            "zh-Hant": "需要每個 N(v) 已以集合正確求出；度數數的是不同鄰居，不是清單中的出現次數。",
            "en": "Each N(v) must have been found correctly as a set; a degree counts distinct neighbours, not occurrences in the list."
          }
        },
        "leaf_basis": "graph_defs + finite_counting_basics"
      },
      {
        "id": "S09",
        "uses": [
          "S03",
          "S08"
        ],
        "before_tex": "\\sum_{v\\in V}\\deg(v),\\ 2|E|",
        "after_tex": "1+3+2+2+0=8=2\\cdot 4",
        "relation": "implies",
        "rule": "numeric_evaluation",
        "conditions": [],
        "explanation": {
          "zh-Hant": "度數和 1+3+2+2+0=8，2|E|=2·4=8，兩者相等。這個例子吻合握手公式，但一個例子不證明一般結論；一般證明在 S10。",
          "en": "The degree sum is 1+3+2+2+0=8 and 2|E|=2·4=8, so they agree. This example fits the handshake formula, but one example does not prove the general claim; the general proof is in S10."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S03",
            "S08",
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "可獨立重算（N1、N2）；不由此宣稱公式對所有圖成立。",
            "en": "This can be recomputed (N1, N2); it is not used to claim the formula for all graphs."
          }
        },
        "leaf_basis": "numeric_evaluation + finite_sum_rules"
      },
      {
        "id": "S10",
        "uses": [
          "S03",
          "S08",
          "L_handshake"
        ],
        "before_tex": "G=(V,E)\\ \\text{finite simple undirected}",
        "after_tex": "\\sum_{v\\in V}\\deg(v)=2|E|",
        "relation": "theorem_application",
        "rule": "L_handshake",
        "conditions": [
          "V\\ \\text{finite}",
          "\\text{no loops, no multiple edges}"
        ],
        "explanation": {
          "zh-Hant": "引理 L_handshake 對每個有限簡單無向圖成立；它在子步 S10.1 到 S10.3 證明，證明只用 graph_defs 的定義與雙重計數，不用 MKO 陳述中的握手公式本身。用於本例：Σ deg(v)=8=2·4，與 S09 的直接計算一致。",
          "en": "Lemma L_handshake holds for every finite simple undirected graph; it is proved in sub-steps S10.1 to S10.3 using only the definitions in graph_defs and double counting, not the handshake statement contained in the MKO. For this example: Σ deg(v)=8=2·4, agreeing with the direct computation in S09."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "L_handshake",
            "S03",
            "S08"
          ],
          "explanation": {
            "zh-Hant": "需要 G 是有限簡單無向圖（S01、S02 已確認）；有向圖或多重圖不在範圍內。",
            "en": "G must be a finite simple undirected graph (confirmed in S01 and S02); directed graphs and multigraphs are out of scope."
          }
        },
        "leaf_basis": "graph_defs + double_counting + two_element_set + finite_sum_rules"
      },
      {
        "id": "S10.1",
        "uses": [
          "graph_defs",
          "two_element_set",
          "set_extensionality"
        ],
        "before_tex": "E_v=\\{e\\in E\\mid v\\in e\\}",
        "after_tex": "|E_v|=\\deg(v)",
        "relation": "implies",
        "rule": "graph_defs",
        "conditions": [
          "u\\neq v\\ \\text{for every}\\ u\\in N(v)"
        ],
        "explanation": {
          "zh-Hant": "固定 v，定義 φ(u)={u,v}，把 N(v) 映到 E_v（u∈N(v) 表示 {u,v}∈E，且這條邊含 v）。單射：若 {u,v}={u′,v}，因 u≠v，由 u∈{u′,v} 得 u=u′。滿射：若 e∈E_v，e 是含 v 的二元素集合，所以 e={v,w} 且 w≠v；{w,v}∈E 表示 w∈N(v)，且 φ(w)=e。φ 是雙射，依有限計數 |E_v|=|N(v)|=deg(v)。",
          "en": "Fix v and define φ(u)={u,v}, mapping N(v) to E_v (u∈N(v) means {u,v}∈E, and this edge contains v). Injective: if {u,v}={u′,v}, then since u≠v, u∈{u′,v} forces u=u′. Surjective: if e∈E_v, e is a two-element set containing v, so e={v,w} with w≠v; {w,v}∈E means w∈N(v), and φ(w)=e. φ is a bijection, so by finite counting |E_v|=|N(v)|=deg(v)."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "graph_defs",
            "two_element_set",
            "injective_surjective_def",
            "finite_counting_basics"
          ],
          "explanation": {
            "zh-Hant": "本稿固定無自環的二元素邊模型，這裡的單射論證使用 u≠v。不能一概說允許自環後鄰點與關聯邊的對應必失敗：若以單點集合表示 loop，該對應仍可能雙射；此時後續每條邊恰有兩個端點的計數才不再適用。loop 的度數慣例須另定，本稿不處理。",
            "en": "The guide fixes loop-free edges as two-element sets, and this injectivity argument uses u≠v. Allowing loops does not inevitably destroy the neighbour-to-incident-edge correspondence: with a loop represented by a singleton set it can remain bijective, while the later count of exactly two endpoints per edge fails. Loop-degree conventions would need a separate definition and are outside this guide."
          }
        },
        "leaf_basis": "graph_defs + two_element_set + set_extensionality + injective_surjective_def + finite_counting_basics"
      },
      {
        "id": "S10.2",
        "uses": [
          "graph_defs",
          "two_element_set"
        ],
        "before_tex": "\\{v\\in V\\mid v\\in e\\}\\ \\text{for}\\ e\\in E",
        "after_tex": "|\\{v\\in V\\mid v\\in e\\}|=|e|=2",
        "relation": "implies",
        "rule": "two_element_set",
        "conditions": [],
        "explanation": {
          "zh-Hant": "固定邊 e={u,w}∈E（u≠w，兩端都在 V 中）。屬於 e 的頂點恰是 u 與 w，所以這個集合就是 e，元素個數是 2。",
          "en": "Fix an edge e={u,w}∈E (u≠w, both endpoints in V). The vertices lying in e are exactly u and w, so this set is e itself, with 2 elements."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "graph_defs",
            "two_element_set"
          ],
          "explanation": {
            "zh-Hant": "需要兩端相異；端點都在 V 中保證 e⊆V。",
            "en": "It needs the endpoints to be distinct; both endpoints lying in V guarantees e⊆V."
          }
        },
        "leaf_basis": "graph_defs + two_element_set"
      },
      {
        "id": "S10.3",
        "uses": [
          "S10.1",
          "S10.2",
          "double_counting",
          "finite_sum_rules"
        ],
        "before_tex": "I=\\{(v,e)\\in V\\times E\\mid v\\in e\\}",
        "after_tex": "\\sum_{v\\in V}\\deg(v)=|I|=\\sum_{e\\in E}2=2|E|",
        "relation": "implies",
        "rule": "double_counting",
        "conditions": [
          "V,\\ E\\ \\text{finite}"
        ],
        "explanation": {
          "zh-Hant": "對關聯對集合 I 做雙重計數：按第一分量分組，v 那一組是 {e ∣ (v,e)∈I}=E_v，大小 deg(v)（S10.1），所以 |I|=Σ_v deg(v)；按第二分量分組，e 那一組是 {v ∣ v∈e}，大小 2（S10.2），所以 |I|=Σ_e 2=2|E|（有限和的常數倍）。兩式都等於 |I|，得 Σ_v deg(v)=2|E|。S10.1 到 S10.3 證得引理 L_handshake。",
          "en": "Count the incidence set I twice: grouped by first coordinate, the group of v is {e ∣ (v,e)∈I}=E_v, of size deg(v) (S10.1), so |I|=Σ_v deg(v); grouped by second coordinate, the group of e is {v ∣ v∈e}, of size 2 (S10.2), so |I|=Σ_e 2=2|E| (a constant multiple in a finite sum). Both expressions equal |I|, so Σ_v deg(v)=2|E|. S10.1 to S10.3 prove Lemma L_handshake."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S10.1",
            "S10.2",
            "double_counting",
            "finite_sum_rules",
            "eq_refl_symm_trans"
          ],
          "explanation": {
            "zh-Hant": "需要 V、E 有限，雙重計數才適用；空圖時兩邊都是 0，仍成立。",
            "en": "V and E must be finite for double counting to apply; for an empty graph both sides are 0 and it still holds."
          }
        },
        "leaf_basis": "double_counting + finite_sum_rules + eq_refl_symm_trans"
      },
      {
        "id": "S11",
        "uses": [
          "S08",
          "S10",
          "contradiction"
        ],
        "before_tex": "|E'|=6\\ \\text{(counting list entries)}",
        "after_tex": "2\\cdot 6=12\\neq 8=\\sum_{v}\\deg(v)",
        "relation": "implies",
        "rule": "contradiction",
        "conditions": [],
        "explanation": {
          "zh-Hant": "若把 (1,2) 與 (2,1)、(2,4) 與 (4,2) 各算成兩條邊，會得到 6 條。但度數由鄰居集合決定（S08），和為 8；而 S10 對簡單圖證明了度數和必等於 2|E|。12≠8，所以「6 條邊」與簡單圖的定義矛盾，是計數錯誤。",
          "en": "If (1,2) and (2,1), and (2,4) and (4,2), were each counted as two edges, we would get 6 edges. But the degrees are fixed by the neighbour sets (S08) and sum to 8, while S10 proved that the degree sum of a simple graph must equal 2|E|. Since 12≠8, '6 edges' contradicts the definition of a simple graph; it is a counting error."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S08",
            "S10",
            "contradiction",
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "此步只說明錯誤計數與已證公式矛盾（N3）；正確的 |E|=4 來自 S02、S03。",
            "en": "This step only shows the wrong count contradicts the proved formula (N3); the correct |E|=4 comes from S02 and S03."
          }
        },
        "leaf_basis": "contradiction + numeric_evaluation"
      },
      {
        "id": "S12",
        "uses": [
          "G3",
          "graph_defs",
          "L_handshake"
        ],
        "before_tex": "G_0=(\\{1,2,3\\},\\varnothing)",
        "after_tex": "\\deg(v)=0\\ \\text{for every}\\ v,\\ \\sum_{v}\\deg(v)=0=2\\cdot 0",
        "relation": "implies",
        "rule": "graph_defs",
        "conditions": [],
        "explanation": {
          "zh-Hant": "MKO 允許空圖。取 V₀={1,2,3}、E₀=∅：對每個 v，沒有 {u,v}∈∅，所以 N(v)=∅、deg(v)=0；度數和 0+0+0=0=2·0，與 L_handshake 一致。若 V 也是空集合，度數和是空和 0，仍等於 2·0。",
          "en": "The MKO permits the empty graph. Take V₀={1,2,3}, E₀=∅: for every v there is no {u,v}∈∅, so N(v)=∅ and deg(v)=0; the degree sum 0+0+0=0=2·0 agrees with L_handshake. If V is empty as well, the degree sum is the empty sum 0, still equal to 2·0."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "graph_defs",
            "finite_sum_rules",
            "L_handshake"
          ],
          "explanation": {
            "zh-Hant": "需要空和等於 0 的約定（有限和規則）；N5 重算 0+0+0=2·0。",
            "en": "It needs the convention that the empty sum is 0 (finite sum rules); N5 recomputes 0+0+0=2·0."
          }
        },
        "leaf_basis": "graph_defs + finite_sum_rules + numeric_evaluation"
      },
      {
        "id": "S13",
        "uses": [
          "S02",
          "S03",
          "S08",
          "S10",
          "S12"
        ],
        "before_tex": "\\text{S02, S03, S08, S10, S12}",
        "after_tex": "|E|=4,\\ (\\deg(v))_{v=1}^{5}=(1,3,2,2,0),\\ \\sum_v\\deg(v)=2|E|",
        "relation": "implies",
        "rule": "and_intro_elim",
        "conditions": [],
        "explanation": {
          "zh-Hant": "彙整：正規化後 E={{1,2},{2,3},{3,4},{2,4}}，|E|=4（S02、S03）；度數依序為 1、3、2、2、0（S08）；握手公式對每個有限簡單無向圖成立，本例 8=2·4（S10）；空邊集合時度數和為 0（S12）。",
          "en": "Summary: after normalization E={{1,2},{2,3},{3,4},{2,4}} and |E|=4 (S02, S03); the degrees are 1, 3, 2, 2, 0 in order (S08); the handshake formula holds for every finite simple undirected graph, here 8=2·4 (S10); with an empty edge set the degree sum is 0 (S12)."
        },
        "reverse_audit": {
          "kind": "sufficient_goal_reduction",
          "required_ids": [
            "S02",
            "S03",
            "S08",
            "S10",
            "S12",
            "and_intro_elim"
          ],
          "explanation": {
            "zh-Hant": "目標 G：E、各度數、握手公式的核對與一般證明。足夠條件 H：S02、S03、S08、S10、S12；H⇒G 只是合取，H 由 G1 到 G3 正向證成，沒有把 G 當作前提。",
            "en": "Goal G: E, the degrees, the check and the general proof of the handshake formula. Sufficient condition H: S02, S03, S08, S10, S12; H⇒G is just conjunction, H is proved forwards from G1 to G3, and G is never used as a premise."
          }
        },
        "leaf_basis": "and_intro_elim"
      }
    ],
    "result": {
      "zh-Hant": "輸入的六項正規化後只有四條不同的無向邊：E={{1,2},{2,3},{3,4},{2,4}}。鄰居集合為 N(1)={2}、N(2)={1,3,4}、N(3)={2,4}、N(4)={2,3}、N(5)=∅，度數依序為 1、3、2、2、0，度數和 8=2·4=2|E|。對每個有限簡單無向圖，Σ_v deg(v)=2|E|（以雙重計數證明）；空邊集合時度數和為 0。",
      "en": "The six input entries normalize to only four distinct undirected edges: E={{1,2},{2,3},{3,4},{2,4}}. The neighbour sets are N(1)={2}, N(2)={1,3,4}, N(3)={2,4}, N(4)={2,3}, N(5)=∅, the degrees are 1, 3, 2, 2, 0 in order, and the degree sum is 8=2·4=2|E|. For every finite simple undirected graph, Σ_v deg(v)=2|E| (proved by double counting); with an empty edge set the degree sum is 0."
    },
    "negative_controls": [
      {
        "claim": {
          "zh-Hant": "(1,2) 與 (2,1) 是兩條不同的邊，所以 |E|=6",
          "en": "(1,2) and (2,1) are two different edges, so |E|=6"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "{1,2}={2,1}；|E|=4，而 2·6=12 與度數和 8 不符。",
          "en": "{1,2}={2,1}; |E|=4, and 2·6=12 disagrees with the degree sum 8."
        }
      },
      {
        "claim": {
          "zh-Hant": "圖上兩條邊的線段相交處是一個新頂點",
          "en": "The point where two drawn edges cross is a new vertex"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "頂點集合 V 是給定的；交叉點只屬於畫法，不在 V 中，也不改變 E。",
          "en": "The vertex set V is given; a crossing belongs only to the drawing, is not in V, and does not change E."
        }
      },
      {
        "claim": {
          "zh-Hant": "5 沒有鄰居，所以 5 不是圖的頂點",
          "en": "5 has no neighbour, so 5 is not a vertex of the graph"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "5∈V；它是度數 0 的孤立頂點。",
          "en": "5∈V; it is an isolated vertex of degree 0."
        }
      },
      {
        "claim": {
          "zh-Hant": "可以加入邊 {3,3}，使 deg(3) 變成 3",
          "en": "The edge {3,3} can be added, making deg(3) equal to 3"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "{3,3}={3} 只有一個元素，不是二元素子集合；簡單圖沒有自環。",
          "en": "{3,3}={3} has one element and is not a two-element subset; a simple graph has no loops."
        }
      }
    ],
    "status": "candidate",
    "gaps": [],
    "verification": {
      "structure": "checked_local_script",
      "mathematics": "candidate_argument",
      "formalization": "not_formalized"
    },
    "rule_glossary": [
      {
        "id": "set_extensionality",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "集合相等：A=B 當且僅當 A⊆B 且 B⊆A，即兩者有相同元素。",
          "en": "Set equality: A=B if and only if A⊆B and B⊆A, i.e. they have the same elements."
        }
      },
      {
        "id": "set_builder",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "集合建構式：x∈{y∈A ∣ P(y)} 當且僅當 x∈A 且 P(x)。",
          "en": "Set-builder notation: x∈{y∈A ∣ P(y)} if and only if x∈A and P(x)."
        }
      },
      {
        "id": "finite_counting_basics",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "有限計數：互斥有限集合 A、B 有 |A∪B|=|A|+|B|；|A×B|=|A|·|B|；有限集之間存在雙射 ⇔ 元素個數相同。",
          "en": "Finite counting: for disjoint finite sets A, B, |A∪B|=|A|+|B|; |A×B|=|A|·|B|; there is a bijection between finite sets ⇔ they have the same number of elements."
        }
      },
      {
        "id": "finite_sum_rules",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "有限和：Σ_{i=1}^{0} a_i=0、Σ_{i=1}^{n+1} a_i=Σ_{i=1}^{n} a_i + a_{n+1}；Σ(a_i+b_i)=Σa_i+Σb_i；Σ c·a_i=c·Σa_i。",
          "en": "Finite sums: Σ_{i=1}^{0} a_i=0 and Σ_{i=1}^{n+1} a_i=Σ_{i=1}^{n} a_i + a_{n+1}; Σ(a_i+b_i)=Σa_i+Σb_i; Σ c·a_i=c·Σa_i."
        }
      },
      {
        "id": "numeric_evaluation",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "明確整數或有理數算式的精確求值；可以獨立重算。",
          "en": "Exact evaluation of an explicit integer or rational expression; independently recomputable."
        }
      },
      {
        "id": "injective_surjective_def",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "單射：f(a)=f(a′) ⇒ a=a′。滿射：每個 b∈B 都有 a∈A 使 f(a)=b。雙射：既單又滿，此時有唯一反函數 f⁻¹ 使 f⁻¹∘f=id_A、f∘f⁻¹=id_B。",
          "en": "Injective: f(a)=f(a′) ⇒ a=a′. Surjective: every b∈B has some a∈A with f(a)=b. Bijective: both; then there is a unique inverse f⁻¹ with f⁻¹∘f=id_A and f∘f⁻¹=id_B."
        }
      },
      {
        "id": "eq_refl_symm_trans",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "等號的性質：u=u；若 u=v 則 v=u；若 u=v 且 v=w 則 u=w。",
          "en": "Properties of equality: u=u; if u=v then v=u; if u=v and v=w then u=w."
        }
      },
      {
        "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": "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_graph_def",
        "kind": "cited",
        "source": {
          "mko_id": "mko-graph",
          "sha256": "47d40107cd3836bb878ae46e5c4766288abb1b91e480c38ed14f61f749d27d55",
          "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f"
        },
        "statement": {
          "zh-Hant": "有限簡單無向圖 G=(V,E) 由有限頂點集合 V 與其二元素子集合構成的邊集合 E 組成。沒有自環或重邊；N(v)={u∈V:{u,v}∈E}，deg(v)=|N(v)|，所有頂點度數和為 2|E|。",
          "en": "A finite simple undirected graph G=(V,E) consists of a finite vertex set V and an edge set E of two-element subsets of V. There are no loops or multiple edges. N(v)={u∈V:{u,v}∈E}, deg(v)=|N(v)|, and the sum of all vertex degrees is 2|E|."
        }
      },
      {
        "id": "graph_defs",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "定義部分（不含度數和的結論）：G=(V,E)，V 有限，E 的每個元素是 V 的二元素子集合 {u,v}（u≠v）；N(v)={u∈V ∣ {u,v}∈E}；deg(v)=|N(v)|。",
          "en": "The definitions only (without the degree-sum conclusion): G=(V,E) with V finite and every element of E a two-element subset {u,v} of V (u≠v); N(v)={u∈V ∣ {u,v}∈E}; deg(v)=|N(v)|."
        }
      },
      {
        "id": "two_element_set",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "{u,v}={v,u}；u≠v 時 {u,v} 恰有兩個元素；{u,u}={u} 只有一個元素；z∈{u,v} 當且僅當 z=u 或 z=v。",
          "en": "{u,v}={v,u}; when u≠v, {u,v} has exactly two elements; {u,u}={u} has one element; z∈{u,v} exactly when z=u or z=v."
        }
      },
      {
        "id": "roster_membership",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "列舉集合的成員關係：對以列舉給出的有限集合 S={s_i ∣ 1≤i≤n}，z∈S 當且僅當存在 i 使 z=s_i。",
          "en": "Membership in a listed set: for a finite set given by listing, S={s_i ∣ 1≤i≤n}, z∈S exactly when z=s_i for some i."
        }
      },
      {
        "id": "double_counting",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "雙重計數：對有限集合 X、Y 與 I⊆X×Y，|I|=Σ_{x∈X} |{y∈Y ∣ (x,y)∈I}|=Σ_{y∈Y} |{x∈X ∣ (x,y)∈I}|（I 依第一或第二分量分成互斥的切片，再用互斥有限集合的加法原理）。",
          "en": "Double counting: for finite sets X, Y and I⊆X×Y, |I|=Σ_{x∈X} |{y∈Y ∣ (x,y)∈I}|=Σ_{y∈Y} |{x∈X ∣ (x,y)∈I}| (I splits into disjoint slices by either coordinate, and the addition rule for disjoint finite sets applies)."
        }
      },
      {
        "id": "L_handshake",
        "kind": "lemma",
        "proved_in": [
          "S10.1",
          "S10.2",
          "S10.3"
        ],
        "statement": {
          "zh-Hant": "對每個有限簡單無向圖 G=(V,E)，Σ_{v∈V} deg(v)=2|E|。",
          "en": "For every finite simple undirected graph G=(V,E), Σ_{v∈V} deg(v)=2|E|."
        }
      }
    ],
    "revision_log": [],
    "numeric_checks": [
      {
        "id": "N1",
        "step": "S09",
        "lhs": "1+3+2+2+0",
        "rhs": "8"
      },
      {
        "id": "N2",
        "step": "S09",
        "lhs": "2*4",
        "rhs": "8"
      },
      {
        "id": "N3",
        "step": "S11",
        "lhs": "2*6",
        "relation": "!=",
        "rhs": "8"
      },
      {
        "id": "N4",
        "step": "S03",
        "lhs": "4",
        "relation": "<=",
        "rhs": "comb(5,2)"
      },
      {
        "id": "N5",
        "step": "S12",
        "lhs": "0+0+0",
        "rhs": "2*0"
      },
      {
        "id": "N6",
        "step": "S10",
        "lhs": "2+2+2+2",
        "rhs": "1+3+2+2+0"
      }
    ]
  },
  "presentation": {
    "md_scope": {
      "zh-Hant": "在 MKO 的範圍內工作：有限頂點集合、二元素子集合作為邊、沒有自環與重邊、允許空圖。以雙重計數證明握手公式；雙重計數原理（有限集合按分量分組計數）作為前提。不處理有向圖、多重圖、自環計數、連通性或樹；不從畫法推論相鄰性；不改動 canonical MKO 或英文 edition。",
      "en": "Works inside the MKO's scope: a finite vertex set, edges as two-element subsets, no loops or multiple edges, and the empty graph allowed. Proves the handshake formula by double counting; the double-counting principle (counting a finite set of pairs by grouping on either coordinate) is a premise. Directed graphs, multigraphs, loop counting, connectivity and trees are not treated; adjacency is never inferred from a drawing; the canonical MKO and its English edition are not changed."
    },
    "md_symbols": [
      [
        "G=(V,E)",
        "有限簡單無向圖",
        "a finite simple undirected graph"
      ],
      [
        "\\{u,v\\}",
        "以 u、v 為端點的無向邊（u≠v）",
        "the undirected edge with endpoints u, v (u≠v)"
      ],
      [
        "N(v)",
        "v 的鄰居集合 {u∈V ∣ {u,v}∈E}",
        "the neighbour set {u∈V ∣ {u,v}∈E} of v"
      ],
      [
        "\\deg(v)",
        "v 的度數 |N(v)|",
        "the degree |N(v)| of v"
      ],
      [
        "E_v",
        "含 v 的邊所成集合 {e∈E ∣ v∈e}",
        "the set {e∈E ∣ v∈e} of edges at v"
      ],
      [
        "I",
        "關聯對集合 {(v,e)∈V×E ∣ v∈e}",
        "the incidence set {(v,e)∈V×E ∣ v∈e}"
      ]
    ],
    "md_error_controls": [
      {
        "title": "同一條無向邊不要算兩次 / Do not count one undirected edge twice",
        "zh": "MKO 指出的誤解之一是把無向邊的兩種排序算成兩條。{1,2}={2,1}、{2,4}={4,2}，所以六項輸入只有四條邊（S02、S03）。若算成 6 條，2·6=12 與度數和 8 不符（S11），握手公式立即揭露這個錯誤。",
        "en": "One misconception named by the MKO is counting the two orderings of an undirected edge as two edges. {1,2}={2,1} and {2,4}={4,2}, so the six input entries give only four edges (S02, S03). Counting 6 would give 2·6=12, which disagrees with the degree sum 8 (S11); the handshake formula exposes the error at once."
      },
      {
        "title": "畫線相交不是頂點 / A crossing in a drawing is not a vertex",
        "zh": "MKO 指出的另一個誤解是把示意線相交當成新增頂點。若把 1、2、3、4 畫在 (0,0)、(2,2)、(0,2)、(2,0)，則邊 {1,2} 與 {3,4} 的線段在 (1,1) 相交，但 V 仍是 {1,2,3,4,5}，(1,1) 不是頂點，也不產生新邊。相鄰性只由 E 決定，不由畫法決定。",
        "en": "The other misconception named by the MKO is treating a crossing of drawn lines as a new vertex. If 1, 2, 3, 4 are drawn at (0,0), (2,2), (0,2), (2,0), the segments of the edges {1,2} and {3,4} cross at (1,1), yet V is still {1,2,3,4,5}; (1,1) is not a vertex and creates no new edge. Adjacency is decided by E alone, not by a drawing."
      },
      {
        "title": "度數是不同鄰居數，孤立頂點仍要計入 / Degree counts distinct neighbours, and isolated vertices still count",
        "zh": "deg(2)=|{1,3,4}|=3，不是 2 在清單中出現的次數 5。5 沒有鄰居，deg(5)=0，但 5 仍是頂點，度數和要包含它（加 0）。自環 {v,v}={v} 不是二元素集合，簡單圖中不存在。",
        "en": "deg(2)=|{1,3,4}|=3, not the 5 occurrences of 2 in the list. 5 has no neighbour and deg(5)=0, but 5 is still a vertex and the degree sum includes it (adding 0). A loop {v,v}={v} is not a two-element set and does not exist in a simple graph."
      }
    ],
    "md_open_items": [
      {
        "zh-Hant": "雙重計數原理（double_counting）是本稿的前提，未在此由加法原理逐步推出。",
        "en": "The double-counting principle (double_counting) is a premise of this guide and is not derived here step by step from the addition rule."
      },
      {
        "zh-Hant": "本稿不處理握手公式的推論（例如奇度頂點個數為偶數），也不處理有向圖、多重圖或連通性。",
        "en": "This guide does not treat consequences of the handshake formula (such as the number of odd-degree vertices being even), nor directed graphs, multigraphs or connectivity."
      }
    ]
  },
  "revision": {
    "id": "production-20261019-adopted-96",
    "source_commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f",
    "adopted_source_sha256": "56916889c62315f978ca130e85048a57dac57e96f65188fb5224dbb0fa53182f",
    "original_source_sha256": "695ff8e49c105f1940c6ba7abe0fe527fc5fa6cc710601419531ac68bc4782e4",
    "owner_adopted": true,
    "bilingual_sync": "complete_source_bound",
    "formal_Lean": "NOT_RUN",
    "independent_AI_concurrence": "NOT_MEASURED",
    "issue_ids": [
      "BR-M010"
    ],
    "scope": "Owner-adopted natural-language teaching guide; not a formal proof, canonical MKO rewrite or evidence-status promotion."
  }
}
