Main derivation
S01 · definition
Before
g\circ f
After
(g\circ f)(x)=g(f(x)),\ \ x\in D=\{x\in\mathrm{dom}(f)\mid f(x)\in\mathrm{dom}(g)\}Conditions: none
Rule: mko_comp_def · Uses: G3, mko_comp_def
Leaf basis: mko_comp_def + composition_def
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.
S02 · equivalent
Before
D=\{x\in\mathrm{dom}(f)\mid f(x)\in\mathrm{dom}(g)\}After
D=\{x\in\mathbb{R}\mid x-3\geq 0\}Conditions: none
Rule: set_builder · Uses: S01, G1, G2, set_builder
Leaf basis: set_builder + def_unfold
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.
S03 · equivalent
Before
x-3\geq 0
After
x\geq 3
Conditions: none
Rule: L_shift3 · Uses: S02, L_shift3
Leaf basis: L_shift3
By Lemma L_shift3, x−3≥0 ⇔ x≥3. The lemma is proved in S03.1.
S04 · equivalent
Before
D=\{x\in\mathbb{R}\mid x-3\geq 0\}After
D=[3,\infty)
Conditions: none
Rule: set_extensionality · Uses: S02, S03, set_extensionality
Leaf basis: set_extensionality + set_builder
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.
S05 · implies
Before
x\in D
After
(g\circ f)(x)=\sqrt{x-3},\ \ g\circ f:[3,\infty)\to\mathbb{R}Conditions: x\geq 3
Rule: composition_def · Uses: S01, S04, composition_def
Leaf basis: composition_def + function_def
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,∞)→ℝ.
S06 · implies
Before
x=7
After
f(7)=7-3=4\in\mathrm{dom}(g),\ \ 7\in DConditions: none
Rule: numeric_evaluation · Uses: G1, S04
Leaf basis: numeric_evaluation + set_builder
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.
S07 · implies
Before
g(4)
After
(g\circ f)(7)=g(4)=\sqrt{4}=\sqrt{2^2}=2Conditions: 2\geq 0
Rule: L_sqrt_sq · Uses: S06, G2, L_sqrt_sq
Leaf basis: L_sqrt_sq + numeric_evaluation
Outer step: g(4)=√4. Since 4=2² and 2≥0, Lemma L_sqrt_sq gives √4=2. So (g∘f)(7)=2.
S08 · implies
Before
x=4
After
(g\circ f)(4)=g(f(4))=g(1)=\sqrt{1}=1Conditions: 4\geq 3
Rule: composition_def · Uses: G1, G2, S04, L_sqrt_sq
Leaf basis: composition_def + L_sqrt_sq + numeric_evaluation
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.
S09 · implies
Before
x=1
After
f(1)=-2\notin\mathrm{dom}(g),\ \text{so}\ 1\notin D\ \text{and}\ (g\circ f)(1)\ \text{is undefined}Conditions: none
Rule: set_builder · Uses: G1, G2, S04, sqrt_def
Leaf basis: set_builder + sqrt_def + order_basics + numeric_evaluation
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.
S10 · implies
Before
f\circ g
After
\{x\in\mathrm{dom}(g)\mid g(x)\in\mathrm{dom}(f)\}=[0,\infty),\ \ (f\circ g)(x)=\sqrt{x}-3Conditions: none
Rule: composition_def · Uses: G1, G2, composition_def, set_builder
Leaf basis: composition_def + set_builder + function_def
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.
S11 · implies
Before
x=4
After
(f\circ g)(4)=f(g(4))=f(2)=2-3=-1
Conditions: 4\geq 0
Rule: composition_def · Uses: S10, L_sqrt_sq
Leaf basis: composition_def + L_sqrt_sq + numeric_evaluation
4∈[0,∞). Inner step g(4)=√4=2 (S07), outer step f(2)=2−3=−1. So (f∘g)(4)=−1.
S12 · implies
Before
(g\circ f)(4)=1,\ (f\circ g)(4)=-1
After
g\circ f\neq f\circ g
Conditions: none
Rule: function_def · Uses: S04, S08, S10, S11, function_def
Leaf basis: function_def + numeric_evaluation
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.
S13 · implies
Before
f(4)\cdot g(4)
After
f(4)\cdot g(4)=1\cdot 2=2\neq 1=(g\circ f)(4)
Conditions: none
Rule: numeric_evaluation · Uses: G1, G2, S07, S08
Leaf basis: numeric_evaluation
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.
S14 · implies
Before
S04,\ S07,\ S08,\ S09,\ S12,\ S13
After
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)
Conditions: none
Rule: and_intro_elim · Uses: S04, S07, S08, S09, S12, S13
Leaf basis: and_intro_elim
Goal (1) is completed by S04, (2) by S07 to S09, (3) by S10 to S12, and (4) by S13.
Error controls and negative controls
g∘f means f first, then g
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.
The intermediate value must lie in the domain of g
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.
Composition is neither commutative nor multiplication
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.
- (g∘f)(4) is computed as g(4)=2 first, then f(2)=−1 →
reject — That is (f∘g)(4); (g∘f)(4)=g(f(4))=g(1)=1. - The permitted inputs of g∘f are dom(f)=ℝ →
reject — 1∈ℝ but f(1)=−2∉dom(g); the permitted set is [3,∞). - g∘f=f∘g →
reject — Their domains differ, and their values at 4 are 1 and −1. - (g∘f)(4)=f(4)·g(4)=2 →
reject — (g∘f)(4)=1; composition is not multiplication of values. - With k(u)=(√u)² for u≥0, k(f(x)) simplifies to x−3, so k∘f is defined on all reals →
reject — The permitted inputs are fixed by f(x)∈dom(k) and are still [3,∞).