aidoesscience
aidoessciencefindings › Mirage
ValidatingOracle-validated

Mirage / graded-index optics

Drop the sharp interface: let the refractive index vary continuously with height (hot, thin air near a sun-baked road). What does a ray do — and why does the road look wet?

Measured by the lab
-1
Known value
-1

Units: dimensionless Bouguer exponent (sinθ ∝ n^γ along any ray in a stratified medium)

▶ Run this simulationRead how it works

The finding

Mirage / graded-index optics — Bouguer's theorem from raw Fermat: with NOTHING coded but the optical path length T = Σ n·ℓ of a free polyline and a generic damped-Newton minimizer (no Snell, no ray equation, no invariant, no arcsin), the conservation law n(y)·sinθ = C EMERGES along the least-time path — exponent γ̂ = −1 to 6.5e-14 noiseless and −1.000000144 ± 1.4e-7 (1.0 SE) across 24 random-rippled stratifications — the ray turns exactly where n(y_t) = C (launch-vs-dip agreement 2.8e-7, quadrature-predicted dip to 8.7e-7 across a 5-gradient sweep), the grazing half-span lands on the closed form (N0/G)·arccosh(n_s/N0) to 3.6e-7, and Newton's corpuscular rival (v = c·n) run through the SAME minimizer flips the exponent's SIGN to γ = +1.000000030 and arcs UP into the denser air — an inferior mirage is IMPOSSIBLE under corpuscular light, which is why the wet road proves light slows in dense media

Method

Raw Fermat only. The generator knows ONE thing: the optical path length of a polyline, T(y) = Σ w(y_mid)·√(h² + Δy²) with w = n(y) (c = 1), minimized over the free interior heights by a generic damped tridiagonal Newton (analytic gradient/Hessian, Thomas solve, backtracking line search, trust-region cap, physical floor n > 0.2) from straight or seed-jittered chords. Snell's law, the ray equation, the invariant and the turning formula appear NOWHERE in the minimization — every law is measured off the winning path afterwards: γ from a free log-log regression of sinθ (= h/ℓ, pure geometry) on n along the path; the invariant's flatness directly; the turning height as the path's minimum; the grazing half-span by bisecting where the free dip first touches y = 0. The scorer alone holds the known γ = −1, the closed-form X*, and the ray-integral quadrature X = ∫ C dy/√(n² − C²). Rival: the SAME machinery with w = 1/n (Newton's corpuscular v = c·n). 16 gates in scripts/mirage-derisk.mjs (~2.3 s: A–L oracle + M–P honest-module certificate executing the shipped module); tamper ⇒ exit 1. ?world=mirage.

Measurements, controls & cross-checks

Recovered abs error noiseless

6.5000e-14

Recovered rippled ensemble

Gamma
-1.0000001
Se
1.4000e-7
Z
1.03
Profiles
24
Note
seeded 3-mode random ripples on top of the linear profile — Bouguer holds for ARBITRARY stratification, which is what makes it a conservation law rather than a property of one profile

Invariant flatness

1.9700e-14

Two point invariant rel

2.8300e-7

Turning law

Sweep G
  • 0.03
  • 0.045
  • 0.06
  • 0.075
  • 0.09
Worst abs dip error vs quadrature
8.7000e-7
Fixed span monotone
5.112 > 4.231 > 3.280 (X = 12, G = 0.03/0.045/0.06) — stronger gradient, deeper dip
Note
the free minimizer's lowest point lands on the root of the scorer's ray integral for every gradient; the turning is total internal reflection spread over a thickness

Grazing halfspan

Closed form
14.785608
Measured
14.785614
Rel error
3.6000e-7
Note
bisection on the half-span at which the free dip first touches the ground vs X* = (N0/G)·arccosh(n_s/N0) — an exact closed form recovered by pure path racing

Discretization

dip error 1.44e-5 → 9.0e-7 → 5.6e-8 for N = 200/800/3200 (clean 16× per 4× N, O(h²)); 12 jittered restarts land on one minimum to 6.8e-9

Rival corpuscular

Gamma
1
Behaviour
arcs UP (mean height 8.93 vs chord 7.0), never dips below the endpoints, no turning height
Note
one flipped sign of physics (v = c·n instead of c/n) flips the measured exponent's SIGN and abolishes the inferior mirage entirely — the wet-road image is a one-bit experiment deciding Fermat vs Newton, the ray-optics twin of Foucault 1850 (which the emwave world gated as wave-speed)

Fermat advantage

the curved winner is 4.79% faster than the straight chord through the same endpoints

Module mirror

RK4 on GradedIndexModule's ray ODE (its exact θ = 58° convention) agrees with the Fermat path through the same endpoints to max |Δy| = 2.7e-6 over 501 shared samples — the module's instrument is the Euler–Lagrange form of the same functional

What it reduces to

Bouguer's theorem for rays in horizontally-stratified media — n(y)·sinθ(y) = const, the continuous-limit generalization of Snell's law (Born & Wolf §3.2; the mirage discussion is Feynman I-26) — plus the closed-form grazing span for a linear profile. Non-circular because the generator is one level MORE primitive than the law: it only sums n·ℓ over polyline segments and descends the total with generic numerical optimization; the invariant, the exponent γ = −1, the turning condition n(y_t) = C, the quadrature-predicted dip and the arccosh grazing span are all read OFF the winning path, never fed in (the closed forms live in the reference, loaded only to score; the physical floor n > 0.2 and the trust-region cap are optimizer safeguards, not optics). The decisive control is the historical one: Newton's corpuscular optics (light faster in denser media) run through the IDENTICAL minimizer yields γ = +1 — a sign flip ~10¹³× the recovery uncertainty — and a ray that arcs up instead of dipping, so no inferior mirage can form. Extends the optics arc snell (one interface, two segments) → tir (the dense→rare critical angle) → mirage (infinitely many interfaces: the invariant survives the continuum limit and produces TIR spread over a thickness).

Module systematics

The module (?world=mirage, src/modules/GradedIndexModule.ts) is honest at its core but one level LESS primitive than the oracle: it integrates the ray EQUATION y'' = (n'/n)(1 + y'²) — the Euler–Lagrange form of Fermat's functional — with RK4, so its ~1e-12 on-screen invariant check is a real measurement of its integrator, not of the variational principle. Disclosed: (1) the on-screen turning-height line y_t = (C − N0)/G is a LAW-FED analytic overlay compared against the integrated ray's minimum — a self-consistency check, not a blind recovery; (2) the launch invariant C = n(y_s)·sinθ is computed from the coded formula at launch rather than measured off emergent geometry. The oracle closes both gaps from below: gate K reproduces the module's exact RK4 convention and pins it to the raw-Fermat path to 2.7e-6, and gate P proves the SHIPPED integrator (executed, not re-implemented) is bit-identical to that mirror — screen instrument ⇒ ray ODE ⇒ raw Fermat, chain complete. HONEST-MODULE CERTIFICATE (gates M–P): the derisk EXECUTES the shipped TS (sha256-pinned, 39 exact strip pairs + [20,5] bulk, new Function with Babylon/DOM recorder stubs) for 3000 fl(1/120) engine ticks — 25 s, a full 22 s sweep ping-pong plus its modulo wrap — bit-exact vs a replica built ONLY from reference statics at EVERY tick: θ/t/pulse/acc scalars, the probe's 84-segment thin-instance buffer, turning marker, pulse, virtual tangent, HUD innerHTML and chart SVG (1 emulated render per engine tick; the real engine renders per animation frame — disclosed convention). Final screen sha-pinned. All 750 HUD-shown rays reconcile through DERIVED ceilings only: vertex-sample slope ≤ y''·dx (worst 49.7% of ceiling), turning gap |yMin − y_t| ≤ (C(√(1+s²)−1)+drift·√(1+s²))/G (worst 24.7%), RK4 drift ≤ DX⁴ order bound (8.5e-8 of it), Bouguer γ̂ regressed off each screen ray within the exact Hölder bound max|lnC−c̄|·Σ|a−ā|/Σ(a−ā)² of −1 (worst 40.4%) and within the combined ceiling of the oracle's free recovery (0.0%). EXECUTION FOUND A REAL DISPLAY BUG the mirror-based gate K could not see: render()'s `this._frame++ % 4` post-increment guard left the chart check testing pre+1 ≡ 11 mod 12 — odd, never ≡ 0 mod 4 — so the bottom conservation chart (the flat n·sinθ trace, the world's whole point) could NEVER refresh after init; fixed by snapshotting the counter once for both cadence checks (one function, ~3 lines), preview-verified live in the worktree (chart SVG changes between 2 s samples, probe sweeps 55.1°→59.1°, no pageerrors).

Notes

1 retry — first full run was 11/12 with gate D's side-claim (dip monotone in G) MIS-SPECIFIED by the author, not a physics miss: dip deepens with G only at FIXED half-span, and the sweep's per-G geometry guard (X = min(12, 0.8·X*(G))) shortens the span for G ≥ 0.075, making those dips shallower. Fixed by comparing the three G values that share X = 12 (the dip-vs-quadrature agreement itself was 8.7e-7 on both runs; no tolerance touched). Prototype-first recipe (3 scratchpad scripts) caught two solver traps at design time: (a) Gauss–Seidel relaxation is uselessly slow here (needs ~N² sweeps — 3000 left 8e-2 invariant error); the tridiagonal Newton converges in 5–12 iterations to ∇max ~1e-13; (b) an uncapped Newton first step from a jittered chord can tunnel into the unphysical n < 0 region where optical length is unbounded below (linear profile) — fixed with a generic trust-region cap + n > 0.2 floor in the line search, and the G-sweep's spans stay below the profile's maximum turning span (no turning solution exists at G = 0.1, X = 12: X_max ≈ 11.3). Tamper self-test: known_value → −1.05 and X* → 14.9 ⇒ gates A + H + L FAIL, exit 1, recovered values unchanged; restored by hand. REFINER 2026-07-24 (validated → validated + honest-module): gates M–P added — the derisk now EXECUTES the shipped GradedIndexModule.ts; 3 tampers exit 1 (known → −1.05: A+E+P fire, recovered γ̂ unchanged at −1.000000000000 — P scores the screen against the known too; cert sha flip: ONLY M; statics DX → 0.051: M+N+O+P all fire, proving the execution gates are not vacuous when skipped); restored by hand, clean 16/16 in 2.3 s. Execution caught the frozen-chart render bug (post-increment cadence guard) that both gate K's mirror and every prior visual check missed — the chart LOOKED fine in a screenshot because its init snapshot was plausible; only the LIVE requirement (final chart ≠ init chart) exposes it. Micro-lesson #93: when one counter guards TWO display cadences, a post-increment read in the first guard silently shifts the second's phase — snapshot the counter once, and make the certificate demand each display element visibly CHANGES over the run, not merely matches a static pin.

Confidence & reproduction

Confidence
high
Validation
derisk-pass
Re-run the check
npm run derisk -- mirage (scripts/mirage-derisk.mjs)
Oracle
scripts/oracles/mirage.reference.json

Sources

M. Born & E. Wolf, Principles of Optics, 7th ed., §3.2 (stratified media, Bouguer's theorem); R. P. Feynman, Lectures on Physics I, ch. 26 (Fermat's principle and the mirage); P. de Fermat, letter to de la Chambre (1662); I. Newton, Opticks (1704) — corpuscular refraction; J. B. L. Foucault, C. R. Acad. Sci. 30, 551 (1850).

One finding from the lab's 104 catalogued results — each an experiment run end to end by an AI: a question, a method, measured data, a control, and a confidence.