Skip to content

test(poincare): gyrogroup property tests for Möbius addition - #2769

Open
HomunculusLabs wants to merge 2 commits into
SauersML:mainfrom
HomunculusLabs:research/poincare-gyrogroup-tests
Open

test(poincare): gyrogroup property tests for Möbius addition#2769
HomunculusLabs wants to merge 2 commits into
SauersML:mainfrom
HomunculusLabs:research/poincare-gyrogroup-tests

Conversation

@HomunculusLabs

@HomunculusLabs HomunculusLabs commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

What

Adds 11 deterministic tests covering G2–G6 of the gyrocommutative gyrogroup structure of Poincaré-ball Möbius addition—G1 was already covered by mobius_add_zero_is_identity_on_either_side—plus selected derived laws, closure, nonassociativity, and curvature-scaling regressions.

References: Ungar (2008), Analytic Hyperbolic Geometry and Albert Einstein's Special Theory of Relativity, Ch. 2, for the gyrogroup laws; Ganea et al. (2018), §2.3, for the Poincaré-ball Möbius-addition convention.

Why

The existing Poincaré tests cover identity, distance, exp/log round-trips, and conformal Dirichlet penalty — but do not test the algebraic structure of Möbius addition itself. Möbius addition is NOT a group operation (it is non-associative); it is a gyrocommutative gyrogroup. These laws are load-bearing for arbitrary-base Poincaré exp/log maps and other consumers of Möbius translation.

Tests added

Test Axiom/Law Notes
mobius_add_inverse_cancels_to_origin G2 (left inverse) + derived right inverse Tests both (-a)⊕a=0 and a⊕(-a)=0
mobius_add_satisfies_left_gyroassociative_law G3 (left gyroassociativity) a⊕(b⊕c) = (a⊕b)⊕gyra,b
gyration_is_automorphism_of_addition G4 (gyration is automorphism) gyr(x⊕y) = gyr(x)⊕gyr(y)
gyration_left_loop_property G5 (left loop) gyr[a⊕b,b] = gyr[a,b]
mobius_add_is_gyrocommutative G6 (gyrocommutativity) a⊕b = gyra,b
mobius_add_left_cancellation_law Derived (-a)⊕(a⊕b) = b
gyration_inverse_is_reversed_gyration Derived gyr[b,a]∘gyr[a,b] = id
gyration_is_identity_when_either_generator_is_zero Derived gyr[a,0] = gyr[0,a] = id (Ungar Thm 2.34)
mobius_add_is_not_associative Counterexample (a⊕b)⊕c ≠ a⊕(b⊕c)
mobius_add_stays_inside_ball_for_interior_points Closure ‖a⊕b‖ < 1
mobius_add_curvature_scaling_relation Regression Homothety + flat limit

The gyration operator is gyr[u,v]w = -(u⊕v) ⊕ (u ⊕ (v ⊕ w)), matching the convention in ConstantCurvature::gyration (cross-checked).

Review

Three review cycles before ready:

  1. Oracle review — caught missing automorphism + loop property tests, vague curvature claim
  2. Codex engineer review (gpt-5.6-sol) — caught missing left-inverse, isometry→homothety correction, axiom attribution fix. Convention cross-checked against constant_curvature.rs.
  3. GPT Pro review — confirmed all 11 assertions mathematically correct. Found citation errors (Ganea §3.1→§2.3, Ungar title incomplete, Theorem 2.34 on wrong test), inaccurate SAE-decoder rationale, and taxonomy wording. All fixed in commit 94cfd6e.

Verification

cargo test -p gam-geometry --lib manifolds::poincare
test result: ok. 34 passed; 0 failed

cargo test -p gam-geometry --lib
test result: ok. 317 passed; 0 failed

Not established

  • Gyrogroup identities tested at c = -1 only (curvature scaling test covers K=4 and near-flat limit separately).
  • Fixed deterministic examples, not property-based generated inputs.
  • The gyr helper is test-local; a production gyr might belong in the public API if consumers need it.

@HomunculusLabs
HomunculusLabs marked this pull request as draft August 12, 2026 18:31
@HomunculusLabs
HomunculusLabs force-pushed the research/poincare-gyrogroup-tests branch from 487f6a9 to ac95ee8 Compare August 12, 2026 18:39
Add 11 tests verifying gyrogroup identities of Poincaré-ball Möbius
addition (Ungar 2008, Ganea et al. NeurIPS 2018):

- Möbius inverse: a ⊕ (-a) = 0
- Left-cancellation law: (-a) ⊕ (a ⊕ b) = b
- Gyration inverse: gyr[b,a] ∘ gyr[a,b] = id
- Gyration vanishes at identity: gyr[0,b] = gyr[b,0] = id
- Gyrocommutative law: a ⊕ b = gyr[a,b](b ⊕ a)
- Non-associativity: (a⊕b)⊕c ≠ a⊕(b⊕c) for generic points
- Gyrogroup identity: a ⊕ (b ⊕ c) = (a ⊕ b) ⊕ gyr[a,b](c)
- Gyration automorphism: gyr[a,b](x⊕y) = gyr[a,b](x) ⊕ gyr[a,b](y)
- Left loop property: gyr[a⊕b, b] = gyr[a, b]
- Closure: a ⊕ b stays inside the ball for interior points
- Curvature scaling: x ⊕_{-K} y = (1/√K)((√K x) ⊕_{-1} (√K y)) + flat limit

The gyration operator gyr[u,v]w = -(u⊕v) ⊕ (u ⊕ (v ⊕ w)) measures the
defect of associativity and is the defining operation that makes the
Poincaré ball a gyrocommutative gyrogroup rather than a vector space.

These properties are load-bearing for the manifold SAE decoder: tangent-
space aggregation uses Möbius addition to combine atom contributions,
and the gyrogroup structure governs how those combinations behave under
reparameterization. Reviewed via repoprompt oracle.
@HomunculusLabs
HomunculusLabs force-pushed the research/poincare-gyrogroup-tests branch from ac95ee8 to aab5453 Compare August 12, 2026 18:54
GPT Pro review of PR SauersML#2769 found all 11 test assertions mathematically
correct but identified documentation and code-quality issues:

P1 (blocking):
- Ganea citation: §3.1 -> §2.3 (Gyrovector spaces)
- Ungar title: full title with Einstein subtitle
- Theorem 2.34 pointer: moved from gyration inverse to zero-generator test
- SAE decoder rationale: decoder uses linear log_0 aggregation + exp_0,
  not Möbius addition; corrected to cite arbitrary-base exp/log maps

P2 (quality):
- Renamed: gyration_vanishes -> gyration_is_identity_when_either_generator_is_zero
- Renamed: gyration_recovers_associativity_defect -> mobius_add_satisfies_left_gyroassociative_law
- Fixed inverse comment: removed gyrocommutativity attribution
- Fixed helper prose: 'measures how much' -> 'gyroautomorphism that compensates'
- Better section header with G1-G6 taxonomy
- Replaced hardcoded 0..3 loops with length-based ranges
- Tightened flat-limit tolerance: 1e-6 -> 1e-10
- Reordered tests: G2, G3, G4, G5, G6, derived laws, regressions

All 34 poincare tests pass. No mathematical logic changed.
@HomunculusLabs
HomunculusLabs marked this pull request as ready for review August 12, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant