Physlib.Mathematics.Fin
36 declarations
Predecessor of relative to pivot
#predAboveIFor any , given elements and in (represented by ), this function returns an element in (represented by ). The output is defined as if , and if .
For any natural number and any element in the set (represented by ), the function evaluated at with pivot is equal to , where the result is an element of .
Let be a natural number. For any pivot and any element , applying the function to the value obtained from returns . Here, is defined as if and if , while is defined as if and if . The identity states:
For any natural number and any elements , if , then . Here, is the function that returns if and if . The function is the standard map from to that "skips" the index , defined as if and if .
Let be a natural number. For any elements such that , and any element , the following equivalence holds: where returns if and if , and is the function from to that skips , defined as if and if .
for
#predAboveI_ltFor any natural number , let and be elements of . If the value of is strictly less than the value of (), then the predecessor of relative to the pivot , denoted , is equal to as an element of .
for
#predAboveI_geFor any natural number and any two elements , if , then the value of the predecessor of relative to pivot is , where the result is an element of .
Identity for the composition of two maps via reindexing
#succAbove_succAbove_predAboveIFor any natural number , let , , and . The following equality holds: where: - For , the function is the embedding that "skips" the index , defined by if and if . - The function returns the predecessor of relative to the pivot , defined as if and if .
Equivalence extracting the -th component
#finExtractOneFor any natural number and an index , this definition provides an equivalence (a bijection) between the finite set and the disjoint union . This mapping is constructed such that the specific element is mapped to the unique element in the left summand , while all other elements where are mapped into the right summand .
The equivalence `finExtractOne i` maps to `Sum.inl 0`
#finExtractOne_apply_eqLet be a natural number and . Let be the equivalence that extracts the -th component. Then , where is the unique element of the first summand .
For any natural number and any index , the composition of the inverse of the equivalence with the right-side injection is equal to the function , which embeds into by skipping the index .
Let be a natural number, be an index, and be an element. Let be the equivalence defined by `finExtractOne`, which extracts the -th component to the left summand. Then the inverse of this equivalence applied to the element in the right summand is equal to : where is the function that embeds into by skipping the index .
For any natural number and any index , let be the equivalence (bijection) defined by `finExtractOne`, which maps the element to the left summand. The inverse of this equivalence applied to the unique element in the left summand returns the original index :
For any natural number and any two distinct elements , let be the equivalence (bijection) that extracts the -th component. Then the image of under this equivalence is the inclusion into the right summand of the relative predecessor of with respect to : where is the function that returns if and if .
Induced map by removing and
#finExtractOnPermHomFor natural numbers and , given a fixed index and a bijection (equivalence) , this function defines a map from to . For an input , the function identifies with the unique element such that via the inverse of `finExtractOne`. It then applies the bijection to obtain and uses `predAboveI` to re-index into the set by skipping the value . Effectively, this is the map between the remaining finite sets obtained by removing from the domain and from the codomain.
for maps induced by removing indices and
#finExtractOnPermHom_invLet be natural numbers. For any index and any bijection , let be the induced map obtained by removing from the domain and from the codomain. Then the composition of with the map induced by the inverse bijection (relative to the pivot ) is the identity on : where is the map obtained by removing from the domain of and from its codomain.
Induced equivalence by removing and
#finExtractOnePermFor natural numbers , given an index and a bijection (equivalence) , this function defines the induced bijection between the reduced sets and . It is constructed by removing the element from the domain and its image from the codomain. For any , the map identifies with the unique such that (using the re-indexing map that skips ), applies to obtain , and then re-indexes into by skipping the value .
For natural numbers and , let be a bijection and let be a fixed index. Then the following identity holds: where is the map that embeds into by skipping the index , and is the induced bijection obtained by removing from the domain and from the codomain of .
Explicit formula for the value of the induced permutation
#finExtractOnePerm_applyFor any natural number , let be a bijection and let be a fixed index. The value of the induced bijection (obtained by removing from the domain and from the codomain) at any is given by the formula: where: - is the map that embeds into by skipping the index . - is the function that maps to if and to if .
Explicit formula for the value of the inverse induced permutation
#finExtractOnePerm_symm_applyFor any natural number , let be a bijection and be a fixed index. Let be the induced bijection obtained by removing the element from the domain and its image from the codomain. For any , the value of the inverse bijection is given by: where: - is the map that embeds into by skipping the index . - is the function that maps to if and to if . - is the inverse bijection of .
Equivalence extracting indices and
#finExtractTwoFor any natural number , given indices and , this definition provides an equivalence (a bijection) between the finite set and the iterated disjoint union . The mapping is constructed such that: 1. The element is mapped to the first summand . 2. The element (the -th element of when is excluded) is mapped to the second summand . 3. The remaining elements of are mapped bijectively to the summand .
`finExtractTwo i j i = Sum.inl (Sum.inl 0)`
#finExtractTwo_apply_fstFor any natural number , an index , and an index , let be the equivalence defined by `finExtractTwo i j` (which maps and the -th element of the remaining set to the two summands). Then the image of under this equivalence is , representing the unique element in the first summand.
For any natural number , let and . Let be the equivalence (bijection) defined by `finExtractTwo i j`, which extracts the index and the index . The composition of the inverse equivalence with the inclusion of the third summand is given by the composition of two skip-index functions: where is the function that embeds into by skipping the index .
For any natural number , index , index , and element , let be the equivalence (bijection) defined by `finExtractTwo i j`, which extracts the indices and . The inverse equivalence maps an element from the third summand back to according to the formula: where is the function that embeds into by skipping the index , and denotes the inclusion into the right summand of the disjoint union.
For any natural number , index , and index , let be the equivalence (bijection) defined by `finExtractTwo i j`, which extracts the indices and . Then the inverse equivalence maps the unique element in the second summand to . Specifically, where represents the unique element of the second summand in the disjoint union and is the function that embeds into by skipping the index .
The inverse of `finExtractTwo i j` maps the first summand to
#finExtractTwo_symm_inl_inl_applyFor any natural number , index , and index , let be the equivalence (bijection) defined by `finExtractTwo i j`. Then the inverse equivalence maps the element in the first summand to . Specifically, , where represents the unique element of the first summand of the disjoint union.
For any natural number , index , and index , let be the equivalence defined by `finExtractTwo i j`. Then applying to the element yields , which represents the unique element of the second summand in the disjoint union.
The equivalence constructed from inverse functions and evaluates to
#finMapToEquiv_applyLet be natural numbers. Suppose and are functions such that and are inverses of each other (i.e., for all and for all ). Let be the equivalence between and constructed from these maps. Then for any , the value of is equal to .
The inverse of the equivalence induced by inverse functions and is
#finMapToEquiv_symm_applyLet be natural numbers. Suppose and are functions such that for all and for all . Let be the equivalence (bijection) between and constructed from these functions. Then, for any , the inverse of the equivalence applied to is equal to . (Here, denotes the set of natural numbers ).
The inverse of `finMapToEquiv f1 f2` equals `finMapToEquiv f2 f1`
#finMapToEquiv_symm_eqLet . Suppose we have functions and such that and are inverses of each other, i.e., for all and for all . Then the inverse (symmetry) of the equivalence constructed from these functions is equal to the equivalence constructed by swapping the roles of and .
Extension of an equivalence to
#equivConsGiven an equivalence between the sets of natural numbers and , this definition constructs an induced equivalence . The mapping is defined such that , and for any , . Its inverse is defined analogously using the inverse of .
Let and be natural numbers and let be an equivalence between the sets and . Let be the extended equivalence. Then the image of under is .
`equivCons` commutes with composition of equivalences
#equivCons_transFor any natural numbers and any equivalences and , the extension of their composition to via `equivCons` is equal to the composition of their individual extensions. That is, .
The extension of a cast equivalence via `equivCons` is the cast equivalence of the successors
#equivCons_castOrderIsoFor any natural numbers and such that , let be the canonical order-preserving equivalence (cast) between the sets of natural numbers and . Then the extension of this equivalence to the successor sets, —defined by mapping to and to —is equal to the canonical order-preserving equivalence between and .
Let and be natural numbers and let be an equivalence between the sets of natural numbers and . Let be the induced equivalence (defined as `equivCons e`) such that and for all . Then for any , the inverse of this extended equivalence satisfies .
for the extended equivalence induced by
#equivCons_succLet and let be an equivalence between the sets and . Let be the extended equivalence constructed by `Fin.equivCons`, which maps to and increments the image of all other elements by . For any natural number such that , the value of at is given by .
