375 apply(blast) |
375 apply(blast) |
376 apply(simp add: supp_swap) |
376 apply(simp add: supp_swap) |
377 apply(simp add: eqvts) |
377 apply(simp add: eqvts) |
378 done |
378 done |
379 |
379 |
380 lemma perm_zero: |
|
381 assumes a: "\<forall>x::atom. p \<bullet> x = x" |
|
382 shows "p = 0" |
|
383 using a |
|
384 by (simp add: expand_perm_eq) |
|
385 |
|
386 fun |
|
387 add_perm |
|
388 where |
|
389 "add_perm [] = 0" |
|
390 | "add_perm ((a, b) # xs) = (a \<rightleftharpoons> b) + add_perm xs" |
|
391 |
|
392 fun |
|
393 elem_perm |
|
394 where |
|
395 "elem_perm [] = {}" |
|
396 | "elem_perm ((a, b) # xs) = {a, b} \<union> elem_perm xs" |
|
397 |
|
398 |
|
399 lemma add_perm_apend: |
|
400 shows "add_perm (xs @ ys) = add_perm xs + add_perm ys" |
|
401 apply(induct xs arbitrary: ys) |
|
402 apply(auto simp add: add_assoc) |
|
403 done |
|
404 |
|
405 lemma perm_list_exists: |
|
406 fixes p::perm |
|
407 shows "\<exists>xs. p = add_perm xs \<and> supp xs \<subseteq> supp p" |
|
408 apply(induct p taking: "\<lambda>p::perm. card (supp p)" rule: measure_induct) |
|
409 apply(rename_tac p) |
|
410 apply(case_tac "supp p = {}") |
|
411 apply(simp) |
|
412 apply(simp add: supp_perm) |
|
413 apply(drule perm_zero) |
|
414 apply(simp) |
|
415 apply(rule_tac x="[]" in exI) |
|
416 apply(simp add: supp_Nil) |
|
417 apply(subgoal_tac "\<exists>x. x \<in> supp p") |
|
418 defer |
|
419 apply(auto)[1] |
|
420 apply(erule exE) |
|
421 apply(drule_tac x="p + (((- p) \<bullet> x) \<rightleftharpoons> x)" in spec) |
|
422 apply(drule mp) |
|
423 defer |
|
424 apply(erule exE) |
|
425 apply(rule_tac x="xs @ [((- p) \<bullet> x, x)]" in exI) |
|
426 apply(simp add: add_perm_apend) |
|
427 apply(erule conjE) |
|
428 apply(drule sym) |
|
429 apply(simp) |
|
430 apply(simp add: expand_perm_eq) |
|
431 apply(simp add: supp_append) |
|
432 apply(simp add: supp_perm supp_Cons supp_Nil supp_Pair supp_atom) |
|
433 apply(rule conjI) |
|
434 prefer 2 |
|
435 apply(auto)[1] |
|
436 apply (metis left_minus minus_unique permute_atom_def_raw permute_minus_cancel(2)) |
|
437 defer |
|
438 apply(rule psubset_card_mono) |
|
439 apply(simp add: finite_supp) |
|
440 apply(rule psubsetI) |
|
441 defer |
|
442 apply(subgoal_tac "x \<notin> supp (p + (- p \<bullet> x \<rightleftharpoons> x))") |
|
443 apply(blast) |
|
444 apply(simp add: supp_perm) |
|
445 defer |
|
446 apply(auto simp add: supp_perm)[1] |
|
447 apply(case_tac "x = xa") |
|
448 apply(simp) |
|
449 apply(case_tac "((- p) \<bullet> x) = xa") |
|
450 apply(simp) |
|
451 apply(case_tac "sort_of xa = sort_of x") |
|
452 apply(simp) |
|
453 apply(auto)[1] |
|
454 apply(simp) |
|
455 apply(simp) |
|
456 apply(subgoal_tac "{a. p \<bullet> (- p \<bullet> x \<rightleftharpoons> x) \<bullet> a \<noteq> a} \<subseteq> {a. p \<bullet> a \<noteq> a}") |
|
457 apply(blast) |
|
458 apply(auto simp add: supp_perm)[1] |
|
459 apply(case_tac "x = xa") |
|
460 apply(simp) |
|
461 apply(case_tac "((- p) \<bullet> x) = xa") |
|
462 apply(simp) |
|
463 apply(case_tac "sort_of xa = sort_of x") |
|
464 apply(simp) |
|
465 apply(auto)[1] |
|
466 apply(simp) |
|
467 apply(simp) |
|
468 done |
|
469 |
|
470 lemma tt0: |
|
471 fixes p::perm |
|
472 shows "(supp x) \<sharp>* p \<Longrightarrow> \<forall>a \<in> supp p. a \<sharp> x" |
|
473 apply(auto simp add: fresh_star_def supp_perm fresh_def) |
|
474 done |
|
475 |
|
476 lemma uu0: |
|
477 shows "(\<forall>a \<in> elem_perm xs. a \<sharp> x) \<Longrightarrow> (add_perm xs \<bullet> x) = x" |
|
478 apply(induct xs rule: add_perm.induct) |
|
479 apply(simp) |
|
480 apply(simp add: swap_fresh_fresh) |
|
481 done |
|
482 |
|
483 lemma yy0: |
|
484 fixes xs::"(atom \<times> atom) list" |
|
485 shows "supp xs = elem_perm xs" |
|
486 apply(induct xs rule: elem_perm.induct) |
|
487 apply(auto simp add: supp_Nil supp_Cons supp_Pair supp_atom) |
|
488 done |
|
489 |
|
490 lemma tt1: |
|
491 shows "(supp x) \<sharp>* p \<Longrightarrow> p \<bullet> x = x" |
|
492 apply(drule tt0) |
|
493 apply(subgoal_tac "\<exists>xs. p = add_perm xs \<and> supp xs \<subseteq> supp p") |
|
494 prefer 2 |
|
495 apply(rule perm_list_exists) |
|
496 apply(erule exE) |
|
497 apply(simp only: yy0) |
|
498 apply(rule uu0) |
|
499 apply(auto) |
|
500 done |
|
501 |
|
502 |
380 |
503 lemma perm_induct_test: |
381 lemma perm_induct_test: |
504 fixes P :: "perm => bool" |
382 fixes P :: "perm => bool" |
505 assumes fin: "finite (supp p)" |
383 assumes fin: "finite (supp p)" |
506 assumes zero: "P 0" |
384 assumes zero: "P 0" |
507 assumes swap: "\<And>a b. \<lbrakk>sort_of a = sort_of b; a \<noteq> b\<rbrakk> \<Longrightarrow> P (a \<rightleftharpoons> b)" |
385 assumes swap: "\<And>a b. \<lbrakk>sort_of a = sort_of b; a \<noteq> b\<rbrakk> \<Longrightarrow> P (a \<rightleftharpoons> b)" |
508 assumes plus: "\<And>p1 p2. \<lbrakk>supp p1 \<inter> supp p2 = {}; P p1; P p2\<rbrakk> \<Longrightarrow> P (p1 + p2)" |
386 assumes plus: "\<And>p1 p2. \<lbrakk>supp p1 \<inter> supp p2 = {}; P p1; P p2\<rbrakk> \<Longrightarrow> P (p1 + p2)" |
509 shows "P p" |
387 shows "P p" |
510 using fin |
388 using fin |
511 apply(induct F\<equiv>"supp p" arbitrary: p rule: finite_induct) |
389 apply(induct F\<equiv>"supp p" arbitrary: p rule: finite_induct) |
512 apply(simp add: supp_perm) |
|
513 apply(drule perm_zero) |
|
514 apply(simp add: zero) |
|
515 apply(rotate_tac 3) |
|
516 oops |
390 oops |
517 |
391 |
518 lemma ii: |
392 lemma ii: |
519 assumes "\<forall>x \<in> A. p \<bullet> x = x" |
393 assumes "\<forall>x \<in> A. p \<bullet> x = x" |
520 shows "p \<bullet> A = A" |
394 shows "p \<bullet> A = A" |
616 apply(simp add: alpha_gen) |
490 apply(simp add: alpha_gen) |
617 apply(erule conjE)+ |
491 apply(erule conjE)+ |
618 apply(case_tac "a \<notin> supp x") |
492 apply(case_tac "a \<notin> supp x") |
619 apply(simp) |
493 apply(simp) |
620 apply(subgoal_tac "supp x \<sharp>* p") |
494 apply(subgoal_tac "supp x \<sharp>* p") |
621 apply(drule tt1) |
495 apply(drule supp_perm_eq) |
622 apply(simp) |
496 apply(simp) |
623 apply(simp) |
497 apply(simp) |
624 apply(simp) |
498 apply(simp) |
625 apply(case_tac "a \<notin> supp y") |
499 apply(case_tac "a \<notin> supp y") |
626 apply(simp) |
500 apply(simp) |
627 apply(drule tt1) |
501 apply(drule supp_perm_eq) |
628 apply(clarify) |
502 apply(clarify) |
629 apply(simp (no_asm_use)) |
503 apply(simp (no_asm_use)) |
630 apply(simp) |
504 apply(simp) |
631 apply(simp) |
505 apply(simp) |
632 apply(drule yy) |
506 apply(drule yy) |
633 apply(simp) |
507 apply(simp) |
634 apply(simp) |
508 apply(simp) |
635 apply(simp) |
509 apply(simp) |
636 apply(case_tac "a \<sharp> p") |
510 apply(case_tac "a \<sharp> p") |
637 apply(subgoal_tac "supp y \<sharp>* p") |
511 apply(subgoal_tac "supp y \<sharp>* p") |
638 apply(drule tt1) |
512 apply(drule supp_perm_eq) |
639 apply(clarify) |
513 apply(clarify) |
640 apply(simp (no_asm_use)) |
514 apply(simp (no_asm_use)) |
641 apply(metis) |
515 apply(metis) |
642 apply(auto simp add: fresh_star_def)[1] |
516 apply(auto simp add: fresh_star_def)[1] |
643 apply(frule_tac kk) |
517 apply(frule_tac kk) |