Created
August 1, 2022 13:44
-
-
Save ratmice/ae54d9b27f7afa8cabb7cc84c42550e0 to your computer and use it in GitHub Desktop.
This file contains 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
-- From the post https://dylanj.xyz/posts/rust-coq-opaque-types/ | |
-- Figured it would be fun to do a lean version without tactics. | |
def impl_trait_transform (Trait: Type → Prop) (Result: Prop) : | |
((∃ t, Trait(t)) → Result) ↔ (∀ t, (Trait(t) → Result)) := | |
⟨λ existsTrait, λ ty, λ trait, existsTrait ⟨ty, trait⟩, | |
λ anyTrait, λ existsTrait, exists.elim existsTrait (λ ty, anyTrait ty)⟩ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment