src/HOL/Library/Quotient_List.thy
changeset 47634 091bcd569441
parent 47455 26315a545e26
child 47641 2cddc27a881f
equal deleted inserted replaced
47627:2b1d3eda59eb 47634:091bcd569441
   204 
   204 
   205 lemma list_all2_refl:
   205 lemma list_all2_refl:
   206   assumes a: "\<And>x y. R x y = (R x = R y)"
   206   assumes a: "\<And>x y. R x y = (R x = R y)"
   207   shows "list_all2 R x x"
   207   shows "list_all2 R x x"
   208   by (induct x) (auto simp add: a)
   208   by (induct x) (auto simp add: a)
       
   209 
       
   210 subsection {* Setup for lifting package *}
   209 
   211 
   210 lemma list_quotient:
   212 lemma list_quotient:
   211   assumes "Quotient R Abs Rep T"
   213   assumes "Quotient R Abs Rep T"
   212   shows "Quotient (list_all2 R) (List.map Abs) (List.map Rep) (list_all2 T)"
   214   shows "Quotient (list_all2 R) (List.map Abs) (List.map Rep) (list_all2 T)"
   213 proof (rule QuotientI)
   215 proof (rule QuotientI)
   249   done
   251   done
   250 qed
   252 qed
   251 
   253 
   252 declare [[map list = (list_all2, list_quotient)]]
   254 declare [[map list = (list_all2, list_quotient)]]
   253 
   255 
       
   256 lemma list_invariant_commute [invariant_commute]:
       
   257   "list_all2 (Lifting.invariant P) = Lifting.invariant (list_all P)"
       
   258   apply (simp add: fun_eq_iff list_all2_def list_all_iff Lifting.invariant_def Ball_def) 
       
   259   apply (intro allI) 
       
   260   apply (induct_tac rule: list_induct2') 
       
   261   apply simp_all 
       
   262   apply metis
       
   263 done
       
   264 
   254 end
   265 end