-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed Modality #970
Closed Modality #970
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! I have just a couple of comments.
Cubical/HITs/Join/Properties.agda
Outdated
join-leftUnit : {A : Type ℓ} → isContr (join (Unit* {ℓ'}) A) | ||
fst join-leftUnit = inl tt* | ||
snd join-leftUnit (inl tt*) = refl | ||
snd join-leftUnit (inr a) = push tt* a | ||
snd join-leftUnit (push tt* a i) j = push tt* a (i ∧ j) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name leftUnit
is a bit ambiguous---it could also refer to the left unit law join ⊥ A ≃ A
. How about instead calling this joinAnnihilL
, following the algebra naming conventions (Cubical/Algebra/NAMING.md)?
Modality.◯-elim closedModality {B = B} B-modal f (push x a i) = | ||
hcomp | ||
(λ where | ||
j (i = i0) → contr (transport (λ k → B (push x a (~ k))) (f a)) (~ j) -- Contractibilty | ||
j (i = i1) → f a) | ||
(transport-filler (sym (cong B (push x a))) (f a) (~ i)) | ||
where | ||
contr : (y : B (inl x)) → fst (B-modal (inl x) x) ≡ y | ||
contr = snd (B-modal (inl x) x) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A more compact (if less "efficient") proof for this case is
Modality.◯-elim closedModality B-modal f (push x a i) =
isProp→PathP (λ i → isContr→isProp (B-modal (push x a i) x)) (B-modal (inl x) x .fst) (f a) i
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for the suggestions! I've implemented them now.
Implement the closed modality, also left unit law for join of types.