Skip to content

Commit ead7c4f

Browse files
authored
Merge pull request #1739 from bvssvni/main
Added `SplitEpic` and `SplitMonic`
2 parents 904985a + 76db3b8 commit ead7c4f

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

src/fun/inv.rs

+16-10
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
//! When a function is "split epic", it means that it has a right inverse.
3636
//! Similarly, when a function is "split monic", it means it has a left inverse.
3737
//!
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])
4040
4141
use super::*;
4242

@@ -59,6 +59,12 @@ pub type Surjective<F, X, Y, B, A> = Imply<
5959
Exists<Ty<A, X>, Eq<App<F, A>, B>>
6060
>;
6161

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+
6268
/// Inverse type `(f : x -> y) => (inv(f) : y -> x)`.
6369
pub fn inv_ty<F: Prop, X: Prop, Y: Prop>(
6470
_ty_f: Ty<F, Pow<Y, X>>
@@ -89,25 +95,25 @@ pub fn path<F: Prop, X: Prop, Y: Prop>(
8995
pub fn id_inv<X: Prop>() -> Eq<Inv<App<FId, X>>, App<FId, X>> {unimplemented!()}
9096
/// `~(f . inv(f)) ⋀ (f : a -> b) ⋀ (f . inv(f)) => id{b}`.
9197
pub fn comp_right_inv_to_id<F: Prop, A: Prop, B: Prop>(
92-
_: Qu<Comp<F, Inv<F>>>,
98+
_: SplitEpic<F>,
9399
_: Ty<F, Pow<B, A>>,
94100
_: Comp<F, Inv<F>>
95101
) -> App<FId, B> {unimplemented!()}
96102
/// `~(f . inv(f)) ⋀ (f : a -> b) ⋀ id{b} => (f . inv(f))`.
97103
pub fn id_to_comp_right_inv<F: Prop, A: Prop, B: Prop>(
98-
_: Qu<Comp<F, Inv<F>>>,
104+
_: SplitEpic<F>,
99105
_: Ty<F, Pow<B, A>>,
100106
_: App<FId, B>
101107
) -> Comp<F, Inv<F>> {unimplemented!()}
102108
/// `~(inv(f) . f) ⋀ (f : a -> b) ⋀ (inv(f) . f) => id{a}`.
103109
pub fn comp_left_inv_to_id<F: Prop, A: Prop, B: Prop>(
104-
_: Qu<Comp<Inv<F>, F>>,
110+
_: SplitMonic<F>,
105111
_: Ty<F, Pow<B, A>>,
106112
_: Comp<Inv<F>, F>
107113
) -> App<FId, A> {unimplemented!()}
108114
/// `~(inv(f) . f) ⋀ (f : a -> b) ⋀ id{a} => (inv(f). f)`.
109115
pub fn id_to_comp_left_inv<F: Prop, A: Prop, B: Prop>(
110-
_: Qu<Comp<Inv<F>, F>>,
116+
_: SplitMonic<F>,
111117
_: Ty<F, Pow<B, A>>,
112118
_: App<FId, A>
113119
) -> Comp<Inv<F>, F> {unimplemented!()}
@@ -227,7 +233,7 @@ pub fn self_inv_to_eq_id<F: Prop, A: Prop>(
227233
}
228234
/// `~(f . inv(f)) ⋀ ((g . f) == (h . f)) ⋀ (f : a -> x) ⋀ (g : x -> y) ⋀ (h : x -> y) => g == h`.
229235
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>,
231237
x: Eq<Comp<G, F>, Comp<H, F>>,
232238
ty_f: Ty<F, Pow<X, A>>,
233239
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>(
245251
}
246252
/// `~(inv(f) . f) ⋀ ((f . g) == (f . h)) ⋀ (f : x -> y) ⋀ (g : a -> x) ⋀ (h : a -> x) => g == h`.
247253
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>,
249255
x: Eq<Comp<F, G>, Comp<F, H>>,
250256
ty_f: Ty<F, Pow<Y, X>>,
251257
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>(
263269
}
264270
/// `~(inv(f) . f) ⋀ (f : a -> b) => (inv(f) . f) == id{a}`.
265271
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>,
267273
ty_f: Ty<F, Pow<B, A>>
268274
) -> Eq<Comp<Inv<F>, F>, Id<A>> {
269275
let ty_f2 = ty_f.clone();
@@ -273,7 +279,7 @@ pub fn eq_comp_left_inv_id<F: Prop, A: Prop, B: Prop>(
273279
}
274280
/// `~(f . inv(f)) ⋀ (f : a -> b) => (f . inv(f)) == id{b}`.
275281
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>,
277283
ty_f: Ty<F, Pow<B, A>>
278284
) -> Eq<Comp<F, Inv<F>>, Id<B>> {
279285
let ty_f2 = ty_f.clone();

0 commit comments

Comments
 (0)