{
  "schema_version": "ocme-derivation-reader-v1",
  "guide_id": "derivation-mko-lean-proof-term-01",
  "mko_id": "mko-lean-proof-term",
  "title": {
    "zh-Hant": "證明項：逐部分解讀 λh. ⟨snd h, fst h⟩ 為何是 P∧Q→Q∧P 的證明項",
    "en": "Proof term: reading λh. ⟨snd h, fst h⟩ part by part as a proof term for P∧Q→Q∧P"
  },
  "contract": {
    "schema_version": "ocme-derivation-guide-v0.1",
    "guide_id": "derivation-mko-lean-proof-term-01",
    "source": {
      "mko_id": "mko-lean-proof-term",
      "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f",
      "sha256": "a11c7813a596785a48d1af6603780643970769d714b6a167fec2a29245c6e1b2",
      "english_sha256": "d42bc57cd7682e13350bb803d8c13f2fcb0aa358ca7532f8aed5e5715b020506"
    },
    "mode": "definition_walkthrough",
    "audience_prerequisites": [
      "def_unfold",
      "and_intro_elim",
      "imp_intro",
      "contradiction"
    ],
    "goal": {
      "zh-Hant": "在一個明示的合成小型命題型別系統 ST 中（對應 MKO 假設 a2），取相異命題原子 P、Q：逐部分說明項 t=λh:P∧Q. ⟨snd h, fst h⟩ 的每一部分建立了什麼、具有什麼型別，推導判斷 ⊢ t : P∧Q→Q∧P，並說明 t 的型別為什麼與命題 S=P∧Q→Q∧P 相符；再證明外觀相近的 t′=λh:P∧Q. ⟨fst h, snd h⟩ 不是 S 的證明項。最後區分「ST 中的型別推導」「Lean kernel 接受」與「已保存的 proof-term receipt」三者。",
      "en": "In an explicit synthetic small propositional type system ST (matching MKO assumption a2), with distinct propositional atoms P and Q: explain part by part what each piece of the term t=λh:P∧Q. ⟨snd h, fst h⟩ establishes and what type it has, derive the judgment ⊢ t : P∧Q→Q∧P, and explain why the type of t matches the proposition S=P∧Q→Q∧P; then prove that the similar-looking t′=λh:P∧Q. ⟨fst h, snd h⟩ is not a proof term for S. Finally separate three things: a typing derivation in ST, acceptance by the Lean kernel, and a saved proof-term receipt."
    },
    "givens": [
      {
        "id": "G1",
        "statement": {
          "zh-Hant": "環境 E_ST 固定：P、Q 是兩個相異的命題原子，各自已作為命題給出（MKO 假設 a1）；型別由原子經 ∧ 與 → 組成。項、context 與規則表在全稿固定不變。",
          "en": "The environment E_ST is fixed: P and Q are two distinct propositional atoms, each already given as a proposition (MKO assumption a1); types are built from atoms with ∧ and →. Terms, contexts and the rule table stay fixed throughout."
        }
      },
      {
        "id": "G2",
        "statement": {
          "zh-Hant": "ST 的規則表只有六條。Var：若 x:A 列在 Γ 中，則 Γ⊢x:A。∧I：由 Γ⊢a:A 與 Γ⊢b:B 得 Γ⊢⟨a,b⟩:A∧B。∧E1：由 Γ⊢p:A∧B 得 Γ⊢fst p:A。∧E2：由 Γ⊢p:A∧B 得 Γ⊢snd p:B。→I：由 Γ,x:A⊢b:B 得 Γ⊢λx:A.b : A→B。→E：由 Γ⊢f:A→B 與 Γ⊢a:A 得 Γ⊢f a:B。context 中每個變數至多出現一次；兩個型別相等當且僅當語法相同。",
          "en": "ST has exactly six rules. Var: if x:A is listed in Γ then Γ⊢x:A. ∧I: from Γ⊢a:A and Γ⊢b:B infer Γ⊢⟨a,b⟩:A∧B. ∧E1: from Γ⊢p:A∧B infer Γ⊢fst p:A. ∧E2: from Γ⊢p:A∧B infer Γ⊢snd p:B. →I: from Γ,x:A⊢b:B infer Γ⊢λx:A.b : A→B. →E: from Γ⊢f:A→B and Γ⊢a:A infer Γ⊢f a:B. Each variable occurs at most once in a context; two types are equal exactly when they are syntactically identical."
        }
      },
      {
        "id": "G3",
        "statement": {
          "zh-Hant": "目標命題 S=P∧Q→Q∧P；待解讀的項 t=λh:P∧Q. ⟨snd h, fst h⟩；對照項 t′=λh:P∧Q. ⟨fst h, snd h⟩。",
          "en": "Target proposition S=P∧Q→Q∧P; the term to be read t=λh:P∧Q. ⟨snd h, fst h⟩; the comparison term t′=λh:P∧Q. ⟨fst h, snd h⟩."
        }
      },
      {
        "id": "G4",
        "statement": {
          "zh-Hant": "本稿沒有執行 Lean（MKO 假設 a2）：沒有 kernel 判斷，沒有保存的 term，也沒有 receipt。",
          "en": "Lean was not run for this guide (MKO assumption a2): there is no kernel verdict, no saved term and no receipt."
        }
      }
    ],
    "steps": [
      {
        "id": "S01",
        "uses": [
          "G1",
          "G2",
          "G3",
          "G4"
        ],
        "before_tex": "\\text{proof term: fixed version, imports, environment }E,\\ \\Gamma,\\ \\text{kernel}",
        "after_tex": "\\text{ST: atoms }P\\neq Q,\\ \\Gamma_0=\\varnothing,\\ S=P\\land Q\\to Q\\land P,\\ \\text{six rules}",
        "relation": "definition",
        "rule": "mko_proof_term",
        "conditions": [],
        "explanation": {
          "zh-Hant": "MKO 指出「證明項」只有在固定版本、imports、環境與 local context 之後才有意義。本稿固定一個教學用的對應物：環境 E_ST 只含原子 P、Q，起始 context Γ0 為空，目標命題 S=P∧Q→Q∧P，而「檢查器」的角色由 G2 的六條規則擔任：一個判斷只有在能用這六條規則逐條推出時才算成立。之後所有型別結論都是 ST 中的結論；關於 Lean 的陳述只在 S10 另外處理。",
          "en": "The MKO says that 'proof term' is meaningful only after the version, imports, environment and local context are fixed. This guide fixes a teaching counterpart: the environment E_ST contains only the atoms P and Q, the starting context Γ0 is empty, the target proposition is S=P∧Q→Q∧P, and the role of the checker is played by the six rules of G2: a judgment holds only if it can be derived rule by rule from them. Every typing conclusion below is a conclusion in ST; statements about Lean are handled separately in S10."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "G2",
            "G4",
            "mko_proof_term"
          ],
          "explanation": {
            "zh-Hant": "此步只固定設定，不推出新事實。以 ST 規則表代替 kernel 是 G2、G4 明示的教學選擇，不是關於 Lean 的證據。",
            "en": "This step only fixes the setting and derives no new fact. Letting the ST rule table stand in for a kernel is a teaching choice stated in G2 and G4, not evidence about Lean."
          }
        },
        "leaf_basis": "mko_proof_term + def_intro"
      },
      {
        "id": "S02",
        "uses": [
          "S01",
          "G3"
        ],
        "before_tex": "t",
        "after_tex": "t=\\lambda h{:}P\\land Q.\\,\\langle \\mathrm{snd}\\,h,\\ \\mathrm{fst}\\,h\\rangle",
        "relation": "definition",
        "rule": "def_intro",
        "conditions": [],
        "explanation": {
          "zh-Hant": "為項取名並逐部分預讀它要建立的東西：λh:P∧Q 引入一個名為 h、型別為 P∧Q 的假設，讀作「假設有 P∧Q 的證明 h」；fst h 與 snd h 從 h 取出 P 與 Q 的證明；⟨·,·⟩ 把兩個證明裝成一個合取的證明，分量的先後決定合取項的先後。依命題即型別，蘊涵的證明是一個把前提的證明變成結論的證明的函數。Lean 4 中對應的表面寫法是 `fun h : P ∧ Q => And.intro h.right h.left`（或 `fun h => ⟨h.2, h.1⟩`），這裡只作閱讀對照。",
          "en": "Name the term and preview what each part is meant to establish: λh:P∧Q introduces a hypothesis named h of type P∧Q, read as 'assume a proof h of P∧Q'; fst h and snd h extract proofs of P and of Q from h; ⟨·,·⟩ packs two proofs into a proof of a conjunction, and the order of the components fixes the order of the conjuncts. Under propositions-as-types, a proof of an implication is a function that turns proofs of the premise into proofs of the conclusion. The Lean 4 surface counterpart is `fun h : P ∧ Q => And.intro h.right h.left` (or `fun h => ⟨h.2, h.1⟩`), given here only as a reading aid."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G3",
            "def_intro"
          ],
          "explanation": {
            "zh-Hant": "此步只取名；對各部分的解讀是一個計畫，必須由 S03 到 S07 逐條規則證成。這裡尚未宣稱 t 有任何型別。",
            "en": "This step only names the term; the reading of its parts is a plan that S03 to S07 must justify rule by rule. No type of t is claimed yet."
          }
        },
        "leaf_basis": "def_intro + def_unfold"
      },
      {
        "id": "S03",
        "uses": [
          "S02",
          "G2"
        ],
        "before_tex": "\\Gamma_1=\\Gamma_0,\\ h{:}P\\land Q",
        "after_tex": "\\Gamma_1\\vdash h:P\\land Q",
        "relation": "implies",
        "rule": "st_var",
        "conditions": [
          "h{:}P\\land Q\\in\\Gamma_1"
        ],
        "explanation": {
          "zh-Hant": "λ 的綁定說明本體要在哪個 context 中檢查：Γ1 是 Γ0 加上 h:P∧Q。依 Var 規則，h:P∧Q 列在 Γ1 中，所以 Γ1⊢h:P∧Q。這一部分建立的是：在本體內部，h 可以當作 P∧Q 的證明使用。",
          "en": "The λ-binder says in which context the body is checked: Γ1 is Γ0 extended by h:P∧Q. By the Var rule, h:P∧Q is listed in Γ1, so Γ1⊢h:P∧Q. What this part establishes: inside the body, h may be used as a proof of P∧Q."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G2",
            "st_var"
          ],
          "explanation": {
            "zh-Hant": "Var 只需要 h:P∧Q 列在 Γ1 中。不宣稱反向：在 Γ0 中 h 沒有宣告，Γ0⊢h:P∧Q 不成立，所以本體必須在 Γ1 中檢查。",
            "en": "Var needs only that h:P∧Q is listed in Γ1. No converse is claimed: h is not declared in Γ0, so Γ0⊢h:P∧Q fails, which is why the body must be checked in Γ1."
          }
        },
        "leaf_basis": "st_var"
      },
      {
        "id": "S04",
        "uses": [
          "S03",
          "G2"
        ],
        "before_tex": "\\Gamma_1\\vdash h:P\\land Q",
        "after_tex": "\\Gamma_1\\vdash \\mathrm{snd}\\,h:Q",
        "relation": "implies",
        "rule": "st_and_elim",
        "conditions": [
          "A=P,\\ B=Q"
        ],
        "explanation": {
          "zh-Hant": "對 S03 使用 ∧E2，取 A=P、B=Q：snd h 取出第二分量，型別為 Q。這一部分建立了「由假設得到 Q 的證明」。snd h 的型別是從 h 的型別讀出來的，不是自行指定的。",
          "en": "Apply ∧E2 to S03 with A=P and B=Q: snd h extracts the second component and has type Q. This part establishes 'a proof of Q obtained from the hypothesis'. The type of snd h is read off from the type of h; it is not chosen freely."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S03",
            "st_and_elim"
          ],
          "explanation": {
            "zh-Hant": "∧E2 需要 h 具有合取型別，S03 提供 P∧Q。不宣稱反向：由 Q 的證明不能得到 P∧Q 的證明。",
            "en": "∧E2 needs h to have a conjunction type, and S03 supplies P∧Q. No converse is claimed: a proof of Q does not give a proof of P∧Q."
          }
        },
        "leaf_basis": "st_and_elim"
      },
      {
        "id": "S05",
        "uses": [
          "S03",
          "G2"
        ],
        "before_tex": "\\Gamma_1\\vdash h:P\\land Q",
        "after_tex": "\\Gamma_1\\vdash \\mathrm{fst}\\,h:P",
        "relation": "implies",
        "rule": "st_and_elim",
        "conditions": [
          "A=P,\\ B=Q"
        ],
        "explanation": {
          "zh-Hant": "對 S03 使用 ∧E1：fst h 取出第一分量，型別為 P。現在 Γ1 中同時有 P 的證明與 Q 的證明，而且兩者都只依賴假設 h。",
          "en": "Apply ∧E1 to S03: fst h extracts the first component and has type P. Now Γ1 has both a proof of P and a proof of Q, and both depend only on the hypothesis h."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S03",
            "st_and_elim"
          ],
          "explanation": {
            "zh-Hant": "與 S04 相同，只需要 h 的合取型別；結果與 S04 位於同一個 context Γ1，這是 S06 的前提。",
            "en": "As in S04, only the conjunction type of h is needed; the result lies in the same context Γ1 as S04, which S06 requires."
          }
        },
        "leaf_basis": "st_and_elim"
      },
      {
        "id": "S06",
        "uses": [
          "S04",
          "S05"
        ],
        "before_tex": "\\Gamma_1\\vdash \\mathrm{snd}\\,h:Q,\\ \\ \\Gamma_1\\vdash \\mathrm{fst}\\,h:P",
        "after_tex": "\\Gamma_1\\vdash \\langle \\mathrm{snd}\\,h,\\ \\mathrm{fst}\\,h\\rangle:Q\\land P",
        "relation": "implies",
        "rule": "st_and_intro",
        "conditions": [
          "a=\\mathrm{snd}\\,h,\\ A=Q,\\ b=\\mathrm{fst}\\,h,\\ B=P"
        ],
        "explanation": {
          "zh-Hant": "使用 ∧I，第一分量 a=snd h（型別 A=Q），第二分量 b=fst h（型別 B=P），得到 A∧B=Q∧P。合取項的先後由分量的先後決定：第一分量的型別成為左合取項。這一部分建立了「由 P∧Q 的假設得到 Q∧P 的證明」。",
          "en": "Apply ∧I with first component a=snd h (type A=Q) and second component b=fst h (type B=P), giving A∧B=Q∧P. The order of the conjuncts is fixed by the order of the components: the type of the first component becomes the left conjunct. This part establishes 'a proof of Q∧P from the hypothesis P∧Q'."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S04",
            "S05",
            "st_and_intro"
          ],
          "explanation": {
            "zh-Hant": "∧I 需要兩個前提位於同一個 context，S04、S05 都在 Γ1。型別 Q∧P 是由分量次序強制的；若把分量對調，得到的是 P∧Q（見 S13）。",
            "en": "∧I needs both premises in the same context, and S04 and S05 are both in Γ1. The type Q∧P is forced by the order of the components; swapping them gives P∧Q (see S13)."
          }
        },
        "leaf_basis": "st_and_intro"
      },
      {
        "id": "S07",
        "uses": [
          "S06",
          "S03"
        ],
        "before_tex": "\\Gamma_0,\\ h{:}P\\land Q\\vdash \\langle \\mathrm{snd}\\,h,\\ \\mathrm{fst}\\,h\\rangle:Q\\land P",
        "after_tex": "\\Gamma_0\\vdash \\lambda h{:}P\\land Q.\\,\\langle \\mathrm{snd}\\,h,\\ \\mathrm{fst}\\,h\\rangle:P\\land Q\\to Q\\land P",
        "relation": "implies",
        "rule": "st_imp_intro",
        "conditions": [
          "x=h,\\ A=P\\land Q,\\ B=Q\\land P"
        ],
        "explanation": {
          "zh-Hant": "使用 →I，x=h、A=P∧Q、B=Q∧P：釋放假設 h，結論位於 Γ0，其中已沒有 h。綁定上的註記 P∧Q 成為蘊涵的前件，本體的型別 Q∧P 成為後件。這正是 →引入（imp_intro）在命題即型別下的讀法：在假設 P∧Q 的作用域中得到 Q∧P，就得到 P∧Q→Q∧P。",
          "en": "Apply →I with x=h, A=P∧Q and B=Q∧P: the hypothesis h is discharged and the conclusion lives in Γ0, where h no longer appears. The binder's annotation P∧Q becomes the antecedent of the implication and the body's type Q∧P becomes its consequent. This is →-introduction (imp_intro) read through propositions-as-types: obtaining Q∧P inside the scope of the assumption P∧Q gives P∧Q→Q∧P."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S06",
            "st_imp_intro",
            "imp_intro"
          ],
          "explanation": {
            "zh-Hant": "→I 需要本體的判斷位於「Γ0 恰好加上 h:P∧Q」的 context，S06 提供的正是 Γ1。釋放之後 h 不可再當作已知使用。",
            "en": "→I needs the body's judgment in the context Γ0 extended by exactly h:P∧Q, and S06 supplies precisely Γ1. After discharge, h may no longer be used as known."
          }
        },
        "leaf_basis": "st_imp_intro + imp_intro"
      },
      {
        "id": "S08",
        "uses": [
          "S07",
          "G3"
        ],
        "before_tex": "T(t)=P\\land Q\\to Q\\land P,\\ \\ S=P\\land Q\\to Q\\land P",
        "after_tex": "T(t)\\equiv S",
        "relation": "implies",
        "rule": "st_type_eq",
        "conditions": [],
        "explanation": {
          "zh-Hant": "MKO 的公式 T(t)=P 要求推得的型別與命題相同（本稿把命題記為 S，以免與原子 P 混淆）。逐符號比較：前件 P∧Q 對 P∧Q，後件 Q∧P 對 Q∧P，完全相同，所以在 ST 中 T(t)≡S。Lean 的型別比對是到定義相等為止，範圍較寬；ST 只用語法相同，所以這裡沒有使用任何 conversion。",
          "en": "The MKO formula T(t)=P asks that the derived type be the proposition itself (here the proposition is called S to avoid a clash with the atom P). Compare symbol by symbol: antecedent P∧Q against P∧Q, consequent Q∧P against Q∧P; they are identical, so T(t)≡S in ST. Lean compares types up to definitional equality, a wider relation; ST uses syntactic identity only, so no conversion is used here."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S07",
            "G3",
            "st_type_eq"
          ],
          "explanation": {
            "zh-Hant": "需要 S07 推得的型別與 G3 的命題；比較的是型別而不是真值。Q∧P 與 P∧Q 邏輯等價，卻不是同一個型別（見錯誤控制）。",
            "en": "It needs the type derived in S07 and the proposition from G3; what is compared is types, not truth values. Q∧P and P∧Q are logically equivalent but are not the same type (see the error controls)."
          }
        },
        "leaf_basis": "st_type_eq + eq_refl_symm_trans"
      },
      {
        "id": "S09",
        "uses": [
          "S07",
          "S08",
          "mko_proof_term"
        ],
        "before_tex": "\\Gamma_0\\vdash t:T(t),\\ \\ T(t)\\equiv S",
        "after_tex": "t\\ \\text{is a proof term for }S\\ \\text{in ST}",
        "relation": "implies",
        "rule": "mko_proof_term",
        "conditions": [],
        "explanation": {
          "zh-Hant": "MKO 的定義要求兩件事：項的型別就是該命題，而且固定環境的檢查器接受這個判斷。在 ST 中檢查器就是規則表：S03 到 S07 每一步都是 G2 的一條規則，構成 Γ0⊢t:T(t) 的完整推導；S08 把 T(t) 與 S 等同，所以 Γ0⊢t:S 可推導，這是「kernel 接受 Γ⊢t:P」在 ST 中的對應。因此 t 是 S 在 ST 中的證明項；此步宣稱的就只有這些。",
          "en": "The MKO definition asks for two things: the term's type is the proposition, and the checker of the fixed environment accepts the judgment. In ST the checker is the rule table: each of S03 to S07 is one rule of G2, forming a complete derivation of Γ0⊢t:T(t), and S08 identifies T(t) with S, so Γ0⊢t:S is derivable, the ST counterpart of 'the kernel accepts Γ⊢t:P'. Hence t is a proof term for S in ST; that is all this step claims."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S07",
            "S08",
            "mko_proof_term"
          ],
          "explanation": {
            "zh-Hant": "需要一個完整的推導（每一步一條規則）與型別相符。結論只屬於 ST，不轉移到 Lean（見 S10）。",
            "en": "It needs a complete derivation (one rule per step) and the type match. The conclusion belongs to ST only and is not transferred to Lean (see S10)."
          }
        },
        "leaf_basis": "mko_proof_term + modus_ponens + eq_replace"
      },
      {
        "id": "S10",
        "uses": [
          "S09",
          "G4",
          "mko_receipt"
        ],
        "before_tex": "t\\ \\text{proof term in ST};\\ \\text{Lean not run}",
        "after_tex": "\\text{Lean counterpart: candidate term, no kernel verdict, no receipt}",
        "relation": "implies",
        "rule": "mko_receipt",
        "conditions": [],
        "explanation": {
          "zh-Hant": "依 MKO，只有保存 term 並在指定 kernel／環境中檢查，才形成 receipt。G4 說明本稿沒有執行 Lean，沒有保存也沒有檢查任何 term。所以 Lean 4 對應寫法 `fun h : P ∧ Q => And.intro h.right h.left` 的狀態只是候選 proof term：不宣稱 kernel 接受，也沒有 receipt。ST 的推導不能代替 kernel 判斷，因為兩者是不同的系統（Lean 另有 universe、定義相等與 elaborator）。即使日後 kernel 接受，也只證形式 judgment；命題是否忠實表達原意、imports 是否含不當公理仍需另外審查。",
          "en": "By the MKO, only a saved term checked by the specified kernel in the specified environment forms a receipt. G4 records that Lean was not run, and no term was saved or checked. So the Lean 4 counterpart `fun h : P ∧ Q => And.intro h.right h.left` has the status of a candidate proof term only: no kernel acceptance is claimed and there is no receipt. The ST derivation cannot replace a kernel verdict, because the two are different systems (Lean also has universes, definitional equality and an elaborator). Even if a kernel later accepted it, that would prove only the formal judgment; whether the proposition faithfully expresses the intended claim and whether the imports contain improper axioms still need separate review."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G4",
            "S09",
            "mko_receipt"
          ],
          "explanation": {
            "zh-Hant": "只需要「沒有發生 kernel 檢查」這一事實。方向是「未檢查 ⇒ 無 receipt」；此步也不宣稱 Lean 會拒絕這個項，它對 Lean 的判斷不作任何宣稱。",
            "en": "It needs only the fact that no kernel check took place. The direction is 'not checked ⇒ no receipt'; the step does not claim that Lean would reject the term either: it makes no claim at all about Lean's verdict."
          }
        },
        "leaf_basis": "mko_receipt + modus_ponens"
      },
      {
        "id": "S11",
        "uses": [
          "G2"
        ],
        "before_tex": "\\text{rule table of ST}",
        "after_tex": "\\text{each outer term form is concluded by exactly one rule}",
        "relation": "implies",
        "rule": "case_analysis",
        "conditions": [],
        "explanation": {
          "zh-Hant": "逐條檢查六條規則結論中主詞的外層形式：Var 是變數；∧I 是配對 ⟨a,b⟩；∧E1 是 fst p；∧E2 是 snd p；→I 是 λx:A.b；→E 是應用 f a。六條規則對應六種互不相同的形式，而每個項恰有一種外層形式。Γ⊢u:A 的推導必以某條結論為 Γ⊢u:A 的規則結束，所以最後一條規則就是 u 的外層形式所對應的唯一規則，其前提必在其上方已被推出，A 也必具該規則規定的形狀。這證明了引理 L_inversion。",
          "en": "Go through the six rules and record the outer form of the subject in each conclusion: Var, a variable; ∧I, a pair ⟨a,b⟩; ∧E1, fst p; ∧E2, snd p; →I, λx:A.b; →E, an application f a. Six rules, six pairwise distinct forms, and every term has exactly one outer form. A derivation of Γ⊢u:A ends with a rule whose conclusion is Γ⊢u:A, so its last rule is the unique rule for u's outer form, that rule's premises must have been derived above it, and A must have the shape the rule prescribes. This proves Lemma L_inversion."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G2",
            "case_analysis"
          ],
          "explanation": {
            "zh-Hant": "分情況是完整的，因為 G2 列出了 ST 的全部規則（只有六條）。若系統另有 conversion 規則或第二條配對規則，反演需要更多情況；這也是本論證不能原封不動搬到 Lean 的原因之一。",
            "en": "The case analysis is complete because G2 lists all rules of ST (exactly six). If the system had a conversion rule or a second rule for pairs, inversion would need more cases; that is one reason this argument cannot be moved to Lean unchanged."
          }
        },
        "leaf_basis": "case_analysis + def_unfold"
      },
      {
        "id": "S12",
        "uses": [
          "G3",
          "L_tprime_untyped"
        ],
        "before_tex": "t'=\\lambda h{:}P\\land Q.\\,\\langle \\mathrm{fst}\\,h,\\ \\mathrm{snd}\\,h\\rangle",
        "after_tex": "\\Gamma_0\\nvdash t':P\\land Q\\to Q\\land P",
        "relation": "implies",
        "rule": "L_tprime_untyped",
        "conditions": [],
        "explanation": {
          "zh-Hant": "依引理 L_tprime_untyped（在 S12.1 到 S12.4 證明），t′ 在 ST 中不能具有型別 S。所以 t′ 不是 S 的證明項，即使它用到同一個假設與同樣兩個投影。",
          "en": "By Lemma L_tprime_untyped (proved in S12.1 to S12.4), t′ cannot have type S in ST. So t′ is not a proof term for S, even though it uses the same hypothesis and the same two projections."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "L_tprime_untyped"
          ],
          "explanation": {
            "zh-Hant": "依賴該引理；引理的證明只用到反演與 P、Q 相異。",
            "en": "It depends on the lemma, whose proof uses only inversion and the distinctness of P and Q."
          }
        },
        "leaf_basis": "L_inversion + st_type_eq + contradiction"
      },
      {
        "id": "S12.1",
        "uses": [
          "G3",
          "L_inversion"
        ],
        "before_tex": "\\Gamma_0\\vdash t':P\\land Q\\to Q\\land P\\ \\ (\\text{assumed})",
        "after_tex": "\\Gamma_1\\vdash \\langle \\mathrm{fst}\\,h,\\ \\mathrm{snd}\\,h\\rangle:Q\\land P",
        "relation": "implies",
        "rule": "L_inversion",
        "conditions": [],
        "explanation": {
          "zh-Hant": "為了反證，假設 Γ0⊢t′:S 有推導。t′ 的外層形式是 λ，依 L_inversion 最後一條規則必為 →I，其結論型別 A→B 中 A 是綁定註記 P∧Q；由 A→B≡P∧Q→Q∧P 得 B≡Q∧P。所以前提 Γ0,h:P∧Q⊢⟨fst h, snd h⟩:Q∧P 可推導，也就是 Γ1⊢⟨fst h, snd h⟩:Q∧P。",
          "en": "For contradiction, assume Γ0⊢t′:S has a derivation. The outer form of t′ is λ, so by L_inversion the last rule is →I; in its conclusion type A→B, A is the binder annotation P∧Q, and A→B≡P∧Q→Q∧P gives B≡Q∧P. So the premise Γ0,h:P∧Q⊢⟨fst h, snd h⟩:Q∧P is derivable, that is, Γ1⊢⟨fst h, snd h⟩:Q∧P."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "L_inversion",
            "st_type_eq"
          ],
          "explanation": {
            "zh-Hant": "用到 λ 項只能由 →I 推出，以及 A→B≡P∧Q→Q∧P 迫使 B≡Q∧P。這是反證法中的暫時假設，在 S12.4 釋放。",
            "en": "It uses that a λ-term is concluded only by →I and that A→B≡P∧Q→Q∧P forces B≡Q∧P. This is a temporary assumption of the proof by contradiction, discharged in S12.4."
          }
        },
        "leaf_basis": "L_inversion + st_type_eq"
      },
      {
        "id": "S12.2",
        "uses": [
          "S12.1",
          "L_inversion"
        ],
        "before_tex": "\\Gamma_1\\vdash \\langle \\mathrm{fst}\\,h,\\ \\mathrm{snd}\\,h\\rangle:Q\\land P",
        "after_tex": "\\Gamma_1\\vdash \\mathrm{fst}\\,h:Q",
        "relation": "implies",
        "rule": "L_inversion",
        "conditions": [],
        "explanation": {
          "zh-Hant": "配對只能由 ∧I 推出，其結論型別 A∧B 中 A 是第一分量的型別。由 A∧B≡Q∧P 得 A≡Q，所以前提 Γ1⊢fst h:Q 必須可推導。",
          "en": "A pair is concluded only by ∧I, whose conclusion type A∧B has A equal to the type of the first component. A∧B≡Q∧P gives A≡Q, so the premise Γ1⊢fst h:Q must be derivable."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S12.1",
            "L_inversion",
            "st_type_eq"
          ],
          "explanation": {
            "zh-Hant": "只用反演與合取型別的逐分量比較；仍在反證假設之下。",
            "en": "It uses only inversion and componentwise comparison of conjunction types; it is still under the assumption made for contradiction."
          }
        },
        "leaf_basis": "L_inversion + st_type_eq"
      },
      {
        "id": "S12.3",
        "uses": [
          "S12.2",
          "L_inversion"
        ],
        "before_tex": "\\Gamma_1\\vdash \\mathrm{fst}\\,h:Q",
        "after_tex": "\\Gamma_1\\vdash h:Q\\land B\\ \\text{for some type }B",
        "relation": "implies",
        "rule": "L_inversion",
        "conditions": [],
        "explanation": {
          "zh-Hant": "fst 的形式只能由 ∧E1 推出，其前提是 Γ1⊢h:A∧B 且結論型別為 A。這裡 A≡Q，所以存在某個型別 B 使 Γ1⊢h:Q∧B 可推導。",
          "en": "The form fst is concluded only by ∧E1, whose premise is Γ1⊢h:A∧B with conclusion type A. Here A≡Q, so for some type B the judgment Γ1⊢h:Q∧B is derivable."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S12.2",
            "L_inversion"
          ],
          "explanation": {
            "zh-Hant": "B 是 ∧E1 前提中出現的某個型別，我們不需要知道它是什麼；仍在反證假設之下。",
            "en": "B is whatever type occurs in the premise of ∧E1; we need not know it. Still under the assumption made for contradiction."
          }
        },
        "leaf_basis": "L_inversion"
      },
      {
        "id": "S12.4",
        "uses": [
          "S12.3",
          "G1",
          "G2",
          "L_inversion"
        ],
        "before_tex": "\\Gamma_1\\vdash h:Q\\land B",
        "after_tex": "Q\\land B\\equiv P\\land Q\\Rightarrow Q\\equiv P\\ \\ (\\text{contradiction})",
        "relation": "implies",
        "rule": "contradiction",
        "conditions": [
          "P\\not\\equiv Q"
        ],
        "explanation": {
          "zh-Hant": "變數只能由 Var 推出，所以 h:Q∧B 必須就是 Γ1 中 h 的條目；Γ1 只列 h 一次，型別為 P∧Q，故 Q∧B≡P∧Q。依 st_type_eq 逐分量比較得 Q≡P，與 G1 中 P、Q 為相異原子矛盾。所以 S12.1 的假設不成立，Γ0⊢t′:S 不可推導。S12.1 到 S12.4 合起來證得引理 L_tprime_untyped。",
          "en": "A variable is concluded only by Var, so h:Q∧B must be exactly the entry for h in Γ1; Γ1 lists h once, with type P∧Q, so Q∧B≡P∧Q. Componentwise comparison by st_type_eq gives Q≡P, contradicting that P and Q are distinct atoms (G1). So the assumption of S12.1 fails and Γ0⊢t′:S is not derivable. S12.1 to S12.4 together prove Lemma L_tprime_untyped."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S12.3",
            "G1",
            "st_var",
            "st_type_eq",
            "contradiction"
          ],
          "explanation": {
            "zh-Hant": "矛盾需要兩件事：context 中每個變數只出現一次（G2），以及 P、Q 相異（G1）。若 P 與 Q 是同一個原子，t′ 就會有型別 S，所以這個前提不可省略。",
            "en": "The contradiction needs two things: each variable occurs once in a context (G2), and P and Q are distinct (G1). If P and Q were the same atom, t′ would have type S, so this premise cannot be dropped."
          }
        },
        "leaf_basis": "st_var + st_type_eq + contradiction"
      },
      {
        "id": "S13",
        "uses": [
          "S04",
          "S05"
        ],
        "before_tex": "\\Gamma_1\\vdash \\mathrm{fst}\\,h:P,\\ \\ \\Gamma_1\\vdash \\mathrm{snd}\\,h:Q",
        "after_tex": "\\Gamma_1\\vdash \\langle \\mathrm{fst}\\,h,\\ \\mathrm{snd}\\,h\\rangle:P\\land Q",
        "relation": "implies",
        "rule": "st_and_intro",
        "conditions": [
          "a=\\mathrm{fst}\\,h,\\ A=P,\\ b=\\mathrm{snd}\\,h,\\ B=Q"
        ],
        "explanation": {
          "zh-Hant": "看看 t′ 實際證明了什麼：分量次序為 fst h、snd h，∧I 給出 P∧Q，而不是 Q∧P。差別只在分量次序，但型別因此不同。",
          "en": "See what t′ actually proves: with the components in the order fst h, snd h, ∧I gives P∧Q, not Q∧P. The only difference is the order of the components, and it changes the type."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S04",
            "S05",
            "st_and_intro"
          ],
          "explanation": {
            "zh-Hant": "重用 S04、S05 的兩個判斷，只是以另一種次序配對。",
            "en": "It reuses the two judgments of S04 and S05, paired in the other order."
          }
        },
        "leaf_basis": "st_and_intro"
      },
      {
        "id": "S14",
        "uses": [
          "S13"
        ],
        "before_tex": "\\Gamma_0,\\ h{:}P\\land Q\\vdash \\langle \\mathrm{fst}\\,h,\\ \\mathrm{snd}\\,h\\rangle:P\\land Q",
        "after_tex": "\\Gamma_0\\vdash t':P\\land Q\\to P\\land Q",
        "relation": "implies",
        "rule": "st_imp_intro",
        "conditions": [
          "x=h,\\ A=P\\land Q,\\ B=P\\land Q"
        ],
        "explanation": {
          "zh-Hant": "對 S13 使用 →I 並釋放 h：t′ 是 P∧Q→P∧Q 的證明項，這是另一個命題。所以「是否為 S 的證明項」取決於確切的型別，而不是取決於用到哪些假設或投影。",
          "en": "Apply →I to S13 and discharge h: t′ is a proof term for P∧Q→P∧Q, a different proposition. So whether a term proves S depends on its exact type, not on which hypotheses or projections it uses."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S13",
            "st_imp_intro"
          ],
          "explanation": {
            "zh-Hant": "與 S07 相同的 →I 用法；結合 S12，t′ 的型別是 P∧Q→P∧Q 而不能是 S。",
            "en": "The same use of →I as in S07; together with S12, the type of t′ is P∧Q→P∧Q and cannot be S."
          }
        },
        "leaf_basis": "st_imp_intro + imp_intro"
      },
      {
        "id": "S15",
        "uses": [
          "S09",
          "S10",
          "S12",
          "S14"
        ],
        "before_tex": "\\Gamma_0\\vdash t:S,\\ \\Gamma_0\\nvdash t':S,\\ \\text{Lean not run}",
        "after_tex": "t\\ \\text{proves }S\\ \\text{in ST};\\ t'\\ \\text{does not};\\ \\text{no Lean receipt}",
        "relation": "implies",
        "rule": "and_intro_elim",
        "conditions": [],
        "explanation": {
          "zh-Hant": "合併三個結論：t 是 S 在 ST 中的證明項（S09）；t′ 不是（S12），它證明的是 P∧Q→P∧Q（S14）；Lean 方面只有候選項，沒有 kernel 判斷與 receipt（S10）。",
          "en": "Combine the three conclusions: t is a proof term for S in ST (S09); t′ is not (S12), and proves P∧Q→P∧Q instead (S14); on the Lean side there is only a candidate term, with no kernel verdict and no receipt (S10)."
        },
        "reverse_audit": {
          "kind": "sufficient_goal_reduction",
          "required_ids": [
            "S09",
            "S10",
            "S12",
            "S14",
            "and_intro_elim"
          ],
          "explanation": {
            "zh-Hant": "目標 G：本稿目標中的三項判定。足夠條件 H：S09、S12、S10 三個已證結論（H⇒G 由合取引入）。H 由給定條件正向推出，沒有把 G 當作前提。",
            "en": "Goal G: the three determinations stated in the goal. Sufficient condition H: the three proved conclusions S09, S12 and S10 (H⇒G by conjunction introduction). H is derived forwards from the givens; G is never used as a premise."
          }
        },
        "leaf_basis": "and_intro_elim"
      }
    ],
    "result": {
      "zh-Hant": "在合成系統 ST 中，t=λh:P∧Q. ⟨snd h, fst h⟩ 的各部分依次建立：h 是 P∧Q 的假設，snd h 與 fst h 分別是 Q、P 的證明，配對給出 Q∧P，釋放 h 得到 P∧Q→Q∧P；此型別與 S 逐符號相同，所以 t 是 S 在 ST 中的證明項。t′=λh:P∧Q. ⟨fst h, snd h⟩ 的型別是 P∧Q→P∧Q，依反演它不能具有型別 S。本稿沒有執行 Lean：Lean 4 對應項只是候選，沒有 kernel 判斷，也沒有 receipt。",
      "en": "In the synthetic system ST, the parts of t=λh:P∧Q. ⟨snd h, fst h⟩ establish in turn: h is a hypothesis of P∧Q, snd h and fst h are proofs of Q and P, the pair gives Q∧P, and discharging h gives P∧Q→Q∧P; this type is symbol for symbol the same as S, so t is a proof term for S in ST. The term t′=λh:P∧Q. ⟨fst h, snd h⟩ has type P∧Q→P∧Q and, by inversion, cannot have type S. Lean was not run: the Lean 4 counterpart is only a candidate, with no kernel verdict and no receipt."
    },
    "negative_controls": [
      {
        "claim": {
          "zh-Hant": "tactic `intro h; exact ⟨h.2, h.1⟩` 顯示沒有 goals，所以已經有 kernel 接受的 proof-term receipt",
          "en": "The tactic script `intro h; exact ⟨h.2, h.1⟩` shows no goals, so a kernel-accepted proof-term receipt exists"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "零 goals 是建構過程的狀態；receipt 需要保存 term 並在指定環境經 kernel 檢查，本稿兩者都沒有（G4、S10）。",
          "en": "Zero goals is a state of the construction; a receipt needs a saved term checked by the kernel in a specified environment, and neither exists here (G4, S10)."
        }
      },
      {
        "claim": {
          "zh-Hant": "t′=λh:P∧Q. ⟨fst h, snd h⟩ 也是 P∧Q→Q∧P 的證明項，因為它用了同一個假設與兩個投影",
          "en": "t′=λh:P∧Q. ⟨fst h, snd h⟩ is also a proof term for P∧Q→Q∧P, since it uses the same hypothesis and both projections"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "依反演，這要求 Q≡P，與 P、Q 相異矛盾（S12.4）；t′ 的型別是 P∧Q→P∧Q（S14）。",
          "en": "By inversion this would require Q≡P, contradicting that P and Q are distinct (S12.4); the type of t′ is P∧Q→P∧Q (S14)."
        }
      },
      {
        "claim": {
          "zh-Hant": "既然 ST 中 ⊢t:S 可推導，Lean 的 kernel 已經接受 `fun h : P ∧ Q => And.intro h.right h.left`",
          "en": "Since ⊢t:S is derivable in ST, Lean's kernel has accepted `fun h : P ∧ Q => And.intro h.right h.left`"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "ST 是合成的教學系統，本稿沒有執行 Lean；一個系統中的推導不代表另一個檢查器的判斷。",
          "en": "ST is a synthetic teaching system and Lean was not run; a derivation in one system is not the verdict of a different checker."
        }
      },
      {
        "claim": {
          "zh-Hant": "若 kernel 接受 Γ⊢t:S，則 S 必然忠實表達原始中文命題，imports 也沒有不當公理",
          "en": "If the kernel accepts Γ⊢t:S, then S faithfully expresses the original Chinese statement and the imports contain no improper axioms"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "MKO 指出 kernel 接受只證形式 judgment；忠實性與公理清單是另外的語義與信任義務。",
          "en": "The MKO says kernel acceptance proves only the formal judgment; faithfulness and the axiom inventory are separate semantic and trust obligations."
        }
      }
    ],
    "status": "candidate",
    "gaps": [],
    "verification": {
      "structure": "checked_local_script",
      "mathematics": "candidate_argument",
      "formalization": "not_formalized"
    },
    "rule_glossary": [
      {
        "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": "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": "imp_intro",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "→引入（釋放假設）：若在暫時假設 P 的作用域中推出 Q，則得到 P⇒Q；此後 P 不再可當作已知使用。",
          "en": "→-introduction (discharging a hypothesis): if Q is derived inside a scope that temporarily assumes P, then P⇒Q follows, and P may no longer be used as known."
        }
      },
      {
        "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": "def_intro",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "引入定義：可為一個命題、式子或物件取名；之後名稱與被定義者可互相替換。",
          "en": "Introducing a definition: a statement, expression or object may be given a name, after which the name and what it stands for are interchangeable."
        }
      },
      {
        "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": "modus_ponens",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "肯定前件：由 P 與 P⇒Q 得 Q。",
          "en": "Modus ponens: from P and P⇒Q infer Q."
        }
      },
      {
        "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": "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": "mko_proof_term",
        "kind": "cited",
        "source": {
          "mko_id": "mko-lean-proof-term",
          "sha256": "a11c7813a596785a48d1af6603780643970769d714b6a167fec2a29245c6e1b2",
          "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f"
        },
        "statement": {
          "zh-Hant": "在固定 Lean 版本、imports、環境 E 與 local context Γ 中，若核心項 t 具有命題 P 的型別，且 kernel 接受 Γ⊢t:P，則 t 是 P 的證明項。tactic log 只是建構過程，不等於已保存且可重播的 proof-term receipt。",
          "en": "Fix a Lean version, imports, environment E and local context Γ. If core term t has propositional type P and the kernel accepts Γ⊢t:P, then t is a proof term for P. A tactic log is a construction trace, not a saved, replayable proof-term receipt."
        }
      },
      {
        "id": "mko_receipt",
        "kind": "cited",
        "source": {
          "mko_id": "mko-lean-proof-term",
          "sha256": "a11c7813a596785a48d1af6603780643970769d714b6a167fec2a29245c6e1b2",
          "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f"
        },
        "statement": {
          "zh-Hant": "tactic 成功且無 goals 通常產生候選 proof term；只有保存該 term 並經指定 kernel／環境檢查，才形成 receipt。kernel 接受只證形式 judgment；statement 是否忠實、imports 是否含不當公理是另外的義務。",
          "en": "A successful tactic run with no goals usually yields a candidate proof term; only saving that term and checking it with the specified kernel and environment forms a receipt. Kernel acceptance proves only the formal judgment; whether the statement is faithful and whether the imports contain improper axioms are separate obligations."
        }
      },
      {
        "id": "st_var",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "ST 的 Var 規則：若 x:A 列在 Γ 中，則 Γ⊢x:A。",
          "en": "Var rule of ST: if x:A is listed in Γ then Γ⊢x:A."
        }
      },
      {
        "id": "st_and_intro",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "ST 的 ∧I 規則：由 Γ⊢a:A 與 Γ⊢b:B 得 Γ⊢⟨a,b⟩:A∧B；第一分量的型別成為左合取項。",
          "en": "∧I rule of ST: from Γ⊢a:A and Γ⊢b:B infer Γ⊢⟨a,b⟩:A∧B; the type of the first component becomes the left conjunct."
        }
      },
      {
        "id": "st_and_elim",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "ST 的 ∧E1、∧E2 規則：由 Γ⊢p:A∧B 得 Γ⊢fst p:A 與 Γ⊢snd p:B。",
          "en": "∧E1 and ∧E2 rules of ST: from Γ⊢p:A∧B infer Γ⊢fst p:A and Γ⊢snd p:B."
        }
      },
      {
        "id": "st_imp_intro",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "ST 的 →I 規則：由 Γ,x:A⊢b:B 得 Γ⊢λx:A.b : A→B；結論的 context 中不再有 x（假設被釋放）。",
          "en": "→I rule of ST: from Γ,x:A⊢b:B infer Γ⊢λx:A.b : A→B; x no longer appears in the conclusion's context (the hypothesis is discharged)."
        }
      },
      {
        "id": "st_type_eq",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "ST 的型別相等就是語法相同：A∧B≡C∧D ⇔ A≡C 且 B≡D；A→B≡C→D ⇔ A≡C 且 B≡D；相異原子不相等。",
          "en": "Type equality in ST is syntactic identity: A∧B≡C∧D ⇔ A≡C and B≡D; A→B≡C→D ⇔ A≡C and B≡D; distinct atoms are not equal."
        }
      },
      {
        "id": "L_inversion",
        "kind": "lemma",
        "proved_in": [
          "S11"
        ],
        "statement": {
          "zh-Hant": "ST 的反演：每種外層項形式恰好是一條規則結論的主詞。所以若 Γ⊢u:A 可推導，則推導的最後一條規則就是 u 外層形式所對應的那條，其前提都可推導，且 A 具有該規則規定的形狀。",
          "en": "Inversion for ST: each outer term form is the subject of the conclusion of exactly one rule. So if Γ⊢u:A is derivable, the last rule of the derivation is the rule for u's outer form, its premises are derivable, and A has the shape that rule prescribes."
        }
      },
      {
        "id": "L_tprime_untyped",
        "kind": "lemma",
        "proved_in": [
          "S12.1",
          "S12.2",
          "S12.3",
          "S12.4"
        ],
        "statement": {
          "zh-Hant": "在 ST 中，判斷 Γ0⊢t′:P∧Q→Q∧P 不可推導，其中 t′=λh:P∧Q. ⟨fst h, snd h⟩。",
          "en": "In ST the judgment Γ0⊢t′:P∧Q→Q∧P is not derivable, where t′=λh:P∧Q. ⟨fst h, snd h⟩."
        }
      }
    ],
    "revision_log": [],
    "numeric_checks": [
      {
        "id": "N1",
        "step": "S09",
        "vars": [
          "p",
          "q"
        ],
        "range": [
          0,
          1
        ],
        "lhs": "max(1-p*q, q*p)",
        "rhs": "1"
      },
      {
        "id": "N2",
        "step": "S08",
        "vars": [
          "p",
          "q"
        ],
        "range": [
          0,
          1
        ],
        "lhs": "p*q",
        "rhs": "q*p"
      },
      {
        "id": "N3",
        "step": "S14",
        "vars": [
          "p",
          "q"
        ],
        "range": [
          0,
          1
        ],
        "lhs": "max(1-p*q, p*q)",
        "rhs": "1"
      }
    ]
  },
  "presentation": {
    "md_scope": {
      "zh-Hant": "型別推導只在合成系統 ST 中進行；ST 的型別相等就是語法相同，沒有 Lean 的定義相等（conversion）、universe、implicit 參數或 elaboration。本稿不執行 Lean，不宣稱任何項已被 Lean 編譯、elaborate 或經 kernel 檢查，也不產生 Lean formal Evidence 或 receipt；文中的 Lean 4 表面寫法只是閱讀對照。不改動 canonical MKO 或英文 edition。",
      "en": "Typing derivations are carried out only in the synthetic system ST, where type equality is syntactic identity; ST has none of Lean's definitional equality (conversion), universes, implicit arguments or elaboration. This guide does not run Lean, does not claim that any term has been compiled, elaborated or checked by Lean's kernel, and produces no Lean formal Evidence or receipt; the Lean 4 surface notation that appears is only a reading aid. It does not change the canonical MKO or its English edition."
    },
    "md_symbols": [
      [
        "\\Gamma_0,\\ \\Gamma_1",
        "空 context；Γ0 加上假設 h:P∧Q",
        "the empty context; Γ0 extended by the hypothesis h:P∧Q"
      ],
      [
        "\\Gamma\\vdash u:A",
        "判斷：在 context Γ 中項 u 具有型別 A",
        "judgment: in context Γ the term u has type A"
      ],
      [
        "\\langle a,b\\rangle",
        "配對建構子（∧ 引入）",
        "pair constructor (∧-introduction)"
      ],
      [
        "\\mathrm{fst}\\,p,\\ \\mathrm{snd}\\,p",
        "第一、第二投影（∧ 消去）",
        "first and second projection (∧-elimination)"
      ],
      [
        "\\lambda h{:}A.\\,b",
        "以假設 h:A 做的函數抽象（→ 引入）",
        "function abstraction over a hypothesis h:A (→-introduction)"
      ],
      [
        "S",
        "目標命題 P∧Q→Q∧P",
        "the target proposition P∧Q→Q∧P"
      ],
      [
        "T(u)",
        "項 u 在給定 context 中推得的型別",
        "the type derived for the term u in the given context"
      ]
    ],
    "md_error_controls": [
      {
        "title": "tactic 紀錄、零 goals 與自報都不是 receipt / Tactic logs, zero goals and self-reports are not receipts",
        "zh": "例如 tactic 稿 `intro h; exact ⟨h.2, h.1⟩` 顯示沒有剩餘 goals，只說明建構過程看起來完成了。依 MKO，receipt 需要保存下來的 term，以及在指定 toolchain、imports 與環境中由 kernel 檢查的結果。成功編譯的訊息或模型自報同理，都不能代替保存且可重播的 kernel 判斷。本稿 S10 因此只給出 candidate 狀態。",
        "en": "A tactic script such as `intro h; exact ⟨h.2, h.1⟩` showing no remaining goals only says that the construction appears to be complete. By the MKO, a receipt needs the saved term and the result of a kernel check under the specified toolchain, imports and environment. A message reporting successful compilation, or a model's self-report, likewise cannot replace a saved, replayable kernel verdict. That is why S10 assigns only the candidate status."
      },
      {
        "title": "型別要完全相符，不是用到 P 和 Q 就好 / The type must match exactly, not merely mention P and Q",
        "zh": "t′ 用到同一個假設與兩個投影，型別卻是 P∧Q→P∧Q；S12 以反演證明它不能具有型別 S。另外，Q∧P 與 P∧Q 在每個真值賦值下真假相同（N2），但它們不是同一個型別；兩者的邏輯等價需要兩個方向的證明；t 只建立 P∧Q→Q∧P，反方向需另給相應的交換證明項。即使建立了等價，也不能取代此語法系統的型別比對。",
        "en": "t′ uses the same hypothesis and both projections, yet its type is P∧Q→P∧Q; S12 proves by inversion that it cannot have type S. Moreover Q∧P and P∧Q have the same truth value under every valuation (N2), but they are not the same type; their logical equivalence requires proofs in both directions. The term t establishes only P∧Q→Q∧P; a corresponding swap term is needed in the reverse direction. Even an established equivalence does not replace type comparison in this syntactic system."
      },
      {
        "title": "ST 推導不是 Lean kernel 檢查 / An ST derivation is not a Lean kernel check",
        "zh": "ST 只有六條規則與語法相等；Lean 另有 universe、定義相等、elaboration 與 implicit 參數。本稿的推導說明證明項的結構，不證明任何 Lean 檔案可以編譯。即使 kernel 接受，也只證形式 judgment；命題是否忠實、imports 是否含不當公理仍需另外審查（MKO 第三段）。",
        "en": "ST has six rules and syntactic equality only; Lean also has universes, definitional equality, elaboration and implicit arguments. The derivation here explains the structure of a proof term; it does not prove that any Lean file compiles. Even kernel acceptance proves only the formal judgment; whether the proposition is faithful and whether the imports contain improper axioms still need separate review (third paragraph of the MKO)."
      }
    ],
    "md_open_items": [
      {
        "zh-Hant": "N1 到 N3 是對四個布林賦值的真值表核對，這四點就是全部賦值；它們只涉及古典真值，不涉及型別，本稿的型別論證不依賴它們。",
        "en": "N1 to N3 are truth-table checks over the four Boolean valuations, which are all the valuations; they concern classical truth values only, not typing, and the typing argument does not depend on them."
      },
      {
        "zh-Hant": "→E 規則在本稿的推導中沒有用到，列入規則表是為了讓 S11 的反演分情況完整。",
        "en": "The →E rule is not used in the derivations here; it is listed so that the case analysis for inversion in S11 is complete."
      },
      {
        "zh-Hant": "Lean 方面的 receipt（固定 toolchain、imports、公理清單與保存的 term）留待 OCME 主負責人恢復 Lean 工作後處理。",
        "en": "A Lean receipt (fixed toolchain, imports, axiom inventory and saved term) is left until the OCME owner resumes Lean work."
      }
    ]
  },
  "revision": {
    "id": "production-20261019-adopted-96",
    "source_commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f",
    "adopted_source_sha256": "e911f6af08dca1ddcd82398376624ff01b2bc98988791c2202ae47e5512c751c",
    "original_source_sha256": "a17503af594b30f3d269250d35760be89786b5b022f96578e7977e5d3be7c2da",
    "owner_adopted": true,
    "bilingual_sync": "complete_source_bound",
    "formal_Lean": "NOT_RUN",
    "independent_AI_concurrence": "NOT_MEASURED",
    "issue_ids": [
      "BR-M038"
    ],
    "scope": "Owner-adopted natural-language teaching guide; not a formal proof, canonical MKO rewrite or evidence-status promotion."
  }
}
