MinHash and Jaccard similarity
DefinitionMin-hash of a set under a permutation#✓fully proved
Cslib.Bioinformatics.Sketching.MinHash.minHash
The min-hash of A under the permutation π: the least element of π(A), or ⊤ if A is
empty.
def minHash (π : Equiv.Perm U) (A : Finset U) : WithTop U := (A.image π).min
Used by 2
TheoremMinHash, counting form#✓fully proved
Cslib.Bioinformatics.Sketching.MinHash.card_minHash_collision
The number of permutations of U under which A and B have
the same min-hash, times |A ∪ B|, equals |A ∩ B| times the number of all permutations.
theorem card_minHash_collision [Fintype U] (A B : Finset U) (hC : (A ∪ B).Nonempty) :
(univ.filter fun π : Equiv.Perm U => minHash π A = minHash π B).card * (A ∪ B).card =
(A ∩ B).card * Fintype.card (Equiv.Perm U)
def minHash (π : Equiv.Perm U) (A : Finset U) : WithTop U := (A.image π).min
CSLibExt/Bioinformatics/Sketching/MinHash.lean:62
Uses 1 · Used by 1
Statement usesMin-hash of a set under a permutation
TheoremMinHash collision probability#✓fully proved
Cslib.Bioinformatics.Sketching.MinHash.uniformOn_minHash_collision
MinHash collision probability (Broder 1997): for a uniformly random permutation π of
the finite universe U (uniformOn Set.univ on Equiv.Perm U, for any measurable structure in
which singletons are measurable, e.g. ⊤) and sets A, B with A ∪ B nonempty,
P(min π(A) = min π(B)) = |A ∩ B| / |A ∪ B|, the Jaccard similarity of A and B.
theorem uniformOn_minHash_collision [Finite U] [MeasurableSpace (Equiv.Perm U)]
[MeasurableSingletonClass (Equiv.Perm U)] (A B : Finset U) (hC : (A ∪ B).Nonempty) :
ProbabilityTheory.uniformOn Set.univ {π : Equiv.Perm U | minHash π A = minHash π B} =
((A ∩ B).card : ENNReal) / (A ∪ B).card
def minHash (π : Equiv.Perm U) (A : Finset U) : WithTop U := (A.image π).min
CSLibExt/Bioinformatics/Sketching/MinHash.lean:62
Uses 2
Statement usesMin-hash of a set under a permutation
Proof usesMinHash, counting form
3 fully proved
Loading dependency explorer…
The dependency explorer needs JavaScript and its graph data.