Advertisement
chemoelectric

Untitled

Jan 31st, 2019
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. #ifdef TYPECHECK_SMT2__ #then
  2. primplement
  3. lemma_divisible_terms_to_sum {a, b} {d} () =
  4. let
  5. (* A proof by contradiction: I prove that the remainder
  6. ((a + b) mod d) has to be divisible. *)
  7.  
  8. prval _ = prop_verify {a == d * (a / d)} ()
  9. prval _ = prop_verify {b == d * (b / d)} ()
  10. prval _ =
  11. prop_verify {a + b == (d * ((a + b) / d)) + ((a + b) mod d)} ()
  12.  
  13. prval _ =
  14. prop_verify
  15. {(d * (a / d)) + (d * (b / d)) ==
  16. (d * ((a + b) / d)) + ((a + b) mod d)} ()
  17. prval _ =
  18. prop_verify
  19. {(a + b) mod d ==
  20. (d * (a / d)) + (d * (b / d)) - (d * ((a + b) / d))} ()
  21. prval _ =
  22. prop_verify
  23. {(a + b) mod d == d * ((a / d) + (b / d) - ((a + b) / d))} ()
  24.  
  25. stadef k = (a / d) + (b / d) - ((a + b) / d)
  26.  
  27. prval _ = lemma_divisible_factor_to_product {d, k} {d} ()
  28. in
  29. unit_p
  30. end
  31. #endif (* TYPECHECK_SMT2__ *)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement