Skip to content
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

Merged
merged 5 commits into from
Jan 14, 2023
Merged

Closed Modality #970

merged 5 commits into from
Jan 14, 2023

Conversation

markrd-williams
Copy link
Contributor

Implement the closed modality, also left unit law for join of types.

Copy link
Collaborator

@ecavallo ecavallo left a 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.

Comment on lines 480 to 484
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)
Copy link
Collaborator

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)?

Comment on lines 35 to 43
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)
Copy link
Collaborator

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

Copy link
Contributor Author

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.

@ecavallo ecavallo merged commit 8f47d5a into agda:master Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants