Slide 1

Slide 1 text

bsky.chewxy.com F()-ing Cox-Zucker Tunes a MA Screw unto a Kummer Surface
 Chewxy bsky.chewxy.com

Slide 2

Slide 2 text

bsky.chewxy.com of 
 the 
 Meta
 Diagonalization


Slide 3

Slide 3 text

bsky.chewxy.com 想像象相 “Yeah, I think it did. The boys still at their Matrix marathon?”
 Viv nodded. “Why didn’t you join them Audrey? You love The Matrix.”
 “Fourth one soured me to it. Neo ended up back in the Matrix”
 “Ah, that’s where you got it wrong. See, the matrix is defective. It’s never about escaping the matrix. It’s really about reducing the matrix to its eigenbasis. Once you have found your eigenvectors and eigenvalues, then you can orthogonalize the subspace,” said Edith, before finishing with a flourish, “Then you’re the Superman. The Thought Robot.”


Slide 4

Slide 4 text

bsky.chewxy.com "Yeah, I think it did. The boys still at their Matrix marathon?"
 Viv nodded. "Why didn't you join them Audrey? You love The Matrix."
 "Fourth one soured me to it. Neo ended up back in the Matrix"
 "Ah, that's where you got it wrong. See, the matrix is defective. It was never about leaving. It’s all about reducing the matrix to its eigenbasis. Once you have found your eigenvectors and dominant eigenvalues, you can then orthogonalize the subspace," said Edith before finishing with a flourish, “then, you’ll be free”
 Mort chuckled as Audrey playfully punched her elder sister.


Slide 5

Slide 5 text

bsky.chewxy.com Writers build worlds.
 World-building work.
 起

Slide 6

Slide 6 text

bsky.chewxy.com I am a poor visualizer.


Slide 7

Slide 7 text

bsky.chewxy.com Stability Precision Aphantasia

Slide 8

Slide 8 text

bsky.chewxy.com Stability Precision Aphantasia Me

Slide 9

Slide 9 text

bsky.chewxy.com Stability Precision Aphantasia Me Me + LSD Me + Vyvanse Me + Cannabis Me + Alcohol

Slide 10

Slide 10 text

bsky.chewxy.com Show, Don’t Tell


Slide 11

Slide 11 text

bsky.chewxy.com Mathematical worldbuilding is precise and stable.


Slide 12

Slide 12 text

bsky.chewxy.com Constructing the Universe
 1. Find an elliptic curve E. 2. Parameterize by t to make it a screw. 3. Find the cross product E × E. 4. Apply an involution function (a1, a2) ↦ (-a1, -a2) . 5. Fibrate over P1 into an elliptic surface. 6. Apply Cox-Zucker machine to find basis. 7. ??? 8. Profit!

Slide 13

Slide 13 text

bsky.chewxy.com Side Note: Screwing and Kummer Surfaces
 Credit: wikimedia commons Credit: wikipedia on Kummer surfaces

Slide 14

Slide 14 text

bsky.chewxy.com What is a Cox-Zucker?
 承

Slide 15

Slide 15 text

bsky.chewxy.com Cox-Zucker Machine
 This algorithm determines whether a given set of sections provides a basis (up to torsion) for the Mordell–Weil group of an elliptic surface E → S, where S is isomorphic to the projective line. (Wikipedia)

Slide 16

Slide 16 text

bsky.chewxy.com Cox-Zucker Machine
 This algorithm determines whether a given set of sections provides a basis (up to torsion) for the Mordell–Weil group of an elliptic surface E → S, where S is isomorphic to the projective line. (Wikipedia) 󰷺󰷺󰷺

Slide 17

Slide 17 text

bsky.chewxy.com Cox-Zucker Machine
 This algorithm determines whether a given set of sections provides a basis (up to torsion) for the Mordell–Weil group of an elliptic surface E → S, where S is isomorphic to the projective line. (Wikipedia)

Slide 18

Slide 18 text

bsky.chewxy.com Elliptic Curves & Surfaces


Slide 19

Slide 19 text

bsky.chewxy.com Elliptic Curves
 y2 = x3 + ax + b Picture of Elliptic Curve

Slide 20

Slide 20 text

bsky.chewxy.com Elliptic Curves
 y2 = x3 + ax + b Picture of Elliptic Curve type EC struct { a, b int } func (c *EC) Eval1(x int) int { y2 := x*x*x + c.a*x + c.b return sqrt(y2) } func (c *EC) Eval2(x, y int) int { return y*y + c.Eval1(x) }

Slide 21

Slide 21 text

bsky.chewxy.com Elliptic Curves Are Surfaces
 y2 = x3 + ax + b z = -y2 + x3 + ax + b

Slide 22

Slide 22 text

bsky.chewxy.com Elliptic Curves Are Surfaces
 z = -y2 + x3 + ax + b type EC struct { a, b int } func (c *EC) Eval1(x int) int { y2 := x*x*x + c.a*x + c.b return sqrt(y2) } func (c *EC) Eval2(x, y int) int { return y*y + c.Eval1(x) }

Slide 23

Slide 23 text

bsky.chewxy.com Elliptic Surfaces
 An elliptic surface is a surface with an elliptic fibration.

Slide 24

Slide 24 text

bsky.chewxy.com Elliptic Surfaces
 An elliptic surface is a surface with an elliptic fibration.

Slide 25

Slide 25 text

bsky.chewxy.com A Fibration is a Generic Fibre Bundle
 The surface of a cylinder can be thought of as a bundle of fibres going from the base space of a circle. The surface of a Möbius strip can be thought of as a bundle of fibres going from a base space of a circle.

Slide 26

Slide 26 text

bsky.chewxy.com Elliptic Surfaces
 An elliptic surface is a surface with an elliptic fibration.

Slide 27

Slide 27 text

bsky.chewxy.com Elliptic Surface


Slide 28

Slide 28 text

bsky.chewxy.com Elliptic Surface
 y2 = x3 + A(t)x + B(t)x

Slide 29

Slide 29 text

bsky.chewxy.com Elliptic Curve
 y2 = x3 + ax + bx

Slide 30

Slide 30 text

bsky.chewxy.com Elliptic Surface
 y2 = x3 + A(t)x + B(t)x Polynomials A(t) = ɑtn + βtn-1 + … + ψt1 + ⍵t0

Slide 31

Slide 31 text

bsky.chewxy.com // Q is a representation of a rat number. type Q big.Rat // Section is a section on an elliptic surface type Section struct { x, y QFn } // Polynomial is a representation of a polynomial. // The slice stores coefficients in ascending order of power. type Poly []*Q // QFn represents a rational function. type QFn struct { n, d Poly } // Point is a point on an elliptic curve. type Point struct { x, y *Q } // EC represents an elliptic curve. type EC struct { a, b *Q points []Point } Elliptic Curve & Surface
 // ES represents an elliptic surface. type ES struct { a, b QFn sections []*Section }

Slide 32

Slide 32 text

bsky.chewxy.com Cox-Zucker Machine
 This algorithm determines whether a given set of sections provides a basis (up to torsion) for the Mordell–Weil group of an elliptic surface E → S, where S is isomorphic to the projective line. (Wikipedia)

Slide 33

Slide 33 text

bsky.chewxy.com Cox-Zucker Machine
 This algorithm determines whether a given set of sections provides a basis (up to torsion) for the Mordell–Weil group of an elliptic surface E → S, where S is isomorphic to the projective line. (Wikipedia)

Slide 34

Slide 34 text

bsky.chewxy.com Basis


Slide 35

Slide 35 text

bsky.chewxy.com Basis
 Towards Sentosa (infinitely far away) Towards Tekong (infinitely far away)

Slide 36

Slide 36 text

bsky.chewxy.com Basis
 Directions to Marina Bay Sands from JW Marriott: 1. 1.85 km towards Tekong 2. 2.54 km towards Sentosa Marina Bay Sands = 1.85T + 2.54S 1km 1km

Slide 37

Slide 37 text

bsky.chewxy.com Basis
 = 1.85 + 2.54 (1.85, 2.54)

Slide 38

Slide 38 text

bsky.chewxy.com Basis
 = (1, 0) = (0, 1)

Slide 39

