16-channel hyperspectral vision
What does a mantis shrimp see?
The most complex eye in nature. 12 spectral channels from 300–720 nm plus 4 polarization channels — including circular polarization, which no other animal sees.
human (3 channels, UV patches invisible) · mantis (16 channels, blue-violet UV reveal)
Drag below 380 nm. The human cones are silent; the mantis bank keeps ranking. Drag past 700 nm — the mantis still has receptors firing where humans long ago went black.
Drag from 3 to 16 channels. Watch the reef change.
The math behind it
Each function carries a @verify contract that compiles to a Lean theorem about its bounds. The same source compiles to C, Verilog, HLSL, and 28 more targets. View the experiment on GitHub →
spectral_channel.emlchain 1module spectral_channel;
@verify(lean, theorem = "spectral_channel_in_unit_interval")
fn spectral_sensitivity(
wavelength_nm: Real,
peak_nm: Real,
sigma_nm: Real,
) -> Real
requires (sigma_nm > 0.0)
ensures (result >= 0.0)
ensures (result <= 1.0)
{
clamp(exp(-((wavelength_nm - peak_nm) * (wavelength_nm - peak_nm))
/ (2.0 * sigma_nm * sigma_nm)),
0.0, 1.0)
}polarization.emlchain 1module polarization;
@verify(lean, theorem = "polarization_response_bounded")
fn polarization_response(
intensity: Real,
polar_degree: Real,
incoming_angle: Real,
preferred_angle: Real,
) -> Real
requires (intensity >= 0.0)
requires (polar_degree >= 0.0 and polar_degree <= 1.0)
ensures (result >= 0.0)
ensures (result <= 2.0 * intensity)
{
clamp(intensity * (1.0 + polar_degree
* cos(2.0 * (incoming_angle - preferred_angle))),
0.0, 2.0 * intensity)
}Same EML pipeline. Different sense.
Eight more cross-species sensor models live alongside this one — bat sonar, owl 3D hearing, pit-viper infrared, dog olfaction, pigeon magnetoreception, shark electric sense, mantis shrimp 16-channel hyperspectral, spider web vibration.
See all nine senses →