Collision bound for finite random keys
Lax235315.RandomKeyCollisions · concepts/Lax235315/RandomKeyCollisions.lean · lax-235315
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Lemma
Give each of a vertices an independent uniform key from M possibilities. The number of assignments with any repeated key is at most a² M^(a-1). For M>0, division by M^a gives the probability bound a²/M.
Concept map
Lean source view on GitHub
| 1 | import Mathlib.Data.Fintype.Card |
| 2 | import Mathlib.Data.Set.Card |
| 3 | |
| 4 | /-! |
| 5 | --- |
| 6 | title: Collision bound for finite random keys |
| 7 | type: lemma |
| 8 | --- |
| 9 | Give each of a vertices an independent uniform key from M possibilities. |
| 10 | The number of assignments with any repeated key is at most a² M^(a-1). |
| 11 | For M>0, division by M^a gives the probability bound a²/M. |
| 12 | |
| 13 | # Formalization notes |
| 14 | |
| 15 | Assignments are functions from Fin a to Fin M. Noninjectivity is exactly |
| 16 | the collision event, so no sampling implementation is built into the |
| 17 | statement. The counting form covers empty vertex or key sets as well; |
| 18 | the stated probability interpretation only uses M>0. |
| 19 | -/ |
| 20 | |
| 21 | namespace Lax235315.RandomKeyCollisions |
| 22 | |
| 23 | /-- A union bound over distinct coordinate pairs bounds colliding key assignments. -/ |
| 24 | axiom count_noninjective_le (a M : ℕ) : |
| 25 | {f : Fin a → Fin M | ¬ Function.Injective f}.ncard ≤ |
| 26 | a ^ 2 * M ^ (a - 1) |
| 27 | |
| 28 | end Lax235315.RandomKeyCollisions |
| 29 |
Formalization notes
Assignments are functions from Fin a to Fin M. Noninjectivity is exactly the collision event, so no sampling implementation is built into the statement. The counting form covers empty vertex or key sets as well; the stated probability interpretation only uses M>0.
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments