Cardinalities of images, complements, coverings, division preimages, sigma fibres and doubled sets #
Two maps on a common index type that identify the same pairs of indices take equally many values
on every set of indices (Set.encard_image_eq_encard_image_of_eq_iff): the second map factors
through the first by a map that is injective on its values.
For n > 0, every natural number j is the quotient i / n of exactly the n natural numbers
n * j, …, n * j + n - 1. Hence for n > 0 the preimage of a finite set S ⊆ ℕ under
i ↦ i / n has n times as many elements as S. This is the counting fact behind sequences that
repeat each term n times, such as the singular values of a block sum of n copies of one map.
Adding a fresh element to a set removes one element from its complement
(Set.encard_compl_insert_add_one).
The points of the range of an injective map φ into a sigma type that lie in the fibre over i
are counted by the arguments that φ maps into that fibre (Set.ncard_preimage_sigmaMk_range).
A property read off the same function on both copies of ι in ι ⊕ ι holds on twice as many
indices as on ι (Set.ncard_setOf_sumElim).
For an injective map f from a finite type into a linear order, the number of indices whose value
lies below f a determines a (Set.injective_ncard_setOf_lt): it is the rank of f a among
the values of f. Each j < Nat.card ι is the rank of exactly one index
(Set.encard_setOf_ncard_setOf_lt_eq).
A set covered by finitely many finite sets C i is finite, with at most ∑ i, |C i| elements
(Set.finite_and_ncard_le_sum_of_subset_biUnion).
A set of naturals with at most n elements up to 2n, for every n, leaves at least n + 1
numbers up to 2n outside it, so its complement is infinite
(Set.infinite_compl_of_ncard_inter_Iic_le). Constructions of simple sets obtain
coinfiniteness from this counting invariant.
The statement Set.ncard_preimage_div needs no hypotheses: Set.ncard is 0 on infinite sets,
and i / 0 = 0 makes the preimage under division by zero either ∅ or all of ℕ, so both
sides are 0 when S is infinite or n = 0.
The points of the range of an injective map into a sigma type lying over the index i are
counted by the arguments mapped over i.
A set covered by the sets C i, i ∈ t, each finite with at most b i elements, is finite
with at most ∑ i ∈ t, b i elements. The sets C i may overlap.
For an injective map f from a finite type into a linear order, the number of indices whose
value lies below f a determines a.
For an injective map f from a finite type into a linear order, every j < Nat.card ι is the
number of indices whose value lies below f k for exactly one index k, and no larger j is.
A property of the doubled index set ι ⊕ ι, read off the same function on both copies of ι,
holds on twice as many indices as on ι. Both sides are 0 when the set on ι is infinite.