I have a function f
returning a pair. Then I prove some results about it.
In my lemmas, my first attempt to get each component was using let (x, y) := f z in<
You have found what I believe is the correct solution. let (l1, l2) := ... in ...
will block reduction and break everything. Whether you use split_in2
or split_in3
depends on what your starting point is.
Note, however, that turning on Primitive Projections
and redefining prod
as a primitive record will make it so that split_in
and split_in2
are actually the same theorem, because split l
and (fst (split l), snd (split l))
are judgmentally equal. You can do this with
Set Primitive Projections.
Record prod {A B} := pair { fst : A ; snd : B }.
Arguments prod : clear implicits.
Arguments pair {A B}.
Add Printing Let prod.
Notation "x * y" := (prod x y) : type_scope.
Notation "( x , y , .. , z )" := (pair .. (pair x y) .. z) : core_scope.
Hint Resolve pair : core.