ich ein Typ wieBeweisen Sie, dass die einzige Null-Längen-Vektor ist gleich Null
Inductive bits : nat -> Set :=
| bitsNil : bits 0
| bitsCons : forall {l}, bool -> bits l -> bits (S l).
definiert haben und ich versuche zu beweisen:
Lemma emptyIsAlwaysNil : forall {a: bits 0}, a = bitsNil.
Nach intros
, ich habe constructor 1
versucht, case a
, intuition
, vergeblich. case a
scheint, wie die am nächsten, aber es wird eine Fehlermeldung:
Abstracting over the terms "0" and "a" leads to a term
fun (n : nat) (a0 : bits n) => a0 = bitsNil
which is ill-typed.
Reason is: Illegal application:
The term "@eq" of type "forall A : Type, A -> A -> Prop"
cannot be applied to the terms
"bits n" : "Set"
"a0" : "bits n"
"bitsNil" : "bits 0"
The 3rd term has type "bits 0" which should be coercible to
"bits n".
Es klingt wie es nicht, ob ein Bit-Vektor einer beliebigen Länge, die gleich ist zu einem von der Länge Null bestimmen kann, weil sie anders sind auf der Typenebene. Ist das korrekt?
Erinnert mich an Monins kleine Inversionen: https://hal.archives-ouvertes.fr/inria-00489412/ – gallais