{
  "schema_version": "ocme-derivation-reader-v1",
  "guide_id": "derivation-mko-lean-formal-statement-01",
  "mko_id": "mko-lean-formal-statement",
  "title": {
    "zh-Hant": "證明助理中的形式陳述：逐層讀懂一個 Lean 陳述並區分「是陳述」與「已證明」",
    "en": "Formal statements in a proof assistant: reading a Lean statement layer by layer and separating 'is a statement' from 'is proved'"
  },
  "contract": {
    "schema_version": "ocme-derivation-guide-v0.1",
    "guide_id": "derivation-mko-lean-formal-statement-01",
    "source": {
      "mko_id": "mko-lean-formal-statement",
      "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f",
      "sha256": "b60e51a622407c4c4ee426df9c55830652f67ff5e0a8344c040c14f26dd49128",
      "english_sha256": "6789411a1961a61e6cf08b736a42a177d218afda0346550c73cd38cbc89b71df"
    },
    "mode": "definition_walkthrough",
    "audience_prerequisites": [
      "order_basics",
      "numeric_evaluation",
      "def_unfold"
    ],
    "goal": {
      "zh-Hant": "以源碼字串 s：`∀ (a b : Nat), a ≤ b → a < b + 1` 為教學對象，在一個明示固定但未實際執行的環境 E 中逐層說明：它的約束變數與型別、假設與結論、若 elaboration 成功應得到的核心項 S、為何 S 的型別會是 Prop、一個證明項必須建立什麼；再給出其數學內容的非正式證明，並以 s′：`∀ (a : Nat), a - 1 < a`（是 Prop 但為假）與 s″：`∀ (a : Int), a - 1 < a`（為真）對照。全程未執行 Lean，不宣稱任何內容可解析、可 elaboration、已編譯或已被 Lean 證明。",
      "en": "Take the source string s: `∀ (a b : Nat), a ≤ b → a < b + 1` as a teaching object and, in an environment E that is fixed explicitly but never executed, explain layer by layer: its bound variables and their types, its hypothesis and conclusion, the core term S that elaboration would have to produce if it succeeded, why S would have type Prop, and what a proof term would have to establish; then give an informal proof of its mathematical content and contrast it with s′: `∀ (a : Nat), a - 1 < a` (a Prop, but false) and s″: `∀ (a : Int), a - 1 < a` (true). Lean is not run at any point, and nothing here claims that any text parses, elaborates, compiles or is proved by Lean."
    },
    "givens": [
      {
        "id": "G1",
        "statement": {
          "zh-Hant": "環境 E=(V,I,N,Γ)：V 是某個指定的 Lean 4 版本（應於恢復 Lean 工作時記入 receipt，本稿未釘選）；I 為除 Lean 4 core prelude 外沒有其他 imports；N 為該 prelude 所宣告的名稱；Γ 為空的 local context。四者都是陳述身分的一部分（MKO 假設 a1）。",
          "en": "Environment E=(V,I,N,Γ): V is a specified Lean 4 version (to be recorded in a receipt when Lean work resumes; not pinned here); I is no imports beyond the Lean 4 core prelude; N is the names declared by that prelude; Γ is the empty local context. All four are part of statement identity (MKO assumption a1)."
        }
      },
      {
        "id": "G2",
        "statement": {
          "zh-Hant": "本稿不執行 Lean（使用者指示；MKO 假設 a2）：沒有執行解析、elaboration、型別檢查或 kernel check。下文關於這些階段的每句話，要嘛是該階段必須建立什麼的定義，要嘛是以該階段成功為前提的手工分析。",
          "en": "Lean is not run in this guide (owner instruction; MKO assumption a2): no parsing, elaboration, type checking or kernel check was executed. Every sentence below about these stages is either a definition of what the stage must establish or a hand analysis conditional on that stage succeeding."
        }
      },
      {
        "id": "G3",
        "statement": {
          "zh-Hant": "源碼字串 s = `∀ (a b : Nat), a ≤ b → a < b + 1`。若要宣告定理，還需寫成 theorem t : s := p 並提供證明 p；本稿只討論冒號後的陳述部分。",
          "en": "The source string s = `∀ (a b : Nat), a ≤ b → a < b + 1`. Declaring a theorem would further require 'theorem t : s := p' with a proof p; this guide discusses only the statement after the colon."
        }
      },
      {
        "id": "G4",
        "statement": {
          "zh-Hant": "對照字串 s′ = `∀ (a : Nat), a - 1 < a` 與 s″ = `∀ (a : Int), a - 1 < a`，在同一 E 中閱讀。",
          "en": "Contrast strings s′ = `∀ (a : Nat), a - 1 < a` and s″ = `∀ (a : Int), a - 1 < a`, read in the same E."
        }
      }
    ],
    "steps": [
      {
        "id": "S01",
        "uses": [
          "G1",
          "G2"
        ],
        "before_tex": "s,\\ E",
        "after_tex": "E=(V,I,N,\\Gamma),\\quad \\Gamma=\\varnothing",
        "relation": "definition",
        "rule": "def_intro",
        "conditions": [
          "\\text{Lean not run (G2)}"
        ],
        "explanation": {
          "zh-Hant": "先把環境寫成四元組並命名。MKO 假設 a1 說版本、imports、已宣告名稱與 local context 都屬於陳述身分，所以任何關於 s 的判斷都必須附上 E。G2 記錄：這個四元組只在紙上固定，沒有呼叫任何工具鏈。",
          "en": "First write the environment as a 4-tuple and name it. MKO assumption a1 says that version, imports, declared names and local context all belong to statement identity, so every judgement about s must carry E. G2 records that this tuple is fixed on paper only and no toolchain was invoked."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "G2",
            "mko_lean_formal_statement_def"
          ],
          "explanation": {
            "zh-Hant": "此步只命名，不推出新事實。V 尚未釘選，這是待處理項，不影響後面以 E 為參數的條件式分析。",
            "en": "This step only names and derives no new fact. V is not pinned yet; that is an open item and does not affect the conditional analysis below, which treats E as a parameter."
          }
        },
        "leaf_basis": "def_intro + mko_lean_formal_statement_def"
      },
      {
        "id": "S02",
        "uses": [
          "S01",
          "G3"
        ],
        "before_tex": "s",
        "after_tex": "\\mathsf{Parse}(s)\\ ;\\ \\mathsf{Elab}(s)=S\\ ;\\ \\Gamma\\vdash S:\\mathrm{Prop}\\ ;\\ \\Gamma\\vdash p:S\\ ;\\ \\mathsf{Kernel}(p,S)",
        "relation": "definition",
        "rule": "lean_stages",
        "conditions": [],
        "explanation": {
          "zh-Hant": "為五個狀態命名：s 被解析；s elaboration 成核心項 S；S 的型別是 Prop；存在證明項 p:S；p 通過 kernel check。後面的狀態以前面的狀態為前提，但前面的狀態都不蘊含後面的狀態。MKO 的誤解正是把這幾個狀態合成一件事。本稿開始時五個狀態都是「未執行」。",
          "en": "Name five states: s is parsed; s elaborates to a core term S; S has type Prop; a proof term p:S exists; p passes the kernel check. Each later state presupposes the earlier ones, but no earlier state implies a later one. The misconception identified in the MKO is merging these states into one. At the start of this guide all five are 'not executed'."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "lean_stages",
            "mko_lean_formal_statement_def"
          ],
          "explanation": {
            "zh-Hant": "階段劃分來自引用的 Lean 文件（citation_verified）。此步只定義狀態名稱，不宣稱任何狀態已達成。",
            "en": "The division into stages comes from the cited Lean documentation (citation_verified). This step only defines names for the states and claims none of them has been reached."
          }
        },
        "leaf_basis": "lean_stages + def_intro"
      },
      {
        "id": "S03",
        "uses": [
          "S02",
          "G3"
        ],
        "before_tex": "s=\\texttt{∀ (a b : Nat), a ≤ b → a < b + 1}",
        "after_tex": "\\forall a:\\mathrm{Nat},\\ \\forall b:\\mathrm{Nat},\\ \\bigl((a\\le b)\\to(a<(b+1))\\bigr)",
        "relation": "implies",
        "rule": "lean_core_notation",
        "conditions": [
          "\\text{notation and precedence of E as cited}"
        ],
        "explanation": {
          "zh-Hant": "依引用的記號與優先序慣例手工讀出結構：(a b : Nat) 是兩個巢狀的全稱約束；∀ 延伸到字串結尾；+ 比 < 結合得緊，所以 a < b + 1 是 a<(b+1)；≤ 與 < 比 → 結合得緊，所以 → 的兩邊是 a≤b 與 a<b+1。讀出的意思：對所有自然數 a、b，若 a≤b 則 a<b+1。這是按慣例的人工閱讀，不是執行解析器的結果（G2）。",
          "en": "Read the structure by hand using the cited notation and precedence conventions: (a b : Nat) is two nested universal binders; the ∀ extends to the end of the string; + binds more tightly than <, so a < b + 1 is a<(b+1); ≤ and < bind more tightly than →, so the two sides of → are a≤b and a<b+1. The reading: for all natural numbers a and b, if a≤b then a<b+1. This is a manual reading according to the conventions, not the output of running the parser (G2)."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G3",
            "lean_core_notation"
          ],
          "explanation": {
            "zh-Hant": "閱讀依賴 E 中的記號與優先序；不同 imports 可能重新定義記號而得到不同結構（MKO 第二段）。不宣稱解析器接受 s。",
            "en": "The reading depends on the notation and precedence in E; different imports could redefine notation and give a different structure (MKO paragraph 2). It is not claimed that the parser accepts s."
          }
        },
        "leaf_basis": "lean_core_notation"
      },
      {
        "id": "S04",
        "uses": [
          "S03"
        ],
        "before_tex": "\\forall a\\,b:\\mathrm{Nat},\\ a\\le b\\to a<b+1",
        "after_tex": "S=\\forall a\\,b:\\mathrm{Nat},\\ \\mathrm{LE.le}\\,a\\,b\\to\\mathrm{LT.lt}\\,a\\,(\\mathrm{HAdd.hAdd}\\,b\\,(\\mathrm{OfNat.ofNat}\\,1))",
        "relation": "implies",
        "rule": "lean_core_notation",
        "conditions": [
          "\\mathsf{Elab}(s)\\ \\text{succeeds (not run)}"
        ],
        "explanation": {
          "zh-Hant": "說明 elaboration 若成功必須產生什麼：把每個記號換成其常數，並補上隱式型別參數 Nat 與 instance 參數（LE Nat、LT Nat、HAdd Nat Nat Nat、OfNat Nat 1）；顯示的項省略了這些隱式參數。這是對 elaboration 任務的描述；它是否成功、instance 的確切名稱，本稿都沒有檢查。",
          "en": "Describe what elaboration must produce if it succeeds: replace each notation by its constant and fill in the implicit type argument Nat and the instance arguments (LE Nat, LT Nat, HAdd Nat Nat Nat, OfNat Nat 1); the displayed term omits these implicit arguments. This describes elaboration's task; whether it succeeds, and the exact instance names, are not checked here."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S03",
            "lean_core_notation",
            "G2"
          ],
          "explanation": {
            "zh-Hant": "此步是條件式：以 Elab(s) 成功為前提。若 E 中缺少任一 instance 或記號，elaboration 會失敗，S 根本不存在。",
            "en": "This step is conditional on Elab(s) succeeding. If E lacked any of the instances or notations, elaboration would fail and S would not exist at all."
          }
        },
        "leaf_basis": "lean_core_notation + lean_stages"
      },
      {
        "id": "S05",
        "uses": [
          "S04"
        ],
        "before_tex": "S",
        "after_tex": "\\Gamma\\vdash S:\\mathrm{Prop}\\quad(\\text{conditional on}\\ \\mathsf{Elab}(s)=S)",
        "relation": "theorem_application",
        "rule": "prop_formation",
        "conditions": [
          "\\mathsf{Elab}(s)=S"
        ],
        "explanation": {
          "zh-Hant": "以 S04 的形狀為前提，用型別形成規則逐層推得 S 的型別是 Prop：先是兩個原子命題（S05.1），再是蘊含（S05.2），最後是兩層全稱（S05.3）。這是手工型別分析，不是型別檢查器的輸出。",
          "en": "Given the shape from S04, the typing rules show layer by layer that S has type Prop: first the two atomic propositions (S05.1), then the implication (S05.2), finally the two universal quantifiers (S05.3). This is a hand type analysis, not the output of the type checker."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S04",
            "prop_formation"
          ],
          "explanation": {
            "zh-Hant": "需要 S04 的條件式前提與引用的型別規則；若 elaboration 給出不同的項，這個分析要重做。",
            "en": "It needs the conditional premise of S04 and the cited typing rules; if elaboration produced a different term, this analysis would have to be redone."
          }
        },
        "leaf_basis": "prop_formation + lean_core_notation"
      },
      {
        "id": "S05.1",
        "uses": [
          "S04"
        ],
        "before_tex": "\\Gamma_1=(a:\\mathrm{Nat},\\ b:\\mathrm{Nat})",
        "after_tex": "\\Gamma_1\\vdash b+1:\\mathrm{Nat},\\ \\Gamma_1\\vdash a\\le b:\\mathrm{Prop},\\ \\Gamma_1\\vdash a<b+1:\\mathrm{Prop}",
        "relation": "implies",
        "rule": "lean_core_notation",
        "conditions": [],
        "explanation": {
          "zh-Hant": "在加入兩個約束變數後的 context Γ1 中：HAdd Nat Nat Nat 的輸出型別是 Nat，所以 b+1 : Nat；LE.le 與 LT.lt 的型別是 Nat → Nat → Prop，套用到兩個 Nat 就得到 Prop。",
          "en": "In the context Γ1 obtained by adding the two bound variables: the output type of HAdd Nat Nat Nat is Nat, so b+1 : Nat; LE.le and LT.lt have type Nat → Nat → Prop, and applying them to two Nat terms gives a Prop."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "lean_core_notation"
          ],
          "explanation": {
            "zh-Hant": "需要引用的 LE、LT、HAdd 型別簽名。這只說 a≤b 是命題，不說它為真。",
            "en": "It needs the cited type signatures of LE, LT and HAdd. It says only that a≤b is a proposition, not that it is true."
          }
        },
        "leaf_basis": "lean_core_notation"
      },
      {
        "id": "S05.2",
        "uses": [
          "S05.1"
        ],
        "before_tex": "\\Gamma_1\\vdash a\\le b:\\mathrm{Prop},\\ \\Gamma_1\\vdash a<b+1:\\mathrm{Prop}",
        "after_tex": "\\Gamma_1\\vdash (a\\le b\\to a<b+1):\\mathrm{Prop}",
        "relation": "implies",
        "rule": "prop_formation",
        "conditions": [],
        "explanation": {
          "zh-Hant": "依規則 (i)：兩個 Prop 之間的蘊含仍是 Prop。",
          "en": "By rule (i): an implication between two Props is a Prop."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S05.1",
            "prop_formation"
          ],
          "explanation": {
            "zh-Hant": "只需兩邊都是 Prop；不宣稱蘊含為真。",
            "en": "Only both sides being Props is needed; the implication is not claimed to be true."
          }
        },
        "leaf_basis": "prop_formation"
      },
      {
        "id": "S05.3",
        "uses": [
          "S05.2"
        ],
        "before_tex": "\\Gamma_1\\vdash (a\\le b\\to a<b+1):\\mathrm{Prop}",
        "after_tex": "\\Gamma\\vdash \\forall a:\\mathrm{Nat},\\ \\forall b:\\mathrm{Nat},\\ (a\\le b\\to a<b+1):\\mathrm{Prop}",
        "relation": "implies",
        "rule": "prop_formation",
        "conditions": [
          "\\mathrm{Nat}:\\mathrm{Type}=\\mathrm{Sort}\\ 1"
        ],
        "explanation": {
          "zh-Hant": "依規則 (ii) 兩次：先在 context (a:Nat) 中約束 b，得到 ∀b:Nat, (a≤b → a<b+1) : Prop；再在空 context Γ 中約束 a。因為 Nat : Type，而 Prop 是非直謂的，對任何型別量化一個 Prop 仍得 Prop。三個子步合起來給出 S05 的結論。",
          "en": "Apply rule (ii) twice: first bind b in the context (a:Nat), giving ∀b:Nat, (a≤b → a<b+1) : Prop; then bind a in the empty context Γ. Since Nat : Type and Prop is impredicative, quantifying a Prop over any type gives a Prop. The three sub-steps together give the conclusion of S05."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S05.2",
            "prop_formation"
          ],
          "explanation": {
            "zh-Hant": "需要 Nat 是一個型別（Sort 1）以及規則 (ii)。結論是 S 屬於 Prop，與 S 是否可證無關。",
            "en": "It needs Nat to be a type (Sort 1) and rule (ii). The conclusion is that S lies in Prop, which says nothing about whether S is provable."
          }
        },
        "leaf_basis": "prop_formation"
      },
      {
        "id": "S06",
        "uses": [
          "S05",
          "S02"
        ],
        "before_tex": "\\mathsf{Elab}(s)=S\\ \\wedge\\ \\Gamma\\vdash S:\\mathrm{Prop}",
        "after_tex": "s\\ \\text{expresses a formal statement in}\\ E",
        "relation": "implies",
        "rule": "mko_lean_formal_statement_def",
        "conditions": [
          "\\mathsf{Elab}(s)=S\\ \\text{(not run)}"
        ],
        "explanation": {
          "zh-Hant": "套用 MKO 定義作為條件式：若 s 在 E 中 elaboration 為 S 且 Γ⊢S:Prop，則 s 在 E 中表達一個形式陳述。前件的型別部分已在 S05 以 elaboration 成功為前提手工得到；elaboration 本身沒有執行（G2）。因此記錄的狀態是：「預期在 E 中表達形式陳述；缺 elaboration receipt」。",
          "en": "Apply the MKO definition as a conditional: if s elaborates in E to S with Γ⊢S:Prop, then s expresses a formal statement in E. The typing half of the antecedent was obtained by hand in S05, assuming elaboration succeeds; elaboration itself was not run (G2). The recorded status is therefore 'expected to express a formal statement in E; elaboration receipt missing'."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S05",
            "mko_lean_formal_statement_def",
            "G2"
          ],
          "explanation": {
            "zh-Hant": "此步不宣稱前件已成立，所以不能把後件當作已確認。它也不宣稱 S 為真或已證明：是陳述與已證明是分離狀態。",
            "en": "This step does not claim the antecedent holds, so the consequent cannot be treated as confirmed. Nor does it claim S is true or proved: being a statement and being proved are separate states."
          }
        },
        "leaf_basis": "mko_lean_formal_statement_def + lean_stages"
      },
      {
        "id": "S07",
        "uses": [
          "S04"
        ],
        "before_tex": "\\Gamma\\vdash p:S",
        "after_tex": "p=\\lambda (a\\,b:\\mathrm{Nat})\\,(h:a\\le b).\\ q,\\quad a,b:\\mathrm{Nat},\\ h:a\\le b\\ \\vdash\\ q:a<b+1",
        "relation": "definition",
        "rule": "curry_howard",
        "conditions": [],
        "explanation": {
          "zh-Hant": "依命題即型別，S 的證明項是一個函數：接收任意 a、b : Nat 與假設 a≤b 的證明 h，回傳 a<b+1 的證明 q。約束變數 a、b 是資料，h 是假設；證明責任是：對任意 a、b 與 h，造出 a<b+1 的證明。這正是 S09 非正式證明的形狀。",
          "en": "By propositions as types, a proof term of S is a function: it takes arbitrary a, b : Nat and a proof h of the hypothesis a≤b, and returns a proof q of a<b+1. The bound variables a and b are data and h is the hypothesis; the obligation is to produce, for arbitrary a, b and h, a proof of a<b+1. This is exactly the shape of the informal proof in S09."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S04",
            "curry_howard"
          ],
          "explanation": {
            "zh-Hant": "此步只描述證明項必須是什麼形狀；沒有造出任何 p，也沒有 kernel check。",
            "en": "This step only describes the shape a proof term must have; no p is constructed and nothing is kernel-checked."
          }
        },
        "leaf_basis": "curry_howard"
      },
      {
        "id": "S08",
        "uses": [
          "S03"
        ],
        "before_tex": "\\forall a\\,b,\\ a\\le b\\to a<b+1",
        "after_tex": "(a,b)=(3,3):\\ 3\\le 3\\to 3<4;\\quad (a,b)=(5,2):\\ 5\\le 2\\to 5<3",
        "relation": "implies",
        "rule": "forall_elim",
        "conditions": [],
        "explanation": {
          "zh-Hant": "用兩個實例看清陳述的意思。a=b=3 時假設 3≤3 成立，結論 3<4 也成立。a=5、b=2 時假設 5≤2 不成立，陳述對這一對不要求結論 5<3（在古典讀法中這個蘊含空真）。假設限定了陳述對哪些數對宣稱結論。",
          "en": "Use two instances to see what the statement says. For a=b=3 the hypothesis 3≤3 holds and the conclusion 3<4 holds too. For a=5, b=2 the hypothesis 5≤2 fails, and the statement demands nothing about 5<3 for this pair (in the classical reading the implication is vacuously true). The hypothesis restricts which pairs the conclusion is claimed for."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S03",
            "forall_elim"
          ],
          "explanation": {
            "zh-Hant": "實例化只把全稱陳述用到特定值；兩個實例不能證明全稱陳述（N1、N2 只核對這兩個數值）。",
            "en": "Instantiation only applies the universal statement to particular values; two instances cannot prove the universal statement (N1, N2 check only these numbers)."
          }
        },
        "leaf_basis": "forall_elim + numeric_evaluation"
      },
      {
        "id": "S09",
        "uses": [
          "S03"
        ],
        "before_tex": "\\forall a,b\\in\\mathbb{N},\\ a\\le b\\Rightarrow a<b+1",
        "after_tex": "\\text{true in}\\ \\mathbb{N}\\ \\text{(informal proof)}",
        "relation": "theorem_application",
        "rule": "L_main",
        "conditions": [],
        "explanation": {
          "zh-Hant": "套用引理 L_main（在 S09.1、S09.2 證明）：在標準自然數中，陳述的數學內容成立。這是數學上的非正式證明，對應 S07 中 q 的構造計畫。",
          "en": "Apply Lemma L_main (proved in S09.1 and S09.2): in the standard natural numbers the mathematical content of the statement holds. This is an informal mathematical proof and corresponds to the plan for constructing q in S07."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "L_main"
          ],
          "explanation": {
            "zh-Hant": "結論是關於標準 ℕ 的數學事實，不是關於 Lean 的任何狀態；它不產生證明項，也不經 kernel check。N3 只在 0 到 6 的 49 個數對上做有限核對，不取代引理的證明。",
            "en": "The conclusion is a mathematical fact about standard ℕ, not about any Lean state; it produces no proof term and passes through no kernel check. N3 is a finite check on the 49 pairs from 0 to 6 only and does not replace the proof of the lemma."
          }
        },
        "leaf_basis": "order_basics + forall_intro + imp_intro"
      },
      {
        "id": "S09.1",
        "uses": [
          "order_basics"
        ],
        "before_tex": "0<1",
        "after_tex": "b<b+1",
        "relation": "implies",
        "rule": "order_basics",
        "conditions": [
          "b\\in\\mathbb{N}"
        ],
        "explanation": {
          "zh-Hant": "由 0<1，兩邊同加 b（次序對加法保持），得 b<b+1。把 ℕ 視為 ℝ 的子集，使用同一個次序。",
          "en": "From 0<1, add b to both sides (order is preserved by addition) to get b<b+1. View ℕ inside ℝ with the same order."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "order_basics"
          ],
          "explanation": {
            "zh-Hant": "只用到 u<v ⇒ u+w<v+w。",
            "en": "Only u<v ⇒ u+w<v+w is used."
          }
        },
        "leaf_basis": "order_basics"
      },
      {
        "id": "S09.2",
        "uses": [
          "S09.1",
          "order_basics"
        ],
        "before_tex": "a\\le b,\\ b<b+1",
        "after_tex": "a<b+1",
        "relation": "implies",
        "rule": "case_analysis",
        "conditions": [
          "a\\le b"
        ],
        "explanation": {
          "zh-Hant": "a≤b 表示 a<b 或 a=b。若 a<b，與 b<b+1 依傳遞得 a<b+1；若 a=b，把 b 換成 a 代入 b<b+1 直接得 a<b+1。兩種情況都得結論；a、b 是任意的，釋放假設並全稱推廣，L_main 得證。",
          "en": "a≤b means a<b or a=b. If a<b, transitivity with b<b+1 gives a<b+1; if a=b, replacing b by a in b<b+1 gives a<b+1 directly. Both cases reach the conclusion; since a and b were arbitrary, discharging the hypothesis and generalizing proves L_main."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S09.1",
            "order_basics",
            "case_analysis",
            "imp_intro",
            "forall_intro"
          ],
          "explanation": {
            "zh-Hant": "兩種情況涵蓋 a≤b 的全部可能；不宣稱反向（a<b+1 ⇒ a≤b 在 ℕ 中其實也成立，但這裡沒用到也沒證明）。",
            "en": "The two cases cover every way a≤b can hold; no converse is claimed (a<b+1 ⇒ a≤b does hold in ℕ, but it is neither used nor proved here)."
          }
        },
        "leaf_basis": "case_analysis + order_basics + eq_replace + imp_intro + forall_intro"
      },
      {
        "id": "S10",
        "uses": [
          "S06",
          "S07",
          "S09"
        ],
        "before_tex": "\\text{informal proof of the content of}\\ S",
        "after_tex": "\\mathsf{Parse},\\ \\mathsf{Elab},\\ \\mathsf{Kernel}:\\ \\text{not run};\\ p:\\ \\text{not constructed}",
        "relation": "implies",
        "rule": "mko_lean_formal_statement_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "整理狀態。S09 證明了陳述的數學內容在標準 ℕ 中為真，並給出 S07 中 q 的構造計畫；但它不是 Lean 證明項，也沒有任何東西經過 kernel check。因此狀態表為：解析未執行；elaboration 未執行；Prop 型別只有手工分析（S05，以 elaboration 成功為前提）；證明項未建立；kernel check 未執行。依 MKO，形式陳述與其已檢查證明項是分離狀態，本稿只推進了前者的概念分析。",
          "en": "Collect the states. S09 proved that the mathematical content of the statement is true in standard ℕ and gave the plan for q in S07; but it is not a Lean proof term and nothing passed a kernel check. So the status table is: parsing not run; elaboration not run; Prop typing by hand analysis only (S05, conditional on elaboration); proof term not constructed; kernel check not run. By the MKO, a formal statement and its checked proof term are separate states, and this guide advances only the conceptual analysis of the former."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S06",
            "S07",
            "S09",
            "mko_lean_formal_statement_def",
            "G2"
          ],
          "explanation": {
            "zh-Hant": "此步的作用是阻止升級：數學上為真與非正式證明都不能推出 Γ⊢p:S 已被 kernel 接受。",
            "en": "The role of this step is to block promotion: mathematical truth and an informal proof do not imply that Γ⊢p:S has been accepted by the kernel."
          }
        },
        "leaf_basis": "mko_lean_formal_statement_def + lean_stages + mko_proposition_def"
      },
      {
        "id": "S11",
        "uses": [
          "G4",
          "S05"
        ],
        "before_tex": "s'=\\texttt{∀ (a : Nat), a - 1 < a}",
        "after_tex": "\\Gamma\\vdash S':\\mathrm{Prop}\\quad(\\text{conditional on}\\ \\mathsf{Elab}(s'))",
        "relation": "implies",
        "rule": "prop_formation",
        "conditions": [
          "\\mathsf{Elab}(s')\\ \\text{succeeds (not run)}"
        ],
        "explanation": {
          "zh-Hant": "對 s′ 重做 S05 的型別分析：a−1 是 HSub Nat Nat Nat 的值，型別 Nat；LT.lt (a−1) a : Prop；對 a : Nat 全稱量化仍是 Prop。所以若 s′ 能 elaboration，它同樣表達一個形式陳述。",
          "en": "Redo the type analysis of S05 for s′: a−1 is a value of HSub Nat Nat Nat with type Nat; LT.lt (a−1) a : Prop; quantifying over a : Nat still gives a Prop. So if s′ elaborates, it too expresses a formal statement."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G4",
            "prop_formation",
            "lean_core_notation"
          ],
          "explanation": {
            "zh-Hant": "與 S05 一樣是以 elaboration 成功為前提的手工分析；結論只到「是 Prop」。",
            "en": "As in S05 this is a hand analysis conditional on elaboration succeeding; the conclusion goes only as far as 'is a Prop'."
          }
        },
        "leaf_basis": "prop_formation + lean_core_notation"
      },
      {
        "id": "S12",
        "uses": [
          "S11"
        ],
        "before_tex": "\\forall a:\\mathrm{Nat},\\ a-1<a",
        "after_tex": "a=0:\\ 0-1=0,\\ \\neg(0<0)\\ \\Rightarrow\\ \\neg\\forall a,\\ a-1<a",
        "relation": "implies",
        "rule": "quantifier_negation",
        "conditions": [
          "\\text{truncated subtraction on Nat}"
        ],
        "explanation": {
          "zh-Hant": "在 Nat 的截斷減法下，a=0 給出 0−1=0（S12.1），而 0<0 不成立（S12.2）。存在反例，依量詞否定，S′ 的內容在標準讀法下為假。S′ 是 Prop（S11）但不是真命題：是命題不表示已證明為真（mko_proposition_def）。",
          "en": "Under truncated subtraction on Nat, a=0 gives 0−1=0 (S12.1), and 0<0 fails (S12.2). A counterexample exists, so by quantifier negation the content of S′ is false in the standard reading. S′ is a Prop (S11) but not a true one: being a proposition does not mean being proved true (mko_proposition_def)."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "nat_trunc_sub",
            "quantifier_negation",
            "mko_proposition_def"
          ],
          "explanation": {
            "zh-Hant": "需要引用的截斷減法定義（citation_verified）。一個反例足以否定全稱陳述（N4、N5 可重算）。",
            "en": "It needs the cited definition of truncated subtraction (citation_verified). One counterexample suffices to refute a universal statement (recomputable as N4, N5)."
          }
        },
        "leaf_basis": "nat_trunc_sub + quantifier_negation + order_basics"
      },
      {
        "id": "S12.1",
        "uses": [
          "nat_trunc_sub"
        ],
        "before_tex": "0-1\\ \\text{in Nat}",
        "after_tex": "0-1=0",
        "relation": "implies",
        "rule": "nat_trunc_sub",
        "conditions": [
          "0\\le 1"
        ],
        "explanation": {
          "zh-Hant": "因為 0≤1，截斷減法給出 0−1=0，而不是 −1；−1 不是自然數。",
          "en": "Since 0≤1, truncated subtraction gives 0−1=0, not −1; −1 is not a natural number."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "nat_trunc_sub"
          ],
          "explanation": {
            "zh-Hant": "結論依賴 Nat 減法的定義；在 Int 中同一式子等於 −1（見 S13）。",
            "en": "The conclusion depends on the definition of subtraction on Nat; in Int the same expression equals −1 (see S13)."
          }
        },
        "leaf_basis": "nat_trunc_sub"
      },
      {
        "id": "S12.2",
        "uses": [
          "S12.1",
          "order_basics"
        ],
        "before_tex": "0-1<0",
        "after_tex": "0<0,\\ \\text{which is false}",
        "relation": "equivalent",
        "rule": "eq_replace",
        "conditions": [],
        "explanation": {
          "zh-Hant": "以 0−1=0 代換，0−1<0 等價於 0<0；依三分律 0=0 時 0<0 不成立。",
          "en": "Replacing 0−1 by 0, the claim 0−1<0 is equivalent to 0<0; by trichotomy, 0=0 rules out 0<0."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "S12.1",
            "eq_replace"
          ],
          "explanation": {
            "zh-Hant": "以相等的式子代換不改變真假，兩向都成立。",
            "en": "Replacing an expression by an equal one does not change truth, so both directions hold."
          }
        },
        "leaf_basis": "eq_replace + order_basics"
      },
      {
        "id": "S13",
        "uses": [
          "G4",
          "S12"
        ],
        "before_tex": "s''=\\texttt{∀ (a : Int), a - 1 < a}",
        "after_tex": "\\forall a\\in\\mathbb{Z},\\ a-1<a\\ \\text{(true)};\\quad S''\\ne S'",
        "relation": "implies",
        "rule": "order_basics",
        "conditions": [
          "\\text{ring subtraction on Int}"
        ],
        "explanation": {
          "zh-Hant": "在 Int 上減法是通常的環減法。對任意整數 a，−1<0，兩邊加 a 得 a−1<a，所以 S″ 的內容為真。s′ 與 s″ 只差一個型別名稱，但約束變數型別不同、減法不同，因此是不同的核心項，而且真假不同。型別與環境都是陳述身分的一部分（MKO 假設 a1）。",
          "en": "On Int subtraction is the usual ring subtraction. For every integer a, −1<0, and adding a to both sides gives a−1<a, so the content of S″ is true. s′ and s″ differ only in one type name, but the bound variable's type and the subtraction differ, so they are different core terms with different truth values. Types and environment are part of statement identity (MKO assumption a1)."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G4",
            "nat_trunc_sub",
            "order_basics"
          ],
          "explanation": {
            "zh-Hant": "需要 Int 減法的通常定義（引用）與次序對加法保持。N6 只在有限範圍核對，不取代全稱證明。",
            "en": "It needs the usual definition of subtraction on Int (cited) and that order is preserved by addition. N6 checks a finite range only and does not replace the universal proof."
          }
        },
        "leaf_basis": "order_basics + nat_trunc_sub"
      },
      {
        "id": "S14",
        "uses": [
          "S01",
          "S03"
        ],
        "before_tex": "t_0=\\texttt{a ≤ b → a < b + 1}",
        "after_tex": "\\text{meaning of}\\ t_0\\ \\text{depends on}\\ \\Gamma\\ \\text{and elaborator options}",
        "relation": "implies",
        "rule": "mko_lean_formal_statement_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "去掉約束後的文字 t0。若 local context 是 Γ′=(a b : Nat)，t0 會被讀成關於這兩個區域變數的陳述；在 E 的空 Γ 中，a、b 不是已宣告名稱，elaboration 可能失敗，也可能依 elaborator 選項（例如自動隱式約束）以不同方式處理，本稿不預測是哪一種。所以 receipt 必須記錄 Γ 與選項；同一段文字在不同 context 中不是同一個陳述。",
          "en": "Take the text t0 without binders. If the local context is Γ′=(a b : Nat), t0 would be read as a statement about those two local variables; in E's empty Γ, a and b are not declared names, so elaboration may fail or may treat them differently depending on elaborator options (such as automatic implicit binding), and this guide does not predict which. So a receipt must record Γ and the options; the same text in different contexts is not the same statement."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S01",
            "mko_lean_formal_statement_def",
            "lean_stages"
          ],
          "explanation": {
            "zh-Hant": "此步只陳述依賴關係，不宣稱 t0 在任何環境中的實際 elaboration 結果。",
            "en": "This step states only the dependence and claims no actual elaboration result for t0 in any environment."
          }
        },
        "leaf_basis": "mko_lean_formal_statement_def + lean_stages"
      }
    ],
    "result": {
      "zh-Hant": "s 讀作「對所有自然數 a、b，若 a≤b 則 a<b+1」：兩個 Nat 約束變數、一個假設 a≤b、一個結論 a<b+1。若在 E 中 elaboration 成功，核心項 S 的型別依型別規則為 Prop，於是 s 表達一個形式陳述；其證明項必須是接收 a、b 與 h:a≤b 並回傳 a<b+1 證明的函數。其數學內容在標準 ℕ 中為真（非正式證明）。本稿沒有執行 Lean：解析、elaboration、證明項與 kernel check 的狀態都是「未執行」。s′ 是 Prop 但在 a=0 時為假，s″ 為真，顯示型別與環境屬於陳述身分。",
      "en": "s reads 'for all natural numbers a and b, if a≤b then a<b+1': two Nat bound variables, one hypothesis a≤b and one conclusion a<b+1. If elaboration succeeds in E, the typing rules give the core term S type Prop, so s expresses a formal statement; a proof term must be a function taking a, b and h:a≤b to a proof of a<b+1. Its mathematical content is true in standard ℕ (informal proof). Lean was not run: parsing, elaboration, proof term and kernel check are all 'not executed'. s′ is a Prop but false at a=0 and s″ is true, showing that types and environment belong to statement identity."
    },
    "negative_controls": [
      {
        "claim": {
          "zh-Hant": "s 看起來是合法的 Lean，所以它在任何環境中都能 elaboration",
          "en": "s looks like valid Lean, so it elaborates in every environment"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "elaboration 依賴版本、imports、記號、instance 與 local context（MKO 假設 a1）；本稿也沒有執行 elaboration。",
          "en": "Elaboration depends on version, imports, notation, instances and local context (MKO assumption a1); and elaboration was not run in this guide."
        }
      },
      {
        "claim": {
          "zh-Hant": "S 的型別是 Prop，所以 S 已被證明",
          "en": "S has type Prop, so S is proved"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "S′ 同樣是 Prop，卻在 a=0 時為假：0−1=0 而 0<0 不成立。",
          "en": "S′ is also a Prop, yet it is false at a=0: 0−1=0 and 0<0 fails."
        }
      },
      {
        "claim": {
          "zh-Hant": "本稿顯示 s 可以編譯，且定理已由 Lean 證明",
          "en": "This guide shows that s compiles and that the theorem is proved by Lean"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "G2：本稿沒有執行 Lean，沒有任何解析、elaboration 或 kernel receipt。",
          "en": "G2: Lean was not run, and there is no parse, elaboration or kernel receipt."
        }
      },
      {
        "claim": {
          "zh-Hant": "s′ 與 s″ 只差型別名稱，所以是同一個陳述",
          "en": "s′ and s″ differ only in a type name, so they are the same statement"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "型別與減法不同，s′ 在 a=0 為假而 s″ 對所有整數為真。",
          "en": "The types and the subtraction differ; s′ is false at a=0 while s″ is true for every integer."
        }
      }
    ],
    "status": "candidate",
    "gaps": [],
    "verification": {
      "structure": "checked_local_script",
      "mathematics": "candidate_argument",
      "formalization": "not_formalized"
    },
    "rule_glossary": [
      {
        "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": "numeric_evaluation",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "明確整數或有理數算式的精確求值；可以獨立重算。",
          "en": "Exact evaluation of an explicit integer or rational expression; independently recomputable."
        }
      },
      {
        "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": "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": "forall_elim",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "∀消去（代入特例）：若 ∀x∈D, P(x) 成立且 a∈D，則 P(a) 成立。",
          "en": "∀-elimination (instantiation): if ∀x∈D, P(x) holds and a∈D, then P(a) holds."
        }
      },
      {
        "id": "forall_intro",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "∀引入（全稱推廣）：若某命題對一個「任意的」元素 x 證成，而證明沒有對 x 加任何額外假設，則它對論域中所有 x 成立。",
          "en": "∀-introduction (generalization): if a statement is proved for an arbitrary element x, with no extra assumption on x, it holds for every x in the domain."
        }
      },
      {
        "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": "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": "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": "quantifier_negation",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "量詞否定：¬(∀x, P(x)) 等價於 ∃x, ¬P(x)；¬(∃x, P(x)) 等價於 ∀x, ¬P(x)。",
          "en": "Negating quantifiers: ¬(∀x, P(x)) is equivalent to ∃x, ¬P(x), and ¬(∃x, P(x)) is equivalent to ∀x, ¬P(x)."
        }
      },
      {
        "id": "mko_lean_formal_statement_def",
        "kind": "cited",
        "source": {
          "mko_id": "mko-lean-formal-statement",
          "sha256": "b60e51a622407c4c4ee426df9c55830652f67ff5e0a8344c040c14f26dd49128",
          "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f"
        },
        "statement": {
          "zh-Hant": "在固定 Lean 版本、imports、名稱環境與 local context Γ 中，source syntax s 若成功 elaboration 為核心項 S，且 Γ⊢S:Prop，則 s 在該環境中表達一個形式陳述。陳述成立與存在已檢查證明項是分離狀態。",
          "en": "In a fixed Lean version, with fixed imports, name environment and local context Γ, source syntax s expresses a formal statement if it elaborates successfully to a core term S with Γ⊢S:Prop. A statement and the existence of its checked proof term are separate states."
        }
      },
      {
        "id": "mko_proposition_def",
        "kind": "cited",
        "source": {
          "mko_id": "mko-proposition",
          "sha256": "77a5e0d8403fa47d1ee57431b11f6fc52bfdde80a575db9dac3589fb0b9e8510",
          "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f"
        },
        "statement": {
          "zh-Hant": "命題 P 可以為真或為假；P 是命題不表示 P 已被證明為真。",
          "en": "A proposition P may be true or false; being a proposition does not mean that P has been proved true."
        }
      },
      {
        "id": "lean_stages",
        "kind": "cited",
        "source": {
          "reference": "Lean Language Reference, Elaboration and Compilation, Sections 2.1-2.3",
          "original_reference": "J. Avigad, L. de Moura, S. Kong, S. Ullrich, Theorem Proving in Lean 4 (online book), and the Lean 4 language reference, sections on syntax, elaboration and the kernel",
          "url": "https://lean-lang.org/doc/reference/latest/Elaboration-and-Compilation/",
          "locator": "Parsing, Elaboration, The Kernel",
          "checked_date": "2026-10-19",
          "verification": "original_verified",
          "verification_note": "Documentation reading only; Lean was not executed."
        },
        "needs_citation": false,
        "statement": {
          "zh-Hant": "Lean 4 分階段處理源碼：解析把文字變成語法樹；elaboration 把語法變成核心項，並解析名稱、記號、隱式參數與 type-class instance，可能失敗；型別檢查推得核心項的型別；宣告定理時，kernel 檢查所提供的證明項具有所宣告的型別。前一階段成功不保證後一階段成功。",
          "en": "Lean 4 processes source in stages: parsing turns text into syntax; elaboration turns syntax into a core term, resolving names, notation, implicit arguments and type-class instances, and may fail; type checking infers the core term's type; for a theorem declaration the kernel checks that the supplied proof term has the stated type. Success at one stage does not guarantee success at a later one."
        }
      },
      {
        "id": "lean_core_notation",
        "kind": "cited",
        "source": {
          "reference": "Lean 4 v4.30.0 Init/Notation.lean; Lean Language Reference Basic Classes; Init.Prelude API",
          "original_reference": "Lean 4 core prelude (Init) and the Lean 4 language reference, notation and type classes LE, LT, HAdd, HSub, OfNat",
          "url": "https://raw.githubusercontent.com/leanprover/lean4/v4.30.0/src/Init/Notation.lean",
          "locator": "Core notation declarations, LE/LT/HAdd/HSub/OfNat signatures",
          "checked_date": "2026-10-19",
          "verification": "original_verified",
          "verification_note": "Notation and signatures checked as documentation, not as a replay of the guide's unpinned environment.",
          "additional_urls": [
            "https://lean-lang.org/doc/reference/latest/Type-Classes/Basic-Classes/",
            "https://lean-lang.org/doc/api/Init/Prelude.html#OfNat"
          ]
        },
        "needs_citation": false,
        "statement": {
          "zh-Hant": "在 Lean 4 core 中，a ≤ b 是 LE.le a b 的記號，a < b 是 LT.lt a b，a + b 是 HAdd.hAdd a b，a - b 是 HSub.hSub a b，數字 1 是 OfNat.ofNat 1；LE.le 與 LT.lt 的型別是 α → α → Prop。+ 的結合力強於 ≤ 與 <，兩者又強於 →；→ 向右結合；∀ 的作用域延伸到最右；(a b : Nat) 宣告兩個型別為 Nat 的約束變數。core prelude 為 Nat 與 Int 提供這些類別的 instance。",
          "en": "In Lean 4 core, a ≤ b is notation for LE.le a b, a < b for LT.lt a b, a + b for HAdd.hAdd a b, a - b for HSub.hSub a b, and the numeral 1 for OfNat.ofNat 1; LE.le and LT.lt have type α → α → Prop. + binds more tightly than ≤ and <, which bind more tightly than →; → associates to the right; a ∀ extends as far right as possible; (a b : Nat) declares two bound variables of type Nat. The core prelude provides instances of these classes for Nat and Int."
        }
      },
      {
        "id": "prop_formation",
        "kind": "cited",
        "source": {
          "reference": "Theorem Proving in Lean 4, Chapters 3 and 4, Sections 3.1 and 4.1",
          "original_reference": "J. Avigad, L. de Moura, S. Kong, S. Ullrich, Theorem Proving in Lean 4, chapters 'Dependent Type Theory' and 'Propositions and Proofs'",
          "url": "https://lean-lang.org/theorem_proving_in_lean4/Quantifiers-and-Equality/",
          "locator": "Sort(imax i j) and impredicativity; Propositions as Types",
          "checked_date": "2026-10-19",
          "verification": "original_verified",
          "verification_note": "Type formation does not establish the truth of a proposition.",
          "additional_urls": [
            "https://lean-lang.org/theorem_proving_in_lean4/Propositions-and-Proofs/",
            "https://lean-lang.org/doc/reference/latest/The-Type-System/Universes/"
          ]
        },
        "needs_citation": false,
        "statement": {
          "zh-Hant": "Lean 型別論的規則：(i) 若 Γ⊢A:Prop 且 Γ⊢B:Prop，則 Γ⊢(A→B):Prop；(ii) 若 Γ⊢α:Sort u 且 Γ,x:α⊢B:Prop，則 Γ⊢(∀x:α, B):Prop（Prop 的非直謂性）；Nat : Type 與 Int : Type，其中 Type = Sort 1。",
          "en": "Rules of Lean's type theory: (i) if Γ⊢A:Prop and Γ⊢B:Prop then Γ⊢(A→B):Prop; (ii) if Γ⊢α:Sort u and Γ,x:α⊢B:Prop then Γ⊢(∀x:α, B):Prop (impredicativity of Prop); Nat : Type and Int : Type, where Type = Sort 1."
        }
      },
      {
        "id": "curry_howard",
        "kind": "cited",
        "source": {
          "reference": "Theorem Proving in Lean 4, Sections 3.1 and 4.1",
          "original_reference": "J. Avigad, L. de Moura, S. Kong, S. Ullrich, Theorem Proving in Lean 4, chapter 'Propositions and Proofs' (propositions as types)",
          "url": "https://lean-lang.org/theorem_proving_in_lean4/Propositions-and-Proofs/",
          "locator": "Implication as functions and universal quantification as dependent functions",
          "checked_date": "2026-10-19",
          "verification": "original_verified",
          "verification_note": "Forall case additionally checked in Quantifiers and Equality.",
          "additional_urls": [
            "https://lean-lang.org/theorem_proving_in_lean4/Quantifiers-and-Equality/"
          ]
        },
        "needs_citation": false,
        "statement": {
          "zh-Hant": "命題即型別：∀x:α, B 的證明是把每個 x:α 送到 B 的證明的函數；A→B 的證明是把 A 的證明送到 B 的證明的函數；p : S 表示 p 是型別為 S 的項。",
          "en": "Propositions as types: a proof of ∀x:α, B is a function sending each x:α to a proof of B; a proof of A→B is a function sending each proof of A to a proof of B; p : S means p is a term of type S."
        }
      },
      {
        "id": "nat_trunc_sub",
        "kind": "cited",
        "source": {
          "reference": "Lean 4 Init.Prelude API, Nat.sub; Lean Language Reference, Integers, Int.sub",
          "original_reference": "Lean 4 core prelude (Init), definitions Nat.sub and Int.sub; Theorem Proving in Lean 4",
          "url": "https://lean-lang.org/doc/api/Init/Prelude.html#Nat.sub",
          "locator": "Nat.sub truncated at zero; Int.sub usual integer subtraction",
          "checked_date": "2026-10-19",
          "verification": "original_verified",
          "verification_note": "Documentation checked; no Lean computation was run.",
          "additional_urls": [
            "https://lean-lang.org/doc/reference/latest/Basic-Types/Integers/#Int.sub"
          ]
        },
        "needs_citation": false,
        "statement": {
          "zh-Hant": "在 Lean 4 core 中，Nat 上的減法是截斷減法：a≤b 時 a−b=0，否則為通常的差；特別地 0−1=0。Int 上的減法是通常的環減法。",
          "en": "In Lean 4 core, subtraction on Nat is truncated: a−b=0 when a≤b, and the usual difference otherwise; in particular 0−1=0. Subtraction on Int is the usual ring subtraction."
        }
      },
      {
        "id": "L_main",
        "kind": "lemma",
        "proved_in": [
          "S09.1",
          "S09.2"
        ],
        "statement": {
          "zh-Hant": "對所有自然數 a、b：若 a≤b，則 a<b+1。",
          "en": "For all natural numbers a and b: if a≤b then a<b+1."
        }
      }
    ],
    "revision_log": [],
    "numeric_checks": [
      {
        "id": "N1",
        "step": "S08",
        "lhs": "3",
        "relation": "<=",
        "rhs": "3"
      },
      {
        "id": "N2",
        "step": "S08",
        "lhs": "3",
        "relation": "<",
        "rhs": "3+1"
      },
      {
        "id": "N3",
        "step": "S09",
        "vars": [
          "a",
          "b"
        ],
        "range": [
          0,
          6
        ],
        "lhs": "max(min(a-b,1),0)+max(min(b+1-a,1),0)",
        "relation": ">=",
        "rhs": "1"
      },
      {
        "id": "N4",
        "step": "S12.1",
        "lhs": "max(0-1,0)",
        "rhs": "0"
      },
      {
        "id": "N5",
        "step": "S12.2",
        "lhs": "max(0-1,0)",
        "relation": ">=",
        "rhs": "0"
      },
      {
        "id": "N6",
        "step": "S13",
        "vars": [
          "a"
        ],
        "range": [
          -6,
          6
        ],
        "lhs": "a-1",
        "relation": "<",
        "rhs": "a"
      }
    ]
  },
  "presentation": {
    "md_scope": {
      "zh-Hant": "在 MKO 範圍內工作：陳述身分包含 Lean 版本、imports、名稱環境與 local context（假設 a1）；依使用者指示暫停 Lean，所以只做概念說明與手工型別分析，不產生任何 elaboration 或 kernel receipt（假設 a2）。所引用的 Lean 記號與型別規則以 citation_verified 標記；不改動 canonical MKO 或英文 edition。",
      "en": "Works inside the MKO's scope: statement identity includes the Lean version, imports, name environment and local context (assumption a1); Lean is paused by the owner's instruction, so this guide gives only conceptual explanation and hand type analysis and produces no elaboration or kernel receipt (assumption a2). The cited Lean notation and typing rules carry citation_verified; the canonical MKO and its English edition are not changed."
    },
    "md_symbols": [
      [
        "E=(V,I,N,\\Gamma)",
        "環境：Lean 版本、imports、名稱環境、local context",
        "the environment: Lean version, imports, name environment, local context"
      ],
      [
        "s",
        "源碼字串（尚未解析的文字）",
        "the source string (text not yet parsed)"
      ],
      [
        "S",
        "若 elaboration 成功所得的核心項",
        "the core term elaboration would produce if it succeeded"
      ],
      [
        "\\Gamma\\vdash S:\\mathrm{Prop}",
        "在 Γ 中 S 的型別是 Prop",
        "in Γ, S has type Prop"
      ],
      [
        "p",
        "S 的候選證明項",
        "a candidate proof term of S"
      ],
      [
        "\\mathsf{Elab},\\ \\mathsf{Kernel}",
        "elaboration 與 kernel check 兩個階段",
        "the elaboration and kernel-check stages"
      ],
      [
        "\\mathrm{Nat},\\ \\mathrm{Int}",
        "Lean 的自然數型別與整數型別",
        "Lean's natural-number and integer types"
      ]
    ],
    "md_error_controls": [
      {
        "title": "四種狀態不是同一件事 / Four states are not one thing",
        "zh": "MKO 指出的誤解是把成功解析、成功 elaboration、型別為 Prop 與已通過 kernel 的證明視為同一件事。S02 把它們分成五個狀態；s′ 說明即使前幾個狀態都達成（若 elaboration 成功），陳述仍可能為假，因此不可能有證明。本稿只有手工分析，任何狀態都沒有執行。",
        "en": "The misconception identified in the MKO is treating successful parsing, successful elaboration, having type Prop and a kernel-checked proof as one thing. S02 separates them into five states; s′ shows that even if the early states are reached (should elaboration succeed), the statement can be false and so have no proof. This guide contains hand analysis only; no state was executed."
      },
      {
        "title": "文字相同不等於陳述相同 / The same text is not the same statement",
        "zh": "s′ 與 s″ 只差 Nat 與 Int，卻是不同的核心項，一假一真（S12、S13）；t0 在不同 local context 中意義不同（S14）。比對陳述時必須比較環境與核心項，不能只比字串。",
        "en": "s′ and s″ differ only in Nat versus Int, yet they are different core terms, one false and one true (S12, S13); t0 means different things in different local contexts (S14). Comparing statements requires comparing environments and core terms, not strings."
      },
      {
        "title": "非正式證明不是已檢查的證明項 / An informal proof is not a checked proof term",
        "zh": "S09 的論證證明了數學內容，並提供證明項的構造計畫（S07），但它不是 Lean 項，也沒有經過 kernel。把它寫成「已由 Lean 證明」是錯誤的升級。",
        "en": "The argument in S09 proves the mathematical content and gives a construction plan for the proof term (S07), but it is not a Lean term and has not passed the kernel. Reporting it as 'proved by Lean' would be a false promotion."
      }
    ],
    "md_open_items": [
      {
        "zh-Hant": "使用者恢復 Lean 工作後，應釘選 toolchain 版本與 import closure，並為 s、s′、s″ 記錄解析與 elaboration receipt；若要證明 s，需建立證明項並取得 kernel receipt（MKO formal next）。",
        "en": "When the owner resumes Lean work, pin the toolchain version and import closure and record parse and elaboration receipts for s, s′ and s″; proving s would require constructing a proof term and obtaining a kernel receipt (MKO formal next)."
      },
      {
        "zh-Hant": "S04 顯示的核心項省略了隱式與 instance 參數，確切形式（含 instance 名稱）只能由實際 elaboration 確定。所引用的記號、型別規則與截斷減法已對照 Lean 官方文件和列出的核心來源；未執行 Lean，也未取得 elaboration 或 kernel receipt。",
        "en": "The core term shown in S04 omits implicit and instance arguments; its exact form, including instance names, requires actual elaboration. The cited notation, typing rules and truncated subtraction have been checked against official Lean documentation and the listed core sources. Lean was not run and no elaboration or kernel receipt was obtained."
      }
    ]
  },
  "revision": {
    "id": "production-20261019-adopted-96",
    "source_commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f",
    "adopted_source_sha256": "5cb0d5f28f6aea7530d0c886c4ff344564b3ecefcd4d14d3748e25c6afef4cd2",
    "original_source_sha256": "5cb0d5f28f6aea7530d0c886c4ff344564b3ecefcd4d14d3748e25c6afef4cd2",
    "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."
  }
}
