Counting ordered pairs of distinct agents by species #
For a configuration c : Fin n → S, the ordered pairs (u, v) of distinct agents whose
species form the unordered pair {A, B} are 2·#A·#B if A ≠ B and #A·(#A - 1) if
A = B, where #A is the number of agents of species A; there are n·(n - 1) ordered pairs
of distinct agents. This is the counting behind the key identity of CRN-1.
Filtering ordered pairs of distinct agents is filtering the off-diagonal of Fin n × Fin n.
theorem
Crn.card_pairs_of_ne
{S : Type u_1}
[DecidableEq S]
{n : ℕ}
(c : Fin n → S)
{A B : S}
(hAB : A ≠ B)
:
Ordered pairs of distinct agents with species {A, B}, A ≠ B: 2·#A·#B.