35
35
//! When a function is "split epic", it means that it has a right inverse.
36
36
//! Similarly, when a function is "split monic", it means it has a left inverse.
37
37
//!
38
- //! - `~(f . inv(f))` is the same as saying that `f` is split epic (see [split_epic])
39
- //! - `~(inv(f) . f)` is the same as saying that `f` is split monic (see [split_monic])
38
+ //! - `~(f . inv(f))` is the same as saying that `f` is split epic (see [SplitEpic] and [ split_epic])
39
+ //! - `~(inv(f) . f)` is the same as saying that `f` is split monic (see [SplitMonic] and [ split_monic])
40
40
41
41
use super :: * ;
42
42
@@ -59,6 +59,12 @@ pub type Surjective<F, X, Y, B, A> = Imply<
59
59
Exists < Ty < A , X > , Eq < App < F , A > , B > >
60
60
> ;
61
61
62
+ /// `split_epic(f) := ~(f . inv(f))`.
63
+ pub type SplitEpic < F > = Qu < Comp < F , Inv < F > > > ;
64
+
65
+ /// `split_monic(f) := ~(inv(f) . f)`.
66
+ pub type SplitMonic < F > = Qu < Comp < Inv < F > , F > > ;
67
+
62
68
/// Inverse type `(f : x -> y) => (inv(f) : y -> x)`.
63
69
pub fn inv_ty < F : Prop , X : Prop , Y : Prop > (
64
70
_ty_f : Ty < F , Pow < Y , X > >
@@ -89,25 +95,25 @@ pub fn path<F: Prop, X: Prop, Y: Prop>(
89
95
pub fn id_inv < X : Prop > ( ) -> Eq < Inv < App < FId , X > > , App < FId , X > > { unimplemented ! ( ) }
90
96
/// `~(f . inv(f)) ⋀ (f : a -> b) ⋀ (f . inv(f)) => id{b}`.
91
97
pub fn comp_right_inv_to_id < F : Prop , A : Prop , B : Prop > (
92
- _: Qu < Comp < F , Inv < F > > > ,
98
+ _: SplitEpic < F > ,
93
99
_: Ty < F , Pow < B , A > > ,
94
100
_: Comp < F , Inv < F > >
95
101
) -> App < FId , B > { unimplemented ! ( ) }
96
102
/// `~(f . inv(f)) ⋀ (f : a -> b) ⋀ id{b} => (f . inv(f))`.
97
103
pub fn id_to_comp_right_inv < F : Prop , A : Prop , B : Prop > (
98
- _: Qu < Comp < F , Inv < F > > > ,
104
+ _: SplitEpic < F > ,
99
105
_: Ty < F , Pow < B , A > > ,
100
106
_: App < FId , B >
101
107
) -> Comp < F , Inv < F > > { unimplemented ! ( ) }
102
108
/// `~(inv(f) . f) ⋀ (f : a -> b) ⋀ (inv(f) . f) => id{a}`.
103
109
pub fn comp_left_inv_to_id < F : Prop , A : Prop , B : Prop > (
104
- _: Qu < Comp < Inv < F > , F > > ,
110
+ _: SplitMonic < F > ,
105
111
_: Ty < F , Pow < B , A > > ,
106
112
_: Comp < Inv < F > , F >
107
113
) -> App < FId , A > { unimplemented ! ( ) }
108
114
/// `~(inv(f) . f) ⋀ (f : a -> b) ⋀ id{a} => (inv(f). f)`.
109
115
pub fn id_to_comp_left_inv < F : Prop , A : Prop , B : Prop > (
110
- _: Qu < Comp < Inv < F > , F > > ,
116
+ _: SplitMonic < F > ,
111
117
_: Ty < F , Pow < B , A > > ,
112
118
_: App < FId , A >
113
119
) -> Comp < Inv < F > , F > { unimplemented ! ( ) }
@@ -227,7 +233,7 @@ pub fn self_inv_to_eq_id<F: Prop, A: Prop>(
227
233
}
228
234
/// `~(f . inv(f)) ⋀ ((g . f) == (h . f)) ⋀ (f : a -> x) ⋀ (g : x -> y) ⋀ (h : x -> y) => g == h`.
229
235
pub fn split_epic < F : Prop , G : Prop , H : Prop , X : Prop , Y : Prop , A : Prop > (
230
- qu_comp_f_inv_f : Qu < Comp < F , Inv < F > > > ,
236
+ qu_comp_f_inv_f : SplitEpic < F > ,
231
237
x : Eq < Comp < G , F > , Comp < H , F > > ,
232
238
ty_f : Ty < F , Pow < X , A > > ,
233
239
ty_g : Ty < G , Pow < Y , X > > ,
@@ -245,7 +251,7 @@ pub fn split_epic<F: Prop, G: Prop, H: Prop, X: Prop, Y: Prop, A: Prop>(
245
251
}
246
252
/// `~(inv(f) . f) ⋀ ((f . g) == (f . h)) ⋀ (f : x -> y) ⋀ (g : a -> x) ⋀ (h : a -> x) => g == h`.
247
253
pub fn split_monic < F : Prop , G : Prop , H : Prop , X : Prop , Y : Prop , A : Prop > (
248
- qu_comp_inv_f_f : Qu < Comp < Inv < F > , F > > ,
254
+ qu_comp_inv_f_f : SplitMonic < F > ,
249
255
x : Eq < Comp < F , G > , Comp < F , H > > ,
250
256
ty_f : Ty < F , Pow < Y , X > > ,
251
257
ty_g : Ty < G , Pow < X , A > > ,
@@ -263,7 +269,7 @@ pub fn split_monic<F: Prop, G: Prop, H: Prop, X: Prop, Y: Prop, A: Prop>(
263
269
}
264
270
/// `~(inv(f) . f) ⋀ (f : a -> b) => (inv(f) . f) == id{a}`.
265
271
pub fn eq_comp_left_inv_id < F : Prop , A : Prop , B : Prop > (
266
- qu_comp_inv_f_f : Qu < Comp < Inv < F > , F > > ,
272
+ qu_comp_inv_f_f : SplitMonic < F > ,
267
273
ty_f : Ty < F , Pow < B , A > >
268
274
) -> Eq < Comp < Inv < F > , F > , Id < A > > {
269
275
let ty_f2 = ty_f. clone ( ) ;
@@ -273,7 +279,7 @@ pub fn eq_comp_left_inv_id<F: Prop, A: Prop, B: Prop>(
273
279
}
274
280
/// `~(f . inv(f)) ⋀ (f : a -> b) => (f . inv(f)) == id{b}`.
275
281
pub fn eq_comp_right_inv_id < F : Prop , A : Prop , B : Prop > (
276
- qu_comp_f_inv_f : Qu < Comp < F , Inv < F > > > ,
282
+ qu_comp_f_inv_f : SplitEpic < F > ,
277
283
ty_f : Ty < F , Pow < B , A > >
278
284
) -> Eq < Comp < F , Inv < F > > , Id < B > > {
279
285
let ty_f2 = ty_f. clone ( ) ;
0 commit comments