Theory ZFC_Rudiments
section βΉSome rudiments of ZFCβΊ
text βΉSee also πβΉhttps://www.isa-afp.org/entries/ZFC_in_HOL.htmlβΊ by L.C. Paulson.βΊ
theory ZFC_Rudiments
imports Main
begin
typedecl V
axiomatization elts :: "V β V set"
where ext [intro?]: "elts x = elts y βΉ x=y"
and down_raw: "Y β elts x βΉ Y β range elts"
and Union_raw: "X β range elts βΉ Union (elts ` X) β range elts"
and Pow_raw: "X β range elts βΉ inv elts ` Pow X β range elts"
and replacement_raw: "X β range elts βΉ f ` X β range elts"
and inf_raw: "range (g :: nat β V) β range elts"
and foundation: "wf {(x,y). x β elts y}"
definition small :: "'a set β bool"
where "small X β‘ βV_of :: 'a β V. inj_on V_of X β§ V_of ` X β range elts"
definition set :: "V set β V"
where "set X β‘ (if small X then inv elts X else inv elts {})"
definition VPow :: "V β V"
where "VPow x = set (set ` Pow (elts x))"
definition vpair :: "V β V β V"
where "vpair a b = set {set {a},set {a,b}}"
definition vfst :: "V β V"
where "vfst p = (THE x. βy. p = vpair x y)"
definition vsnd :: "V β V"
where "vsnd p = (THE y. βx. p = vpair x y)"
definition VSigma :: "V β (V β V) β V"
where "VSigma A B = set(βx β elts A. βy β elts (B x). {vpair x y})"
abbreviation vtimes :: "V β V β V"
where "vtimes A B β‘ VSigma A (Ξ»x. B)"
definition pairs :: "V β (V Γ V) set"
where "pairs r = {(x,y). vpair x y β elts r}"
definition VLambda :: "V β (V β V) β V"
where "VLambda A b = set ((Ξ»x. vpair x (b x)) ` elts A)"
definition app :: "V β V β V"
where "app f x β‘ THE y. vpair x y β elts f"
definition VPi :: "V β (V β V) β V"
where "VPi A B =
set {f β elts (VPow (VSigma A B)). elts A β Domain (pairs f) β§ single_valued (pairs f)}"
end