Skip to content

Commit a58c9e6

Browse files
committed
Various improvements
1 parent 67ea033 commit a58c9e6

23 files changed

Lines changed: 1943 additions & 1476 deletions

File tree

essays/NAM/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,6 @@ this equal?" and "which is bigger?" non-primitive, partial, or outright undecida
548548
complex out of carelessness — the translation preserves computability by discarding cheap equality. Betacrypt-3, but the
549549
trade is honest and the dialect is at least the same one everywhere.
550550
551-
552551
The natural equivalence relation on generator VMs is extensional: two VMs are equal iff they produce identical digit
553552
streams on every query. This relation is **not computably decidable** — it is the canonical example of an undecidable
554553
semantic property of programs (Rice's theorem). The library therefore cannot ship an `equals(x, y)` operation that
@@ -664,4 +663,4 @@ with the codec/base separation and the first-class skip primitive, this is a rea
664663
iRRAM, mpmath) even where it builds on their mathematical foundations.
665664

666665
Alpha to omega: from mathematical definitions to compiled digit streams, with the approximations made explicit, the
667-
costs made honest, and the limits made visible.
666+
costs made honest, and the limits made visible.

essays/NAM/index.html

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3532,23 +3532,26 @@ <h2 class="section-title" id="heading-equality-limits">
35323532
</div>
35333533
<div class="section-body">
35343534
<p class="section-intro">
3535-
There is a Futurama line that captures the situation with uncomfortable precision.
3536-
Professor Farnsworth, having "translated" an alien message, announces:
3537-
<em>"Of course we can translate it — but only into Betacrypt-3… a language so
3538-
complex, there is even less chance of understanding it."</em> The joke lands because
3539-
the translation technically succeeds — it just maps the problem into a representation
3540-
where the operations people actually cared about have become harder, not easier. This
3541-
is, structurally, exactly the move Numbers as Machines makes. We "translate" every
3542-
number into a generator-VM that emits an infinite digit stream, gaining uniformity,
3543-
composability, and exactness. The bill for that translation comes due precisely here:
3544-
the very act of representing a number as a non-halting machine is what makes "is this
3545-
equal?" and "which is bigger?" non-primitive, partial, or outright undecidable. We did
3546-
not make the substrate too complex out of carelessness — the translation preserves
3547-
computability by discarding cheap equality. Betacrypt-3, but the trade is honest and
3548-
the dialect is at least the same one everywhere.
3549-
</p>
3550-
<p>
3551-
The natural equivalence relation on generator VMs is extensional: two VMs are equal
3535+
There is a Futurama line that captures the situation with uncomfortable precision.
3536+
Professor Farnsworth, having "translated" an alien message, announces:
3537+
<em
3538+
>"Of course we can translate it — but only into Betacrypt-3… a language so
3539+
complex, there is even less chance of understanding it."</em
3540+
>
3541+
The joke lands because the translation technically succeeds — it just maps the
3542+
problem into a representation where the operations people actually cared about have
3543+
become harder, not easier. This is, structurally, exactly the move Numbers as
3544+
Machines makes. We "translate" every number into a generator-VM that emits an
3545+
infinite digit stream, gaining uniformity, composability, and exactness. The bill
3546+
for that translation comes due precisely here: the very act of representing a number
3547+
as a non-halting machine is what makes "is this equal?" and "which is bigger?"
3548+
non-primitive, partial, or outright undecidable. We did not make the substrate too
3549+
complex out of carelessness — the translation preserves computability by discarding
3550+
cheap equality. Betacrypt-3, but the trade is honest and the dialect is at least the
3551+
same one everywhere.
3552+
</p>
3553+
<p>
3554+
The natural equivalence relation on generator VMs is extensional: two VMs are equal
35523555
iff they produce identical digit streams on every query. This relation is
35533556
<strong class="key-concept">not computably decidable</strong> — it is the canonical
35543557
example of an undecidable semantic property of programs (Rice's theorem).
@@ -4766,4 +4769,4 @@ <h3 class="footer-col-title">Key Concepts</h3>
47664769
})();
47674770
</script>
47684771
</body>
4769-
</html>
4772+
</html>
Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,73 @@
11
// affine.js
2-
// Precomputed reference of affine transformation sets in algebraic form,
3-
// one entry per polygon type. Each "move" is an edge-crossing generator
4-
// normalized to a canonical compass order (North, then clockwise).
5-
//
6-
// The algebraic representation reuses field.js for n=5 (pentagon) where
7-
// exact Q(sqrt5, S) arithmetic is available. For other n we store the
8-
// float rotation angle and a symbolic label; the algebraic layer can be
9-
// expanded later per polygon.
10-
//
11-
// Each affine generator g maps a tile frame (centroid c, orient o, sigma s)
12-
// to a neighbor frame. We expose:
13-
// - rotationSteps: how many edge rotations relative to canonical North
14-
// - sheetDelta: canonical sheet shift for THIS compass direction
15-
//
16-
// The key normalization rule: a "move" is indexed by its compass slot,
17-
// not by the raw edge index. Edge index depends on orientation; compass
18-
// slot does not. We compute compass slot = (edge - orient) mod n with the
19-
// North edge at slot 0, then increasing clockwise.
2+
// Precomputed reference of affine transformation sets in algebraic form,
3+
// one entry per polygon type. Each "move" is an edge-crossing generator
4+
// normalized to a canonical compass order (North, then clockwise).
5+
//
6+
// The algebraic representation reuses field.js for n=5 (pentagon) where
7+
// exact Q(sqrt5, S) arithmetic is available. For other n we store the
8+
// float rotation angle and a symbolic label; the algebraic layer can be
9+
// expanded later per polygon.
10+
//
11+
// Each affine generator g maps a tile frame (centroid c, orient o, sigma s)
12+
// to a neighbor frame. We expose:
13+
// - rotationSteps: how many edge rotations relative to canonical North
14+
// - sheetDelta: canonical sheet shift for THIS compass direction
15+
//
16+
// The key normalization rule: a "move" is indexed by its compass slot,
17+
// not by the raw edge index. Edge index depends on orientation; compass
18+
// slot does not. We compute compass slot = (edge - orient) mod n with the
19+
// North edge at slot 0, then increasing clockwise.
2020

21-
import { K } from './field.js';
21+
import { K } from './field.js';
2222

23-
// Canonical compass labels for small n (purely informational).
24-
const COMPASS = {
25-
3: ['N', 'SE', 'SW'],
26-
4: ['N', 'E', 'S', 'W'],
27-
5: ['N', 'NE', 'SE', 'SW', 'NW'],
28-
6: ['N', 'NE', 'SE', 'S', 'SW', 'NW'],
29-
};
23+
// Canonical compass labels for small n (purely informational).
24+
const COMPASS = {
25+
3: ['N', 'SE', 'SW'],
26+
4: ['N', 'E', 'S', 'W'],
27+
5: ['N', 'NE', 'SE', 'SW', 'NW'],
28+
6: ['N', 'NE', 'SE', 'S', 'SW', 'NW'],
29+
};
3030

31-
// Normalize a raw edge index to a compass slot given the tile orientation.
32-
// North-then-clockwise: slot 0 is the edge that, in the tile's own frame,
33-
// points most nearly "up" (+y). Because orient rotates the vertex frame by
34-
// orient*(2pi/n), the canonical North edge of an oriented tile is edge
35-
// index `orient` (mod n) for the +y-up convention used in ngon.js.
36-
export function edgeToCompass(edge, orient, n) {
37-
return ((edge - orient) % n + n) % n;
38-
}
31+
// Normalize a raw edge index to a compass slot given the tile orientation.
32+
// North-then-clockwise: slot 0 is the edge that, in the tile's own frame,
33+
// points most nearly "up" (+y). Because orient rotates the vertex frame by
34+
// orient*(2pi/n), the canonical North edge of an oriented tile is edge
35+
// index `orient` (mod n) for the +y-up convention used in ngon.js.
36+
export function edgeToCompass(edge, orient, n) {
37+
return (((edge - orient) % n) + n) % n;
38+
}
3939

40-
// Inverse: compass slot back to raw edge index for a given orientation.
41-
export function compassToEdge(slot, orient, n) {
42-
return ((slot + orient) % n + n) % n;
43-
}
40+
// Inverse: compass slot back to raw edge index for a given orientation.
41+
export function compassToEdge(slot, orient, n) {
42+
return (((slot + orient) % n) + n) % n;
43+
}
4444

