@hotdocx/endash-stdlib 0.0.0-stage → 0.1.0-preview.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FunctorialShowcase.en +84 -0
- package/LICENSE +15 -0
- package/README.md +2 -2
- package/arithmetic.json +1 -0
- package/manifest.json +27 -0
- package/package.json +20 -4
- package/walking-end.json +1 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
-- Pillar 3 Showcase: Directed Functorial Type Theory & Three-Pillar Bridge
|
|
2
|
+
-- Demonstrates bunched functorial abstractions `fun^f (x : Op C, y : C) => ...`,
|
|
3
|
+
-- directed composition in `WalkingEnd` (`Hom(WalkingEnd, base, base) ≃ Nat`),
|
|
4
|
+
-- the `WalkingEnd → Path Circle` group-completion & monodromy bridge, and the
|
|
5
|
+
-- side-by-side contrast between directed `WalkingEnd.loop` (non-invertible)
|
|
6
|
+
-- and groupoidal `Circle.loop` (invertible).
|
|
7
|
+
|
|
8
|
+
import HoTT.Circle
|
|
9
|
+
|
|
10
|
+
namespace Showcase.Functorial
|
|
11
|
+
|
|
12
|
+
/-- Representable Hom bifunctor `Op WalkingEnd × WalkingEnd → CatCart 0` built via `fun^f`! -/
|
|
13
|
+
def walkingHomBifunctor :
|
|
14
|
+
Functor (Op WalkingEnd) (Functor WalkingEnd (CatCart 0)) :=
|
|
15
|
+
fun^f (x : Op WalkingEnd, y : WalkingEnd) : CatCart 0 =>
|
|
16
|
+
Hom WalkingEnd x y
|
|
17
|
+
|
|
18
|
+
/-- Representable Hom bifunctor on the fundamental groupoid `Path Circle`. -/
|
|
19
|
+
def circleHomBifunctor :
|
|
20
|
+
Functor (Op (Path Circle)) (Functor (Path Circle) (CatCart 0)) :=
|
|
21
|
+
fun^f (x : Op (Path Circle), y : Path Circle) : CatCart 0 =>
|
|
22
|
+
Hom (Path Circle) x y
|
|
23
|
+
|
|
24
|
+
/-- Lax-staged 2-categorical constant family across a semicolon `;` bunch boundary! -/
|
|
25
|
+
def laxStagedWalkingFamily :
|
|
26
|
+
FunctorLax WalkingEnd (FunctorLax WalkingEnd (CatLax 0)) :=
|
|
27
|
+
fun^f (x : WalkingEnd; y : WalkingEnd) : CatLax 0 =>
|
|
28
|
+
WalkingEnd
|
|
29
|
+
|
|
30
|
+
/-- Directed 2-fold endomorphism `loop ∘ loop` in `WalkingEnd`. -/
|
|
31
|
+
def directedDoubleLoop : Hom WalkingEnd WalkingEnd.base WalkingEnd.base :=
|
|
32
|
+
WalkingEnd.loop ∘ WalkingEnd.loop
|
|
33
|
+
|
|
34
|
+
/-- Judgmental Došen spine encoding: `WalkingEnd.encode (loop ∘ loop) = 2` by `rfl`! -/
|
|
35
|
+
theorem directed_double_loop_encode :
|
|
36
|
+
WalkingEnd.encode directedDoubleLoop = 2 := rfl
|
|
37
|
+
|
|
38
|
+
/-- Directed Pillar 3 Equivalence: `Obj (Hom WalkingEnd base base) ≃ Nat`. -/
|
|
39
|
+
theorem walking_end_hom_equiv_nat :
|
|
40
|
+
Obj (Hom WalkingEnd WalkingEnd.base WalkingEnd.base) ≃ Nat :=
|
|
41
|
+
WalkingEnd.homEquivNat
|
|
42
|
+
|
|
43
|
+
/-- Group-completion functor `WalkingEnd → Path Circle` maps `WalkingEnd.loop ↦ Circle.loop` judgmentally! -/
|
|
44
|
+
theorem group_completion_on_generator :
|
|
45
|
+
WalkingEnd.toCircleHom WalkingEnd.loop = Circle.loop := rfl
|
|
46
|
+
|
|
47
|
+
/-- Group-completion maps `loop ∘ loop` in `WalkingEnd` judgmentally to `Circle.loop ∙ Circle.loop`! -/
|
|
48
|
+
theorem group_completion_on_double_loop :
|
|
49
|
+
WalkingEnd.toCircleHom directedDoubleLoop = (Circle.loop ∙ Circle.loop) := rfl
|
|
50
|
+
|
|
51
|
+
/-- Commuting Three-Pillar Encoding Square:
|
|
52
|
+
`WalkingEnd ──toCircleHom──► Path(Circle)`
|
|
53
|
+
` │ │`
|
|
54
|
+
` encode encodeBase`
|
|
55
|
+
` ▼ ▼`
|
|
56
|
+
` Nat ──────Int.ofNat──────► Int` -/
|
|
57
|
+
theorem three_pillar_encoding_square
|
|
58
|
+
(p : Obj (Hom WalkingEnd WalkingEnd.base WalkingEnd.base)) :
|
|
59
|
+
Circle.encodeBase (WalkingEnd.toCircleHom p) = Int.ofNat (WalkingEnd.encode p) :=
|
|
60
|
+
WalkingEnd.encode_toCircle_eq_ofNat p
|
|
61
|
+
|
|
62
|
+
/-- Monodromy restriction `(Circle → G) → Functor WalkingEnd (Path G)` computes on `loop` by `rfl`! -/
|
|
63
|
+
theorem monodromy_loop_beta (G : Grpd 0) (h : Circle → G) :
|
|
64
|
+
(WalkingEnd.restrictCircleMap G h).map1 WalkingEnd.loop = congrArg h Circle.loop := rfl
|
|
65
|
+
|
|
66
|
+
/-- Directed vs. Groupoidal Contrast (Part A): `WalkingEnd.loop` has NO inverse (`NC-6`)! -/
|
|
67
|
+
theorem directed_loop_not_invertible :
|
|
68
|
+
¬ IsIso WalkingEnd WalkingEnd.base WalkingEnd.base WalkingEnd.loop :=
|
|
69
|
+
WalkingEnd.loop_not_isIso
|
|
70
|
+
|
|
71
|
+
/-- Directed vs. Groupoidal Contrast (Part B): `Circle.loop` IS invertible in `Path Circle`! -/
|
|
72
|
+
theorem groupoid_loop_is_invertible :
|
|
73
|
+
IsIso (Path Circle) Circle.base Circle.base Circle.loop :=
|
|
74
|
+
Circle.loop_isIso
|
|
75
|
+
|
|
76
|
+
#check @walkingHomBifunctor
|
|
77
|
+
#check @three_pillar_encoding_square
|
|
78
|
+
#eval WalkingEnd.encode directedDoubleLoop
|
|
79
|
+
#eval Int.ofNat (WalkingEnd.encode directedDoubleLoop)
|
|
80
|
+
#print axioms three_pillar_encoding_square
|
|
81
|
+
#print axioms directed_loop_not_invertible
|
|
82
|
+
#print axioms groupoid_loop_is_invertible
|
|
83
|
+
|
|
84
|
+
end Showcase.Functorial
|
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 emdash contributors
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
+
PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @hotdocx/endash-stdlib
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This preview ships the verified WalkingEnd and arithmetic library closures and a source example. See manifest.json for the required kernel version, included modules and SHA-256 digest.
|