For a fee-free constant-product pool with reserves x, y > 0 and an external price P > 0, the pool's internal price y/x differs from P if and only if some single swap against the pool, valued at P, earns a riskless profit, by selling X to the pool or buying X from it (which direction pays, selling when P < y/x and buying when y/x < P, is exists_profitable_swap_iff / exists_profitable_reverse_swap_iff, not this statement). Equivalently, a pool at the external price admits no profitable swap of any size. Fees are not modelled.
ℝ → ℝ → ℝ → ℝ
Constant-product AMM swap output: given input Δx of token X and reserves (x, y) with x, y > 0, the output Δy of token Y under the constant-product invariant x · y = k is
Δy := y · Δx / (x + Δx).
This is the algebraic core of the Uniswap v2 model (Adams-Zinsmeister 2020), as formalised by Pusceddu-Bartoletti (2024).