src/HOL/Multivariate_Analysis/Finite_Cartesian_Product.thy
changeset 34290 1edf0f223c6e
parent 34289 c9c14c72d035
child 34291 4e896680897e
equal deleted inserted replaced
34289:c9c14c72d035 34290:1edf0f223c6e
    16   morphisms Cart_nth Cart_lambda ..
    16   morphisms Cart_nth Cart_lambda ..
    17 
    17 
    18 notation Cart_nth (infixl "$" 90)
    18 notation Cart_nth (infixl "$" 90)
    19 
    19 
    20 notation (xsymbols) Cart_lambda (binder "\<chi>" 10)
    20 notation (xsymbols) Cart_lambda (binder "\<chi>" 10)
       
    21 
       
    22 (*
       
    23   Translate "'b ^ 'n" into "'b ^ ('n :: finite)". When 'n needs more than one
       
    24   type class write "cart 'b ('n::{finite, ...})"
       
    25 *)
       
    26 
       
    27 syntax "_finite_cart" :: "type \<Rightarrow> type \<Rightarrow> type" ("(_ ^/ _)" [15, 16] 15)
       
    28 
       
    29 parse_translation {*
       
    30 let
       
    31   fun cart t u = Syntax.const @{type_name cart} $ t $ u
       
    32   fun finite_cart_tr [t, u as Free (x, _)] =
       
    33         if Syntax.is_tid x
       
    34         then cart t (Syntax.const "_ofsort" $ u $ Syntax.const (hd @{sort finite}))
       
    35         else cart t u
       
    36     | finite_cart_tr [t, u] = cart t u
       
    37 in
       
    38   [("_finite_cart", finite_cart_tr)]
       
    39 end
       
    40 *}
    21 
    41 
    22 lemma stupid_ext: "(\<forall>x. f x = g x) \<longleftrightarrow> (f = g)"
    42 lemma stupid_ext: "(\<forall>x. f x = g x) \<longleftrightarrow> (f = g)"
    23   apply auto
    43   apply auto
    24   apply (rule ext)
    44   apply (rule ext)
    25   apply auto
    45   apply auto