mathlib3 documentation

category_theory.category.PartialFun

The category of types with partial functions #

THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.

This defines PartialFun, the category of types equipped with partial functions.

This category is classically equivalent to the category of pointed types. The reason it doesn't hold constructively stems from the difference between part and option. Both can model partial functions, but the latter forces a decidable domain.

Precisely, PartialFun_to_Pointed turns a partial function α →. β into a function option α → option β by sending to none the undefined values (and none to none). But being defined is (generally) undecidable while being sent to none is decidable. So it can't be constructive.

References #

def PartialFun  :
Type (u_1+1)

The category of types equipped with partial functions.

Equations
Instances for PartialFun
@[nolint]

Turns a type into a PartialFun.

Equations
@[simp]
theorem PartialFun.coe_of (X : Type u_1) :
@[protected, instance]
Equations
@[protected, instance]
Equations
def PartialFun.iso.mk {α β : PartialFun} (e : α β) :
α β

Constructs a partial function isomorphism between types from an equivalence between them.

Equations
@[simp]
theorem PartialFun.iso.mk_inv {α β : PartialFun} (e : α β) :
@[simp]
theorem PartialFun.iso.mk_hom {α β : PartialFun} (e : α β) :

The forgetful functor from Type to PartialFun which forgets that the maps are total.

Equations
Instances for Type_to_PartialFun
@[simp]
theorem Pointed_to_PartialFun_map (X Y : Pointed) (f : X Y) (ᾰ : {x // x X.point}) :

The functor which deletes the point of a pointed type. In return, this makes the maps partial. This the computable part of the equivalence PartialFun_equiv_Pointed.

Equations

The functor which maps undefined values to a new point. This makes the maps total and creates pointed types. This the noncomputable part of the equivalence PartialFun_equiv_Pointed. It can't be computable because = option.none is decidable while the domain of a general part isn't.

Equations
@[simp]
@[simp]
theorem PartialFun_equiv_Pointed_inverse_map_get_coe (X Y : Pointed) (f : X Y) (ᾰ : {x // x X.point}) (property : f.to_fun ᾰ.val Y.point) :
@[simp]
theorem PartialFun_equiv_Pointed_inverse_map_dom (X Y : Pointed) (f : X Y) (ᾰ : {x // x X.point}) :
@[simp]
theorem PartialFun_equiv_Pointed_counit_iso_inv_app_to_fun (X : Pointed) (ᾰ : ((𝟭 Pointed).obj X)) :
(PartialFun_equiv_Pointed.counit_iso.inv.app X).to_fun = dite (ᾰ = X.point) (λ (h : = X.point), option.none) (λ (h : ¬= X.point), option.some ᾰ, h⟩)

Forgetting that maps are total and making them total again by adding a point is the same as just adding a point.

Equations