Skip to content

Commit b4c75f7

Browse files
authored
Merge pull request #173 from haansn08/prodLists
replace prodLists with list_prod from stdlib
2 parents 3eaa7ee + c615010 commit b4c75f7

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

theories/Shared/Libs/PSL/FiniteTypes/BasicDefinitions.v

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,6 @@ Proof.
1919
cbn. rewrite IH. unfold Dec. now destruct (HX x y); destruct (HX y x); congruence.
2020
Qed.
2121

22-
(* Function that takes two lists and returns the list of all pairs of elements from the two lists *)
23-
Fixpoint prodLists {X Y: Type} (A: list X) (B: list Y) {struct A} :=
24-
match A with
25-
| nil => nil
26-
| cons x A' => map (fun y => (x,y)) B ++ prodLists A' B end.
27-
28-
(* Crossing any list with the empty list always yields the empty list *)
29-
Lemma prod_nil (X Y: Type) (A: list X) :
30-
prodLists A ([]: list Y) = [].
31-
Proof.
32-
induction A.
33-
- reflexivity.
34-
- cbn. assumption.
35-
Qed.
36-
3722
(* This function takes a (A: list X) and yields a list (option X) which for every x in A contains Some x. The resultung list also contains None. The order is preserved. None is the first element of the resulting list. *)
3823

3924
Definition toOptionList {X: Type} (A: list X) :=

theories/Shared/Libs/PSL/FiniteTypes/CompoundFinTypes.v

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
From Undecidability.Shared.Libs.PSL Require Import FinTypes.
22

33
(* * Definition of prod as finType *)
4-
54
Lemma ProdCount (T1 T2: eqType) (A: list T1) (B: list T2) (a:T1) (b:T2) :
6-
count (prodLists A B) (a,b) = count A a * count B b .
5+
count (list_prod A B) (a,b) = count A a * count B b .
76
Proof.
87
induction A.
98
- reflexivity.
@@ -13,7 +12,7 @@ Proof.
1312
Qed.
1413

1514
Lemma prod_enum_ok (T1 T2: finType) (x: T1 * T2):
16-
count (prodLists (elem T1) (elem T2)) x = 1.
15+
count (list_prod (elem T1) (elem T2)) x = 1.
1716
Proof.
1817
destruct x as [x y]. rewrite ProdCount. unfold elem.
1918
now repeat rewrite enum_ok.

0 commit comments

Comments
 (0)