This repository was archived by the owner on Oct 14, 2023. It is now read-only.
RFC: Implement transfer method. Use it for int and dlist#1435
Closed
johoelzl wants to merge 12 commits intoleanprover:masterfrom
johoelzl:int_transfer
Closed
RFC: Implement transfer method. Use it for int and dlist#1435johoelzl wants to merge 12 commits intoleanprover:masterfrom johoelzl:int_transfer
johoelzl wants to merge 12 commits intoleanprover:masterfrom
johoelzl:int_transfer
Conversation
This commit introduces the transfer method. As application it is used it to prove that the integers form a commutative ring.
leodemoura
reviewed
Mar 8, 2017
| dlist.transfer, | ||
| intros, | ||
| simp | ||
| end |
Contributor
|
Beautiful! |
Member
|
I have already merged it. |
Contributor
Author
|
I marked it as RFC as its only tested on |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a
transfermethod to lean.It is used to prove that
intis a commutative ring. For this it transfers along a relation betweenint(i.e. a disjoint sum of nonnegative and negative numbers) and pairs of natural numbers. Usingtransferthe instantiation ofcomm_ring intis much shorter and nicer structured. For example: provingadd_assocrequired a case distinction on all 3 variables, this is now completely gone. Now it requires a proof for each constant (i.e.zero,add,mul, ...) that it is proper wrt to the relation. This turns out to be a straight forward case distinction on the function arguments.For
dlistit transfers along the isomorphism betweendlistandlist.This currently only supports simple types. It does not yet support type constructors, i.e. it can not transfer
list (dlist α)tolist (list α)orlist inttolist (nat * nat).