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

[Merged by Bors] - feat: Add instance of Infinite String #1973

Closed

Conversation

loewenheim
Copy link
Contributor

This proves that the String type is infinite.


Open in Gitpod

Infinite.of_surjective String.length <| by
intro n
exists (String.replicate n 'x')
exact String.length_replicate n 'x'
Copy link
Member

Choose a reason for hiding this comment

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

I think the proof is even shorter if you move it down a few lines and use String.data instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've now changed the proof so it uses the injectivity of String.mk. I suspect that said injectivity could be proven more concisely, do you have any suggestions in that regard?

@semorrison
Copy link
Contributor

bors merge

bors bot pushed a commit that referenced this pull request Mar 29, 2023
This proves that the `String` type is infinite.
@bors
Copy link

bors bot commented Mar 30, 2023

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat: Add instance of Infinite String [Merged by Bors] - feat: Add instance of Infinite String Mar 30, 2023
@bors bors bot closed this Mar 30, 2023
joelriou pushed a commit that referenced this pull request Mar 30, 2023
This proves that the `String` type is infinite.
MonadMaverick pushed a commit that referenced this pull request Apr 9, 2023
This proves that the `String` type is infinite.
MonadMaverick pushed a commit that referenced this pull request Apr 9, 2023
This proves that the `String` type is infinite.
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

3 participants