Slide 39 text

bsky.chewxy.com Basis
 = 1.85 + 2.54

Slide 40

Slide 40 text

bsky.chewxy.com Basis
 = 1.85 + 2.54 Defining + is doable but difficult

Slide 41

Slide 41 text

bsky.chewxy.com Basis
 Phua

Slide 42

Slide 42 text

bsky.chewxy.com Basis
 Towards Batam (infinitely far away) Towards JB (infinitely far away) Phua

Slide 43

Slide 43 text

bsky.chewxy.com Towards North Towards East Orthonormal Basis


Slide 44

Slide 44 text

bsky.chewxy.com What if your world is not a vector space?


Slide 45

Slide 45 text

bsky.chewxy.com What is a “basis” for this?
 y2 = x3 + ax2 + b Picture of Elliptic Curve

Slide 46

Slide 46 text

bsky.chewxy.com Collinear Points
 P + Q + R = 0 Picture of Elliptic Curve P Q R

Slide 47

Slide 47 text

bsky.chewxy.com Collinear Points
 P + Q = -R Picture of Elliptic Curve P Q R

Slide 48

Slide 48 text

bsky.chewxy.com Cox-Zucker Machine
 This algorithm determines whether a given set of sections provides a basis (up to torsion) for the Mordell–Weil group of an elliptic surface E → S, where S is isomorphic to the projective line. (Wikipedia)

Slide 49

Slide 49 text

bsky.chewxy.com Cox-Zucker Machine
 This algorithm determines whether a given set of sections provides a basis (up to torsion) for the Mordell–Weil group of an elliptic surface E → S, where S is isomorphic to the projective line. (Wikipedia)

Slide 50

Slide 50 text

bsky.chewxy.com A Group is:
 A set of things, A A binary operation, · such that a · b = c, where a, b, c ∈ A A = ℤ = {..., -3, -2, -1, 0, 1, 2, 3,…} + type Int int func Add(a, b Int) Int { return a + b } Rules ● A has identity/“zero” element ● (a · b) · c = a · (b· c) type String string func Add(a, b String) String { return a + b }

Slide 51

Slide 51 text

bsky.chewxy.com A Group is:
 A set of things, A A binary operation, · such that a · b = c, where a, b, c ∈ A A = ℤ = {..., -3, -2, -1, 0, 1, 2, 3,…} + type Int int func Add(a, b Int) Int { return a + b } Rules ● A has identity/“zero” element ● (a · b) · c = a · (b· c) ● a · b = b · a ● A has inverse element type String string func Add(a, b String) String { return a + b }

Slide 52

Slide 52 text

bsky.chewxy.com A Group is:
 A set of things, A A binary operation, · such that a · b = c, where a, b, c ∈ A A = ℤ = {..., -3, -2, -1, 0, 1, 2, 3,…} + type Int int func (a Int) Add(b Int) Int { return a + b } Rules ● A has identity/“zero” element ● (a · b) · c = a · (b· c) ● a · b = b · a ● A has inverse element type String string func Add(a, b String) String { return a + b } // Not handled: commutativity and associativity. type Group interface { Add(elem Group) Group Neg() Group }

Slide 53

Slide 53 text

bsky.chewxy.com A Magma is:
 A set of things, A A binary operation, · such that a · b = c, where a, b, c ∈ A A = ℤ = {..., -3, -2, -1, 0, 1, 2, 3,…} + type Int int type String string func (a String) Add(b String) String { return a + b } func (a Int) Add(b Int) Int { return a + b } type Magma interface { Add(elem Magma) Magma IsZero() bool }

Slide 54

Slide 54 text

bsky.chewxy.com Cox-Zucker Machine
 This algorithm determines whether a given set of sections provides a basis (up to torsion) for the Mordell–Weil group of an elliptic surface E → S, where S is isomorphic to the projective line. (Wikipedia) Set of points on the surface whose coordinates are rational numbers

Slide 55

Slide 55 text

bsky.chewxy.com Cox-Zucker Machine
 This algorithm determines whether a given set of sections provides a basis (up to torsion) for the Mordell–Weil group of an elliptic surface E → S, where S is isomorphic to the projective line. (Wikipedia) Set of points on the surface whose coordinates are rational numbers

Slide 56

Slide 56 text

bsky.chewxy.com // QFn represents a rational function. type QFn struct { n, d Poly } // ES represents an elliptic surface. type ES struct { a, b QFn sections []*Section } // EC represents an elliptic curve. type EC struct { a, b *Q points []Point } // Q is a representation of a rat number. type Q struct { n, d *big.Int } // Section is a section on an elliptic surface type Section struct { x, y QFn } // Polynomial is a representation of a polynomial. // The slice stores coefficients in ascending order of power. type Poly []*Q // Point is a point on an elliptic curve. type Point struct { x, y *Q } Elliptic Curve & Surface


Slide 57

Slide 57 text

bsky.chewxy.com Cox-Zucker Machine
 This algorithm determines whether a given set of sections provides a basis (up to torsion) for the Mordell–Weil group of an elliptic surface E → S, where S is isomorphic to the projective line. (Wikipedia) set of points Set of points on the surface whose coordinates are rational numbers

Slide 58

Slide 58 text

bsky.chewxy.com Cox-Zucker Machine
 This algorithm determines whether a given set of sections provides a basis (up to torsion) for the Mordell–Weil group of an elliptic surface E → S, where S is isomorphic to the projective line. (Wikipedia) set of points Set of points on the surface whose coordinates are rational numbers

Slide 59

Slide 59 text

bsky.chewxy.com The Algorithm in Words
 {σ i …σ r } is a basis of the Mordell-Weil group if and only if: det(<σ i , σ j >) = N2 / Πm s 
 
 m s is the number of components of multiplicity 1 N is the number of elements in the torsion subgroup of the Mordell-Weil Group r is the rank of the Mordell-Weil Group

Slide 60

Slide 60 text

bsky.chewxy.com The Algorithm
 n := len(sections) mat := make([][]*Q, n) for i := range mat { mat[i] = make([]*Q, n) } for i := 0; i < n; i++ { for j := 0; j < n; j++ { mat[i][j] = es.HeightPair(sections[i], sections[j]) } } det := qMatDet(mat) thresh := ExpectedDeterminant(es) return det.Eq(thresh)

Slide 61

Slide 61 text

bsky.chewxy.com The Algorithm to Find Bases
 for _, s := range e.MordellWeilLat { if e.F().CoxZucker(s){ bases = append(bases, s) } }

Slide 62

Slide 62 text

bsky.chewxy.com Cox-Zucker in Action
 u.F().CoxZucker()

Slide 63

Slide 63 text

bsky.chewxy.com 111 Words.
 4977 Lines of Code.


Slide 64

Slide 64 text

bsky.chewxy.com 111 Words, 4977 Lines of Code.
 Four lines, stark as dead pixels on a blazing white OLED screen, dissolves into view. Orthogonal to each other, they intersect at sixteen nodal points, their vector dance playing out in every direction – ahead of, behind, and through Mort. A grey volume precipitates from these lines, sweeping across space to connect the dark axes. This precision-crafted mirage skews, rotates then disintegrates
 A different set of four lines appear. Again, a grey volume materializes, only to vanish after a scale and tilt. This sequence repeats, hypnotic – lines shifting, grey form cohering, size changing, dissolving – an infinite recursion of ephemeral functions. Then, sudden stillness: the grey volume suffusing space, stark lines permeating every dimension.


Slide 65

Slide 65 text

bsky.chewxy.com Why I am not releasing the library
 转

Slide 66

Slide 66 text

bsky.chewxy.com Evolution of the 
 data types in the library


Slide 67

Slide 67 text

bsky.chewxy.com // QFn represents a rational function. type QFn struct { n, d Poly } // ES represents an elliptic surface. type ES struct { a, b QFn sections []*Section } // EC represents an elliptic curve. type EC struct { a, b *Q points []Point } // Q is a representation of a rat number. type Q big.Rat // Section is a section on an elliptic surface type Section struct { x, y QFn } // Polynomial is a representation of a polynomial. // The slice stores coefficients in ascending order of power. type Poly []*Q // Point is a point on an elliptic curve. type Point struct { x, y *Q } Elliptic Curve & Surface


Slide 68

Slide 68 text

bsky.chewxy.com Elliptic Curve Day 1
 // EC represents an elliptic curve. type EC struct { a, b int points []Point }

Slide 69

Slide 69 text

bsky.chewxy.com Sidequest: Polynomials
 // Poly represents the coefficients of a polynomial function. type Poly []int func (p Poly) Add(q Poly) Poly { ... } func (p Poly) Mul(q Poly) Poly { ... } func (p Poly) GCD(q Poly) Poly { ... }

Slide 70

Slide 70 text

bsky.chewxy.com Sidequest: Polynomials
 // Poly represents the coefficients of a polynomial function. type Poly []int func (p Poly) Add(q Poly) Poly { ... } func (p Poly) Mul(q Poly) Poly { ... } func (p Poly) GCD(q Poly) Poly { ... } func TestPolyGCD(t *testing.T) { p := Poly{1, 2, 3} q := Poly{2, 4, 6} t.Logf("%v\n%v", p, q) gcd := p.GCD(q) if len(gcd) != 3 { t.Errorf("len(gcd) = %d, want 3", len(gcd)) }

Slide 71

Slide 71 text

bsky.chewxy.com Elliptic Curve Day 2
 // EC represents an elliptic curve over a rational field type EC struct { a, b Q points []Point } type Poly []Q type Q struct { N, D int }

Slide 72

Slide 72 text

bsky.chewxy.com Elliptic Curve Day 3
 // EC represents an elliptic curve over a rational field type EC struct { a, b *Q points []Point } type Poly []*Q type Q = big.Rat

Slide 73

Slide 73 text

bsky.chewxy.com Then I got greedy.


Slide 74

Slide 74 text

bsky.chewxy.com Elliptic Curve Definition
 An elliptic curve is defined over a field K and describes points in K2. (Wikipedia)

Slide 75

Slide 75 text

bsky.chewxy.com What If We Could Genericize?
 An elliptic curve is defined over a field K and describes points in K2. // EC represents an elliptic curve over a rational field type EC struct { a, b *Q points []Point }

Slide 76

Slide 76 text

bsky.chewxy.com What If We Could Genericize?
 An elliptic curve is defined over a field K and describes points in K2. // EC represents an elliptic curve over a rational field K type EC struct { a, b ??? points []Point }

Slide 77

Slide 77 text

bsky.chewxy.com Generics
 // EC represents an elliptic curve over a field f type EC[K Field] struct { a, b K points []Point[K] } // Field is a representation of an abstract, finite field. type Field interface { Add(x Num) Num Sub(x Num) Num Mul(x Num) Num Div(x Num) Num Neg() Num IsZero(x Num) bool CharNum() int }

Slide 78

Slide 78 text

bsky.chewxy.com Alternative
 // Field is a representation of an abstract, finite field. type Field[T any] interface { Add(x, y T) T Sub(x, y T) T Mul(x, y T) T Div(x, y T) T Neg(x T) T IsZero(x T) bool CharNum() int } // EC represents an elliptic curve over a field f type EC[T any] struct { a, b T f Field[T] points []Point }

Slide 79

Slide 79 text

bsky.chewxy.com Implication
 // U 1 = X 1 Z 2 , U 2 = X 2 Z 1 u1 := x1.Mul(z2) u2 := x2.Mul(z1) // U 1 = X 1 Z 2 , U 2 = X 2 Z 1 u1 := e.f.Mul(x1, z2) u2 := e.f.Mul(x2, z1) Generics Alternative

Slide 80

Slide 80 text

bsky.chewxy.com How Do You Conceptualize Field?
 // Field is a representation of an abstract, finite field. type Field[T any] interface { Add(x, y T) T Sub(x, y T) T Mul(x, y T) T Div(x, y T) T Neg(x T) T IsZero(x T) bool CharNum() int } // Field is a representation of an abstract, finite field. type Field interface { Add(x Num) Num Sub(x Num) Num Mul(x Num) Num Div(x Num) Num Neg() Num IsZero(x Num) bool CharNum() int } As a collection of things with rules applied? As an Engine that does things to data?

Slide 81

Slide 81 text

bsky.chewxy.com type Field interface { Add(x Num) Num Sub(x Num) Num Mul(x Num) Num Div(x Num) Num Neg() Num IsZero(x Num) bool CharNum() int } type Field interface { Add(x, y T) T Sub(x, y T) T Mul(x, y T) T Div(x, y T) T Neg(x T) T IsZero(x T) bool CharNum() int } Closer to theory Closer to practice

Slide 82

Slide 82 text

bsky.chewxy.com On Types and Data Types
 type EC[K Field] struct { a, b K points []Point[K] } // Field is a representation of an abstract, finite field. type Field interface { Add(x Num) Num Sub(x Num) Num Mul(x Num) Num Div(x Num) Num Neg() Num IsZero(x Num) bool CharNum() int }

Slide 83

Slide 83 text

bsky.chewxy.com On Types and Data Types
 type EC[K Field] struct { a, b K points []Point[K] } // Field is a representation of an abstract, finite field. type Field interface { Add(x Num) Num Sub(x Num) Num Mul(x Num) Num Div(x Num) Num Neg() Num IsZero(x Num) bool CharNum() int }

Slide 84

Slide 84 text

bsky.chewxy.com On Types and Data Types
 type EC[K Field] struct { a, b K points []Point[K] } // Field is a representation of an abstract, finite field. type Field interface { Add(x Field) Field Sub(x Field) Field Mul(x Field) Field Div(x Field) Field Neg() Field IsZero(x Field) bool CharNum() int }

Slide 85

Slide 85 text

bsky.chewxy.com On Types and Data Types
 type EC[N any, K Field[N]] struct { a, b K points []Point[N, K] } // Field is a representation of an abstract, finite field. type Field[T any] interface { Add(x T) T Sub(x T) T Mul(x T) T Div(x T) T Neg() T IsZero(x T) bool CharNum() int }

Slide 86

Slide 86 text

bsky.chewxy.com Side Note: Reimplementing Rat!
 // Q is a representation of a rational number. type Q big.Rat func (n *Q) Add(m *Q) *Q { ... } func (n *Q) Sub(m *Q) *Q { ... } func (n *Q) Mul(m *Q) *Q { ... } func (n *Q) Div(m *Q) *Q { nr := (*big.Rat)(n) mr := (*big.Rat)(m) retVal := new(big.Rat) retVal = retVal.Quo(nr, mr) // clobbers retVal return (*Q)(retVal) }

Slide 87

Slide 87 text

bsky.chewxy.com type Q struct { N, D int } type Q = big.Rat type Q struct { big.Rat } type Q *big.Rat type Q big.Rat Variations of Implementing Q
 Original implementation Too much to refactor! Not allowed to define methods Sigh, OK

Slide 88

Slide 88 text

bsky.chewxy.com On Types and Data Types
 type EC[N any, K Field[N]] struct { a, b K points []Point[N, K] } // Field is a representation of an abstract, finite field. type Field[T any] interface { Add(x T) T Sub(x T) T Mul(x T) T Div(x T) T Neg() T IsZero(x T) bool CharNum() int } func NewEC[N Num, K Field[DT]](...) {...} ec := NewEC[*Q, *Q](...)

Slide 89

Slide 89 text

bsky.chewxy.com Then I got greedier.


Slide 90

Slide 90 text

bsky.chewxy.com // QFn represents a rational function. type QFn struct { n, d Poly } // ES represents an elliptic surface. type ES struct { a, b QFn sections []*Section } // EC represents an elliptic curve. type EC struct { a, b *Q points []Point } // Q is a representation of a rat number. type Q struct { n, d *big.Int } // Section is a section on an elliptic surface type Section struct { x, y QFn } // Polynomial is a representation of a polynomial. // The slice stores coefficients in ascending order of power. type Poly []*Q // Point is a point on an elliptic curve. type Point struct { x, y *Q } Elliptic Curve & Surface


Slide 91

Slide 91 text

bsky.chewxy.com // QFn represents a rational function. type QFn struct { n, d Poly } // ES represents an elliptic surface. type ES struct { a, b QFn sections []*Section } // EC represents an elliptic curve. type EC struct { a, b *Q points []Point } // Q is a representation of a rat number. type Q struct { n, d *big.Int } // Section is a section on an elliptic surface type Section struct { x, y QFn } // Polynomial is a representation of a polynomial. // The slice stores coefficients in ascending order of power. type Poly []*Q // Point is a point on an elliptic curve. type Point struct { x, y *Q } Elliptic Curve & Surface


Slide 92

Slide 92 text

bsky.chewxy.com // QFn represents a rational function. type QFn struct { n, d Poly } // ES represents an elliptic surface. type ES struct { a, b QFn sections []*Section } // EC represents an elliptic curve. type EC struct { a, b *Q points []Point } // Q is a representation of a rat number. type Q struct { n, d *big.Int } // Section is a section on an elliptic surface type Section struct { x, y QFn } // Polynomial is a representation of a polynomial. // The slice stores coefficients in ascending order of power. type Poly []*Q // Point is a point on an elliptic curve. type Point struct { x, y *Q } Elliptic Curve & Surface
 Field: A set of things with + - × ÷ defined // Field is a representation of an abstract, finite field. type Field[T Num] interface { Add(x T) T Sub(x T) T Mul(x T) T Div(x T) T Neg() T IsZero(x T) bool CharNum() int }

Slide 93

Slide 93 text

bsky.chewxy.com Implementing Q
 type Q[T ???] struct { N, D T } func (n *Q[R]) Add(m *Q[R]) *Q[R] { n2n := n.N.Mul(m.D) n2m := m.N.Mul(n.D) d := n.D.Mul(m.D) return &Q[R]{N: n2n.Add(n2m), D: d} } func (n *Q[R]) Sub(m *Q[R]) *Q[R] { ... } func (n *Q[R]) Mul(m *Q[R]) *Q[R] { ... } func (n *Q[R]) Div(m *Q[R]) *Q[R] { ... } The usual rational numbers: var q *Q[*Z] type Z big.Int The rational function: var qfn *Q[Poly]

Slide 94

Slide 94 text

bsky.chewxy.com Implementing Q
 type Q[R Ring] struct { N, D R } func (n *Q[R]) Add(m *Q[R]) *Q[R] { n2n := n.N.Mul(m.D) n2m := m.N.Mul(n.D) d := n.D.Mul(m.D) return &Q[R]{N: n2n.Add(n2m), D: d} } func (n *Q[R]) Sub(m *Q[R]) *Q[R] { ... } func (n *Q[R]) Mul(m *Q[R]) *Q[R] { ... } func (n *Q[R]) Div(m *Q[R]) *Q[R] { ... } type Ring interface { Add(m ???) ??? Mul(m ???) ??? }

Slide 95

Slide 95 text

bsky.chewxy.com Implementing Q
 type Q[R Ring] struct { N, D R } func (n *Q[R]) Add(m *Q[R]) *Q[R] { n2n := n.N.Mul(m.D) n2m := m.N.Mul(n.D) d := n.D.Mul(m.D) return &Q[R]{N: n2n.Add(n2m), D: d} } func (n *Q[R]) Sub(m *Q[R]) *Q[R] { ... } func (n *Q[R]) Mul(m *Q[R]) *Q[R] { ... } func (n *Q[R]) Div(m *Q[R]) *Q[R] { ... } type Ring[T any] interface { Add(m T) T Mul(m T) T }

Slide 96

Slide 96 text

bsky.chewxy.com Implementing Q
 type Q[T Num, R Ring[T]] struct { N, D R[T] } func (n *Q[T, R]) Add(m *Q[T, R]) *Q[T, R] { n2n := n.N.Mul(m.D) n2m := m.N.Mul(n.D) d := n.D.Mul(m.D) return &Q[R]{N: n2n.Add(n2m), D: d} } func (n *Q[T,R]) Sub(m *Q[T,R]) *Q[T,R] { ... } func (n *Q[T,R]) Mul(m *Q[T,R]) *Q[T,R] { ... } func (n *Q[T,R]) Div(m *Q[T,R]) *Q[T,R] { ... } type Ring[T Num] interface { Add(m T) T Mul(m T) T }

Slide 97

Slide 97 text

bsky.chewxy.com // QFn represents a rational function. type QFn struct { n, d Poly } // ES represents an elliptic surface. type ES struct { a, b QFn sections []*Section } // EC represents an elliptic curve. type EC struct { a, b *Q points []Point } // Q is a representation of a rat number. type Q struct { n, d *big.Int } // Section is a section on an elliptic surface type Section struct { x, y QFn } // Polynomial is a representation of a polynomial. // The slice stores coefficients in ascending order of power. type Poly []*Q // Point is a point on an elliptic curve. type Point struct { x, y *Q } Elliptic Curve & Surface
 Ring: A set of things with + and × defined // Ring is a representation of a ring type Ring[T Num] interface { Add(x T) T Mul(x T) T IsZero(x T) bool CharNum() int }

Slide 98

Slide 98 text

bsky.chewxy.com Implementing Rings
 type Poly []*Q[*Z] type Z big.Int func (p Poly) Div(q Poly) *Q[Poly] { return &Q[Poly]{N: q, D: q} } type Field[T Num] interface { Add(x T) T Sub(x T) T Mul(x T) T Div(x T) T Neg() T IsZero(x T) bool CharNum() int }

Slide 99

Slide 99 text

bsky.chewxy.com // QFn represents a rational function. type QFn struct { n, d Poly } // ES represents an elliptic surface. type ES struct { a, b QFn sections []*Section } // EC represents an elliptic curve. type EC struct { a, b *Q points []Point } // Q is a representation of a rat number. type Q struct { n, d *big.Int } // Section is a section on an elliptic surface type Section struct { x, y QFn } // Polynomial is a representation of a polynomial. // The slice stores coefficients in ascending order of power. type Poly []*Q // Point is a point on an elliptic curve. type Point struct { x, y *Q } Elliptic Curve & Surface
 Magma: A set of things with + defined // Magma is a representation of a magma. type Magma[T Num] interface { Add(x T) T IsZero(x T) bool }

Slide 100

Slide 100 text

bsky.chewxy.com // QFn represents a rational function. type QFn struct { n, d Poly } // ES represents an elliptic surface. type ES struct { a, b QFn sections []*Section } // EC represents an elliptic curve. type EC struct { a, b *Q points []Point } // Q is a representation of a rat number. type Q struct { n, d *big.Int } // Section is a section on an elliptic surface type Section struct { x, y QFn } // Polynomial is a representation of a polynomial. // The slice stores coefficients in ascending order of power. type Poly []*Q // Point is a point on an elliptic curve. type Point struct { x, y *Q } Elliptic Curve & Surface
 Magma: A set of things with + defined // Magma is a representation of a magma. type Magma[T any] interface { Add(x T) T IsZero(x T) bool }

Slide 101

Slide 101 text

bsky.chewxy.com Result: 
 Nothing Gets Done
 合

Slide 102

Slide 102 text

bsky.chewxy.com Conclusion:
 Beware Type Astronauting


Slide 103

Slide 103 text

bsky.chewxy.com Thank You
 bsky.chewxy.com

Slide 104

Slide 104 text

bsky.chewxy.com 天元 /Tengen := Center of the Go board She shook her head. “We store things to tianyuan.”
 Alice paused momentarily as she gathered her thoughts, “I suppose tianyuan is just a bunch of computers and they need to store things. You know, Bob loves retro computers. He’s showed me a few in his collection. They store data on the machine itself, but there’s no such glass things. How does it work?”
 “These glass things have been the standard in cloud storage — er, tianyuan storage — for the past 300 years. How do you not know this?”


Slide 105

Slide 105 text

bsky.chewxy.com Resources
 Elliptic Curves: Ben Lynn’s Notes - https://crypto.stanford.edu/pbc/notes/elliptic/ Elliptic Surfaces: ● Review by Matthias Schütt and Tetsuji Shioda (2010) ● Chao Li’s homepage https://www.math.columbia.edu/~chaoli/docs/EllipticSurfaces.html p/s: Ask ChatGPT/Claude/Gemini if you want to get confused. Textbooks are way better.