Advertisement
tinyevil

Untitled

Jan 21st, 2018
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. Theorem mult_plus_distr_r : forall n m p : nat,
  2. (n + m) * p = (n * p) + (m * p).
  3. Proof.
  4. intros n m p.
  5. induction p.
  6. Focus 2.
  7. rewrite (mult_comm (n+m) (S p)).
  8. rewrite (mult_comm n (S p)).
  9. rewrite (mult_comm m (S p)).
  10. simpl.
  11. rewrite (mult_comm p (n + m)).
  12. rewrite IHp.
  13. rewrite <- (plus_assoc n (p*n) (m + p * m)).
  14. rewrite (plus_comm (p * n) (m + p * m)).
  15. rewrite (plus_assoc n (m + p * m) (p * n)).
  16. rewrite (plus_assoc n m (p*m)).
  17. rewrite (mult_comm n p).
  18. rewrite (mult_comm m p).
  19. rewrite (plus_comm (p * n) (p * m)).
  20. rewrite (plus_assoc (n + m) (p*m) (p*n)).
  21. reflexivity.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement