Guest User

t01.thy

a guest
Mar 24th, 2015
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. theory T01
  2. imports Main
  3. begin
  4. fun add::"nat⇒nat⇒nat" where
  5. "add 0 m = m" |
  6. "add (Suc m) n = Suc (add m n)"
  7.  
  8. fun double :: "nat ⇒ nat" where
  9. "double 0 = add 0 0" |
  10. "double (Suc m) = Suc(Suc (double m))"
  11.  
  12. theorem add_assoc [simp] : "add (add x y) z = add x (add y z)"
  13. apply(induction x)
  14. apply(auto)
  15. done
  16. lemma add_zero [simp] : "add x 0 = add 0 x"
  17. apply(induction x)
  18. apply(auto)
  19. done
  20. lemma add2 [simp] : "add x (Suc y) = Suc (add x y)"
  21. apply(induction x)
  22. apply(auto)
  23. done
  24. theorem add_com [simp]: "add x y = add y x"
  25. apply(induction x)
  26. apply(auto)
  27. done
  28.  
  29. theorem add_d [simp] : "double x = add x x"
  30. apply(induction x)
  31. apply(auto)
  32. done
  33. end
Advertisement
Add Comment
Please, Sign In to add comment