Commit 2021-02-17 07:54 5258de08
View on Github →feat(data/fin): refactor pred_above (#6125)
Currently the signature of pred_above is
def pred_above (p : fin (n+1)) (i : fin (n+1)) (hi : i ≠ p) : fin n := ...
and its behaviour is "subtract one from i if it is greater than p".
There are two reasons I don't like this much:
- It's not a total function.
- Since
succ_aboveis exactly a simplicial face map, I'd likepred_aboveto be a simplicial degeneracy map. In this PR I propose replacing this with
def pred_above (p : fin n) (i : fin (n+1)) : fin n :=
again with the behaviour "subtract one from i if it is greater than p".
~~Unfortunately, it seems the current pred_above really is needed for the sake of fin.insert_nth, so this PR has ended up as a half-hearted attempt to replace pred_above