add lengthPrf0 for contexts

This commit is contained in:
rhiannon morris 2021-12-23 16:03:49 +01:00
parent 7bc58625a1
commit 1924250fcd

View file

@ -183,6 +183,12 @@ lengthPrf [<] = (0 ** Refl)
lengthPrf (tel :< _) =
let len = lengthPrf tel in (S len.fst ** cong S len.snd)
export
lengthPrf0 : Context _ to -> (len : Nat ** len = to)
lengthPrf0 ctx =
let (len ** prf) = lengthPrf ctx in
(len ** rewrite sym $ plusZeroRightNeutral len in prf)
public export %inline
length : Telescope {} -> Nat
length = fst . lengthPrf