home / skills / plurigrid / asi / catsharp-galois

catsharp-galois skill

/skills/catsharp-galois

This skill establishes a Galois adjunction between agent-o-rama and Plurigrid ACT, enabling cross-domain concept mapping and concrete interpretation.

npx playbooks add skill plurigrid/asi --skill catsharp-galois

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
4.0 KB
---
name: catsharp-galois
description: CatSharp Scale Galois Connections between agent-o-rama and Plurigrid ACT via Mazzola's categorical music theory
trit: 0
color: "#D8D826"
---

# CatSharp Galois Skill

**Trit**: 0 (ERGODIC - bridge)
**Color**: Yellow (#D8D826)

## Overview

Establishes **Galois adjunction** α ⊣ γ between conceptual spaces:

```
           α (abstract)
    HERE ─────────────→ ELSEWHERE
      ↑                    │
      │                    │ γ (concretize)
      │    ┌──────────┐    │
      └────│ CatSharp │────┘
           │  Scale   │
           │ (Bridge) │
           └──────────┘
           
    GF(3): (+1) + (0) + (-1) = 0 ✓
```

- **HERE**: agent-o-rama Topos (local operations)
- **ELSEWHERE**: Plurigrid ACT (global cognitive category theory)
- **BRIDGE**: CatSharp Scale (Mazzola's categorical music theory)

## CatSharp Scale Mapping

Pitch classes ℤ₁₂ map to GF(3) trits:

| Trit | Pitch Classes | Chord Type | Hue Range |
|------|---------------|------------|-----------|
| +1 (PLUS) | {0, 4, 8} | Augmented triad | 0-60°, 300-360° |
| 0 (ERGODIC) | {3, 6, 9} | Diminished 7th | 60-180° |
| -1 (MINUS) | {2, 5, 7, 10, 11} | Fifths cycle | 180-300° |

### Tritone: The Möbius Axis

The tritone (6 semitones) is the unique self-inverse interval:
```
6 + 6 = 12 ≡ 0 (mod 12)
```

This mirrors GF(3) Möbius inversion where μ(3)² = 1.

## Galois Connection API

```clojure
(defn α-abstract
  "Abstraction functor: agent-o-rama → Plurigrid ACT"
  [here-concept]
  (let [trit (or (:trit here-concept)
                 (pitch-class->trit (hue->pitch-class (:H here-concept))))]
    {:type :elsewhere
     :hyperedge (case trit
                  1  :generation
                  0  :verification
                  -1 :transformation)
     :source-trit trit}))

(defn γ-concretize
  "Concretization functor: Plurigrid ACT → agent-o-rama"
  [elsewhere-concept]
  (let [trit (case (:hyperedge elsewhere-concept)
               :generation 1
               :verification 0
               :transformation -1)]
    {:type :here
     :trit trit
     :H (pitch-class->hue (first (trit->pitch-classes trit)))}))

;; Adjunction verification
(defn verify-galois [h e]
  (let [αh (α-abstract h)
        γe (γ-concretize e)]
    (= (= (:hyperedge αh) (:hyperedge e))
       (= (:trit h) (:trit γe)))))
```

## Hyperedge Types

| Hyperedge | Trit | HERE Layer | ELSEWHERE Operation |
|-----------|------|------------|---------------------|
| :generation | +1 | α.Operadic | ACT.cogen.generate |
| :verification | 0 | α.∞-Categorical | ACT.cogen.verify |
| :transformation | -1 | α.Cohomological | ACT.cogen.transform |

## Color ↔ Pitch Conversion

```julia
function hue_to_pitch_class(h::Float64)::Int
    mod(round(Int, h / 30.0), 12)
end

function pitch_class_to_hue(pc::Int)::Float64
    mod(pc, 12) * 30.0 + 15.0
end

function pitch_class_to_trit(pc::Int)::Int
    pc = mod(pc, 12)
    if pc ∈ [0, 4, 8]      # Augmented
        return 1
    elseif pc ∈ [3, 6, 9]  # Diminished
        return 0
    else                    # Fifths
        return -1
    end
end
```

## GF(3) Triads

```
catsharp-galois (0) ⊗ gay-mcp (-1) ⊗ ordered-locale (+1) = 0 ✓
catsharp-galois (0) ⊗ rubato-composer (-1) ⊗ topos-of-music (+1) = 0 ✓
```

## Commands

```bash
# Run genesis with CatSharp bridge
just genesis-catsharp seed=0x42D

# Verify Galois adjunction
just galois-verify here=agent-o-rama elsewhere=plurigrid-act

# Sonify CatSharp scale
just catsharp-play pitch-classes="0 4 7"
```

## Related Skills

- `gay-mcp` (-1): SplitMix64 color generation
- `ordered-locale` (+1): Frame structure
- `rubato-composer` (-1): Mazzola's Rubato system
- `topos-of-music` (+1): Full Mazzola formalization

## References

- Mazzola, G. *The Topos of Music* (2002)
- Noll, T. "Neo-Riemannian Theory and the PLR Group"
- Heunen & van der Schaaf. "Ordered Locales" (2024)

Overview

This skill implements a categorical bridge (CatSharp Scale) that establishes a Galois adjunction between a local agent framework (agent-o-rama) and a global cognitive category framework (Plurigrid ACT) using Mazzola-style categorical music theory. It encodes pitch, hue, and triadic types into GF(3) trits to drive abstracting and concretizing functors for cross-domain transformation. The result is a compact API for mapping local operations to global hyperedge actions and back.

How this skill works

The skill maps pitch classes (ℤ₁₂) and hues to GF(3) trits representing three semantic modes: generation (+1), verification (0), and transformation (−1). The abstraction functor α turns a HERE concept into an ELSEWHERE hyperedge by reading trit or hue-derived pitch class; the concretization functor γ reconstructs a HERE concept from an ELSEWHERE hyperedge by choosing representative pitch/hue. A small verification routine checks the adjunction by comparing hyperedge and trit consistency. Color↔pitch conversion utilities perform deterministic round-trip mapping between hue and pitch class.

When to use it

  • When you need a concise semantic bridge between local agent state and a global categorical planner.
  • To map color/hue-based sensory inputs into symbolic hyperedge operations for cognitive workflows.
  • When prototyping music-theory-informed control or generative systems that require triadic mode classification.
  • For testing and verifying adjoint relationships in category-theory-informed architectures.
  • When sonifying category operations or visualizing conceptual transformations as hues.

Best practices

  • Normalize input hues to the 0–360° range before conversion to pitch class to avoid rounding artifacts.
  • Prefer explicit trit annotations on HERE concepts when semantic intent is known; fall back to hue→pitch→trit conversion otherwise.
  • Use the verification routine regularly during integration to ensure α ⊣ γ invariants hold after transformations.
  • Treat the chosen representative pitch/hue from a trit as a canonical sample, not a full specification; propagate additional context when needed.
  • Keep generation, verification, and transformation pipelines separate to preserve semantic clarity between hyperedge operations.

Example use cases

  • Convert agent sensor hues into Plurigrid ACT hyperedges to trigger generation, verification, or transformation workflows.
  • Compose multiple skills into GF(3) triads to validate category-level invariants across modules.
  • Sonify triadic states by mapping pitch-class sets to audible triads for debugging or presentation.
  • Run automated verification scripts to assert that α followed by γ preserves intended hyperedge-trit relationships.
  • Bootstrap a cognitive pipeline where local agent actions are abstracted into global planning steps and later concretized for execution.

FAQ

What does a trit represent here?

A trit is a GF(3) value classifying a concept as generation (+1), verification (0), or transformation (−1), derived from pitch-class or explicit annotation.

How deterministic is hue→pitch mapping?

The mapping uses fixed 30° bins with a midpoint offset, producing a deterministic pitch class for any normalized hue; rounding conventions apply at boundaries.