equal
deleted
inserted
replaced
281 |
281 |
282 lemma nat_of_intify [simp]: "nat_of(intify(z)) = nat_of(z)" |
282 lemma nat_of_intify [simp]: "nat_of(intify(z)) = nat_of(z)" |
283 by (simp add: nat_of_def) |
283 by (simp add: nat_of_def) |
284 |
284 |
285 lemma nat_of_congruent: "(\<lambda>x. (\<lambda>\<langle>x,y\<rangle>. x #- y)(x)) respects intrel" |
285 lemma nat_of_congruent: "(\<lambda>x. (\<lambda>\<langle>x,y\<rangle>. x #- y)(x)) respects intrel" |
286 by (auto simp add: congruent_def split add: nat_diff_split) |
286 by (auto simp add: congruent_def split: nat_diff_split) |
287 |
287 |
288 lemma raw_nat_of: |
288 lemma raw_nat_of: |
289 "[| x\<in>nat; y\<in>nat |] ==> raw_nat_of(intrel``{<x,y>}) = x#-y" |
289 "[| x\<in>nat; y\<in>nat |] ==> raw_nat_of(intrel``{<x,y>}) = x#-y" |
290 by (simp add: raw_nat_of_def UN_equiv_class [OF equiv_intrel nat_of_congruent]) |
290 by (simp add: raw_nat_of_def UN_equiv_class [OF equiv_intrel nat_of_congruent]) |
291 |
291 |
365 |
365 |
366 lemma zneg_nat_of [simp]: "znegative(intify(z)) ==> nat_of(z) = 0" |
366 lemma zneg_nat_of [simp]: "znegative(intify(z)) ==> nat_of(z) = 0" |
367 apply (subgoal_tac "intify(z) \<in> int") |
367 apply (subgoal_tac "intify(z) \<in> int") |
368 apply (simp add: int_def) |
368 apply (simp add: int_def) |
369 apply (auto simp add: znegative nat_of_def raw_nat_of |
369 apply (auto simp add: znegative nat_of_def raw_nat_of |
370 split add: nat_diff_split) |
370 split: nat_diff_split) |
371 done |
371 done |
372 |
372 |
373 |
373 |
374 subsection\<open>@{term zadd}: addition on int\<close> |
374 subsection\<open>@{term zadd}: addition on int\<close> |
375 |
375 |