{
  "schema_version": "ocme-derivation-reader-v1",
  "guide_id": "derivation-mko-factorial-01",
  "mko_id": "mko-factorial",
  "title": {
    "zh-Hant": "階乘：遞迴定義的唯一性、乘積形式與 5! 的計算",
    "en": "Factorial: uniqueness of the recursive definition, the product form and computing 5!"
  },
  "contract": {
    "schema_version": "ocme-derivation-guide-v0.1",
    "guide_id": "derivation-mko-factorial-01",
    "source": {
      "mko_id": "mko-factorial",
      "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f",
      "sha256": "fc2d013658e47191e660f97c927ceeec97905dd4fc520329d3df326b343a4b8f",
      "english_sha256": "8edff46ffb7ebf142e860dc8cf9cd8e40e799c0039337605934357486ae568c3"
    },
    "mode": "theorem_proof",
    "audience_prerequisites": [
      "nat_induction",
      "function_def",
      "eq_replace",
      "mul_comm",
      "order_basics",
      "numeric_evaluation"
    ],
    "goal": {
      "zh-Hant": "只用 F(0)=1 與 F(n+1)=(n+1)F(n)（n∈ℕ，ℕ 含 0）：(1) 證明滿足這兩條的函數 ℕ→ℕ 只有一個；(2) 證明對所有 n 有 F(n)=∏_{k=1}^{n} k（空乘積為 1），所以 n>0 時 n! 是從 1 到 n 所有整數的乘積；(3) 證明每個 F(n)≥1，特別是 0!=1≠0；(4) 由遞迴逐步算出 5!=120。",
      "en": "Using only F(0)=1 and F(n+1)=(n+1)F(n) (n∈ℕ, with 0∈ℕ): (1) prove that at most one function ℕ→ℕ satisfies these two equations; (2) prove F(n)=∏_{k=1}^{n} k for every n (the empty product being 1), so that for n>0, n! is the product of all integers from 1 to n; (3) prove F(n)≥1 for every n, in particular 0!=1≠0; (4) compute 5!=120 step by step from the recursion."
    },
    "givens": [
      {
        "id": "G1",
        "statement": {
          "zh-Hant": "ℕ 包含 0；n 是自然數（MKO 假設 a1）。",
          "en": "ℕ includes 0, and n is a natural number (MKO assumption a1)."
        }
      },
      {
        "id": "G2",
        "statement": {
          "zh-Hant": "F:ℕ→ℕ 滿足 F(0)=1，且對每個 n∈ℕ 有 F(n+1)=(n+1)F(n)；記 n!=F(n)。這樣的 F 存在，取自 MKO 的陳述。",
          "en": "F:ℕ→ℕ satisfies F(0)=1 and F(n+1)=(n+1)F(n) for every n∈ℕ; write n!=F(n). That such an F exists is taken from the MKO statement."
        }
      }
    ],
    "steps": [
      {
        "id": "S01",
        "uses": [
          "G1",
          "G2",
          "mko_factorial_def"
        ],
        "before_tex": "n!",
        "after_tex": "F(0)=1,\\ \\ F(n+1)=(n+1)F(n)\\ \\ (n\\in\\mathbb{N})",
        "relation": "definition",
        "rule": "mko_factorial_def",
        "conditions": [
          "0\\in\\mathbb{N}"
        ],
        "explanation": {
          "zh-Hant": "依 MKO，n! 就是 F(n)，而 F 只由兩條等式決定：起點 F(0)=1，以及「下一個值 = 新的因數 n+1 乘上前一個值」。本稿之後只使用這兩條等式，不使用任何事先記住的公式。",
          "en": "By the MKO, n! means F(n), and F is fixed by two equations only: the start F(0)=1, and 'next value = the new factor n+1 times the previous value'. From here on the guide uses only these two equations and no formula remembered in advance."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "G2",
            "mko_factorial_def"
          ],
          "explanation": {
            "zh-Hant": "此步只寫出定義，不推出新事實。F 的存在是 MKO 提供的前提；唯一性在 S02 到 S05 證明。",
            "en": "This step only states the definition and derives no new fact. Existence of F is a premise supplied by the MKO; uniqueness is proved in S02 to S05."
          }
        },
        "leaf_basis": "mko_factorial_def + def_unfold"
      },
      {
        "id": "S02",
        "uses": [
          "S01"
        ],
        "before_tex": "G:\\mathbb{N}\\to\\mathbb{N},\\ G(0)=1,\\ G(n+1)=(n+1)G(n)",
        "after_tex": "Q(n):\\ G(n)=F(n)",
        "relation": "definition",
        "rule": "def_intro",
        "conditions": [],
        "explanation": {
          "zh-Hant": "為了證明唯一性，任取一個函數 G:ℕ→ℕ，只假設它滿足同樣的兩條等式。對每個 n，把「G(n)=F(n)」這個命題取名為 Q(n)，目標是證明所有 n 都有 Q(n)。",
          "en": "To prove uniqueness, take an arbitrary function G:ℕ→ℕ assumed only to satisfy the same two equations. For each n, name the statement 'G(n)=F(n)' as Q(n); the aim is Q(n) for every n."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S01",
            "def_intro"
          ],
          "explanation": {
            "zh-Hant": "對 G 不加任何其他假設，這是 S05 能對所有這樣的 G 下結論（全稱推廣）的前提。",
            "en": "No other assumption is placed on G; that is what allows S05 to conclude for every such G (generalization)."
          }
        },
        "leaf_basis": "def_intro"
      },
      {
        "id": "S03",
        "uses": [
          "S01",
          "S02"
        ],
        "before_tex": "G(0),\\ F(0)",
        "after_tex": "G(0)=1=F(0)",
        "relation": "induction_base",
        "rule": "eq_refl_symm_trans",
        "conditions": [],
        "explanation": {
          "zh-Hant": "歸納基礎：G(0)=1（G 的假設），F(0)=1（定義），依等號的對稱與傳遞得 G(0)=F(0)，即 Q(0)。",
          "en": "Base case: G(0)=1 by the assumption on G and F(0)=1 by definition, so symmetry and transitivity of equality give G(0)=F(0), that is Q(0)."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S01",
            "S02",
            "eq_refl_symm_trans"
          ],
          "explanation": {
            "zh-Hant": "需要兩個函數的起始值相同；若 G(0)=0，基礎就不成立（見錯誤控制一）。",
            "en": "It needs the two starting values to agree; if G(0)=0 the base case fails (see error control 1)."
          }
        },
        "leaf_basis": "eq_refl_symm_trans"
      },
      {
        "id": "S04",
        "uses": [
          "S01",
          "S02"
        ],
        "before_tex": "G(n)=F(n)",
        "after_tex": "G(n+1)=F(n+1)",
        "relation": "induction_step",
        "rule": "eq_replace",
        "conditions": [
          "n\\in\\mathbb{N}\\ \\text{arbitrary}"
        ],
        "explanation": {
          "zh-Hant": "設某個 n 有 G(n)=F(n)。則 G(n+1)=(n+1)G(n)（G 的遞迴）=(n+1)F(n)（以歸納假設作等值代換）=F(n+1)（F 的遞迴）。所以 Q(n)⇒Q(n+1)。",
          "en": "Suppose G(n)=F(n) for some n. Then G(n+1)=(n+1)G(n) by the recursion for G, =(n+1)F(n) by replacing equals using the induction hypothesis, =F(n+1) by the recursion for F. So Q(n)⇒Q(n+1)."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S01",
            "S02",
            "eq_replace"
          ],
          "explanation": {
            "zh-Hant": "只用到同一個 n 的歸納假設與兩條遞迴；n 是任意的，沒有加條件。不宣稱反向（由 Q(n+1) 推回 Q(n)）。",
            "en": "Only the induction hypothesis for the same n and the two recursions are used; n is arbitrary with no extra condition. The converse, Q(n+1)⇒Q(n), is not claimed."
          }
        },
        "leaf_basis": "eq_replace + eq_refl_symm_trans + forall_elim"
      },
      {
        "id": "S05",
        "uses": [
          "S03",
          "S04",
          "nat_induction",
          "function_def"
        ],
        "before_tex": "Q(0),\\ \\ Q(n)\\Rightarrow Q(n+1)",
        "after_tex": "G=F\\ \\text{for every such}\\ G",
        "relation": "implies",
        "rule": "nat_induction",
        "conditions": [
          "n_0=0"
        ],
        "explanation": {
          "zh-Hant": "依歸納原理（n₀=0），所有 n∈ℕ 都有 G(n)=F(n)。G 與 F 定義域都是 ℕ、對應域都是 ℕ，且每點的值相同，依 function_def 得 G=F。因 G 是任意取的，依全稱推廣：滿足這兩條等式的函數至多一個。這就是 MKO 中「唯一」的內容。",
          "en": "By induction from n₀=0, G(n)=F(n) for every n∈ℕ. G and F both have domain ℕ and codomain ℕ and agree at every point, so G=F by function_def. Since G was arbitrary, generalization shows that at most one function satisfies the two equations. This is the content of 'uniquely' in the MKO."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S03",
            "S04",
            "nat_induction",
            "function_def",
            "forall_intro"
          ],
          "explanation": {
            "zh-Hant": "需要基礎 S03 與歸納步 S04 兩者；只檢查前幾個 n 不能代替歸納步。此步只證唯一性，存在性來自 MKO。",
            "en": "Both the base case S03 and the step S04 are needed; checking the first few n cannot replace the induction step. This proves uniqueness only; existence comes from the MKO."
          }
        },
        "leaf_basis": "nat_induction + function_def + forall_intro"
      },
      {
        "id": "S06",
        "uses": [
          "prod_def",
          "nat_closure"
        ],
        "before_tex": "P(n)=\\prod_{k=1}^{n} k",
        "after_tex": "P:\\mathbb{N}\\to\\mathbb{N}",
        "relation": "definition",
        "rule": "prod_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "取 a_k=k，令 P(n)=∏_{k=1}^{n} k。P(n) 是自然數：P(0)=1∈ℕ，且若 P(n)∈ℕ，則 P(n+1)=P(n)·(n+1)∈ℕ（nat_closure），依歸納原理對所有 n 成立。所以 P 是 ℕ→ℕ 的函數。",
          "en": "With a_k=k, let P(n)=∏_{k=1}^{n} k. Each P(n) is a natural number: P(0)=1∈ℕ, and if P(n)∈ℕ then P(n+1)=P(n)·(n+1)∈ℕ by nat_closure, so by induction this holds for every n. Hence P is a function ℕ→ℕ."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "prod_def",
            "nat_closure",
            "nat_induction"
          ],
          "explanation": {
            "zh-Hant": "要套用 S05，P 必須是 ℕ→ℕ 的函數；這一步確認了對應域。",
            "en": "To apply S05, P must be a function ℕ→ℕ; this step confirms its codomain."
          }
        },
        "leaf_basis": "prod_def + nat_closure + nat_induction"
      },
      {
        "id": "S07",
        "uses": [
          "S06"
        ],
        "before_tex": "P(0)=\\prod_{k=1}^{0} k",
        "after_tex": "P(0)=1",
        "relation": "equivalent",
        "rule": "prod_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "沒有任何因數的乘積是 1（空乘積），這是 prod_def 的第一條；所以 P 的起始值與 F(0)=1 相同。",
          "en": "A product with no factors is 1 (the empty product), the first clause of prod_def; so P starts with the same value as F(0)=1."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "prod_def"
          ],
          "explanation": {
            "zh-Hant": "兩邊依定義是同一個數，等式雙向成立。",
            "en": "Both sides are the same number by definition, so the equation holds both ways."
          }
        },
        "leaf_basis": "prod_def + def_unfold"
      },
      {
        "id": "S08",
        "uses": [
          "S06"
        ],
        "before_tex": "P(n+1)=P(n)\\cdot(n+1)",
        "after_tex": "P(n+1)=(n+1)P(n)",
        "relation": "equivalent",
        "rule": "mul_comm",
        "conditions": [],
        "explanation": {
          "zh-Hant": "prod_def 的第二條給出 P(n+1)=P(n)·(n+1)；依乘法交換律改寫成 (n+1)P(n)，與 F 的遞迴形式完全相同。",
          "en": "The second clause of prod_def gives P(n+1)=P(n)·(n+1); commutativity of multiplication rewrites this as (n+1)P(n), exactly the form of the recursion for F."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "mul_comm"
          ],
          "explanation": {
            "zh-Hant": "交換律是恆等式，兩種寫法表示同一個數，雙向成立。",
            "en": "Commutativity is an identity; both forms name the same number, so the step is two-way."
          }
        },
        "leaf_basis": "prod_def + mul_comm"
      },
      {
        "id": "S09",
        "uses": [
          "S05",
          "S06",
          "S07",
          "S08"
        ],
        "before_tex": "P(0)=1,\\ \\ P(n+1)=(n+1)P(n)",
        "after_tex": "F(n)=\\prod_{k=1}^{n} k\\ \\text{for every}\\ n\\in\\mathbb{N}",
        "relation": "theorem_application",
        "rule": "forall_elim",
        "conditions": [
          "P:\\mathbb{N}\\to\\mathbb{N}"
        ],
        "explanation": {
          "zh-Hant": "P 是 ℕ→ℕ 的函數（S06），且滿足 F 的兩條等式（S07、S08）。S05 對每個這樣的函數成立，取 G=P 得 P=F，即 n!=∏_{k=1}^{n} k。n>0 時，這是從 1 到 n 所有整數的乘積，例如 5!=1·2·3·4·5。",
          "en": "P is a function ℕ→ℕ (S06) satisfying both equations of F (S07, S08). S05 holds for every such function, so taking G=P gives P=F, that is n!=∏_{k=1}^{n} k. For n>0 this is the product of all integers from 1 to n, for example 5!=1·2·3·4·5."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S05",
            "S06",
            "S07",
            "S08",
            "forall_elim"
          ],
          "explanation": {
            "zh-Hant": "套用唯一性需要 P 滿足同樣的起始值與同樣的遞迴，兩者分別由 S07、S08 提供。不是靠核對幾個 n 得到的。",
            "en": "Applying uniqueness needs P to have the same starting value and the same recursion, supplied by S07 and S08. It is not obtained by checking a few values of n."
          }
        },
        "leaf_basis": "forall_elim + function_def + def_unfold"
      },
      {
        "id": "S10",
        "uses": [
          "S01",
          "L_pos"
        ],
        "before_tex": "F(n)",
        "after_tex": "F(n)\\geq 1\\ \\text{for every}\\ n\\in\\mathbb{N};\\ \\text{in particular}\\ 0!=1\\neq 0",
        "relation": "theorem_application",
        "rule": "L_pos",
        "conditions": [],
        "explanation": {
          "zh-Hant": "依引理 L_pos，每個階乘至少是 1，所以沒有任何 n! 等於 0；特別是 0!=1。引理在子步 S10.1、S10.2 以歸納法證明。",
          "en": "By Lemma L_pos every factorial is at least 1, so no n! equals 0; in particular 0!=1. The lemma is proved by induction in sub-steps S10.1 and S10.2."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "L_pos"
          ],
          "explanation": {
            "zh-Hant": "結論只宣稱 F(n)≥1，不宣稱更強的下界。",
            "en": "The conclusion claims only F(n)≥1, not any stronger lower bound."
          }
        },
        "leaf_basis": "nat_induction + order_basics"
      },
      {
        "id": "S10.1",
        "uses": [
          "S01"
        ],
        "before_tex": "F(0)=1",
        "after_tex": "F(0)\\geq 1",
        "relation": "induction_base",
        "rule": "order_basics",
        "conditions": [],
        "explanation": {
          "zh-Hant": "F(0)=1，而 1≥1（相等情形），所以基礎成立。",
          "en": "F(0)=1 and 1≥1 (the equality case), so the base case holds."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S01",
            "order_basics"
          ],
          "explanation": {
            "zh-Hant": "只用到定義的起始值。",
            "en": "Only the defined starting value is used."
          }
        },
        "leaf_basis": "order_basics + def_unfold"
      },
      {
        "id": "S10.2",
        "uses": [
          "S01",
          "nat_closure",
          "order_basics"
        ],
        "before_tex": "F(n)\\geq 1",
        "after_tex": "F(n+1)=(n+1)F(n)\\geq 1",
        "relation": "induction_step",
        "rule": "order_basics",
        "conditions": [
          "n+1>0"
        ],
        "explanation": {
          "zh-Hant": "設 F(n)≥1。因 n+1>0，兩邊同乘 n+1 保持方向：(n+1)F(n)≥(n+1)·1=n+1；又 n+1≥1，依傳遞得 F(n+1)=(n+1)F(n)≥1。S10.1 與 S10.2 依歸納原理證得引理 L_pos。",
          "en": "Suppose F(n)≥1. Since n+1>0, multiplying both sides by n+1 keeps the direction: (n+1)F(n)≥(n+1)·1=n+1; and n+1≥1, so by transitivity F(n+1)=(n+1)F(n)≥1. By induction, S10.1 and S10.2 prove Lemma L_pos."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "nat_closure",
            "order_basics",
            "nat_induction"
          ],
          "explanation": {
            "zh-Hant": "乘以 n+1 保持不等號方向需要 n+1>0；若乘的是可能為 0 的數（例如錯誤遞迴 n·F(n) 在 n=0），結論就會失敗。",
            "en": "Multiplying by n+1 keeps the inequality only because n+1>0; multiplying by a factor that can be 0 (such as the wrong recursion n·F(n) at n=0) breaks the conclusion."
          }
        },
        "leaf_basis": "order_basics + nat_closure + mul_one"
      },
      {
        "id": "S11",
        "uses": [
          "S01"
        ],
        "before_tex": "F(0)=1",
        "after_tex": "F(1)=1,\\ F(2)=2,\\ F(3)=6",
        "relation": "implies",
        "rule": "forall_elim",
        "conditions": [],
        "explanation": {
          "zh-Hant": "依遞迴逐步代入：n=0 得 F(1)=1·F(0)=1；n=1 得 F(2)=2·F(1)=2；n=2 得 F(3)=3·F(2)=6。每一步乘上的是新因數 n+1，不是 n。",
          "en": "Substitute into the recursion one step at a time: n=0 gives F(1)=1·F(0)=1; n=1 gives F(2)=2·F(1)=2; n=2 gives F(3)=3·F(2)=6. Each step multiplies by the new factor n+1, not by n."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S01",
            "forall_elim",
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "每個值都依賴前一個值，必須按順序計算；乘法可獨立重算（N1 到 N3）。",
            "en": "Each value depends on the previous one and must be computed in order; the products can be recomputed independently (N1 to N3)."
          }
        },
        "leaf_basis": "forall_elim + eq_replace + numeric_evaluation"
      },
      {
        "id": "S12",
        "uses": [
          "S01",
          "S11"
        ],
        "before_tex": "F(3)=6",
        "after_tex": "F(4)=24,\\ F(5)=120",
        "relation": "implies",
        "rule": "forall_elim",
        "conditions": [],
        "explanation": {
          "zh-Hant": "繼續代入：n=3 得 F(4)=4·F(3)=4·6=24；n=4 得 F(5)=5·F(4)=5·24=120。所以 5!=120。",
          "en": "Continue: n=3 gives F(4)=4·F(3)=4·6=24, and n=4 gives F(5)=5·F(4)=5·24=120. So 5!=120."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S11",
            "forall_elim",
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "精確整數乘法（N4、N5），沒有使用浮點近似。",
            "en": "Exact integer multiplication (N4, N5), with no floating-point approximation."
          }
        },
        "leaf_basis": "forall_elim + eq_replace + numeric_evaluation"
      },
      {
        "id": "S13",
        "uses": [
          "S09",
          "S12"
        ],
        "before_tex": "\\prod_{k=1}^{5} k",
        "after_tex": "1\\cdot 2\\cdot 3\\cdot 4\\cdot 5=120=F(5)",
        "relation": "implies",
        "rule": "prod_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "交叉核對：依 prod_def 展開 ∏_{k=1}^{5} k=1·2·3·4·5=120，與 S12 由遞迴得到的 F(5)=120 一致，符合 S09。",
          "en": "Cross-check: unfolding prod_def gives ∏_{k=1}^{5} k=1·2·3·4·5=120, which agrees with F(5)=120 from the recursion in S12, as S09 predicts."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S09",
            "S12",
            "prod_def"
          ],
          "explanation": {
            "zh-Hant": "這只是 n=5 的一致性核對；S09 的一般結論來自唯一性，不來自這個例子。",
            "en": "This is a consistency check at n=5 only; the general statement of S09 comes from uniqueness, not from this example."
          }
        },
        "leaf_basis": "prod_def + numeric_evaluation"
      },
      {
        "id": "S14",
        "uses": [
          "S05",
          "S09",
          "S10",
          "S12"
        ],
        "before_tex": "S05,\\ S09,\\ S10,\\ S12",
        "after_tex": "\\text{goals (1) to (4) established}",
        "relation": "implies",
        "rule": "and_intro_elim",
        "conditions": [],
        "explanation": {
          "zh-Hant": "四個目標分別由 S05（唯一性）、S09（乘積形式）、S10（F(n)≥1，0!=1）與 S12（5!=120）證成。",
          "en": "The four goals are established by S05 (uniqueness), S09 (product form), S10 (F(n)≥1 and 0!=1) and S12 (5!=120)."
        },
        "reverse_audit": {
          "kind": "sufficient_goal_reduction",
          "required_ids": [
            "S05",
            "S09",
            "S10",
            "S12",
            "and_intro_elim"
          ],
          "explanation": {
            "zh-Hant": "目標 G：(1) 到 (4) 同時成立。足夠條件 H：S05、S09、S10、S12 各自成立；H⇒G 由合取引入。H 由定義與歸納正向證成，沒有把 G 當作前提。",
            "en": "Goal G: (1) to (4) together. Sufficient condition H: S05, S09, S10 and S12 each hold; H⇒G by conjunction introduction. H is proved forwards from the definition and induction; G is never used as a premise."
          }
        },
        "leaf_basis": "and_intro_elim"
      }
    ],
    "result": {
      "zh-Hant": "由 F(0)=1 與 F(n+1)=(n+1)F(n) 決定的函數只有一個；它等於乘積 ∏_{k=1}^{n} k（n=0 時為空乘積 1），每個值都至少為 1，所以 0!=1 而不是 0；逐步代入得 1!=1、2!=2、3!=6、4!=24、5!=120。",
      "en": "Exactly one function is determined by F(0)=1 and F(n+1)=(n+1)F(n) (given its existence); it equals the product ∏_{k=1}^{n} k (the empty product 1 when n=0), every value is at least 1, so 0!=1 and not 0; step-by-step substitution gives 1!=1, 2!=2, 3!=6, 4!=24 and 5!=120."
    },
    "negative_controls": [
      {
        "claim": {
          "zh-Hant": "0!=0",
          "en": "0!=0"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "定義給出 F(0)=1；且 S10 證明每個 F(n)≥1。",
          "en": "The definition gives F(0)=1, and S10 proves F(n)≥1 for every n."
        }
      },
      {
        "claim": {
          "zh-Hant": "把遞迴寫成 H(n+1)=n·H(n)、H(0)=1，定義的是同一個階乘",
          "en": "Writing the recursion as H(n+1)=n·H(n) with H(0)=1 defines the same factorial"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "H(1)=0·1=0，但 F(1)=1。",
          "en": "H(1)=0·1=0, whereas F(1)=1."
        }
      },
      {
        "claim": {
          "zh-Hant": "對 n=0 到 5 核對 F(n)=∏_{k=1}^{n} k 成立，就證明了所有 n 都成立",
          "en": "Checking F(n)=∏_{k=1}^{n} k for n=0 to 5 proves it for every n"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "有限檢查只涵蓋那些 n；一般結論來自 S05 的唯一性（歸納法）。",
          "en": "A finite check covers only those n; the general statement comes from the uniqueness of S05 (induction)."
        }
      },
      {
        "claim": {
          "zh-Hant": "以 binary64 浮點計算得到的 23! 就是精確值",
          "en": "The value of 23! computed in binary64 floating point is exact"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "23! 的奇數部分大於 2⁵³，binary64 無法精確表示。",
          "en": "The odd part of 23! exceeds 2⁵³, so binary64 cannot represent it exactly."
        }
      }
    ],
    "status": "candidate",
    "gaps": [],
    "verification": {
      "structure": "checked_local_script",
      "mathematics": "candidate_argument",
      "formalization": "not_formalized"
    },
    "rule_glossary": [
      {
        "id": "nat_induction",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "數學歸納原理：對從 n₀ 起的命題族 P(n)，若 P(n₀) 成立，且對每個 n≥n₀ 都有 P(n)⇒P(n+1)，則所有 n≥n₀ 都有 P(n)。",
          "en": "Principle of induction: for a family P(n) starting at n₀, if P(n₀) holds and P(n)⇒P(n+1) for every n≥n₀, then P(n) holds for every n≥n₀."
        }
      },
      {
        "id": "function_def",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "函數：f:A→B 對每個 a∈A 指定恰好一個 f(a)∈B。兩函數相等 ⇔ 定義域、對應域相同且對每個 a 都有相同值。",
          "en": "Function: f:A→B assigns to each a∈A exactly one f(a)∈B. Two functions are equal ⇔ they have the same domain and codomain and agree at every a."
        }
      },
      {
        "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": "mul_comm",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "乘法交換律：uv=vu（在交換的數系中，例如 ℤ、ℚ、ℝ、ℂ）。",
          "en": "Commutativity of multiplication: uv=vu (in commutative number systems such as ℤ, ℚ, ℝ, ℂ)."
        }
      },
      {
        "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": "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": "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": "mul_one",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "乘法單位元：1·u=u。",
          "en": "Multiplicative identity: 1·u=u."
        }
      },
      {
        "id": "and_intro_elim",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "合取：由 P 與 Q 得 P∧Q；由 P∧Q 可分別得 P 與 Q。",
          "en": "Conjunction: from P and Q infer P∧Q; from P∧Q infer P and infer Q."
        }
      },
      {
        "id": "mko_factorial_def",
        "kind": "cited",
        "source": {
          "mko_id": "mko-factorial",
          "sha256": "fc2d013658e47191e660f97c927ceeec97905dd4fc520329d3df326b343a4b8f",
          "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f"
        },
        "statement": {
          "zh-Hant": "函數 F:ℕ→ℕ 由 F(0)=1 與 F(n+1)=(n+1)F(n) 唯一遞迴決定；慣用記號為 n!。",
          "en": "The function F:ℕ→ℕ is uniquely determined recursively by F(0)=1 and F(n+1)=(n+1)F(n). Its customary notation is n!."
        }
      },
      {
        "id": "prod_def",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "有限乘積：∏_{k=1}^{0} a_k=1（空乘積），且 ∏_{k=1}^{n+1} a_k=(∏_{k=1}^{n} a_k)·a_{n+1}。",
          "en": "Finite products: ∏_{k=1}^{0} a_k=1 (the empty product) and ∏_{k=1}^{n+1} a_k=(∏_{k=1}^{n} a_k)·a_{n+1}."
        }
      },
      {
        "id": "nat_closure",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "自然數的和與積仍是自然數；對每個 n∈ℕ 有 n+1≥1>0。",
          "en": "Sums and products of natural numbers are natural numbers; for every n∈ℕ, n+1≥1>0."
        }
      },
      {
        "id": "L_pos",
        "kind": "lemma",
        "proved_in": [
          "S10.1",
          "S10.2"
        ],
        "statement": {
          "zh-Hant": "對每個 n∈ℕ，F(n)≥1。",
          "en": "For every n∈ℕ, F(n)≥1."
        }
      }
    ],
    "revision_log": [],
    "numeric_checks": [
      {
        "id": "N1",
        "step": "S11",
        "lhs": "1*1",
        "rhs": "1"
      },
      {
        "id": "N2",
        "step": "S11",
        "lhs": "2*1",
        "rhs": "2"
      },
      {
        "id": "N3",
        "step": "S11",
        "lhs": "3*2",
        "rhs": "6"
      },
      {
        "id": "N4",
        "step": "S12",
        "lhs": "4*6",
        "rhs": "24"
      },
      {
        "id": "N5",
        "step": "S12",
        "lhs": "5*24",
        "rhs": "120"
      },
      {
        "id": "N6",
        "step": "S13",
        "lhs": "1*2*3*4*5",
        "rhs": "120"
      },
      {
        "id": "N7",
        "step": "S13",
        "lhs": "factorial(5)",
        "rhs": "120"
      },
      {
        "id": "N8",
        "step": "S01",
        "vars": [
          "n"
        ],
        "range": [
          0,
          30
        ],
        "lhs": "factorial(n+1)",
        "rhs": "(n+1)*factorial(n)"
      },
      {
        "id": "N9",
        "step": "S10",
        "vars": [
          "n"
        ],
        "range": [
          0,
          30
        ],
        "lhs": "factorial(n)",
        "relation": ">=",
        "rhs": "1"
      },
      {
        "id": "N10",
        "lhs": "factorial(23)",
        "rhs": "25852016738884976640000"
      },
      {
        "id": "N11",
        "lhs": "factorial(23)",
        "rhs": "2**19*49308808782358125"
      },
      {
        "id": "N12",
        "lhs": "49308808782358125 % 2",
        "rhs": "1"
      },
      {
        "id": "N13",
        "lhs": "49308808782358125",
        "relation": ">",
        "rhs": "2**53"
      },
      {
        "id": "N14",
        "lhs": "0*1",
        "rhs": "0"
      },
      {
        "id": "N15",
        "lhs": "5*5",
        "relation": "!=",
        "rhs": "120"
      }
    ]
  },
  "presentation": {
    "md_scope": {
      "zh-Hant": "在 MKO 的範圍內：自然數含 0（假設 a1），以遞迴定義的函數 F。F 的存在取自 MKO 的陳述（遞迴定理不在本稿證明）；本稿證明唯一性、乘積形式與正性。不證明「n! 計數 n 元集合的排列」（MKO 指出那是另需證明的定理）；不改動 canonical MKO 或英文 edition。",
      "en": "Inside the MKO's scope: natural numbers including 0 (assumption a1) and the recursively defined function F. Existence of F is taken from the MKO statement (the recursion theorem is not proved here); this guide proves uniqueness, the product form and positivity. It does not prove that n! counts the permutations of an n-element set (the MKO says that is a separate theorem), and it does not change the canonical MKO or its English edition."
    },
    "md_symbols": [
      [
        "F,\\ n!",
        "階乘函數及其記號 n!=F(n)",
        "the factorial function and its notation n!=F(n)"
      ],
      [
        "G",
        "任一滿足同樣兩條等式的函數",
        "any function satisfying the same two equations"
      ],
      [
        "\\mathbb{N}",
        "含 0 的自然數",
        "the natural numbers, including 0"
      ],
      [
        "\\prod_{k=1}^{n} k",
        "1 到 n 的整數乘積，n=0 時為 1",
        "the product of the integers from 1 to n, equal to 1 when n=0"
      ],
      [
        "P(n)",
        "乘積 ∏_{k=1}^{n} k 作為 n 的函數",
        "the product ∏_{k=1}^{n} k as a function of n"
      ]
    ],
    "md_error_controls": [
      {
        "title": "0! 是 1，不是 0 / 0! is 1, not 0",
        "zh": "MKO 指出常見誤解是把 0! 當成 0。F(0)=1 是定義的一部分。若把起點改成 H(0)=0 而保留 H(n+1)=(n+1)H(n)，則依歸納每個 H(n) 都是 0（H(n+1)=(n+1)·0=0），整個函數塌成 0，5! 會變成 0 而不是 120。空乘積為 1 的慣例（S07）也與 F(0)=1 一致。",
        "en": "The MKO notes the common mistake of taking 0! to be 0. F(0)=1 is part of the definition. If the start were changed to H(0)=0 while keeping H(n+1)=(n+1)H(n), induction would give H(n)=0 for every n (H(n+1)=(n+1)·0=0): the whole function collapses to 0 and 5! would be 0 instead of 120. The convention that the empty product is 1 (S07) agrees with F(0)=1."
      },
      {
        "title": "n! 不是「n 倍」 / n! is not 'n times'",
        "zh": "MKO 指出另一個誤解是把 n! 當成 n 倍。遞迴每一步都乘上新的因數 n+1，所以 n! 累積了從 1 到 n 的所有因數：3!=6 不是 3，5!=120 不是 5，也不是 5·5=25。另一個常見的差一錯誤是寫成 H(n+1)=n·H(n)：此時 H(1)=0·H(0)=0，之後全為 0。",
        "en": "The MKO also notes the mistake of reading n! as 'n times'. Each step of the recursion multiplies by the new factor n+1, so n! accumulates every factor from 1 to n: 3!=6, not 3, and 5!=120, not 5 and not 5·5=25. A related off-by-one error writes H(n+1)=n·H(n); then H(1)=0·H(0)=0 and every later value is 0."
      },
      {
        "title": "用精確整數，不用浮點近似 / Use exact integers, not floating-point approximations",
        "zh": "MKO 提醒不可用超出安全範圍的浮點值冒充精確結果。23!=25852016738884976640000=2¹⁹·49308808782358125，其奇數部分大於 2⁵³=9007199254740992。IEEE 754 binary64 的有效數具有 53 位元精度，一個正整數（在指數範圍內）可精確表示當且僅當它的奇數部分小於 2⁵³，所以 binary64 無法精確表示 23!。本稿的計算全部用精確整數乘法。",
        "en": "The MKO warns against passing off floating-point values outside the safe range as exact results. 23!=25852016738884976640000=2¹⁹·49308808782358125, whose odd part exceeds 2⁵³=9007199254740992. IEEE 754 binary64 has a 53-bit significand, and a positive integer within the exponent range is exactly representable if and only if its odd part is below 2⁵³, so binary64 cannot represent 23! exactly. Every computation in this guide uses exact integer multiplication."
      }
    ],
    "md_open_items": [
      {
        "zh-Hant": "F 的存在（遞迴定理）取自 MKO 的陳述，本稿未證明；本稿證明的是唯一性與由此推出的性質。",
        "en": "Existence of F (the recursion theorem) is taken from the MKO statement and is not proved here; this guide proves uniqueness and the properties that follow from it."
      },
      {
        "zh-Hant": "N8、N9 是以 Python 標準函式 factorial 對 n=0 到 30 的有限核對，只支持這些 n，論證不依賴它們。",
        "en": "N8 and N9 are finite checks with the standard factorial function for n=0 to 30; they support only those n, and the argument does not depend on them."
      },
      {
        "zh-Hant": "錯誤控制三關於 binary64 的敘述依據 IEEE 754 binary64 格式有 53 位元有效數精度這一事實，本稿未核對標準原文。",
        "en": "The statement about binary64 in error control 3 rests on the fact that the IEEE 754 binary64 format has a 53-bit significand; the text of the standard was not checked here."
      }
    ]
  },
  "revision": {
    "id": "production-20261019-adopted-96",
    "source_commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f",
    "adopted_source_sha256": "20f46251e6543f0cb88df555a6522f263111c7e35fd4a025a2b6b776eb0bc6c5",
    "original_source_sha256": "20f46251e6543f0cb88df555a6522f263111c7e35fd4a025a2b6b776eb0bc6c5",
    "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."
  }
}