45-
// Canonical sheet delta for a compass slot. This is the holonomy generator
46-
// assignment: it depends ONLY on the absolute compass direction, so that
47-
// walking the same world-direction always accrues the same sheet shift.
48-
// Default: slot index itself (mod groupOrder). Override per-n as needed.
49-
export function compassSheetDelta(slot, groupOrder) {
50-
return ((slot % groupOrder) + groupOrder) % groupOrder;
51-
}
45+
// Canonical sheet delta for a compass slot. This is the holonomy generator
46+
// assignment: it depends ONLY on the absolute compass direction, so that
47+
// walking the same world-direction always accrues the same sheet shift.
48+
// Default: slot index itself (mod groupOrder). Override per-n as needed.
49+
export function compassSheetDelta(slot, groupOrder) {
50+
return ((slot % groupOrder) + groupOrder) % groupOrder;
51+
}
5252

53-
// Algebraic generator table. For pentagon we store exact field constants;
54-
// others are extensible placeholders.
55-
export const AFFINE_TABLE = {
56-
5: {
57-
field: 'Q(sqrt5, S)',
58-
// exact circumradius and rotation handled in geometry.js; here we just
59-
// tag that an exact representation exists.
60-
exact: true,
61-
compass: COMPASS[5],
62-
},
63-
};
53+
// Algebraic generator table. For pentagon we store exact field constants;
54+
// others are extensible placeholders.
55+
export const AFFINE_TABLE = {
56+
5: {
57+
field: 'Q(sqrt5, S)',
58+
// exact circumradius and rotation handled in geometry.js; here we just
59+
// tag that an exact representation exists.
60+
exact: true,
61+
compass: COMPASS[5],
62+
},
63+
};
6464

65-
export function affineInfo(n) {
66-
return (
67-
AFFINE_TABLE[n] || {
68-
field: `Q(cos 2pi/${n})`,
69-
exact: n === 3 || n === 4 || n === 6,
70-
compass: COMPASS[n] || null,
71-
}
72-
);
73-
}
65+
export function affineInfo(n) {
66+
return (
67+
AFFINE_TABLE[n] || {
68+
field: `Q(cos 2pi/${n})`,
69+
exact: n === 3 || n === 4 || n === 6,
70+
compass: COMPASS[n] || null,
71+
}
72+
);
73+
}

experiments/Pentagon_Lattice_Geometry/index.html

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ <h1>Multi-Sheeted Pentagon Lattice Lab</h1>
7474
<option value="dodecagon">Regular Dodecagon (n=12)</option>
7575
<option value="custom">Custom n-gon…</option>
7676
<option value="sierpinski">Sierpiński Triangle</option>
77+
<option value="vicsek">Vicsek (Cross) Fractal</option>
7778
</select>
7879
</label>
7980
<label id="customNLabel" style="display: none">
@@ -220,6 +221,34 @@ <h1>Multi-Sheeted Pentagon Lattice Lab</h1>
220221
</label>
221222
</div>
222223
</details>
224+
<details class="section-group" open>
225+
<summary>Path / Distance Tool</summary>
226+
<div class="section-body">
227+
<label>
228+
<input id="pathMode" type="checkbox" />
229+
Path-pick mode (click sets start, then end)
230+
</label>
231+
<div style="margin-top: 6px">
232+
<button id="pathSetStart">Set start = selected</button>
233+
<button id="pathSetEnd">Set end = selected</button>
234+
</div>
235+
<div style="margin-top: 6px">
236+
<button id="pathClear">Clear path</button>
237+
</div>
238+
<label>
239+
<input checked id="pathShowAll" type="checkbox" />
240+
Highlight all shortest paths (not just one)
241+
</label>
242+
<div class="alg-block" id="pathStats" style="margin-top: 8px">
243+
<div>start: <span id="pathStart"></span></div>
244+
<div>end: <span id="pathEnd"></span></div>
245+
<div>hop distance: <span id="pathHops"></span></div>
246+
<div># shortest paths: <span id="pathCount"></span></div>
247+
<div>net sheet shift: <span id="pathSheet"></span></div>
248+
<div>Euclidean dist: <span id="pathEuclid"></span></div>
249+
</div>
250+
</div>
251+
</details>
223252
<details class="section-group" open>
224253
<summary>Cellular Automaton</summary>
225254
<div class="section-body">
@@ -437,4 +466,4 @@ <h1>Multi-Sheeted Pentagon Lattice Lab</h1>
437466
</div>
438467
</div>
439468
</body>
440-
</html>
469+
</html>

0 commit comments

Comments
 (0)