{
  "schema_version": "ocme-derivation-reader-v1",
  "guide_id": "derivation-mko-composition-01",
  "mko_id": "mko-composition",
  "title": {
    "zh-Hant": "函數合成：受限合成的允許輸入、求值順序與不交換",
    "en": "Function composition: the permitted inputs of a restricted composition, evaluation order and non-commutativity"
  },
  "contract": {
    "schema_version": "ocme-derivation-guide-v0.1",
    "guide_id": "derivation-mko-composition-01",
    "source": {
      "mko_id": "mko-composition",
      "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f",
      "sha256": "a915b980c52ed5cfa4fd9ef59e2a23ef237a0eebbe262cd6f1a67b15f052bfa9",
      "english_sha256": "702841fe3d6cacc8f4b48338fbd4fc96731540292253b3030c43dce8e1cf1979"
    },
    "mode": "worked_example",
    "audience_prerequisites": [
      "composition_def",
      "function_def",
      "set_builder",
      "set_extensionality",
      "sqrt_def",
      "order_basics",
      "numeric_evaluation"
    ],
    "goal": {
      "zh-Hant": "設 f:ℝ→ℝ，f(x)=x−3；g:[0,∞)→ℝ，g(u)=√u。(1) 求 g∘f 的允許輸入集合 D={x∈dom(f) ∣ f(x)∈dom(g)}，並證明 D=[3,∞)；(2) 依「先 f 後 g」計算 (g∘f)(7) 與 (g∘f)(4)，並說明 (g∘f)(1) 沒有定義；(3) 說明 f∘g 是 [0,∞) 上的總函數合成，並由 (f∘g)(4)=−1≠1=(g∘f)(4) 得到 g∘f≠f∘g；(4) 說明合成不是函數值的乘法。",
      "en": "Let f:ℝ→ℝ, f(x)=x−3, and g:[0,∞)→ℝ, g(u)=√u. (1) Find the permitted inputs D={x∈dom(f) ∣ f(x)∈dom(g)} of g∘f and prove D=[3,∞); (2) evaluate (g∘f)(7) and (g∘f)(4) by 'f first, then g', and explain why (g∘f)(1) is undefined; (3) show that f∘g is a total composition on [0,∞), and conclude g∘f≠f∘g from (f∘g)(4)=−1≠1=(g∘f)(4); (4) show that composition is not multiplication of function values."
    },
    "givens": [
      {
        "id": "G1",
        "statement": {
          "zh-Hant": "f:ℝ→ℝ，f(x)=x−3；dom(f)=ℝ。",
          "en": "f:ℝ→ℝ with f(x)=x−3; dom(f)=ℝ."
        }
      },
      {
        "id": "G2",
        "statement": {
          "zh-Hant": "g:[0,∞)→ℝ，g(u)=√u；dom(g)=[0,∞)={u∈ℝ ∣ u≥0}。",
          "en": "g:[0,∞)→ℝ with g(u)=√u; dom(g)=[0,∞)={u∈ℝ ∣ u≥0}."
        }
      },
      {
        "id": "G3",
        "statement": {
          "zh-Hant": "對定義域不同的表達式，合成的允許輸入為 D={x∈dom(f) ∣ f(x)∈dom(g)}，且對 x∈D 有 (g∘f)(x)=g(f(x))（MKO）。",
          "en": "For expressions with different domains, the permitted inputs of the composition are D={x∈dom(f) ∣ f(x)∈dom(g)}, and (g∘f)(x)=g(f(x)) for x∈D (MKO)."
        }
      }
    ],
    "steps": [
      {
        "id": "S01",
        "uses": [
          "G3",
          "mko_comp_def"
        ],
        "before_tex": "g\\circ f",
        "after_tex": "(g\\circ f)(x)=g(f(x)),\\ \\ x\\in D=\\{x\\in\\mathrm{dom}(f)\\mid f(x)\\in\\mathrm{dom}(g)\\}",
        "relation": "definition",
        "rule": "mko_comp_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "依 MKO 寫出合成：先算內層 f(x)，再把結果交給 g。記號 g∘f 中 g 寫在左邊，但求值時 f 先做；書寫順序與求值順序相反。因為 f 與 g 的定義域不同，只有使中間值 f(x) 落在 g 定義域內的 x 才是允許輸入。",
          "en": "State the composition from the MKO: first compute the inner value f(x), then hand it to g. In the symbol g∘f the g is written on the left, but f is evaluated first; the written order is the reverse of the order of evaluation. Because f and g have different domains, only the x whose intermediate value f(x) lies in the domain of g are permitted inputs."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G3",
            "mko_comp_def"
          ],
          "explanation": {
            "zh-Hant": "此步只寫出定義，不推出新事實。",
            "en": "This step only states the definition and derives no new fact."
          }
        },
        "leaf_basis": "mko_comp_def + composition_def"
      },
      {
        "id": "S02",
        "uses": [
          "S01",
          "G1",
          "G2",
          "set_builder"
        ],
        "before_tex": "D=\\{x\\in\\mathrm{dom}(f)\\mid f(x)\\in\\mathrm{dom}(g)\\}",
        "after_tex": "D=\\{x\\in\\mathbb{R}\\mid x-3\\geq 0\\}",
        "relation": "equivalent",
        "rule": "set_builder",
        "conditions": [],
        "explanation": {
          "zh-Hant": "代入 dom(f)=ℝ、f(x)=x−3 與 dom(g)={u ∣ u≥0}：條件 f(x)∈dom(g) 就是 x−3≥0。兩種寫法對每個 x 給出同樣的條件，所以集合相同。",
          "en": "Substitute dom(f)=ℝ, f(x)=x−3 and dom(g)={u ∣ u≥0}: the condition f(x)∈dom(g) becomes x−3≥0. Both descriptions impose the same condition on every x, so the sets agree."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "set_builder",
            "G1",
            "G2"
          ],
          "explanation": {
            "zh-Hant": "只是把定義域與規則代入，條件逐點等價，雙向成立。",
            "en": "Only the domains and the rule are substituted; the conditions are equivalent pointwise, so the step is two-way."
          }
        },
        "leaf_basis": "set_builder + def_unfold"
      },
      {
        "id": "S03",
        "uses": [
          "S02",
          "L_shift3"
        ],
        "before_tex": "x-3\\geq 0",
        "after_tex": "x\\geq 3",
        "relation": "equivalent",
        "rule": "L_shift3",
        "conditions": [],
        "explanation": {
          "zh-Hant": "依引理 L_shift3，x−3≥0 ⇔ x≥3。引理在 S03.1 證明。",
          "en": "By Lemma L_shift3, x−3≥0 ⇔ x≥3. The lemma is proved in S03.1."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "L_shift3"
          ],
          "explanation": {
            "zh-Hant": "引理兩個方向都已證明。",
            "en": "Both directions of the lemma are proved."
          }
        },
        "leaf_basis": "L_shift3"
      },
      {
        "id": "S03.1",
        "uses": [
          "order_basics",
          "add_inverse"
        ],
        "before_tex": "x-3\\geq 0",
        "after_tex": "x\\geq 3",
        "relation": "equivalent",
        "rule": "order_basics",
        "conditions": [],
        "explanation": {
          "zh-Hant": "⇒：兩邊同加 3，(x−3)+3=x，0+3=3，得 x≥3。⇐：兩邊同加 −3，得 x−3≥0。兩邊加同一個數保持 ≥ 的方向（嚴格情形依 order_basics，相等情形顯然）。此子步證得引理 L_shift3。",
          "en": "⇒: add 3 to both sides; (x−3)+3=x and 0+3=3, giving x≥3. ⇐: add −3 to both sides, giving x−3≥0. Adding the same number to both sides keeps the direction of ≥ (the strict case by order_basics, the equality case trivially). This sub-step proves Lemma L_shift3."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "order_basics",
            "add_inverse"
          ],
          "explanation": {
            "zh-Hant": "加 3 與加 −3 互為反運算，對任何實數 x 都可做（N10）。",
            "en": "Adding 3 and adding −3 undo each other and are possible for every real x (N10)."
          }
        },
        "leaf_basis": "order_basics + add_inverse + add_assoc + add_zero"
      },
      {
        "id": "S04",
        "uses": [
          "S02",
          "S03",
          "set_extensionality"
        ],
        "before_tex": "D=\\{x\\in\\mathbb{R}\\mid x-3\\geq 0\\}",
        "after_tex": "D=[3,\\infty)",
        "relation": "equivalent",
        "rule": "set_extensionality",
        "conditions": [],
        "explanation": {
          "zh-Hant": "依 S03，集合條件 x−3≥0 可換成等價的 x≥3，所以 D={x∈ℝ ∣ x≥3}=[3,∞)。D 比 dom(f)=ℝ 小：f 能處理所有實數，但 g 只能接受非負的中間值。",
          "en": "By S03 the condition x−3≥0 may be replaced by the equivalent x≥3, so D={x∈ℝ ∣ x≥3}=[3,∞). D is smaller than dom(f)=ℝ: f accepts every real, but g accepts only nonnegative intermediate values."
        },
        "reverse_audit": {
          "kind": "inverse_equivalence",
          "required_ids": [
            "S03",
            "set_extensionality"
          ],
          "explanation": {
            "zh-Hant": "條件逐點等價，依外延原則集合相等。",
            "en": "The conditions are equivalent pointwise, so by extensionality the sets are equal."
          }
        },
        "leaf_basis": "set_extensionality + set_builder"
      },
      {
        "id": "S05",
        "uses": [
          "S01",
          "S04",
          "composition_def"
        ],
        "before_tex": "x\\in D",
        "after_tex": "(g\\circ f)(x)=\\sqrt{x-3},\\ \\ g\\circ f:[3,\\infty)\\to\\mathbb{R}",
        "relation": "implies",
        "rule": "composition_def",
        "conditions": [
          "x\\geq 3"
        ],
        "explanation": {
          "zh-Hant": "對 x∈D，f(x)=x−3∈dom(g)，所以 g(f(x))=√(x−3) 有定義。限制在 D 上，f 是 D→[0,∞) 的總函數，g 是 [0,∞)→ℝ 的總函數，中間型別相容，依 composition_def 得到總函數 g∘f:[3,∞)→ℝ。",
          "en": "For x∈D, f(x)=x−3∈dom(g), so g(f(x))=√(x−3) is defined. Restricted to D, f is a total function D→[0,∞) and g is a total function [0,∞)→ℝ; the intermediate types match, so composition_def gives the total function g∘f:[3,∞)→ℝ."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S04",
            "composition_def"
          ],
          "explanation": {
            "zh-Hant": "公式只在 D 上宣稱；不宣稱在 D 以外有值（假設 a2）。",
            "en": "The formula is claimed only on D; no value is claimed outside D (assumption a2)."
          }
        },
        "leaf_basis": "composition_def + function_def"
      },
      {
        "id": "S06",
        "uses": [
          "G1",
          "S04"
        ],
        "before_tex": "x=7",
        "after_tex": "f(7)=7-3=4\\in\\mathrm{dom}(g),\\ \\ 7\\in D",
        "relation": "implies",
        "rule": "numeric_evaluation",
        "conditions": [],
        "explanation": {
          "zh-Hant": "求 (g∘f)(7) 先做內層：f(7)=7−3=4。4≥0，所以 4∈dom(g)，也就是 7∈D（與 7≥3 一致）。中間值的定義域檢查必須在套用 g 之前完成。",
          "en": "To evaluate (g∘f)(7), do the inner step first: f(7)=7−3=4. Since 4≥0, 4∈dom(g), so 7∈D (consistent with 7≥3). The domain check on the intermediate value must be done before applying g."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "G1",
            "S04",
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "此步只算內層並核對定義域；外層在 S07。",
            "en": "This step computes only the inner value and checks the domain; the outer step is S07."
          }
        },
        "leaf_basis": "numeric_evaluation + set_builder"
      },
      {
        "id": "S07",
        "uses": [
          "S06",
          "G2",
          "L_sqrt_sq"
        ],
        "before_tex": "g(4)",
        "after_tex": "(g\\circ f)(7)=g(4)=\\sqrt{4}=\\sqrt{2^2}=2",
        "relation": "implies",
        "rule": "L_sqrt_sq",
        "conditions": [
          "2\\geq 0"
        ],
        "explanation": {
          "zh-Hant": "外層：g(4)=√4。因 4=2² 且 2≥0，依引理 L_sqrt_sq，√4=2。所以 (g∘f)(7)=2。",
          "en": "Outer step: g(4)=√4. Since 4=2² and 2≥0, Lemma L_sqrt_sq gives √4=2. So (g∘f)(7)=2."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "L_sqrt_sq",
            "S06"
          ],
          "explanation": {
            "zh-Hant": "需要 2≥0；−2 也滿足 (−2)²=4，但它不是主平方根。",
            "en": "It needs 2≥0; −2 also satisfies (−2)²=4 but is not the principal square root."
          }
        },
        "leaf_basis": "L_sqrt_sq + numeric_evaluation"
      },
      {
        "id": "S07.1",
        "uses": [
          "sqrt_def"
        ],
        "before_tex": "b\\geq 0",
        "after_tex": "\\sqrt{b^2}=b",
        "relation": "implies",
        "rule": "sqrt_def",
        "conditions": [
          "b\\geq 0"
        ],
        "explanation": {
          "zh-Hant": "依 sqrt_def，對 a≥0，√a 是唯一滿足 c≥0 且 c²=a 的實數 c。取 a=b²（b²≥0），c=b 滿足 b≥0 且 b²=b²，由唯一性得 √(b²)=b。此子步證得引理 L_sqrt_sq。",
          "en": "By sqrt_def, for a≥0, √a is the unique real c with c≥0 and c²=a. Take a=b² (which is ≥0); c=b satisfies b≥0 and b²=b², so uniqueness gives √(b²)=b. This sub-step proves Lemma L_sqrt_sq."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "sqrt_def",
            "square_nonneg"
          ],
          "explanation": {
            "zh-Hant": "需要 b≥0；若 b<0，例如 b=−2，√((−2)²)=2≠−2。",
            "en": "It needs b≥0; for b<0, for example b=−2, √((−2)²)=2≠−2."
          }
        },
        "leaf_basis": "sqrt_def + square_nonneg"
      },
      {
        "id": "S08",
        "uses": [
          "G1",
          "G2",
          "S04",
          "L_sqrt_sq"
        ],
        "before_tex": "x=4",
        "after_tex": "(g\\circ f)(4)=g(f(4))=g(1)=\\sqrt{1}=1",
        "relation": "implies",
        "rule": "composition_def",
        "conditions": [
          "4\\geq 3"
        ],
        "explanation": {
          "zh-Hant": "4≥3，所以 4∈D。內層 f(4)=4−3=1，因 1≥0，故 1 在 dom(g) 中；外層 g(1)=√1=√(1²)=1（L_sqrt_sq，1≥0）。所以 (g∘f)(4)=1。",
          "en": "4≥3, so 4∈D. Inner step: f(4)=4−3=1, and the intermediate value 1 lies in dom(g) because 1≥0; outer step: g(1)=√1=√(1²)=1 by L_sqrt_sq with 1≥0. So (g∘f)(4)=1."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S04",
            "L_sqrt_sq",
            "composition_def"
          ],
          "explanation": {
            "zh-Hant": "同樣先核對 f(4) 在 g 的定義域內，再套用 g。",
            "en": "Again f(4) is checked to lie in the domain of g before g is applied."
          }
        },
        "leaf_basis": "composition_def + L_sqrt_sq + numeric_evaluation"
      },
      {
        "id": "S09",
        "uses": [
          "G1",
          "G2",
          "S04",
          "sqrt_def"
        ],
        "before_tex": "x=1",
        "after_tex": "f(1)=-2\\notin\\mathrm{dom}(g),\\ \\text{so}\\ 1\\notin D\\ \\text{and}\\ (g\\circ f)(1)\\ \\text{is undefined}",
        "relation": "implies",
        "rule": "set_builder",
        "conditions": [],
        "explanation": {
          "zh-Hant": "1 屬於 dom(f)=ℝ，f(1)=1−3=−2。但 −2<0，不在 dom(g) 中；依 sqrt_def，負數在實數中沒有平方根，g(−2) 沒有定義。所以 1∉D，(g∘f)(1) 沒有定義。只看 1∈dom(f) 而略過中間值的檢查是錯的。",
          "en": "1 belongs to dom(f)=ℝ and f(1)=1−3=−2. But −2<0 is not in dom(g); by sqrt_def a negative number has no real square root, so g(−2) is undefined. Hence 1∉D and (g∘f)(1) is undefined. Looking only at 1∈dom(f) and skipping the check on the intermediate value is a mistake."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S04",
            "set_builder",
            "sqrt_def"
          ],
          "explanation": {
            "zh-Hant": "結論只說 1 不是允許輸入；不給 (g∘f)(1) 任何值。",
            "en": "The conclusion is only that 1 is not a permitted input; no value is assigned to (g∘f)(1)."
          }
        },
        "leaf_basis": "set_builder + sqrt_def + order_basics + numeric_evaluation"
      },
      {
        "id": "S10",
        "uses": [
          "G1",
          "G2",
          "composition_def",
          "set_builder"
        ],
        "before_tex": "f\\circ g",
        "after_tex": "\\{x\\in\\mathrm{dom}(g)\\mid g(x)\\in\\mathrm{dom}(f)\\}=[0,\\infty),\\ \\ (f\\circ g)(x)=\\sqrt{x}-3",
        "relation": "implies",
        "rule": "composition_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "另一個順序 f∘g：先 g 後 f。g 的每個值 √x 都是實數，而 dom(f)=ℝ，所以條件 g(x)∈dom(f) 對每個 x∈[0,∞) 都成立，允許集合就是 [0,∞)。g 的陪域 ℝ 正是 f 的定義域，中間型別相容，f∘g:[0,∞)→ℝ 是總函數合成，(f∘g)(x)=√x−3。",
          "en": "The other order, f∘g: first g, then f. Every value √x of g is real and dom(f)=ℝ, so the condition g(x)∈dom(f) holds for every x∈[0,∞), and the permitted set is [0,∞). The codomain ℝ of g is exactly the domain of f, so the intermediate types match and f∘g:[0,∞)→ℝ is a total composition with (f∘g)(x)=√x−3."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "composition_def",
            "G1",
            "G2"
          ],
          "explanation": {
            "zh-Hant": "需要 g 的陪域包含於 f 的定義域；這裡兩者都是 ℝ。",
            "en": "It needs the codomain of g to be contained in the domain of f; here both are ℝ."
          }
        },
        "leaf_basis": "composition_def + set_builder + function_def"
      },
      {
        "id": "S11",
        "uses": [
          "S10",
          "L_sqrt_sq"
        ],
        "before_tex": "x=4",
        "after_tex": "(f\\circ g)(4)=f(g(4))=f(2)=2-3=-1",
        "relation": "implies",
        "rule": "composition_def",
        "conditions": [
          "4\\geq 0"
        ],
        "explanation": {
          "zh-Hant": "4∈[0,∞)。內層 g(4)=√4=2（S07），外層 f(2)=2−3=−1。所以 (f∘g)(4)=−1。",
          "en": "4∈[0,∞). Inner step g(4)=√4=2 (S07), outer step f(2)=2−3=−1. So (f∘g)(4)=−1."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S10",
            "L_sqrt_sq",
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "這次內層是 g；順序由記號 f∘g 決定：右邊的 g 先做。",
            "en": "This time the inner function is g; the order is fixed by the symbol f∘g: the g on the right acts first."
          }
        },
        "leaf_basis": "composition_def + L_sqrt_sq + numeric_evaluation"
      },
      {
        "id": "S12",
        "uses": [
          "S04",
          "S08",
          "S10",
          "S11",
          "function_def"
        ],
        "before_tex": "(g\\circ f)(4)=1,\\ (f\\circ g)(4)=-1",
        "after_tex": "g\\circ f\\neq f\\circ g",
        "relation": "implies",
        "rule": "function_def",
        "conditions": [],
        "explanation": {
          "zh-Hant": "兩個函數相等需要定義域相同且每點的值相同。這裡兩者的定義域就不同（[3,∞) 與 [0,∞)），而且在兩者共同的輸入 4 上，值 1≠−1。所以 g∘f≠f∘g：合成一般不交換。",
          "en": "Equal functions need the same domain and the same value at every point. Here even the domains differ ([3,∞) and [0,∞)), and at the common input 4 the values are 1≠−1. So g∘f≠f∘g: composition is not commutative in general."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S08",
            "S11",
            "function_def"
          ],
          "explanation": {
            "zh-Hant": "推翻相等只需一個共同輸入上的不同值；不宣稱任何一對函數都不交換。",
            "en": "One common input with different values suffices to refute equality; it is not claimed that no pair of functions commutes."
          }
        },
        "leaf_basis": "function_def + numeric_evaluation"
      },
      {
        "id": "S13",
        "uses": [
          "G1",
          "G2",
          "S07",
          "S08"
        ],
        "before_tex": "f(4)\\cdot g(4)",
        "after_tex": "f(4)\\cdot g(4)=1\\cdot 2=2\\neq 1=(g\\circ f)(4)",
        "relation": "implies",
        "rule": "numeric_evaluation",
        "conditions": [],
        "explanation": {
          "zh-Hant": "函數值的乘積 f(4)·g(4)=1·2=2，而合成 (g∘f)(4)=1。兩者不同，所以 g(f(x)) 不能改寫成 f(x)g(x)；合成是把一個函數的輸出當作另一個函數的輸入，不是乘法。",
          "en": "The product of values is f(4)·g(4)=1·2=2, while the composition gives (g∘f)(4)=1. They differ, so g(f(x)) may not be rewritten as f(x)g(x); composition feeds the output of one function into another and is not multiplication."
        },
        "reverse_audit": {
          "kind": "premise_audit",
          "required_ids": [
            "S08",
            "numeric_evaluation"
          ],
          "explanation": {
            "zh-Hant": "一個輸入上的不同就足以推翻「合成等於乘積」這個一般主張。",
            "en": "A difference at one input is enough to refute the general claim that composition equals the product."
          }
        },
        "leaf_basis": "numeric_evaluation"
      },
      {
        "id": "S14",
        "uses": [
          "S04",
          "S07",
          "S08",
          "S09",
          "S12",
          "S13"
        ],
        "before_tex": "S04,\\ S07,\\ S08,\\ S09,\\ S12,\\ S13",
        "after_tex": "D=[3,\\infty);\\ (g\\circ f)(7)=2,\\ (g\\circ f)(4)=1,\\ 1\\notin D;\\ g\\circ f\\neq f\\circ g;\\ \\exists x\\in D:\\ g(f(x))\\neq f(x)g(x)",
        "relation": "implies",
        "rule": "and_intro_elim",
        "conditions": [],
        "explanation": {
          "zh-Hant": "目標 (1) 由 S04，(2) 由 S07 到 S09，(3) 由 S10 到 S12，(4) 由 S13 完成。",
          "en": "Goal (1) is completed by S04, (2) by S07 to S09, (3) by S10 to S12, and (4) by S13."
        },
        "reverse_audit": {
          "kind": "sufficient_goal_reduction",
          "required_ids": [
            "S04",
            "S07",
            "S08",
            "S09",
            "S12",
            "S13",
            "and_intro_elim"
          ],
          "explanation": {
            "zh-Hant": "目標 G：(1) 到 (4)。足夠條件 H：所列各步成立；H⇒G 由合取引入。H 由定義、引理與精確計算正向證成，沒有把 G 當作前提。",
            "en": "Goal G: (1) to (4). Sufficient condition H: the listed steps hold; H⇒G by conjunction introduction. H is proved forwards from the definitions, lemmas and exact computation; G is never used as a premise."
          }
        },
        "leaf_basis": "and_intro_elim"
      }
    ],
    "result": {
      "zh-Hant": "g∘f 的允許輸入是 D=[3,∞)，(g∘f)(x)=√(x−3)；(g∘f)(7)=2、(g∘f)(4)=1，而 (g∘f)(1) 因 f(1)=−2 不在 g 的定義域而沒有定義。f∘g:[0,∞)→ℝ、(f∘g)(x)=√x−3 是總函數合成，(f∘g)(4)=−1≠1，所以 g∘f≠f∘g；f(4)g(4)=2≠1，合成也不是乘法。",
      "en": "The permitted inputs of g∘f are D=[3,∞), with (g∘f)(x)=√(x−3); (g∘f)(7)=2 and (g∘f)(4)=1, while (g∘f)(1) is undefined because f(1)=−2 is outside the domain of g. f∘g:[0,∞)→ℝ, (f∘g)(x)=√x−3, is a total composition with (f∘g)(4)=−1≠1, so g∘f≠f∘g; and f(4)g(4)=2≠1, so composition is not multiplication."
    },
    "negative_controls": [
      {
        "claim": {
          "zh-Hant": "(g∘f)(4) 的算法是先算 g(4)=2，再算 f(2)=−1",
          "en": "(g∘f)(4) is computed as g(4)=2 first, then f(2)=−1"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "那是 (f∘g)(4)；(g∘f)(4)=g(f(4))=g(1)=1。",
          "en": "That is (f∘g)(4); (g∘f)(4)=g(f(4))=g(1)=1."
        }
      },
      {
        "claim": {
          "zh-Hant": "g∘f 的允許輸入是 dom(f)=ℝ",
          "en": "The permitted inputs of g∘f are dom(f)=ℝ"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "1∈ℝ 但 f(1)=−2∉dom(g)；允許集合是 [3,∞)。",
          "en": "1∈ℝ but f(1)=−2∉dom(g); the permitted set is [3,∞)."
        }
      },
      {
        "claim": {
          "zh-Hant": "g∘f=f∘g",
          "en": "g∘f=f∘g"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "定義域不同，且在 4 的值是 1 與 −1。",
          "en": "Their domains differ, and their values at 4 are 1 and −1."
        }
      },
      {
        "claim": {
          "zh-Hant": "(g∘f)(4)=f(4)·g(4)=2",
          "en": "(g∘f)(4)=f(4)·g(4)=2"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "(g∘f)(4)=1；合成不是函數值的乘法。",
          "en": "(g∘f)(4)=1; composition is not multiplication of values."
        }
      },
      {
        "claim": {
          "zh-Hant": "k(u)=(√u)²（u≥0）時，k(f(x)) 化簡為 x−3，所以 k∘f 在所有實數上都有定義",
          "en": "With k(u)=(√u)² for u≥0, k(f(x)) simplifies to x−3, so k∘f is defined on all reals"
        },
        "expected": "reject",
        "reason": {
          "zh-Hant": "允許輸入由 f(x)∈dom(k) 決定，仍是 [3,∞)。",
          "en": "The permitted inputs are fixed by f(x)∈dom(k) and are still [3,∞)."
        }
      }
    ],
    "status": "candidate",
    "gaps": [],
    "verification": {
      "structure": "checked_local_script",
      "mathematics": "candidate_argument",
      "formalization": "not_formalized"
    },
    "rule_glossary": [
      {
        "id": "composition_def",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "合成：對 f:A→B 與 g:B→C，g∘f:A→C 定義為 (g∘f)(a)=g(f(a))。",
          "en": "Composition: for f:A→B and g:B→C, g∘f:A→C is defined by (g∘f)(a)=g(f(a))."
        }
      },
      {
        "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": "set_builder",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "集合建構式：x∈{y∈A ∣ P(y)} 當且僅當 x∈A 且 P(x)。",
          "en": "Set-builder notation: x∈{y∈A ∣ P(y)} if and only if x∈A and P(x)."
        }
      },
      {
        "id": "set_extensionality",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "集合相等：A=B 當且僅當 A⊆B 且 B⊆A，即兩者有相同元素。",
          "en": "Set equality: A=B if and only if A⊆B and B⊆A, i.e. they have the same elements."
        }
      },
      {
        "id": "sqrt_def",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "主平方根：對 a≥0，√a 是唯一滿足 b≥0 且 b²=a 的實數 b。負數在實數中沒有平方根。",
          "en": "Principal square root: for a≥0, √a is the unique real b with b≥0 and b²=a. Negative numbers have no real square root."
        }
      },
      {
        "id": "order_basics",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "實數的序：任兩數恰有 u<v、u=v、u>v 之一；u<v 且 v<w 推出 u<w；u<v 推出 u+w<v+w；u<v 且 w>0 推出 uw<vw；u<v 且 w<0 推出 uw>vw。",
          "en": "Order of the reals: exactly one of u<v, u=v, u>v holds; u<v and v<w give u<w; u<v gives u+w<v+w; u<v and w>0 give uw<vw; u<v and w<0 give uw>vw."
        }
      },
      {
        "id": "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": "add_inverse",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "加法反元素：每個 u 都有 −u，使 u+(−u)=0；u−v 定義為 u+(−v)。",
          "en": "Additive inverse: every u has −u with u+(−u)=0; u−v means u+(−v)."
        }
      },
      {
        "id": "add_assoc",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "加法結合律：(u+v)+w=u+(v+w)。",
          "en": "Associativity of addition: (u+v)+w=u+(v+w)."
        }
      },
      {
        "id": "add_zero",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "加法單位元：u+0=u。",
          "en": "Additive identity: u+0=u."
        }
      },
      {
        "id": "square_nonneg",
        "kind": "prerequisite",
        "statement": {
          "zh-Hant": "實數平方非負：對所有實數 u，u²≥0，且 u²=0 ⇔ u=0。",
          "en": "Squares are nonnegative: for every real u, u²≥0, and u²=0 ⇔ u=0."
        }
      },
      {
        "id": "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_comp_def",
        "kind": "cited",
        "source": {
          "mko_id": "mko-composition",
          "sha256": "a915b980c52ed5cfa4fd9ef59e2a23ef237a0eebbe262cd6f1a67b15f052bfa9",
          "commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f"
        },
        "statement": {
          "zh-Hant": "若 f:A→B、g:B→C 為總函數，則 g∘f:A→C 由 (g∘f)(x)=g(f(x)) 定義。對不同定義域的表達式，合成允許的輸入為 {x∈dom(f):f(x)∈dom(g)}。",
          "en": "If f:A→B and g:B→C are total functions, then g∘f:A→C is defined by (g∘f)(x)=g(f(x)). For expressions with different domains, the permitted inputs of the composition are {x∈dom(f):f(x)∈dom(g)}."
        }
      },
      {
        "id": "L_shift3",
        "kind": "lemma",
        "proved_in": [
          "S03.1"
        ],
        "statement": {
          "zh-Hant": "對實數 x：x−3≥0 ⇔ x≥3。",
          "en": "For a real x: x−3≥0 ⇔ x≥3."
        }
      },
      {
        "id": "L_sqrt_sq",
        "kind": "lemma",
        "proved_in": [
          "S07.1"
        ],
        "statement": {
          "zh-Hant": "對實數 b≥0：√(b²)=b。",
          "en": "For a real b≥0: √(b²)=b."
        }
      }
    ],
    "revision_log": [],
    "numeric_checks": [
      {
        "id": "N1",
        "step": "S06",
        "lhs": "7-3",
        "rhs": "4"
      },
      {
        "id": "N2",
        "step": "S07",
        "lhs": "2**2",
        "rhs": "4"
      },
      {
        "id": "N3",
        "step": "S08",
        "lhs": "4-3",
        "rhs": "1"
      },
      {
        "id": "N4",
        "step": "S08",
        "lhs": "1**2",
        "rhs": "1"
      },
      {
        "id": "N5",
        "step": "S09",
        "lhs": "1-3",
        "rhs": "-2"
      },
      {
        "id": "N6",
        "step": "S09",
        "lhs": "-2",
        "relation": "<",
        "rhs": "0"
      },
      {
        "id": "N7",
        "step": "S11",
        "lhs": "2-3",
        "rhs": "-1"
      },
      {
        "id": "N8",
        "step": "S12",
        "lhs": "1",
        "relation": "!=",
        "rhs": "-1"
      },
      {
        "id": "N9",
        "step": "S13",
        "lhs": "1*2",
        "relation": "!=",
        "rhs": "1"
      },
      {
        "id": "N10",
        "step": "S03.1",
        "vars": [
          "x"
        ],
        "degree": 1,
        "lhs": "(x-3)+3",
        "rhs": "x"
      },
      {
        "id": "N11",
        "step": "S04",
        "vars": [
          "x"
        ],
        "range": [
          3,
          30
        ],
        "lhs": "x-3",
        "relation": ">=",
        "rhs": "0"
      },
      {
        "id": "N12",
        "step": "S04",
        "vars": [
          "x"
        ],
        "range": [
          -30,
          2
        ],
        "lhs": "x-3",
        "relation": "<",
        "rhs": "0"
      },
      {
        "id": "N13",
        "step": "S07.1",
        "lhs": "(-2)**2",
        "rhs": "2**2"
      }
    ]
  },
  "presentation": {
    "md_scope": {
      "zh-Hant": "在 MKO 的範圍內：函數及其定義域、陪域都已明示（假設 a1）；受限合成只在明示的允許集合上求值（假設 a2）。只用到主平方根的定義與實數的序。不處理一般的合成結合律、反函數或型別轉換條件；不改動 canonical MKO 或英文 edition。",
      "en": "Inside the MKO's scope: the functions and their domains and codomains are stated explicitly (assumption a1), and a restricted composition is evaluated only on its explicitly permitted set (assumption a2). Only the definition of the principal square root and the order of the reals are used. It does not treat associativity of composition in general, inverse functions or type-conversion conditions, and does not change the canonical MKO or its English edition."
    },
    "md_symbols": [
      [
        "f,\\ g",
        "給定的兩個函數",
        "the two given functions"
      ],
      [
        "g\\circ f",
        "先 f 後 g 的合成，(g∘f)(x)=g(f(x))",
        "the composition 'f first, then g', (g∘f)(x)=g(f(x))"
      ],
      [
        "D",
        "g∘f 的允許輸入集合",
        "the set of permitted inputs of g∘f"
      ],
      [
        "\\mathrm{dom}(f)",
        "f 的定義域",
        "the domain of f"
      ],
      [
        "[a,\\infty)",
        "{x∈ℝ ∣ x≥a}",
        "{x∈ℝ ∣ x≥a}"
      ],
      [
        "\\sqrt{u}",
        "u≥0 的主平方根",
        "the principal square root of u≥0"
      ]
    ],
    "md_error_controls": [
      {
        "title": "g∘f 是先 f 後 g / g∘f means f first, then g",
        "zh": "MKO 指出的第一個誤解是把 g∘f 讀成先 g 後 f。在 x=4，正確的 (g∘f)(4)=g(f(4))=g(1)=1；若先 g 後 f，得到 f(g(4))=f(2)=−1，那是 (f∘g)(4)。在 x=7，正確值是 2，先 g 後 f 會得到 √7−3，連數值都完全不同。讀法：從記號的右邊往左做。",
        "en": "The first mistake named by the MKO is reading g∘f as 'g first, then f'. At x=4 the correct value is (g∘f)(4)=g(f(4))=g(1)=1; doing g first gives f(g(4))=f(2)=−1, which is (f∘g)(4). At x=7 the correct value is 2, while g first gives √7−3, a completely different number. Read the symbol from right to left."
      },
      {
        "title": "中間值必須在 g 的定義域中 / The intermediate value must lie in the domain of g",
        "zh": "MKO 指出的第二個誤解是略過中間值的定義域檢查。1∈dom(f)，但 f(1)=−2∉dom(g)，所以 1 不是 g∘f 的允許輸入；允許集合是 [3,∞) 而不是 ℝ。另一個陷阱是先化簡公式：若 k(u)=(√u)²，定義域 [0,∞)，則 k(f(x)) 看似化簡成 x−3、對所有實數都有值，但合成 k∘f 的允許輸入仍然只有 [3,∞)，因為允許集合由 f(x)∈dom(k) 決定，不由化簡後的式子決定。",
        "en": "The second mistake named by the MKO is skipping the domain check on the intermediate value. 1∈dom(f), but f(1)=−2∉dom(g), so 1 is not a permitted input of g∘f; the permitted set is [3,∞), not ℝ. Another trap is simplifying the formula first: if k(u)=(√u)² with domain [0,∞), then k(f(x)) seems to simplify to x−3, defined for every real, but the permitted inputs of k∘f are still only [3,∞), because the permitted set is fixed by f(x)∈dom(k), not by the simplified expression."
      },
      {
        "title": "合成不交換，也不是乘法 / Composition is neither commutative nor multiplication",
        "zh": "MKO 第三段指出，任意改寫為 f(g(x)) 或 f(x)g(x) 都需要額外條件。本例中 (g∘f)(4)=1、(f∘g)(4)=−1、f(4)g(4)=2，三者兩兩不同，連 g∘f 與 f∘g 的定義域也不同。",
        "en": "The third paragraph of the MKO says that rewriting as f(g(x)) or f(x)g(x) needs extra conditions. Here (g∘f)(4)=1, (f∘g)(4)=−1 and f(4)g(4)=2 are pairwise different, and even the domains of g∘f and f∘g differ."
      }
    ],
    "md_open_items": [
      {
        "zh-Hant": "N11、N12 是整數點上的有限核對（x 從 3 到 30 與從 −30 到 2），只支持這些點；D=[3,∞) 的一般結論來自 S02 到 S04。",
        "en": "N11 and N12 are finite checks at integer points (x from 3 to 30 and from −30 to 2) and support only those points; the general statement D=[3,∞) comes from S02 to S04."
      }
    ]
  },
  "revision": {
    "id": "production-20261019-adopted-96",
    "source_commit": "b28a5edbd46279b1db2a3f3f48bb3f447e18899f",
    "adopted_source_sha256": "7475978339b2e04ee6e4e8518b063519655f472a46543961b2bfa1e7094d567b",
    "original_source_sha256": "95339f2c0130b538225fee6de95859d69ec9ec89bcf1a08c5079782ad73dbc7a",
    "owner_adopted": true,
    "bilingual_sync": "complete_source_bound",
    "formal_Lean": "NOT_RUN",
    "independent_AI_concurrence": "NOT_MEASURED",
    "issue_ids": [
      "BR-M008"
    ],
    "scope": "Owner-adopted natural-language teaching guide; not a formal proof, canonical MKO rewrite or evidence-status promotion."
  }
}
