# Cannizzaro reaction

## Status

executable-now: v2 guarded DPO sequence, elementary ownership report, and bounded expansion are implemented.

## Scope

- substrate: Two formaldehyde molecules plus hydroxide.
- product: Formate/methanol pair after acid-base workup.
- note: Implemented as guarded ownership-structured HEG v2 rules for the formaldehyde case.

## HEG v2 State Sketches

These panels are rendered from ownership-structured HEG v2 objects. For `specified-next` examples they are state sketches, not yet products of executable v2 rules.

### Cannizzaro G0 HEG

![Cannizzaro G0 HEG](heg_states/cannizzaro_G0.png)

Executable Cannizzaro substrate state.

### Cannizzaro G1 HEG

![Cannizzaro G1 HEG](heg_states/cannizzaro_G1.png)

After hydroxide addition.

### Cannizzaro G2 HEG

![Cannizzaro G2 HEG](heg_states/cannizzaro_G2.png)

After hydride transfer.

### Cannizzaro G3 HEG

![Cannizzaro G3 HEG](heg_states/cannizzaro_G3.png)

After acid-base workup.

## DPO-like Step Panels

Each primitive snapshot is shown as `L/K/R`. Red marks the ownership edge removed from `L`, orange marks the halfedge whose owner changes, and green marks the ownership edge created in `R`. `K` keeps the common atoms, halfedges, pair objects, and unchanged ownership records. For `specified-next` examples this is an explanatory span derived from route snapshots, not yet a checked executable rule application.

### Cannizzaro executable route step 1

Cannizzaro G0 HEG -> Cannizzaro G1 HEG

Changed ownership: `h3: a1 -> a2; h16: a5 -> a1`

| L | K | R |
|---|---|---|
| ![L](heg_steps/cannizzaro_main_step1_left.png) | ![K](heg_steps/cannizzaro_main_step1_interface.png) | ![R](heg_steps/cannizzaro_main_step1_right.png) |

### Cannizzaro executable route step 2

Cannizzaro G1 HEG -> Cannizzaro G2 HEG

Changed ownership: `h3: a2 -> a1; h5: a1 -> a7; h23: a7 -> a8`

| L | K | R |
|---|---|---|
| ![L](heg_steps/cannizzaro_main_step2_left.png) | ![K](heg_steps/cannizzaro_main_step2_interface.png) | ![R](heg_steps/cannizzaro_main_step2_right.png) |

### Cannizzaro executable route step 3

Cannizzaro G2 HEG -> Cannizzaro G3 HEG

Changed ownership: `h14: a6 -> a5; h24: a8 -> a6`

| L | K | R |
|---|---|---|
| ![L](heg_steps/cannizzaro_main_step3_left.png) | ![K](heg_steps/cannizzaro_main_step3_interface.png) | ![R](heg_steps/cannizzaro_main_step3_right.png) |

## Reaction Sketch

![Cannizzaro reaction reaction sketch](reaction_scheme.png)

## Mechanism Flow

![Cannizzaro reaction mechanism flow](mechanism_flow.png)

## Primitive HEG Patterns Used

| pattern | invariant |
|---|---|
| shared pair to lone pair | Halfedge and pair identity are preserved; exactly one Ownership record changes. |
| lone pair to shared pair | Halfedge and pair identity are preserved; exactly one Ownership record changes. |
| shared pair endpoint transfer | Halfedge and pair identity are preserved; exactly one Ownership record changes. |

## Mechanism Steps

### rho1a carbonyl pi pair becomes alkoxide lone pair

- group: rho1 hydroxide addition
- primitive: shared pair to lone pair
- resource move: `pi(C_A,O_A) -> LP(O_A)`
- roles: moved halfedge: h3; from: C_A; to: O_A; pair: e2
- guard note: requires C_A=O_A carbonyl resource
- executable note: implemented by cannizzaro_hydroxide_addition()

### rho1b hydroxide lone pair becomes O_nuc-C_A sigma pair

- group: rho1 hydroxide addition
- primitive: lone pair to shared pair
- resource move: `LP(O_nuc) -> sigma(O_nuc,C_A)`
- roles: moved halfedge: h16; from: O_nuc; to: C_A; pair: e8
- guard note: requires free hydroxide, available lone pair, and no existing O_nuc-C_A shared pair
- executable note: implemented by cannizzaro_hydroxide_addition()

### rho2a alkoxide lone pair reforms donor carbonyl

- group: rho2 collapse and hydride transfer
- primitive: lone pair to shared pair
- resource move: `LP(O_A) -> pi(C_A,O_A)`
- roles: moved halfedge: h3; from: O_A; to: C_A; pair: e2
- guard note: requires tetrahedral donor C_A-O_A single resource and O_A lone pair
- executable note: implemented by cannizzaro_hydride_transfer()

### rho2b hydride sigma pair transfers to acceptor carbonyl carbon

- group: rho2 collapse and hydride transfer
- primitive: shared pair endpoint transfer
- resource move: `sigma(C_A,H_hyd) -> sigma(C_B,H_hyd)`
- roles: moved halfedge: h5; from: C_A; to: C_B; pair: e3
- guard note: requires H_hyd bound to donor C_A and no existing C_B-H_hyd shared pair
- executable note: implemented by cannizzaro_hydride_transfer()

### rho2c acceptor carbonyl pi pair becomes alkoxide lone pair

- group: rho2 collapse and hydride transfer
- primitive: shared pair to lone pair
- resource move: `pi(C_B,O_B) -> LP(O_B)`
- roles: moved halfedge: h23; from: C_B; to: O_B; pair: e12
- guard note: requires acceptor C_B=O_B carbonyl resource
- executable note: implemented by cannizzaro_hydride_transfer()

### side acid O-H sigma pair becomes formate lone pair

- group: acid-base workup
- primitive: shared pair to lone pair
- resource move: `sigma(O_acid,H_p) -> LP(O_acid)`
- roles: moved halfedge: h14; from: H_p; to: O_acid; pair: e7
- guard note: requires acid O-H bond
- executable note: implemented by cannizzaro_side_proton_transfer()

### side alkoxide lone pair becomes alcohol O_B-H_p sigma pair

- group: acid-base workup
- primitive: lone pair to shared pair
- resource move: `LP(O_B) -> sigma(O_B,H_p)`
- roles: moved halfedge: h24; from: O_B; to: H_p; pair: e12
- guard note: requires alkoxide O_B lone pair and no existing O_B-H_p shared pair
- executable note: implemented by cannizzaro_side_proton_transfer()

## Guard Checklist

- rho1 requires a carbonyl, a free hydroxide oxygen, an attacking lone pair, no pre-existing O_nuc-C_A shared pair, and an admissible product.
- rho2 requires the tetrahedral alkoxide donor, a second aldehyde carbonyl acceptor, a donor C-H hydride resource, no pre-existing C_B-H_hyd shared pair, and an admissible product.
- workup proton transfer requires acid O-H, alkoxide lone pair, no pre-existing O_B-H_p shared pair, and an admissible product.

## Alternative Route Probes

- Current formaldehyde expansion finds route multiplicity from identical aldehyde/H role symmetries, not a genuinely different chemistry route.
- A crossed Cannizzaro substrate with distinguishable aldehydes is the next probe for real alternative hydride donor/acceptor choices.

## Expansion

cannizzaro_expansion(depth=3) currently gives 4 coalesced states and 10 retained transitions for the formaldehyde system.

## Interpretation

The chemical rule is treated as a guarded composite of primitive HEG moves. The primitive move tells us what is composable at the electron-resource level; the guards say when that move has the intended chemical meaning.
