Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1.  
  2. head-eq : {A : Set} {n : Nat} {xs : Vec A n} {ys : Vec A n} -> (x : A) -> xs == ys -> (x :: xs) == (x :: ys)
  3. head-eq {xs = []} {ys = []} x p = refl
  4. head-eq {xs = xs} {ys = ys} x p = refl
  5. -- Error! ^^^^
  6. xs != ys of type Vec .A .n
  7. when checking that the expression refl has type
  8. (x :: xs) == (x :: ys)
  9.  
  10. lem-tab-! : forall {A n} (xs : Vec A n) -> tabulate (_!_ xs) == xs
  11. lem-tab-! [] = refl
  12. lem-tab-! {n = succ n} (x :: xs) = head-eq x (lem-tab-! {n = n} xs)
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19. head-eq' : {A : Set} {n : Nat} {xs : Vec A n} -> (x : A) -> xs == xs -> (x :: xs) == (x :: xs)
  20. head-eq' x p = refl
  21.  
  22. lem-tab-!' : forall {A n} (xs : Vec A n) -> tabulate (_!_ xs) == xs
  23. lem-tab-!' [] = refl
  24. lem-tab-!' {n = succ n} (x :: xs) = head-eq' x (lem-tab-!' {n = n} xs)
  25. -- Error! ^^^^^
  26. xs != tabulate (_!_ xs) of type Vec .A n
  27. when checking that the expression lem-tab-!' {n = n} xs has type
  28. tabulate (_!_ xs) == tabulate (_!_ xs)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement