Emmy, the Algebra System: Differential Geometry Chapter Two

Functional Differential Geometry: Chapter 2
Published

January 29, 2026

2 Manifolds

A manifold is a generalization of our idea of a smooth surface embedded in Euclidean space.

(define R2 (make-manifold Rn 2))

Concerning the expression the (define U (patch ’origin R2)), “We can avoid explicitly naming the patch” as stated in footnote 6, p13 of the FDG book

2.1 Coordinate Functions

(define R2-rect (coordinate-system-at R2 :rectangular :origin))
(define R2-polar (coordinate-system-at R2 :polar-cylindrical :origin))
(define R2-rect-chi (chart R2-rect))
(define R2-rect-chi-inverse (point R2-rect))
(define R2-polar-chi (chart R2-polar))
(define R2-polar-chi-inverse (point R2-polar))
(print-expression
  ((compose R2-polar-chi R2-rect-chi-inverse) (up 'x0 'y0)))
(up (sqrt (+ (expt x0 2) (expt y0 2))) (atan y0 x0))
(print-expression
  ((compose R2-rect-chi R2-polar-chi-inverse) (up 'r0 'theta0)))
(up (* r0 (cos theta0)) (* r0 (sin theta0)))
(print-expression
  ((D (compose R2-rect-chi R2-polar-chi-inverse)) (up 'r0 'theta0)))
(down (up (cos theta0) (sin theta0)) (up (* r0 (- (sin theta0))) (* r0 (cos theta0))))

2.2 Manifold Functions

(define R2->R '(-> (UP Real Real) Real))

Manifold Functions Are Coordinate Independent

(define f
  (compose (literal-function 'f-rect R2->R) R2-rect-chi))

Footnote 8, p16

(define f-shorthand
  (literal-manifold-function 'f-rect R2-rect))
(define R2-rect-point (R2-rect-chi-inverse (up 'x0 'y0)))
(define corresponding-polar-point
  (R2-polar-chi-inverse
    (up (sqrt (+ (square 'x0) (square 'y0)))
        (atan 'y0 'x0))))
(print-expression
  (f R2-rect-point))
(f-rect (up x0 y0))
(print-expression
  (f corresponding-polar-point))
(f-rect (up x0 y0))

Naming Coordinate Functions

(define-coordinates (up x y) R2-rect)
(define-coordinates (up r theta) R2-polar)
(print-expression
  (x (R2-rect-chi-inverse (up 'x0 'y0))))
x0
(print-expression
  (x (R2-polar-chi-inverse (up 'r0 'theta0))))
(* r0 (cos theta0))
(print-expression
  (r (R2-polar-chi-inverse (up 'r0 'theta0))))
r0
(print-expression
  (r (R2-rect-chi-inverse (up 'x0 'y0))))
(sqrt (+ (expt x0 2) (expt y0 2)))
(print-expression
  (theta (R2-rect-chi-inverse (up 'x0 'y0))))
(atan y0 x0)
(define h (+ (* x (square r)) (cube y)))
(print-expression
  (h R2-rect-point))
(+ (* x0 (+ (expt x0 2) (expt y0 2))) (expt y0 3))
(print-expression
  (h (R2-polar-chi-inverse (up 'r0 'theta0))))
(+ (* r0 (cos theta0) (expt r0 2)) (expt (* r0 (sin theta0)) 3))

Exercise 2.1: Curves

(define-coordinates (up r theta) R2-polar)
(print-expression
  ((- r (* 2 'a (+ 1 (cos theta)))) ((point R2-rect) (up 'x 'y))))
(- (sqrt (+ (expt x 2) (expt y 2))) (* 2 a (+ 1 (cos (atan y x)))))

Exercise 2.2: Stereographic Projection

(print-expression
  ((compose
     (chart S2-spherical)
     (point S2-Riemann)
     (chart R2-rect)
     (point R2-polar))
   (up 'rho 'theta)))
NoteOUT
2026-02-08T20:17:32.284Z runnervmwffz4 WARN [emmy.util.logic:22] - Assuming (positive? (/ (* 2 rho) (+ (* (expt rho 2) (expt (cos theta) 2)) (* (expt rho 2) (expt (sin theta) 2)) 1))) in aggressive-atan-2
2026-02-08T20:17:32.288Z runnervmwffz4 WARN [emmy.util.logic:22] - Assuming (= (atan (sin theta) (cos theta)) theta) in atan-sin-cos
(up (acos (/ (+ (expt rho 2) -1) (+ (expt rho 2) 1))) theta)
(repl/scittle-sidebar)
source: src/mentat_collective/emmy/fdg_ch02.clj