Step by step simplification in coq?

后端 未结 2 615
时光取名叫无心
时光取名叫无心 2020-12-16 02:28

Is there a way to simplify one step at a time?

Say you have f1 (f2 x) both of which can be simplified in turn via a single simpl, is it pos

2条回答
  •  时光取名叫无心
    2020-12-16 02:39

    You can also use simpl for a specific pattern.

    Theorem pred_length : forall n : nat, forall l : list nat,
      pred (length (n :: l)) = length l.
    Proof.
     intros.
     simpl length.
     simpl pred.
     reflexivity.
    Qed.
    

    In case you have several occurrences of a pattern like length that could be simplified, you can further restrict the outcome of the simplification by giving a position of that occurrence (from left to right), e.g. simpl length at 1 or simpl length at 2 for the first or second occurrence.

提交回复
热议问题