on master help sign in
Add useful property to Prelude.Vect: xs ++ [] = xs
commit78431f74a5594c5006a35ee8fa88f92718030055 authorDavid Raymond Christiansen <david@davidchristiansen.dk> dateMon 5 May 2014, 14:59 (12 years ago) parent67517aa
1 file changed+12
libs/prelude/Prelude/Vect.idr+12
libs/prelude/Prelude/Vect.idr+12
@@ -447,6 +447,18 @@ range : Vect n (Fin n)
447447range {n=Z} = []
448448range {n=S _} = fZ :: map fS range
449449
450+
451+--------------------------------------------------------------------------------
452+-- Properties
453+--------------------------------------------------------------------------------
454+
455+vectNilRightNeutral : (xs : Vect n a) -> xs ++ [] = xs
456+vectNilRightNeutral [] = refl
457+vectNilRightNeutral (x :: xs) = tailCong _ _ (vectNilRightNeutral xs)
458+ where tailCong : (xs : Vect n a) -> (ys : Vect m a) -> (xs = ys) -> (x :: xs = x :: ys)
459+ tailCong xs xs refl = refl
460+
461+
450462--------------------------------------------------------------------------------
451463-- Proofs
452464--------------------------------------------------------------------------------