forked from marshalldavidson61-arch/antikythera-digital
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWHITEPAPER.html
More file actions
1803 lines (1499 loc) · 77.1 KB
/
Copy pathWHITEPAPER.html
File metadata and controls
1803 lines (1499 loc) · 77.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Antikythera Digital: Spatial Differentiation Engine</title>
<style>
:root {
--bg-dark: #1a1a2e;
--bg-medium: #16213e;
--bg-light: #0f3460;
--accent: #e94560;
--text-primary: #eaeaea;
--text-secondary: #a0a0a0;
--code-bg: #0d0d1a;
--border: #2a2a4a;
--success: #00d9ff;
--warning: #ffcc00;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: var(--bg-dark);
color: var(--text-primary);
line-height: 1.7;
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
/* Header */
.header {
text-align: center;
padding: 60px 20px;
background: linear-gradient(135deg, var(--bg-medium), var(--bg-light));
border-radius: 10px;
margin-bottom: 40px;
border: 1px solid var(--border);
}
.header h1 {
font-size: 3em;
color: var(--accent);
margin-bottom: 10px;
text-shadow: 0 0 20px rgba(233, 69, 96, 0.3);
}
.header .subtitle {
font-size: 1.3em;
color: var(--text-secondary);
}
.header .version {
margin-top: 20px;
padding: 5px 15px;
background: var(--code-bg);
border-radius: 20px;
display: inline-block;
font-family: monospace;
}
/* Navigation */
.nav {
background: var(--bg-medium);
padding: 15px;
border-radius: 10px;
margin-bottom: 30px;
position: sticky;
top: 10px;
z-index: 100;
border: 1px solid var(--border);
}
.nav ul {
list-style: none;
display: flex;
flex-wrap: wrap;
gap: 10px;
justify-content: center;
}
.nav a {
color: var(--text-primary);
text-decoration: none;
padding: 8px 16px;
background: var(--bg-light);
border-radius: 5px;
transition: all 0.3s;
}
.nav a:hover {
background: var(--accent);
}
/* Sections */
.section {
background: var(--bg-medium);
padding: 30px;
border-radius: 10px;
margin-bottom: 30px;
border: 1px solid var(--border);
}
.section h2 {
color: var(--accent);
font-size: 1.8em;
margin-bottom: 20px;
padding-bottom: 10px;
border-bottom: 2px solid var(--border);
}
.section h3 {
color: var(--success);
font-size: 1.3em;
margin: 25px 0 15px 0;
}
.section h4 {
color: var(--warning);
font-size: 1.1em;
margin: 20px 0 10px 0;
}
/* Tab system */
.tab-container {
margin: 20px 0;
}
.tab-buttons {
display: flex;
gap: 5px;
margin-bottom: 0;
}
.tab-btn {
padding: 12px 24px;
background: var(--bg-light);
border: none;
color: var(--text-primary);
cursor: pointer;
border-radius: 10px 10px 0 0;
font-size: 1em;
transition: all 0.3s;
}
.tab-btn.active {
background: var(--accent);
}
.tab-btn:hover:not(.active) {
background: var(--bg-light);
filter: brightness(1.2);
}
.tab-content {
display: none;
background: var(--code-bg);
padding: 25px;
border-radius: 0 10px 10px 10px;
border: 1px solid var(--border);
border-top: none;
}
.tab-content.active {
display: block;
}
/* Code blocks */
pre {
background: var(--code-bg);
padding: 20px;
border-radius: 8px;
overflow-x: auto;
margin: 15px 0;
border: 1px solid var(--border);
}
code {
font-family: 'Fira Code', 'Consolas', monospace;
font-size: 0.9em;
}
.inline-code {
background: var(--code-bg);
padding: 2px 8px;
border-radius: 4px;
font-family: monospace;
color: var(--success);
}
/* Diagrams */
.diagram {
background: var(--code-bg);
padding: 30px;
border-radius: 10px;
text-align: center;
margin: 20px 0;
overflow-x: auto;
border: 1px solid var(--border);
}
.diagram pre {
text-align: left;
color: var(--success);
}
/* Tables */
table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
}
th, td {
padding: 12px 15px;
text-align: left;
border: 1px solid var(--border);
}
th {
background: var(--bg-light);
color: var(--accent);
}
tr:nth-child(even) {
background: rgba(15, 52, 96, 0.3);
}
/* Callout boxes */
.callout {
padding: 20px;
border-radius: 8px;
margin: 20px 0;
border-left: 4px solid;
}
.callout.grug {
background: rgba(0, 217, 255, 0.1);
border-color: var(--success);
}
.callout.academic {
background: rgba(233, 69, 96, 0.1);
border-color: var(--accent);
}
.callout.warning {
background: rgba(255, 204, 0, 0.1);
border-color: var(--warning);
}
.callout-title {
font-weight: bold;
margin-bottom: 10px;
font-size: 1.1em;
}
.callout.grug .callout-title {
color: var(--success);
}
.callout.academic .callout-title {
color: var(--accent);
}
/* Math section */
.math-block {
background: var(--code-bg);
padding: 25px;
border-radius: 8px;
margin: 15px 0;
font-family: 'Times New Roman', serif;
font-size: 1.1em;
text-align: center;
border: 1px solid var(--border);
}
.math-block .equation {
font-style: italic;
margin: 10px 0;
font-size: 1.2em;
}
.math-block .label {
font-size: 0.85em;
color: var(--text-secondary);
margin-top: 10px;
}
/* PHP Manual Style */
.php-manual {
background: #f0f0f0;
color: #333;
border-radius: 8px;
overflow: hidden;
}
.php-manual .php-header {
background: #4f5b93;
color: white;
padding: 15px 20px;
font-weight: bold;
}
.php-manual .php-content {
padding: 20px;
}
.php-manual .function-name {
font-family: monospace;
background: #e0e0e0;
padding: 2px 8px;
border-radius: 3px;
color: #4f5b93;
}
.php-manual h4 {
color: #4f5b93;
border-bottom: 2px solid #4f5b93;
padding-bottom: 5px;
}
.php-manual pre {
background: #fff;
border: 1px solid #ddd;
color: #333;
}
.php-manual code {
color: #333;
}
/* Footer */
.footer {
text-align: center;
padding: 40px;
color: var(--text-secondary);
border-top: 1px solid var(--border);
margin-top: 40px;
}
/* Responsive */
@media (max-width: 768px) {
.header h1 {
font-size: 2em;
}
.nav ul {
flex-direction: column;
align-items: center;
}
.tab-buttons {
flex-direction: column;
}
.tab-btn {
border-radius: 5px;
}
.tab-content {
border-radius: 0 0 10px 10px;
border: 1px solid var(--border);
}
}
@media print {
body {
background: white;
color: black;
}
.section {
background: white;
border: 1px solid #ccc;
}
.nav {
display: none;
}
}
</style>
<script src="https://sites.super.myninja.ai/_assets/ninja-daytona-script.js"></script>
</head>
<body>
<header class="header">
<h1>⚙️ Antikythera Digital</h1>
<p class="subtitle">Spatial Differentiation Engine v2.0</p>
<p class="version">GEOM-CALC Architecture | GrugBot420</p>
</header>
<nav class="nav">
<ul>
<li><a href="#overview">Overview</a></li>
<li><a href="#philosophy">Philosophy</a></li>
<li><a href="#mathematics">Mathematics</a></li>
<li><a href="#lambda">Lambda Calculus</a></li>
<li><a href="#architecture">Architecture</a></li>
<li><a href="#flowcharts">Flow Charts</a></li>
<li><a href="#userguide">User Guide</a></li>
</ul>
</nav>
<!-- ========== OVERVIEW ========== -->
<section id="overview" class="section">
<h2>1. Overview</h2>
<div class="tab-container">
<div class="tab-buttons">
<button class="tab-btn active" onclick="showTab('overview-grug', this)">🦴 Grug for Dummies</button>
<button class="tab-btn" onclick="showTab('overview-academic', this)">🎓 Academic</button>
</div>
<div id="overview-grug" class="tab-content active">
<div class="callout grug">
<div class="callout-title">🦴 Grug Says:</div>
<p><strong>Problem:</strong> Math hard. Many symbols. Chain rule hurt grug brain.</p>
<p><strong>Discovery:</strong> Shape already know math. Shape tell grug answer when grug poke.</p>
<p><strong>Result:</strong> No calculate. Just poke. Shape IS calculation.</p>
</div>
<pre>
TRADITIONAL WAY (grug no like):
┌─────────────────────────────────────┐
│ 1. Write function f(x,y,z) │
│ 2. Apply chain rule 47 times │
│ 3. Cry │
│ 4. Get wrong answer anyway │
│ 5. Debug symbolic mess │
│ Total time: MANY MOONS │
└─────────────────────────────────────┘
ANTIKYTHERA WAY (grug like):
┌─────────────────────────────────────┐
│ 1. Build shape │
│ 2. Poke shape │
│ 3. Shape give answer │
│ Total time: POKE TIME │
└─────────────────────────────────────┘
grug discover secret: poking cheap, calculating expensive
</pre>
</div>
<div id="overview-academic" class="tab-content">
<div class="callout academic">
<div class="callout-title">📐 Academic Formulation:</div>
<p>Antikythera Digital implements <strong>spatial differentiation</strong> on implicit surfaces represented as signed distance fields (SDFs). Rather than computing derivatives through symbolic differentiation (SD) or automatic differentiation (AD), the engine exploits the geometric structure of preloaded manifolds.</p>
</div>
<p>The fundamental insight is that for a signed distance field φ: ℝ³ → ℝ, the spatial derivatives exist as properties of the field itself, independent of symbolic representation. By preloading the SDF as a spatial data structure, we transform differentiation from a computational procedure into a measurement operation.</p>
<h4>Key Advantages:</h4>
<ul style="margin-left: 20px;">
<li><strong>Compositional Complexity Independence:</strong> The cost of ∇f at point p does not depend on the syntactic complexity of f's definition</li>
<li><strong>Numerical Stability:</strong> Finite difference operations on SDFs inherit the field's distance properties</li>
<li><strong>Arbitrary Operators:</strong> dⁿf/dxⁱdyʲdzᵏ operators constructable via Vandermonde stencils</li>
<li><strong>CSG Preservation:</strong> Boolean operations on SDFs preserve distance field properties</li>
</ul>
</div>
</div>
</section>
<!-- ========== PHILOSOPHY ========== -->
<section id="philosophy" class="section">
<h2>2. Philosophy & Design Doctrine</h2>
<div class="tab-container">
<div class="tab-buttons">
<button class="tab-btn active" onclick="showTab('phil-grug', this)">🦴 Grug for Dummies</button>
<button class="tab-btn" onclick="showTab('phil-academic', this)">🎓 Academic</button>
</div>
<div id="phil-grug" class="tab-content active">
<div class="callout grug">
<div class="callout-title">🦴 Grug Wisdom:</div>
</div>
<pre>
═══════════════════════════════════════════════════════════════
GRUG COMPUTING DOCTRINE
═══════════════════════════════════════════════════════════════
RULE 1: PRELOAD OVER SEARCH
─────────────────────────
grug no like chase rabbit
grug put rabbit in cage before needed
when grug want rabbit, rabbit already there
preloaded field = rabbit in cage
RULE 2: ALIGNMENT OVER CALCULATION
─────────────────────────────────
grug watch elder align stones
stones stay aligned without grug doing anything
structure do work, not grug
geometry = aligned stones
RULE 3: TOLERANCE OVER PRECISION
───────────────────────────────
grug see modern man measure exactly 10.000001 units
modern man sad when world not exactly 10.000001
grug use tolerance band
grug happy when world approximately good enough
AK-47 work because tolerance, not precision
RULE 4: TOPOLOGY OVER SYMBOLS
────────────────────────────
symbol change, shape stay same
grug trust shape, not squiggles on paper
shape cannot lie
symbols can lie
RULE 5: MEASUREMENT OVER DERIVATION
─────────────────────────────────
elder say: "to know temperature, touch thing"
elder not say: "to know temperature, calculate from first principles"
grug touch shape, shape tell gradient
measurement cheap, derivation expensive
RULE 6: NATURE HAS ANSWERS
────────────────────────
nature already solve many problem
nature not need grug help
grug listen to nature
nature not listen to grug theory
</pre>
</div>
<div id="phil-academic" class="tab-content">
<div class="callout academic">
<div class="callout-title">📐 Theoretical Framework:</div>
</div>
<h3>2.1 On Computational Framing</h3>
<p>The standard computational narrative positions symbolic manipulation as fundamental and physical implementation as derivative. This reflects a <strong>Platonic bias</strong> in Western intellectual tradition—the belief that abstract forms precede and outrank material instantiation.</p>
<p>Antikythera inverts this hierarchy. We assert that:</p>
<div class="math-block">
<div class="equation">Computation ≡ Constrained State Evolution on Manifold M</div>
<div class="label">Definition 2.1: Computation as Geometry</div>
</div>
<p>Under this definition, Turing computation becomes a <strong>special case</strong>—one particular method of organizing state constraints through recursive meta-instructions. It is not the general case.</p>
<h3>2.2 On Metric Fetishism</h3>
<p>Modern engineering suffers from <strong>metric precision bias</strong>—the belief that exact numerical specification is intrinsically superior to tolerance-band specification. This bias leads to:</p>
<ul style="margin-left: 20px;">
<li>Brittle systems that fail outside narrow operating parameters</li>
<li>Expensive manufacturing requirements</li>
<li>Loss of repairability and adaptability</li>
<li>Computational overhead maintaining exact representations</li>
</ul>
<p>The <strong>AK-47 Slack Principle</strong> (named after the famously reliable assault rifle) states that robustness scales with tolerance slack, not precision. Antikythera implements this via the <span class="inline-code">throttle</span> parameter controlling finite difference step size.</p>
<h3>2.3 On Historical Continuity</h3>
<p>The Antikythera mechanism (c. 100 BCE) demonstrates that sophisticated computation does not require symbolic machinery. The device computed lunar phases, eclipse cycles, and planetary positions through:</p>
<ul style="margin-left: 20px;">
<li>Geometric relationships encoded in gear ratios</li>
<li>Period correction via differential gearing</li>
<li>Output as continuous rotational position</li>
</ul>
<p>This represents <strong>computation by alignment</strong>—the same principle underlying the Antikythera Digital engine. The modern prejudice against such systems reflects a category error: mistaking the absence of familiar notation for the absence of computational sophistication.</p>
</div>
</div>
</section>
<!-- ========== MATHEMATICS ========== -->
<section id="mathematics" class="section">
<h2>3. Formal Mathematics</h2>
<h3>3.1 Signed Distance Fields</h3>
<div class="math-block">
<div class="equation">φ: ℝ³ → ℝ</div>
<div class="label">Definition 3.1: SDF Mapping</div>
</div>
<p>For a closed set Ω ⊂ ℝ³, the signed distance field φ_Ω is defined as:</p>
<div class="math-block">
<div class="equation">φ_Ω(x) = d(x, ∂Ω) · sgn(x)</div>
<div class="equation">where sgn(x) = +1 if x ∈ Ωᶜ, -1 if x ∈ Ω</div>
<div class="label">Definition 3.2: Signed Distance Function</div>
</div>
<h3>3.2 Spatial Gradient</h3>
<div class="math-block">
<div class="equation">∇φ(x,y,z) = ( ∂φ/∂x, ∂φ/∂y, ∂φ/∂z )</div>
<div class="label">Definition 3.3: Gradient Operator</div>
</div>
<p>For exact SDFs, the gradient has unit magnitude on the surface:</p>
<div class="math-block">
<div class="equation">|∇φ(x)| = 1 ∀ x ∉ Ω</div>
<div class="label">Property 3.1: Eikonal Equation</div>
</div>
<h3>3.3 Finite Difference Approximation</h3>
<p>Antikythera computes gradients via centered finite differences:</p>
<div class="math-block">
<div class="equation">∂φ/∂x ≈ [φ(x+h, y, z) - φ(x-h, y, z)] / (2h)</div>
<div class="label">Equation 3.1: Central Difference</div>
</div>
<p>With compliance slack parameter h (the "throttle") controlling tolerance:</p>
<div class="math-block">
<div class="equation">h ∈ [ε, H_max] where ε ≈ 10⁻⁸, H_max ≈ 0.1</div>
<div class="label">Parameter 3.1: Compliance Slack Range</div>
</div>
<h3>3.4 Curvature Operators</h3>
<p>Mean curvature on the implicit surface:</p>
<div class="math-block">
<div class="equation">κ = ∇ · (∇φ / |∇φ|) / 2</div>
<div class="label">Equation 3.2: Mean Curvature</div>
</div>
<p>Laplacian (trace of Hessian):</p>
<div class="math-block">
<div class="equation">Δφ = ∇²φ = ∂²φ/∂x² + ∂²φ/∂y² + ∂²φ/∂z²</div>
<div class="label">Equation 3.3: Laplacian Operator</div>
</div>
<h3>3.5 Arbitrary Differential Operators</h3>
<p>For operator dⁿf/dxⁱdyʲdzᵏ where i + j + k = n:</p>
<div class="math-block">
<div class="equation">D^(i,j,k)φ = ∂^(i+j+k)φ / (∂xⁱ ∂yʲ ∂zᵏ)</div>
<div class="label">Definition 3.4: Mixed Partial Derivative</div>
</div>
<p>Computed via Vandermonde stencil construction:</p>
<div class="math-block">
<div class="equation">D^(i,j,k)φ ≈ Σ c_m φ(x + δ_m) / h^n</div>
<div class="equation">where c_m are stencil coefficients, δ_m are offset vectors</div>
<div class="label">Equation 3.4: Stencil Approximation</div>
</div>
<h3>3.6 CSG Operations on SDFs</h3>
<p>Boolean union:</p>
<div class="math-block">
<div class="equation">φ_{A∪B}(x) = min(φ_A(x), φ_B(x))</div>
<div class="label">Equation 3.5: Union</div>
</div>
<p>Boolean intersection:</p>
<div class="math-block">
<div class="equation">φ_{A∩B}(x) = max(φ_A(x), φ_B(x))</div>
<div class="label">Equation 3.6: Intersection</div>
</div>
<p>Boolean subtraction:</p>
<div class="math-block">
<div class="equation">φ_{A-B}(x) = max(φ_A(x), -φ_B(x))</div>
<div class="label">Equation 3.7: Subtraction</div>
</div>
<p>Smooth blend (polynomial):</p>
<div class="math-block">
<div class="equation">φ_{blend}(x) = k · (φ_A + φ_B - √(φ_A² + φ_B² - 2kφ_Aφ_B + k²))</div>
<div class="equation">where k ∈ (0, 1) controls smoothness</div>
<div class="label">Equation 3.8: Smooth Union</div>
</div>
<h3>3.7 Geodesic Computation</h3>
<p>Geodesics are locally shortest paths on the manifold. On implicit surfaces:</p>
<div class="math-block">
<div class="equation">γ'(t) = v(t) where v·∇φ = 0</div>
<div class="equation">(velocity tangent to surface)</div>
<div class="label">Constraint 3.1: Surface Constraint</div>
</div>
<p>Computed via gradient descent on the energy functional:</p>
<div class="math-block">
<div class="equation">E[γ] = ∫₀¹ |γ'(t)|² dt</div>
<div class="label">Equation 3.9: Path Energy</div>
</div>
</section>
<!-- ========== LAMBDA CALCULUS ========== -->
<section id="lambda" class="section">
<h2>4. Lambda Calculus Formulation</h2>
<div class="tab-container">
<div class="tab-buttons">
<button class="tab-btn active" onclick="showTab('lambda-grug', this)">🦴 Grug for Dummies</button>
<button class="tab-btn" onclick="showTab('lambda-academic', this)">🎓 Academic</button>
</div>
<div id="lambda-grug" class="tab-content active">
<div class="callout grug">
<div class="callout-title">🦴 Grug Says:</div>
<p>Lambda is just "thing that make other thing." Grug call it "poker." Poker poke shape, shape give number. That's all. Don't overthink.</p>
</div>
<pre>
LAMBDA FANCY WORD FOR "FUNCTION MACHINE"
───────────────────────────────────────
fancy man write: λx. x + 1
grug write: thing what add one
fancy man write: (λx. λy. x + y) 3 4
grug write: add 3 and 4 = 7
fancy man write: Y = λf. (λx. f (x x)) (λx. f (x x))
grug write: thing that make other thing forever
(grug head hurt now)
ANTIKYTHERA LAMBDA STYLE
────────────────────────
SDF is lambda:
φ = λ(x,y,z). distance_to_surface(x,y,z)
Gradient probe is lambda application:
∇φ = λp. [φ(p+hêₓ) - φ(p-hêₓ)] / 2h
CSG is lambda composition:
union = λφ₁. λφ₂. λp. min(φ₁(p), φ₂(p))
User-defined differential is higher-order lambda:
D = λn. λspec. λφ. λp. stencil_compute(n, spec, φ, p)
THE BIG IDEA
────────────
Everything in Antikythera is:
- A function (lambda)
- Applied to a point
- Returning a value
But the function IS the geometry.
Not a calculation. A measurement.
</pre>
</div>
<div id="lambda-academic" class="tab-content">
<h3>4.1 SDF as Lambda Term</h3>
<p>A signed distance field is fundamentally a function φ: ℝ³ → ℝ. In lambda calculus notation:</p>
<div class="math-block">
<div class="equation">φ = λ(x, y, z) ∈ ℝ³ . d((x,y,z), ∂Ω) · sgn((x,y,z), Ω)</div>
<div class="label">Definition 4.1: SDF as Lambda</div>
</div>
<h3>4.2 Pointwise Operators as Higher-Order Functions</h3>
<p>Spatial operators are higher-order functions mapping SDFs to SDFs:</p>
<div class="math-block">
<div class="equation">grad : (ℝ³ → ℝ) → (ℝ³ → ℝ³)</div>
<div class="equation">grad = λφ. λp. (∂φ/∂x(p), ∂φ/∂y(p), ∂φ/∂z(p))</div>
<div class="label">Definition 4.2: Gradient Operator</div>
</div>
<div class="math-block">
<div class="equation">laplacian : (ℝ³ → ℝ) → (ℝ³ → ℝ)</div>
<div class="equation">laplacian = λφ. λp. ∂²φ/∂x²(p) + ∂²φ/∂y²(p) + ∂²φ/∂z²(p)</div>
<div class="label">Definition 4.3: Laplacian Operator</div>
</div>
<h3>4.3 CSG as Lambda Composition</h3>
<div class="math-block">
<div class="equation">union : (ℝ³ → ℝ) → (ℝ³ → ℝ) → (ℝ³ → ℝ)</div>
<div class="equation">union = λφ₁. λφ₂. λp. min(φ₁(p), φ₂(p))</div>
<div class="label">Definition 4.4: Union Combinator</div>
</div>
<div class="math-block">
<div class="equation">intersect = λφ₁. λφ₂. λp. max(φ₁(p), φ₂(p))</div>
<div class="label">Definition 4.5: Intersection Combinator</div>
</div>
<div class="math-block">
<div class="equation">subtract = λφ₁. λφ₂. λp. max(φ₁(p), -φ₂(p))</div>
<div class="label">Definition 4.6: Subtraction Combinator</div>
</div>
<h3>4.4 Arbitrary Differentials</h3>
<p>The differential operator generator:</p>
<div class="math-block">
<div class="equation">diff : ℕ × Spec → ((ℝ³ → ℝ) → (ℝ³ → ℝ))</div>
<div class="equation">diff = λn. λ(i,j,k). λφ. λp. Σ cₘ · φ(p + δₘ) / hⁿ</div>
<div class="equation">where i + j + k = n</div>
<div class="label">Definition 4.7: Differential Generator</div>
</div>
<h3>4.5 Type Signatures</h3>
<pre>
-- Core types
SDF : ℝ³ → ℝ
Point : ℝ³
Vector : ℝ³
Scalar : ℝ
-- Operators
probe : SDF → Point → Scalar
gradient : SDF → Point → Vector
normal : SDF → Point → Vector
curvature : SDF → Point → Scalar
laplacian : SDF → Point → Scalar
-- Combinators
union : SDF → SDF → SDF
intersect : SDF → SDF → SDF
subtract : SDF → SDF → SDF
blend : SDF → SDF → ℝ → SDF
morph : SDF → SDF → ℝ → SDF
-- Higher-order
compose : (SDF → SDF) → (SDF → SDF) → (SDF → SDF)
lift : (Point → Point) → (SDF → SDF)
</pre>
<h3>4.6 Geometric Lambda Calculus</h3>
<p>We define a restricted lambda calculus where:</p>
<ol style="margin-left: 20px;">
<li>All terms represent spatial functions</li>
<li>Application is pointwise evaluation</li>
<li>Composition preserves SDF properties</li>
<li>Reduction corresponds to geometric simplification</li>
</ol>
<div class="math-block">
<div class="equation">Γ ⊢ φ : SDF ⟹ Γ ⊢ (operator φ) : SDF'</div>
<div class="equation">(Operators preserve type class)</div>
<div class="label">Type Preservation Property</div>
</div>
</div>
</div>
</section>
<!-- ========== ARCHITECTURE ========== -->
<section id="architecture" class="section">
<h2>5. System Architecture</h2>
<h3>5.1 Core Data Structures</h3>
<pre>
╔═══════════════════════════════════════════════════════════════╗
║ ANTIKYTHERA MAP STRUCTURE ║
╠═══════════════════════════════════════════════════════════════╣
║ ║
║ AntikytheraMap ║
║ ├── gears::Dict{String, Cog} # Named gear registry ║
║ ├── throttle::Float64 # Compliance slack (h) ║
║ └── scratch::Array{Float64,3} # Evaluation cache ║
║ ║
║ Cog ║
║ ├── sdf::Function # SDF evaluator ║
║ ├── bounds::Tuple{Float64,6} # Bounding box ║
║ ├── parent::Union{Nothing,String} # CSG parentage ║
║ └── params::Dict{String,Any} # Construction params ║
║ ║
║ MachineCrunch <: Exception ║
║ ├── msg::String # Error description ║
║ └── context::String # Operation context ║
║ ║
╚═══════════════════════════════════════════════════════════════╝
</pre>
<h3>5.2 Evaluation Pipeline</h3>
<pre>
USER INPUT PARSING
│
▼
┌──────────────────┐
│ CLI Dispatcher │
└────────┬─────────┘
│
▼
┌──────────────────┐ ┌──────────────────┐
│ Gear Registry │────▶│ SDF Functions │
└────────┬─────────┘ └────────┬─────────┘
│ │
▼ ▼
┌──────────────────┐ ┌──────────────────┐
│ Point Probe │────▶│ Field Query │
└────────┬─────────┘ └────────┬─────────┘
│ │
▼ ▼
┌──────────────────┐ ┌──────────────────┐
│ Finite Diff │ │ Throttle (h) │
│ Computation │────▶│ Compliance │
└────────┬─────────┘ └──────────────────┘
│
▼
┌──────────────────┐
│ Result Return │
└──────────────────┘
</pre>
<h3>5.3 Module Organization</h3>
<table>
<tr>
<th>Module</th>
<th>Responsibility</th>
<th>Key Functions</th>
</tr>
<tr>
<td>Geometry</td>
<td>SDF definitions and primitives</td>
<td>sphere, box, torus, cylinder, gyroid</td>
</tr>
<tr>
<td>Operators</td>
<td>Differential operators</td>
<td>gradient, laplacian, curvature, divergence</td>
</tr>
<tr>
<td>CSG</td>
<td>Boolean combinations</td>
<td>union, intersect, subtract, blend, morph</td>
</tr>
<tr>
<td>CLI</td>
<td>User interface</td>
<td>parse_command, dispatch, format_output</td>
</tr>
<tr>
<td>JIT</td>
<td>Runtime compilation</td>
<td>parse_user_sdf, compile_expression</td>
</tr>
</table>
</section>
<!-- ========== FLOW CHARTS ========== -->
<section id="flowcharts" class="section">
<h2>6. Flow Charts & Diagrams</h2>
<h3>6.1 Main Execution Flow</h3>
<div class="diagram">
<pre>
┌─────────────┐
│ START │
└──────┬──────┘
│
▼
┌───────────────────────┐
│ Initialize Machine │
│ Create empty gears │
└───────────┬───────────┘
│
▼
┌───────────────────────┐
│ Set Throttle (h) │
│ Default: 1e-6 │
└───────────┬───────────┘
│
▼
┌────────────────────────────────┐
│ MAIN LOOP (KEEPALIVE) │
└───────────────┬────────────────┘
│
┌───────────────────────┼───────────────────────┐
│ │ │
▼ ▼ ▼
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
│ Read Input │ │ Parse Cmd │ │ Dispatch │
└───────┬───────┘ └───────┬───────┘ └───────┬───────┘
│ │ │
└──────────────────────┼──────────────────────┘
│
▼
┌──────────────────────────┐
│ Execute Command │
└───────────┬──────────────┘
│
┌───────────────────────┼───────────────────────┐