Call a theorem using let-in

前端 未结 1 672
猫巷女王i
猫巷女王i 2021-01-24 09:43

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<

相关标签:
1条回答
  • 2021-01-24 10:23

    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.
    
    0 讨论(0)
提交回复
热议问题