src/HOL/Datatype.thy
changeset 22782 8bc6fbbe1d0f
parent 22744 5cbe966d67a2
child 22886 cdff6ef76009
equal deleted inserted replaced
22781:18fbba942a80 22782:8bc6fbbe1d0f
   550   induction unit_induct
   550   induction unit_induct
   551 
   551 
   552 rep_datatype prod
   552 rep_datatype prod
   553   inject Pair_eq
   553   inject Pair_eq
   554   induction prod_induct
   554   induction prod_induct
       
   555 
       
   556 lemmas prod_caseI = prod.cases [THEN iffD2, standard]
       
   557 
       
   558 lemma prod_caseI2: "!!p. [| !!a b. p = (a, b) ==> c a b |] ==> prod_case c p"
       
   559   by auto
       
   560 
       
   561 lemma prod_caseI2': "!!p. [| !!a b. (a, b) = p ==> c a b x |] ==> prod_case c p x"
       
   562   by (auto simp: split_tupled_all)
       
   563 
       
   564 lemma prod_caseE: "prod_case c p ==> (!!x y. p = (x, y) ==> c x y ==> Q) ==> Q"
       
   565   by (induct p) auto
       
   566 
       
   567 lemma prod_caseE': "prod_case c p z ==> (!!x y. p = (x, y) ==> c x y z ==> Q) ==> Q"
       
   568   by (induct p) auto
       
   569 
       
   570 lemma prod_case_unfold: "prod_case = (%c p. c (fst p) (snd p))"
       
   571   by (simp add: expand_fun_eq)
       
   572 
       
   573 declare prod_caseI2' [intro!] prod_caseI2 [intro!] prod_caseI [intro!]
       
   574 declare prod_caseE' [elim!] prod_caseE [elim!]
   555 
   575 
   556 rep_datatype sum
   576 rep_datatype sum
   557   distinct Inl_not_Inr Inr_not_Inl
   577   distinct Inl_not_Inr Inr_not_Inl
   558   inject Inl_eq Inr_eq
   578   inject Inl_eq Inr_eq
   559   induction sum_induct
   579   induction sum_induct