Skip to main content

lemma_flatten_cardinality_under_disjointness

Function lemma_flatten_cardinality_under_disjointness 

Source
pub proof fn lemma_flatten_cardinality_under_disjointness<A>(parts: Set<Set<A>>)
Expand description
requires
pairwise_disjoint(parts),
ensures
parts.flatten().len() == parts.fold(0nat, |acc: nat, p: Set<A>| acc + p.len()),

If parts is a finite set of finite, pairwise-disjoint sets, then the cardinality of the union is the sum of cardinalities.