diff options
| author | Cyril Cohen | 2020-04-06 01:03:15 +0200 |
|---|---|---|
| committer | Cyril Cohen | 2020-04-10 11:00:55 +0200 |
| commit | 378422bcb7de688ac201a70668a3e33b88bdae42 (patch) | |
| tree | 399870b88750dcb0c8f10ddd642c49ecc12cc780 | |
| parent | dc1ea50f04fdaada16f2a27a81ec24859b4ab843 (diff) | |
Make `all2` better wrt the guard condition
fixes #469
| -rw-r--r-- | CHANGELOG_UNRELEASED.md | 3 | ||||
| -rw-r--r-- | mathcomp/ssreflect/seq.v | 10 |
2 files changed, 8 insertions, 5 deletions
diff --git a/CHANGELOG_UNRELEASED.md b/CHANGELOG_UNRELEASED.md index 96ec16c..aa3983e 100644 --- a/CHANGELOG_UNRELEASED.md +++ b/CHANGELOG_UNRELEASED.md @@ -143,6 +143,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). `ssrnat.mc_1_10` module. One may compile proofs compatible with the version 1.10 in newer versions by using this module. +- The definition of `all2` was slightly altered for a better interaction with + the guard condition (#469) + ### Renamed - `real_lerP` -> `real_leP` diff --git a/mathcomp/ssreflect/seq.v b/mathcomp/ssreflect/seq.v index dca4136..aca2b77 100644 --- a/mathcomp/ssreflect/seq.v +++ b/mathcomp/ssreflect/seq.v @@ -2634,7 +2634,7 @@ Prenex Implicits mask map pmap foldr foldl scanl pairmap. Section Zip. -Variables S T : Type. +Variables (S T : Type) (r : S -> T -> bool). Fixpoint zip (s : seq S) (t : seq T) {struct t} := match s, t with @@ -2645,10 +2645,10 @@ Fixpoint zip (s : seq S) (t : seq T) {struct t} := Definition unzip1 := map (@fst S T). Definition unzip2 := map (@snd S T). -Fixpoint all2 (r : S -> T -> bool) s t := +Fixpoint all2 s t := match s, t with | [::], [::] => true - | x :: s, y :: t => r x y && all2 r s t + | x :: s, y :: t => r x y && all2 s t | _, _ => false end. @@ -2696,8 +2696,8 @@ move: s t; apply: seq_ind2 => //= x y s t eq_sz IHs. by rewrite !rev_cons IHs zip_rcons ?size_rev. Qed. -Lemma all2E r s t : - all2 r s t = (size s == size t) && all [pred xy | r xy.1 xy.2] (zip s t). +Lemma all2E s t : + all2 s t = (size s == size t) && all [pred xy | r xy.1 xy.2] (zip s t). Proof. by elim: s t => [|x s IHs] [|y t] //=; rewrite IHs andbCA. Qed. End Zip. |
