-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
738 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module GATs | ||
export GATC | ||
|
||
using ....Models | ||
using ....Syntax | ||
using ...StdTheories | ||
|
||
using GATlab, GATlab.Models | ||
|
||
struct GATC <: Model{Tuple{GAT, AbsTheoryMap}} | ||
end | ||
|
||
@instance ThCategory{GAT, AbsTheoryMap} (;model::GATC) begin | ||
id(x::GAT) = IdTheoryMap(x) | ||
compose(f::AbsTheoryMap, g::AbsTheoryMap) = TheoryMaps.compose(f,g) | ||
dom(f::AbsTheoryMap) = TheoryMaps.dom(f) | ||
codom(f::AbsTheoryMap) = TheoryMaps.codom(f) | ||
end | ||
|
||
end # module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module Maps | ||
|
||
export SwapMonoid, NatPlusMonoid, PreorderCat | ||
|
||
using ...StdTheories | ||
using ....Syntax | ||
|
||
|
||
SwapMonoid = @theorymap ThMonoid => ThMonoid begin | ||
default => default | ||
x⋅y ⊣ [x, y] => y⋅x ⊣ [x,y] | ||
e => e | ||
end | ||
|
||
|
||
NatPlusMonoid = @theorymap ThMonoid => ThNatPlus begin | ||
default => ℕ | ||
e => Z | ||
(x ⋅ y) ⊣ [x, y] => x+y ⊣ [(x, y)::ℕ] | ||
end | ||
|
||
"""Preorders are categories""" | ||
PreorderCat = @theorymap ThCategory => ThPreorder begin | ||
Ob => default | ||
Hom => Leq | ||
compose(f, g) ⊣ [a::Ob, b::Ob, c::Ob, f::(a → b), g::(b → c)] => | ||
trans(f, g) ⊣ [a, b, c, f::Leq(a, b), g::Leq(b, c)] | ||
id(a) ⊣ [a::Ob] => refl(a) ⊣ [a] | ||
end | ||
|
||
"""Thin categories are isomorphic to preorders""" | ||
# PreorderThinCat = compose(PreorderCat, Incl(ThCategory, ThThinCategory)) | ||
# ThinCatPreorder = inv(PreorderThinCat) | ||
|
||
|
||
end # module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module StdTheoryMaps | ||
|
||
using Reexport | ||
|
||
include("Maps.jl") # split into files when big enough | ||
|
||
@reexport using .Maps | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.