pigeonhole

std.sets.pigeonhole · Level L3

The pigeonhole principle on a function f : A → B between finite sets: whether two elements share an image, as 1 or 0, and the first such pair a₁ < a₂ (0, 0 when there is none); and the largest load, the size of the biggest fibre. When |A| > |B| a collision must exist, and the largest load is at least ⌈|A|/|B|⌉; |A| ≤ |B| does not make f injective.

|A| > |B| ⇒ ∃a₁ ≠ a₂: f(a₁) = f(a₂); max load ≥ ⌈|A|/|B|⌉

Signature

pigeonhole(f: i64[n], cod: f64[k]) → f64[], f64[], f64[], f64[]

Structure

The function as NOVA stores it: one box per input, operation and output, and arrows that carry values. A double border marks another library function this one runs — called once, or by Scan once per element; select it to open that function.

fi64[n]codf64[k]CastffIotayReshapefrReshapefcReshapeyrEqualsameEqualgraphIotariIotaciReduceSumloadsLesslaterReduceMaxmax_loadMultiplypairsReduceMaxrowsReduceMaxcollisionArgMaxa1Casta1iGatherrowArgMaxa2collisionf64[]a2f64[]a1f64[]max_loadf64[]
  • input
  • operation
  • constant
  • call
  • output

Verification

  • Signature proven by NOVA’s shape solver, for every size.
  • Equal to the reference the first equal pair in order, and the largest fibre in exact rational arithmetic, on all 40 test cases.
  • All 160 float64 results are exact: the error is zero.
  • Interpreter and NumPy backend return bit-identical results.
  • At float32 too: the 40 test cases rounded to float32, and 40 of them exact, with zero error.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
100%
bit-equal to the NumPy formula in float64
100%
largest error, in units in the last place
0

Identity

Calls
—
Called by
—
sha256:d7c6d5926722f3e58c93d63949269b14e88959c1b02ecf989429d94b1fea980b

The semantic hash of the graph. It changes when the program changes, and never when only its documentation does.

Control handle

Symbol
Ω:std.sets.pigeonhole · Ω:pigeonhole
Pins
sha256:50baecb6556d8301c2e0e9ac925035217ce2d44ab06800887063e2743ef07438this graph alone
Evidence
sha256:1909e2458125d326014ee123330728f63dd2272c89713562b6dae11f58deb48athe hash of its verification record
Needs
no capability: a pure function

Through NOVA’s control layer, the symbol launches this function only while the program still matches what it pins: a change to this graph, or to any graph it reaches, needs a migration first.

ΣEML 2026

Efficient New Language — a high-density semantic overlay for humans and AI agents.

This site’s demos run on the real EML toolchain, in your browser.

© 2026 EveMissLab (一言諾科技有限公司) / Neo.K. All rights reserved.