(* (c) Copyright, Bill Richter 2013 *) (* Distributed under the same license as HOL Light *) (* *) (* Definitions of FunctionSpace and FunctionComposition. A proof that the *) (* Cartesian product satisfies the universal property that given functions *) (* f â M â A and g â M â B, there is a unique h â M â A â B whose *) (* projections to A and B are f and g. *) needs "RichterHilbertAxiomGeometry/readable.ml";; (* parse_as_infix("â",(11, "right"));; parse_as_infix("â",(20, "right"));; parse_as_infix("â",(20, "right"));; parse_as_infix("â",(13,"right"));; â |- âa l. a â l â ¬(a â l) CartesianProduct |- â X Y. X â Y = {x,y | x â X ⧠y â Y} IN_CartesianProduct |- â X Y x y. x,y â X â Y â x â X ⧠y â Y FunctionSpace |- â s t. s â t = {f | (âx. x â s â f x â t) ⧠â x. x â s â f x = @y. T} IN_FunctionSpace |- â s t f. f â s â t â (âx. x â s â f x â t) ⧠âx. x â s â f x = @y. T FunctionComposition |- â f s g x. (g â (f,s)) x = if x â s then g (f x) else @y. T UniversalPropertyProduct |- â M A B f g. f â M â A ⧠g â M â B â (â! h. h â M â A â B ⧠FST â (h,M) = f ⧠SND â (h,M) = g) *) ParseAsInfix("â",(11, "right"));; ParseAsInfix("â",(20, "right"));; ParseAsInfix("â",(20, "right"));; ParseAsInfix("â",(13,"right"));; let NOTIN = NewDefinition `;âa l. a â l â ¬(a â l)`;; let CartesianProduct = NewDefinition `;â X Y. X â Y = {x,y | x â X ⧠y â Y}`;; let FunctionSpace = NewDefinition `;â s t. s â t = {f | (âx. x IN s â f x IN t) ⧠âx. x â s â f x = @y. T}`;; let FunctionComposition = NewDefinition `;â f:A->B s:A->bool g:B->C x. (g â (f,s)) x = if x â s then g (f x) else @y:C. T`;; let IN_CartesianProduct = theorem `; â X Y x y. x,y â X â Y â x â X ⧠y â Y proof REWRITE_TAC IN_ELIM_THM CartesianProduct; fol PAIR_EQ; qed; `;; let IN_FunctionSpace = theorem `; â s t f. f â s â t â (â x. x â s â f x â t) ⧠â x. x â s â f x = @y. T proof REWRITE_TAC IN_ELIM_THM FunctionSpace; qed; `;; let UniversalPropertyProduct = theorem `; â M A B f g. f â M â A ⧠g â M â B â â! h. h â M â A â B ⧠FST â (h,M) = f ⧠SND â (h,M) = g proof intro_TAC â M A B f g, H1; (â x. x â M â f x â A) ⧠âx. x â M â f x = @y. T [fProp] proof mp_TAC_specl [M; A; f] IN_FunctionSpace; fol H1; qed; (â x. x â M â g x â B) ⧠(âx. x â M â g x = @y. T) [gProp] proof mp_TAC_specl [M; B; g] IN_FunctionSpace; fol H1; qed; consider h such that h = λx. if x â M then f x,g x else @y. T [hExists] by fol; â x. (x â M â h x = f x,g x) ⧠(x â M â h x = @y. T) [hDef] by fol - â; â x. x â M â h x â A â B [hProd] by SIMP_TAC - IN_CartesianProduct fProp gProp; â x. x â M â (FST â (h,M)) x = f x ⧠(SND â (h,M)) x = g x [] proof SIMP_TAC hDef FST_DEF SND_DEF PAIR_EQ FunctionComposition; fol PAIR_EQ; qed; â x. (x â M â (FST â (h,M)) x = f x) ⧠(x â M â (FST â (h,M)) x = f x) ⧠(x â M â (SND â (h,M)) x = g x) ⧠(x â M â (SND â (h,M)) x = g x) [] by SIMP_TAC FunctionComposition - IN_FunctionSpace â fProp gProp; h â M â A â B ⧠FST â (h,M) = f ⧠SND â (h,M) = g [hWorks] proof SIMP_TAC hDef hProd IN_FunctionSpace; fol - â FUN_EQ_THM; qed; â k. (k â M â A â B ⧠FST â (k,M) = f ⧠SND â (k,M) = g) â h = k [] proof intro_TAC â k, kWorks; (â x. x â M â k x â A â B) ⧠â x. x â M â k x = @y. T [kOffM] proof mp_TAC_specl [M; A â B; k] IN_FunctionSpace; fol kWorks; qed; â x. x â M â k x = (FST â (k,M)) x,(SND â (k,M)) x [] by SIMP_TAC - PAIR FunctionComposition; â x. x â M â k x = f x,g x [] by SIMP_TAC - kWorks FST_DEF SND_DEF PAIR_EQ; SIMP_TAC FUN_EQ_THM; fol hDef - kOffM â; qed; fol hWorks - EXISTS_UNIQUE_THM; qed; `;;