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

Computational M-types #1233

Merged
merged 61 commits into from Jun 6, 2019
Merged

Conversation

rmatthes
Copy link
Member

@rmatthes rmatthes commented Jun 5, 2019

a fruit of the UniMath School 2019: a streamlined version of the construction by Felix Rech of M-types (coinductive trees) that enjoy the equational rule of coiteration definitionally: Lemma corec_computation is proved merely by idpath. As input we take any final coalgebra for the respective polynomial functor (hence, with the provable coiteration rule), the output is the refined final coalgebra with the law holding definitionally (of course, both coalgebras are equal - provably). The proof tries to use as much as possible already existing results in the library. Only one lemma of a general nature is added to MoreFoundations.PartA.

The commit history contains also the development made by Scoccola and Rech at UniMath School 2017 and other stuff that is deleted later. For reviewing this PR, looking at the diff will be much easier than following the commit history.

Copy link
Collaborator

@langston-barrett langston-barrett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great result to have in UniMath! Very happy to see the results of two UniMath schools being tidied up and finished. Thanks, Ralph!

cbn. apply funextsec. intros b. rewrite <- helper_A.
unfold carriers_eq. rewrite weqpath_transport.
cbn. rewrite eq_corecM0. apply idpath.
Qed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to use Defined. here?

@benediktahrens
Copy link
Member

The code looks very good. I would only like to have confirmation that the many Qed. are indeed the right choice. @rmatthes @dominik-kirst , can you confirm?

@rmatthes
Copy link
Member Author

rmatthes commented Jun 6, 2019

@benediktahrens : I cannot confirm that Qed was the right choice. Compilation time increased by very little with Defined (almost) everywhere. One would have to observe the impact in case studies using M-types.

@benediktahrens
Copy link
Member

@rmatthes : thanks a lot for your feedback. Why is the body of corec_computation opaque, even though it is idpath? Typically, working with an idpath is as pleasant as it gets, and thus hiding it in an opaque constant seems a shame. Or are you suggesting never using corec_computation?

@rmatthes
Copy link
Member Author

rmatthes commented Jun 6, 2019

@benediktahrens : I thought that such equations are rarely used for rewriting since one would normally solve the goal at hand by idpath, again. But it is true that we do not need to discourage their use so brutally.

Copy link
Member

@benediktahrens benediktahrens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@benediktahrens benediktahrens merged commit be43b5e into UniMath:master Jun 6, 2019
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.

None yet

6 participants