-
-
Save MevenBertrand/855957ab59270c0c0d825bbacfd2417b to your computer and use it in GitHub Desktop.
A demo file for failure of definitional functoriality in Lean
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
| inductive Pos : Type where | |
| | one : Pos | |
| | succ : Pos → Pos | |
| def Pos.toNat : Pos → Nat | |
| | Pos.one => 1 | |
| | Pos.succ n => n.toNat + 1 | |
| instance : Coe Pos Nat where | |
| coe := Pos.toNat | |
| instance : Coe Nat Int where | |
| coe x := ↑x | |
| instance [f : CoeTC X Y] : CoeTC (List X) (List Y) where | |
| coe l := List.map (f.coe) l | |
| example (l : List Pos) : l = ((l : List Nat) : List Int) := rfl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment