pith. sign in
module module moderate

IndisputableMonolith.Patterns.GrayCodeAxioms

show as:
view Lean formalization →

The GrayCodeAxioms module defines the inverse Gray code mapping via cumulative XOR together with supporting facts on invertibility and bounds. Pattern-generation code in the Recognition framework cites these axioms when building hypercube cycles. The module is purely definitional and exports grayInverse plus lemmas that downstream Gray code constructions require.

claimThe inverse mapping satisfies $g^{-1}(g(n)) = n$ where $g^{-1}(x) = x_0 + x_1 + x_2 + x_3 + x_4 + x_5 + x_6 + x_7$ with each $x_i$ the successive right-shift XOR of the Gray-code word.

background

This module sits inside the Patterns domain and imports the core Patterns definitions plus Mathlib. It supplies the concrete inverse operation for binary-reflected Gray codes that the sibling GrayCode and GrayCycleGeneral modules later consume. The upstream Patterns module provides the general pattern interface; the present module adds the specific cumulative-XOR decoder and the GrayCodeFacts bundle that records bound preservation and one-bit properties.

proof idea

This is a definition module, no proofs.

why it matters in Recognition Science

The definitions here are imported directly by GrayCode (binary-reflected Gray code for the hypercube Hamiltonian cycle) and by GrayCycleGeneral (the Workstream A generalization to arbitrary dimension d using the BRGC formula gray(n) = n XOR (n >>> 1)). They close the axiom layer required before those modules can expose GrayCover d (2^d) and GrayCycle d.

scope and limits

used by (2)

From the project-wide theorem graph. These declarations reference this one in their body.

depends on (1)

Lean names referenced from this declaration's body.

declarations in this module (7)