Reputation: 962
Consider I have an inductive:
Inductive DirectSum{L R: Type}: Type :=
| Left: L -> DirectSum L R
| Right: R -> DirectSum L R
.
How do I prove that
forall L R: Type, forall l: L, forall r: R, Left L <> Right R.
?
Upvotes: 0
Views: 31
Reputation: 23582
The easy
tactic is powerful enough to solve this:
Inductive DirectSum (L R: Type): Type :=
| Left: L -> DirectSum L R
| Right: R -> DirectSum L R
.
Arguments Left {_ _}.
Arguments Right {_ _}.
Goal forall L R: Type, forall l: L, forall r: R, Left l <> Right r.
easy.
Qed.
The reason this works, internally, is pattern matching. We can write a function that returns True
on Left
and False
on Right
. If the terms were equal, we would get True = False
, which entails a contradiction.
Upvotes: 1