Created
November 11, 2011 00:07
-
-
Save wires/1356700 to your computer and use it in GitHub Desktop.
Problems defining a coercion between product types
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
Infix "×" := prod (at level 60). | |
Coercion bool_in_nat := fun b:bool => if b then 0 else 1. | |
Definition a : nat := false. | |
Definition foo (p:bool × bool) : bool × nat := | |
(fst p, snd p:nat). | |
Coercion fooc := foo. | |
(* Error: fooc does not respect the uniform inheritance condition. | |
Q1: Can you define such a coercion from A × B → A × C ? | |
Q2: What is the uniform inheritance condition? | |
*) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment