Commit 89217996 authored by Simon Spies's avatar Simon Spies

simplify proof of seqZ_cons

parent 7393911a
Pipeline #18024 canceled with stage
...@@ -3351,12 +3351,10 @@ Section seqZ. ...@@ -3351,12 +3351,10 @@ Section seqZ.
Proof. by destruct n. Qed. Proof. by destruct n. Qed.
Lemma seqZ_cons m n: n > 0 seqZ m n = m :: seqZ (Z.succ m) (Z.pred n). Lemma seqZ_cons m n: n > 0 seqZ m n = m :: seqZ (Z.succ m) (Z.pred n).
Proof. Proof.
intros H. unfold seqZ. intros H. unfold seqZ. replace n with (Z.succ (Z.pred n)) at 1 by lia.
replace (Z.to_nat n) with (S (Z.to_nat (n - 1))) by rewrite Z2Nat.inj_succ by lia. f_equal/=.
(rewrite <-Z2Nat.inj_succ; [f_equal|]; lia). rewrite <-fmap_seq, <-list_fmap_compose.
simpl; f_equal. apply map_ext; naive_solver lia.
erewrite <-fmap_seq, map_map, map_ext; eauto.
intros; lia.
Qed. Qed.
Lemma seqZ_length m n: length (seqZ m n) = Z.to_nat n. Lemma seqZ_length m n: length (seqZ m n) = Z.to_nat n.
Proof. unfold seqZ; by rewrite fmap_length, seq_length. Qed. Proof. unfold seqZ; by rewrite fmap_length, seq_length. Qed.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment