Skip to content
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#1435
johoelzl wants to merge 12 commits intoleanprover:masterfrom
johoelzl:int_transfer

Conversation

@johoelzl
Copy link
Copy Markdown
Contributor

@johoelzl johoelzl commented Mar 8, 2017

This adds a transfer method to lean.

It is used to prove that int is a commutative ring. For this it transfers along a relation between int (i.e. a disjoint sum of nonnegative and negative numbers) and pairs of natural numbers. Using transfer the instantiation of comm_ring int is much shorter and nicer structured. For example: proving add_assoc required 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 dlist it transfers along the isomorphism between dlist and list.

This currently only supports simple types. It does not yet support type constructors, i.e. it can not transfer list (dlist α) to list (list α) or list int to list (nat * nat).

Comment thread library/data/dlist.lean
dlist.transfer,
intros,
simp
end
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice.

@avigad
Copy link
Copy Markdown
Contributor

avigad commented Mar 8, 2017

Beautiful!

@leodemoura
Copy link
Copy Markdown
Member

I have already merged it.
Sorry, I missed the RFC prefix.

@leodemoura leodemoura closed this Mar 8, 2017
@johoelzl johoelzl deleted the int_transfer branch March 8, 2017 14:40
@johoelzl
Copy link
Copy Markdown
Contributor Author

johoelzl commented Mar 8, 2017

I marked it as RFC as its only tested on int and dlist. And as you already have them fixed, I didn't run the test suite.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants