Cardinalities of products with finitely many nontrivial factors and of ranges #
Mathlib's Nat.card_pi computes the cardinality of a product ∀ i, X i over a finite index type.
This file allows an arbitrary index type, provided that all factors outside a finite set s have
exactly one element: the product then has the cardinality of its factors over s. Such products
arise as restricted-product-like objects, for instance a cohomology group of a product of modules
in which only finitely many factors contribute.
The file also compares the ranges of two maps f and f' with e' ∘ f = f' ∘ e, where e is
surjective and e' is injective on the range of f: e' maps the range of f bijectively onto
the range of f'.
For instance, two linear maps intertwined by linear equivalences on the source and on the target
have ranges of the same cardinality; this is a counting step of exact-sequence arguments.
Main results #
Nat.card_pi_eq_prod_of_card_eq_one:Nat.card (∀ i, X i) = ∏ i ∈ s, Nat.card (X i)when every factor outsideshas cardinality one.Nat.card_range_eq_card_range_of_comp_eq:Nat.card (Set.range f) = Nat.card (Set.range f')whene' ∘ f = f' ∘ ewithesurjective ande'injective on the range off.
The cardinality of a product over an arbitrary index type is the product of the
cardinalities of the factors over a finite set s, when every factor outside s has exactly one
element.
Two maps f and f' with e' ∘ f = f' ∘ e, where e is surjective and e' is injective
on the range of f, have ranges of the same cardinality.