<commit_before>(*  Title: 	ZF/sum.thy
    ID:         $Id$
    Author: 	<NAME>, Cambridge University Computer Laboratory
    Copyright   1993  University of Cambridge

Disjoint sums in Zermelo-Fraenkel Set Theory 
"Part" primitive for simultaneous recursive type definitions
*)

Sum = Bool + "simpdata" +
consts
    "+"    	:: "[i,i]=>i"      		(infixr 65)
    Inl,Inr     :: "i=>i"
    case        :: "[i=>i, i=>i, i]=>i"
    Part        :: "[i,i=>i] => i"

defs
    sum_def     "A+B == {0}*A Un {1}*B"
    Inl_def     "Inl(a) == <0,a>"
    Inr_def     "Inr(b) == <1,b>"
    case_def    "case(c,d) == split(%y z. cond(y, d(z), c(z)))"

  (*operator for selecting out the various summands*)
    Part_def	"Part(A,h) == {x: A. EX z. x = h(z)}"
end<commit_msg>case is defined using pattern-matching<commit_after>(*  Title: 	ZF/sum.thy
    ID:         $Id$
    Author: 	<NAME>, Cambridge University Computer Laboratory
    Copyright   1993  University of Cambridge

Disjoint sums in Zermelo-Fraenkel Set Theory 
"Part" primitive for simultaneous recursive type definitions
*)

Sum = Bool + "simpdata" +
consts
    "+"    	:: "[i,i]=>i"      		(infixr 65)
    Inl,Inr     :: "i=>i"
    case        :: "[i=>i, i=>i, i]=>i"
    Part        :: "[i,i=>i] => i"

defs
    sum_def     "A+B == {0}*A Un {1}*B"
    Inl_def     "Inl(a) == <0,a>"
    Inr_def     "Inr(b) == <1,b>"
    case_def    "case(c,d) == (%<y,z>. cond(y, d(z), c(z)))"

  (*operator for selecting out the various summands*)
    Part_def	"Part(A,h) == {x: A. EX z. x = h(z)}"
end
{'fraction_non_alphanumeric': 0.18229166666666666, 'fraction_numerical': 0.013020833333333334, 'mean_word_length': 2.5496535796766744, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5658069', 'n_tokens_mistral': 643, 'n_tokens_neox': 619, 'n_words': 162}