Main derivation
S01 · definition
Before
d:X\times X\to\mathbb{R}After
d\ge 0;\ d(x,y)=0\Leftrightarrow x=y;\ d(x,y)=d(y,x);\ d(x,z)\le d(x,y)+d(y,z)
Conditions: none
Rule: metric_def · Uses: mko_metric_def
Leaf basis: metric_def + mko_metric_def
By the MKO a metric must satisfy four conditions, each for all points (or pairs, or triples): nonnegativity; separation (distance zero exactly when the points coincide); symmetry; the triangle inequality. Separation has two directions: a zero diagonal and nonzero off-diagonal entries.
S02 · implies
Before
d(i,j),\ i,j\in X
After
d(i,j)\in\{0,1,2\},\ d(i,j)\ge 0Conditions: none
Rule: finite_exhaustion · Uses: G1
Leaf basis: finite_exhaustion + order_basics
Inspect all 16 values: each is 0, 1 or 2, so all are nonnegative. Also note a bound used later: every value is at most 2.
S03 · implies
Before
d(i,i),\ i\in X
After
x=y\Rightarrow d(x,y)=0
Conditions: none
Rule: finite_exhaustion · Uses: G1
Leaf basis: finite_exhaustion
The diagonal entries d(0,0), d(1,1), d(2,2), d(3,3) are all 0, so a point has distance zero from itself. This is one direction of separation.
S04 · implies
Before
d(i,j),\ i\neq j
After
d(x,y)=0\Rightarrow x=y
Conditions: none
Rule: contrapositive · Uses: G1, S02
Leaf basis: finite_exhaustion + contrapositive
The 12 off-diagonal cells are all 1 or 2, so for x≠y we have d(x,y)≥1, in particular d(x,y)≠0. By contraposition this is equivalent to 'd(x,y)=0 implies x=y'.
S05 · implies
Before
x=y\Rightarrow d(x,y)=0,\ d(x,y)=0\Rightarrow x=y
After
d(x,y)=0\Leftrightarrow x=y
Conditions: none
Rule: iff_intro · Uses: S03, S04
Leaf basis: iff_intro
S03 and S04 together give both directions, which is separation. This is the MKO's first paragraph: the diagonal must be zero and off-diagonal entries must not be zero, and together they make up separation.
S06 · implies
Before
d(i,j)\ \text{vs}\ d(j,i)After
\forall i,j\in X:\ d(i,j)=d(j,i)
Conditions: none
Rule: finite_exhaustion · Uses: G1
Leaf basis: finite_exhaustion
Compare the 6 mirror pairs: d(0,1)=d(1,0)=1, d(0,2)=d(2,0)=2, d(0,3)=d(3,0)=1, d(1,2)=d(2,1)=1, d(1,3)=d(3,1)=2, d(2,3)=d(3,2)=1; the diagonal is trivially symmetric. The table equals its transpose.
S07 · case_split
Before
(i,j,k)\in X^3
After
i=k\ \lor\ (i\neq k\land(j=i\lor j=k))\ \lor\ i,j,k\ \text{pairwise distinct}Conditions: none
Rule: case_analysis · Uses: S02, S03, S04
Leaf basis: case_analysis
The triangle inequality d(i,k)≤d(i,j)+d(j,k) must hold for all 64 ordered triples. Split the triples into three cases: A: i=k; B: i≠k and j equals i or k; C: i, j, k pairwise distinct. Sub-steps S07.1 to S07.3 treat each case, and S07.4 confirms that the three cases cover exactly the 64 triples.
S08 · implies
Before
\text{cases A, B, C}After
\forall i,j,k\in X:\ d(i,k)\le d(i,j)+d(j,k)
Conditions: none
Rule: case_analysis · Uses: S07, S07.1, S07.2, S07.3, S07.4
Leaf basis: case_analysis + finite_exhaustion
The inequality is proved in all three cases, which cover all 64 triples, so by proof by cases the triangle inequality holds for every ordered triple of X. N1 additionally enumerates all 64 triples with the formula d(i,j)=min(|i−j|, 4−|i−j|) as a cross-check.
S09 · implies
Before
\text{nonnegativity, separation, symmetry, triangle inequality}After
(X,d)\ \text{is a metric space}Conditions: none
Rule: mko_metric_def · Uses: S02, S05, S06, S08
Leaf basis: mko_metric_def + and_intro_elim
The four conditions come from S02, S05, S06 and S08, so (X,d) is a metric space. The conclusion concerns this specified finite model only.
S10 · implies
Before
e\ \text{on } Y=\{0,1,2\}After
e\ge 0,\ e(x,y)=0\Leftrightarrow x=y,\ e(x,y)=e(y,x)
Conditions: none
Rule: finite_exhaustion · Uses: G2
Leaf basis: finite_exhaustion
Inspect candidate B cell by cell: all 9 values are nonnegative; the three diagonal cells are 0; the six off-diagonal cells are 1, 3, 1, 1, 3, 1, none of them 0; e(0,1)=e(1,0)=1, e(0,2)=e(2,0)=3, e(1,2)=e(2,1)=1, so the table is symmetric. The first three conditions all pass.
S11 · implies
Before
e(0,2)\ \text{vs}\ e(0,1)+e(1,2)After
3>1+1=2
Conditions: none
Rule: order_basics · Uses: G2
Leaf basis: order_basics + numeric_evaluation
Take the triple (0,1,2): e(0,2)=3 while e(0,1)+e(1,2)=1+1=2. Since 3>2, the triangle inequality fails at this triple: going through point 1 is shorter than the direct distance.
S12 · implies
Before
\exists(i,j,k):\ e(i,k)>e(i,j)+e(j,k)
After
(Y,e)\ \text{is not a metric space}Conditions: none
Rule: quantifier_negation · Uses: S10, S11
Leaf basis: quantifier_negation + mko_metric_def
The triangle inequality is a universal statement; S11 gives a counterexample, so by quantifier negation it is false and (Y,e) is not a metric space, although nonnegativity, separation and symmetry in S10 all pass.
S13 · implies
Before
f(0,1)=0,\ 0\neq 1
After
(Z,f)\ \text{is not a metric space}Conditions: none
Rule: mko_metric_def · Uses: G3
Leaf basis: mko_metric_def + metric_def + quantifier_negation
Candidate C has all 9 values nonnegative, a symmetric table and a zero diagonal; but f(0,1)=0 although 0≠1, violating 'd(x,y)=0 implies x=y'. Separation fails, so f is not a metric (such a table is usually called a pseudometric). Checking only nonnegativity, symmetry and the diagonal would miss this.
Substeps and lemmas
S07.1 · implies
Before
i=k
After
d(i,k)=0\le d(i,j)+d(j,i)
Conditions: i=k
Rule: order_basics · Uses: S07, S02, S03
Leaf basis: order_basics + add_zero
Case A: i=k, so the left side is d(i,i)=0 (S03); the right side is a sum of two nonnegative numbers (S02), hence ≥0. Since 0≤right side, the inequality holds.
S07.2 · implies
Before
i\neq k,\ j\in\{i,k\}After
d(i,j)+d(j,k)=d(i,k)
Conditions: i\neq k
Rule: eq_replace · Uses: S07, S03
Leaf basis: eq_replace + add_zero + order_basics
Case B: if j=i the right side is d(i,i)+d(i,k)=0+d(i,k)=d(i,k); if j=k it is d(i,k)+d(k,k)=d(i,k)+0=d(i,k). In both sub-cases the right side equals the left, so d(i,k)≤right side holds with equality.
S07.3 · implies
Before
i,j,k\ \text{pairwise distinct}After
d(i,k)\le 2\le d(i,j)+d(j,k)
Conditions: i\neq j,\ j\neq k,\ i\neq k
Rule: order_basics · Uses: S07, S02, S04
Leaf basis: order_basics + numeric_evaluation
Case C: since i≠j and j≠k, S04 gives d(i,j)≥1 and d(j,k)≥1, so the right side is at least 1+1=2; by S02 every distance is at most 2, so d(i,k)≤2. By transitivity of order, d(i,k)≤right side.
S07.4 · implies
Before
|A|+|B|+|C|
After
16+24+24=64=4^3
Conditions: none
Rule: finite_counting_basics · Uses: S07
Leaf basis: finite_counting_basics + numeric_evaluation
The three cases are exclusive and exhaustive: if i=k the triple is in A; otherwise i≠k, and it is in B if j equals i or k, and in C if j differs from both. Counting: A has 4·4=16 triples (choose i and j); B has 2·(4·3)=24 (choose distinct i, k, then let j equal one of them); C has 4·3·2=24. The total 64=4³ is exactly the number of ordered triples.