equal
deleted
inserted
replaced
578 by (simp add: divmod_nat_unique divmod_nat_rel_def) |
578 by (simp add: divmod_nat_unique divmod_nat_rel_def) |
579 |
579 |
580 lemma divmod_nat_zero_left: "divmod_nat 0 n = (0, 0)" |
580 lemma divmod_nat_zero_left: "divmod_nat 0 n = (0, 0)" |
581 by (simp add: divmod_nat_unique divmod_nat_rel_def) |
581 by (simp add: divmod_nat_unique divmod_nat_rel_def) |
582 |
582 |
583 lemma divmod_nat_base: |
583 lemma divmod_nat_base: "m < n \<Longrightarrow> divmod_nat m n = (0, m)" |
584 assumes "m < n" |
584 by (simp add: divmod_nat_unique divmod_nat_rel_def) |
585 shows "divmod_nat m n = (0, m)" |
|
586 proof (rule divmod_nat_unique) |
|
587 show "divmod_nat_rel m n (0, m)" |
|
588 unfolding divmod_nat_rel_def using assms by simp |
|
589 qed |
|
590 |
585 |
591 lemma divmod_nat_step: |
586 lemma divmod_nat_step: |
592 assumes "0 < n" and "n \<le> m" |
587 assumes "0 < n" and "n \<le> m" |
593 shows "divmod_nat m n = (Suc ((m - n) div n), (m - n) mod n)" |
588 shows "divmod_nat m n = (Suc ((m - n) div n), (m - n) mod n)" |
594 proof (rule divmod_nat_unique) |
589 proof (rule divmod_nat_unique) |