; http://cap-lore.com/MathPhys/Algebras/DivAlg.html (list (lambda (f) ; The Cayley Dickson construction (apply (lambda (sg conj zer zer? one + - * inv) (list (lambda () (cons (sg) (sg))) ; new sample generator (lambda (x) (cons (conj (car x)) (- zer (cdr x)))) ; new conjugate (cons zer zer) ; new zero (lambda (a) (and (zer? (car a)) (zer? (cdr a)))) ; new zero test (cons one zer) ; new multiplicative unit (lambda (a b) (cons (+ (car a)(car b))(+ (cdr a)(cdr b)))) ; new add (lambda (a b) (cons (- (car a)(car b))(- (cdr a)(cdr b)))) ; new subtract (lambda (a b) (cons (- (* (car a)(car b))(* (conj (cdr b))(cdr a))) ; new multiply (+ (* (cdr b)(car a))(* (cdr a)(conj (car b)))))) (lambda (x) (let ((d (inv ; new inverse (+ (* (car x)(conj (car x))) (* (cdr x)(conj (cdr x))))))) (cons (* d (conj (car x)))(- zer (* d (cdr x)))))))) f)) (list ; The reals to boot the above ((fileVal "rr") "Seed8") (lambda (x) x) 0 zero? 1 + - * /) (lambda (n j) (let e ((n n)(j j)) (if (zero? n) (if (zero? j) 1 0) (let ((k (- n 1))) (cons (e k j) (e k (- j (expt 2 k))))))))) ; Test (let* ((DA (fileVal "DivisionAlgebra")) (G (car DA)) (hd (G(G(G(G (cadr DA)))))) (e (caddr DA)) (e1 (e 4 1)) (e10 (e 4 10)) (e4 (e 4 4)) (e15 (e 4 15)) (tail (cddddr hd)) (+ (cadr tail)) (- (caddr tail)) (* (cadddr tail))) (* (+ e1 e10) (- e15 e4))) ; behold zero divisors.