# Phase 1D — Primitive Common-Hypotenuse Gate and Certified Search to 5,000,000

**Experiment:** `PCGC-P1D-PRIMITIVE-GATE-5M`  
**Exact bound:** $g\le 5{,}000{,}000$  
**Arithmetic:** integer-only acceptance and verification  
**Perfect Cuboid hits:** **0**

## Theorem Gate A — primitive $g$ has only $1\pmod4$ prime factors

Let $x$ be any cuboid edge. If all Perfect Cuboid conditions hold, then

$$
x^2+D_x^2=g^2
$$

for an integer face diagonal $D_x$.

Suppose an odd prime

$$
p\equiv3\pmod4
$$

divides $g$. Then

$$
x^2+D_x^2\equiv0\pmod p.
$$

Because $-1$ is not a quadratic residue modulo such a prime, this forces

$$
p\mid x
$$

and

$$
p\mid D_x.
$$

The same argument applies to all three cuboid edges, hence $p$ divides
$a,b,c$, contradicting primitiveness.

If $2\mid g$, then

$$
x^2+D_x^2\equiv0\pmod4
$$

forces both $x$ and $D_x$ even for every channel, again forcing all three
edges even.

Therefore any primitive Perfect Cuboid must satisfy

$$
\boxed{
g=\prod_i p_i^{e_i},
\qquad
p_i\equiv1\pmod4.
}
$$

## Theorem Gate B — three representations are necessary

Define

$$
L(g)=
\left\{
x>0:
g^2-x^2\text{ is an integer square}
\right\}.
$$

A Perfect Cuboid is equivalent to choosing

$$
a,b,c\in L(g)
$$

such that

$$
a^2+b^2+c^2=g^2.
$$

No two selected cuboid edges can be the complementary legs of the same
right triangle with hypotenuse $g$, because then the third edge would have
to be zero.

Hence at least three distinct Pythagorean representations of $g^2$ are
necessary, equivalently

$$
|L(g)|\ge6.
$$

For

$$
g=\prod_{p\equiv1\pmod4}p^{e_p},
$$

this is equivalent to

$$
\frac12
\left(
\prod_p(2e_p+1)-1
\right)
\ge3.
$$

## Theorem Gate C — primitive edge parity

For every pair of cuboid edges, their squared sum must be a square.
Squares modulo $4$ show that no two edges can both be odd.

A primitive solution cannot have all three edges even, therefore exactly
one edge is odd.

Now pair the odd edge with either even edge. Modulo $8$, if that even edge
were congruent to $2\pmod4$, then

$$
1+4\equiv5\pmod8,
$$

which is not a square residue modulo $8$.

Therefore the two even edges must both be divisible by $4$:

$$
\boxed{
\text{primitive edge parity}
=
(\text{odd},\,0\pmod4,\,0\pmod4)
}
$$

up to permutation.

## Exact computation

The implementation generated every primitive Pythagorean triple with
hypotenuse at most the search bound using Euclid's theorem, scaled each
triple through all admissible common hypotenuses, and retained only
primitive-$g$ candidates that pass Gate A.

For each surviving $g$, it built the complete finite set $L(g)$ and searched
all candidate pairs for an integer third edge satisfying the sphere
equation.

Statistics:

- Primitive-$g$ values surviving prime-support gate: **416,096**
- Surviving $g$ values with at least one Pythagorean representation: **416,095**
- $g$ values with at least three representations: **241,741**
- Primitive triples enumerated: **795,763**
- Stored leg insertions: **3,961,992**
- Exact candidate-pair checks: **24,813,268**
- Exact two-channel sphere near-hits: **7,817**
- Perfect Cuboid hits: **0**

## Certified result in the tested range

No exact Perfect Cuboid was found for

$$
g\le5{,}000{,}000.
$$

Because the search is exhaustive in the common-hypotenuse variable over
this range, and all pruning gates above are necessary conditions, the
result can be recorded as the bounded statement

$$
\boxed{
\text{No primitive Perfect Cuboid exists with }
g\le5{,}000{,}000.
}
$$

This is a finite-range exclusion only. It is **not** a global nonexistence
proof.

## Smallest two-channel near-hits retained

- $(104,153,672;697)$, $R(g)=4$, leg-membership = $(0,1,1)$
- $(117,520,756;925)$, $R(g)=7$, leg-membership = $(0,1,1)$
- $(448,495,840;1073)$, $R(g)=4$, leg-membership = $(1,1,0)$
- $(264,495,952;1105)$, $R(g)=13$, leg-membership = $(1,0,1)$
- $(264,448,975;1105)$, $R(g)=13$, leg-membership = $(1,0,1)$
- $(333,644,2040;2165)$, $R(g)=4$, leg-membership = $(0,1,1)$
- $(1092,1540,1881;2665)$, $R(g)=13$, leg-membership = $(1,1,0)$
- $(1680,1925,2052;3277)$, $R(g)=4$, leg-membership = $(0,1,1)$
- $(533,756,3360;3485)$, $R(g)=13$, leg-membership = $(1,0,1)$
- $(520,765,3360;3485)$, $R(g)=13$, leg-membership = $(0,1,1)$

## Current computational bottleneck

After the primitive-$g$ gate, the expensive part is no longer generating
integer values blindly. It is the subset-synchronization problem inside
each finite $L(g)$.

The largest state encountered below the current bound was

$$
g=1185665,
$$

with

$$
|L(g)|=242
$$

or

$$
R(g)=121
$$

distinct unordered Pythagorean representations.

This suggests the next optimization should target the internal structure
of $L(g)$ and the three-leg sum condition, not raw integer enumeration.

## Next question

The next useful step is to classify candidate triples inside $L(g)$ by
modular and shared-core signatures before performing the full pair search.

The main target is a proof-safe synchronization invariant that can reject
entire subsets of $L(g)$ at once.
