-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathCombi.Combi.vectNK.html
More file actions
167 lines (118 loc) · 37.8 KB
/
Copy pathCombi.Combi.vectNK.html
File metadata and controls
167 lines (118 loc) · 37.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="coqdoc.css" rel="stylesheet" type="text/css" />
<title>Combi.Combi.vectNK: Integer Vector of Given Sums and Sizes</title>
</head>
<body>
<div id="page">
<div id="header">
</div>
<div id="main">
<h1 class="libtitle">Library Combi.Combi.vectNK: Integer Vector of Given Sums and Sizes</h1>
<div class="code">
</div>
<div class="doc">
</div>
<div class="code">
</div>
<div class="doc">
<a id="lab103"></a><h1 class="section">Integer vectors of sum n and size k</h1>
<div class="paragraph"> </div>
<ul class="doclist">
<li> <span class="inlinecode"><span class="id" title="var">vect_n_k</span></span> <span class="inlinecode"><span class="id" title="var">n</span></span> <span class="inlinecode"><span class="id" title="var">k</span></span> == the list of integer vectors of sum n and size k
</li>
<li> <span class="inlinecode"><span class="id" title="var">cut_k</span></span> <span class="inlinecode"><span class="id" title="var">k</span></span> <span class="inlinecode"><span class="id" title="var">s</span></span> == the list of the cutting of s in k slices (the result is of
type <span class="inlinecode"><span class="id" title="var">seq</span></span> <span class="inlinecode">(<span class="id" title="var">seq</span></span> <span class="inlinecode"><span class="id" title="var">T</span>)</span>)
</li>
<li> <span class="inlinecode"><span class="id" title="var">cut3</span></span> <span class="inlinecode"><span class="id" title="var">s</span></span> == the list of the cutting of s in 3 slices (the result is of type
<span class="inlinecode"><span class="id" title="var">seq</span></span> <span class="inlinecode">(<span class="id" title="var">seq</span></span> <span class="inlinecode"><span class="id" title="var">T</span>)</span> <span class="inlinecode">*</span> <span class="inlinecode">(<span class="id" title="var">seq</span></span> <span class="inlinecode"><span class="id" title="var">T</span>)</span> <span class="inlinecode">*</span> <span class="inlinecode">(<span class="id" title="var">seq</span></span> <span class="inlinecode"><span class="id" title="var">T</span>)</span>)
</li>
</ul>
<div class="paragraph"> </div>
</div>
<div class="code">
<span class="id" title="keyword">From</span> <span class="id" title="var">Corelib</span> <span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Setoids.Setoid.html#"><span class="id" title="library">Setoid</span></a>.<br/>
<span class="id" title="keyword">From</span> <span class="id" title="var">mathcomp</span> <span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <span class="id" title="library">ssreflect</span> <span class="id" title="library">ssrbool</span> <span class="id" title="library">ssrfun</span> <span class="id" title="library">ssrnat</span> <span class="id" title="library">eqtype</span> <span class="id" title="library">seq</span>.<br/>
<span class="id" title="keyword">Require</span> <span class="id" title="keyword">Import</span> <a class="idref" href="Combi.SSRcomplements.tools.html#"><span class="id" title="library">tools</span></a>.<br/>
<br/>
<span class="id" title="keyword">Set Implicit Arguments</span>.<br/>
<br/>
<span class="id" title="keyword">Section</span> <a id="VectNK" class="idref" href="#VectNK"><span class="id" title="section">VectNK</span></a>.<br/>
<br/>
<span class="id" title="keyword">Fixpoint</span> <a id="vect_n_k" class="idref" href="#vect_n_k"><span class="id" title="definition">vect_n_k</span></a> <a id="n:1" class="idref" href="#n:1"><span class="id" title="binder">n</span></a> <a id="k:2" class="idref" href="#k:2"><span class="id" title="binder">k</span></a> :=<br/>
<span class="id" title="keyword">if</span> <a class="idref" href="Combi.Combi.vectNK.html#k:2"><span class="id" title="variable">k</span></a> <span class="id" title="keyword">is</span> <span class="id" title="var">k'</span><span class="id" title="notation">.+1</span><br/>
<span class="id" title="keyword">then</span> <span class="id" title="definition">flatten</span> (<span class="id" title="definition">mkseq</span> (<span class="id" title="keyword">fun</span> <a id="i:5" class="idref" href="#i:5"><span class="id" title="binder">i</span></a> => <span class="id" title="definition">map</span> (<a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#cons"><span class="id" title="constructor">cons</span></a> <a class="idref" href="Combi.Combi.vectNK.html#i:5"><span class="id" title="variable">i</span></a>) (<a class="idref" href="Combi.Combi.vectNK.html#vect_n_k:3"><span class="id" title="definition">vect_n_k</span></a> (<a class="idref" href="Combi.Combi.vectNK.html#n:1"><span class="id" title="variable">n</span></a><span class="id" title="notation">-</span><a class="idref" href="Combi.Combi.vectNK.html#i:5"><span class="id" title="variable">i</span></a>) <span class="id" title="var">k'</span>) ) <a class="idref" href="Combi.Combi.vectNK.html#n:1"><span class="id" title="variable">n</span></a><span class="id" title="notation">.+1</span>)<br/>
<span class="id" title="keyword">else</span> <span class="id" title="keyword">if</span> <a class="idref" href="Combi.Combi.vectNK.html#n:1"><span class="id" title="variable">n</span></a> <span class="id" title="keyword">is</span> 0 <span class="id" title="keyword">then</span> <span class="id" title="notation">[::</span> <span class="id" title="notation">[::]</span><span class="id" title="notation">]</span> <span class="id" title="keyword">else</span> <span class="id" title="notation">[::]</span>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <a id="vect_n_k_in" class="idref" href="#vect_n_k_in"><span class="id" title="lemma">vect_n_k_in</span></a> <a id="n:7" class="idref" href="#n:7"><span class="id" title="binder">n</span></a> <a id="k:8" class="idref" href="#k:8"><span class="id" title="binder">k</span></a> <a id="s:9" class="idref" href="#s:9"><span class="id" title="binder">s</span></a> : <span class="id" title="definition">sumn</span> <a class="idref" href="Combi.Combi.vectNK.html#s:9"><span class="id" title="variable">s</span></a> <span class="id" title="notation">==</span> <a class="idref" href="Combi.Combi.vectNK.html#n:7"><span class="id" title="variable">n</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Logic.html#::type_scope:x_'->'_x"><span class="id" title="notation">-></span></a> <span class="id" title="definition">size</span> <a class="idref" href="Combi.Combi.vectNK.html#s:9"><span class="id" title="variable">s</span></a> <span class="id" title="notation">==</span> <a class="idref" href="Combi.Combi.vectNK.html#k:8"><span class="id" title="variable">k</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Logic.html#::type_scope:x_'->'_x"><span class="id" title="notation">-></span></a> <a class="idref" href="Combi.Combi.vectNK.html#s:9"><span class="id" title="variable">s</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">\</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">in</span></a> <a class="idref" href="Combi.Combi.vectNK.html#vect_n_k"><span class="id" title="definition">vect_n_k</span></a> <a class="idref" href="Combi.Combi.vectNK.html#n:7"><span class="id" title="variable">n</span></a> <a class="idref" href="Combi.Combi.vectNK.html#k:8"><span class="id" title="variable">k</span></a>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <a id="in_vect_n_k" class="idref" href="#in_vect_n_k"><span class="id" title="lemma">in_vect_n_k</span></a> <a id="n:10" class="idref" href="#n:10"><span class="id" title="binder">n</span></a> <a id="k:11" class="idref" href="#k:11"><span class="id" title="binder">k</span></a> <a id="s:12" class="idref" href="#s:12"><span class="id" title="binder">s</span></a> : <a class="idref" href="Combi.Combi.vectNK.html#s:12"><span class="id" title="variable">s</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">\</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">in</span></a> <a class="idref" href="Combi.Combi.vectNK.html#vect_n_k"><span class="id" title="definition">vect_n_k</span></a> <a class="idref" href="Combi.Combi.vectNK.html#n:10"><span class="id" title="variable">n</span></a> <a class="idref" href="Combi.Combi.vectNK.html#k:11"><span class="id" title="variable">k</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Logic.html#::type_scope:x_'->'_x"><span class="id" title="notation">-></span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#::bool_scope:x_'&&'_x"><span class="id" title="notation">(</span></a><span class="id" title="definition">sumn</span> <a class="idref" href="Combi.Combi.vectNK.html#s:12"><span class="id" title="variable">s</span></a> <span class="id" title="notation">==</span> <a class="idref" href="Combi.Combi.vectNK.html#n:10"><span class="id" title="variable">n</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#::bool_scope:x_'&&'_x"><span class="id" title="notation">)</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#::bool_scope:x_'&&'_x"><span class="id" title="notation">&&</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#::bool_scope:x_'&&'_x"><span class="id" title="notation">(</span></a><span class="id" title="definition">size</span> <a class="idref" href="Combi.Combi.vectNK.html#s:12"><span class="id" title="variable">s</span></a> <span class="id" title="notation">==</span> <a class="idref" href="Combi.Combi.vectNK.html#k:11"><span class="id" title="variable">k</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#::bool_scope:x_'&&'_x"><span class="id" title="notation">)</span></a>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <a id="vect_n_kP" class="idref" href="#vect_n_kP"><span class="id" title="lemma">vect_n_kP</span></a> <a id="n:13" class="idref" href="#n:13"><span class="id" title="binder">n</span></a> <a id="k:14" class="idref" href="#k:14"><span class="id" title="binder">k</span></a> <a id="s:15" class="idref" href="#s:15"><span class="id" title="binder">s</span></a> : <a class="idref" href="Combi.Combi.vectNK.html#s:15"><span class="id" title="variable">s</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">\</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">in</span></a> <a class="idref" href="Combi.Combi.vectNK.html#vect_n_k"><span class="id" title="definition">vect_n_k</span></a> <a class="idref" href="Combi.Combi.vectNK.html#n:13"><span class="id" title="variable">n</span></a> <a class="idref" href="Combi.Combi.vectNK.html#k:14"><span class="id" title="variable">k</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#::bool_scope:x_'&&'_x"><span class="id" title="notation">(</span></a><span class="id" title="definition">sumn</span> <a class="idref" href="Combi.Combi.vectNK.html#s:15"><span class="id" title="variable">s</span></a> <span class="id" title="notation">==</span> <a class="idref" href="Combi.Combi.vectNK.html#n:13"><span class="id" title="variable">n</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#::bool_scope:x_'&&'_x"><span class="id" title="notation">)</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#::bool_scope:x_'&&'_x"><span class="id" title="notation">&&</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#::bool_scope:x_'&&'_x"><span class="id" title="notation">(</span></a><span class="id" title="definition">size</span> <a class="idref" href="Combi.Combi.vectNK.html#s:15"><span class="id" title="variable">s</span></a> <span class="id" title="notation">==</span> <a class="idref" href="Combi.Combi.vectNK.html#k:14"><span class="id" title="variable">k</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#::bool_scope:x_'&&'_x"><span class="id" title="notation">)</span></a>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <a id="vect_0_k" class="idref" href="#vect_0_k"><span class="id" title="lemma">vect_0_k</span></a> <a id="k:16" class="idref" href="#k:16"><span class="id" title="binder">k</span></a> : <a class="idref" href="Combi.Combi.vectNK.html#vect_n_k"><span class="id" title="definition">vect_n_k</span></a> 0 <a class="idref" href="Combi.Combi.vectNK.html#k:16"><span class="id" title="variable">k</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <span class="id" title="notation">[::</span> <span class="id" title="definition">nseq</span> <a class="idref" href="Combi.Combi.vectNK.html#k:16"><span class="id" title="variable">k</span></a> 0<span class="id" title="notation">]</span>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <a id="count_mem_vect_n_k_eq_1" class="idref" href="#count_mem_vect_n_k_eq_1"><span class="id" title="lemma">count_mem_vect_n_k_eq_1</span></a> <a id="n:17" class="idref" href="#n:17"><span class="id" title="binder">n</span></a> <a id="k:18" class="idref" href="#k:18"><span class="id" title="binder">k</span></a> <a id="s:19" class="idref" href="#s:19"><span class="id" title="binder">s</span></a> :<br/>
<a class="idref" href="Combi.Combi.vectNK.html#s:19"><span class="id" title="variable">s</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">\</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">in</span></a> <a class="idref" href="Combi.Combi.vectNK.html#vect_n_k"><span class="id" title="definition">vect_n_k</span></a> <a class="idref" href="Combi.Combi.vectNK.html#n:17"><span class="id" title="variable">n</span></a> <a class="idref" href="Combi.Combi.vectNK.html#k:18"><span class="id" title="variable">k</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Logic.html#::type_scope:x_'->'_x"><span class="id" title="notation">-></span></a> <span class="id" title="abbreviation">count_mem</span> <a class="idref" href="Combi.Combi.vectNK.html#s:19"><span class="id" title="variable">s</span></a> (<a class="idref" href="Combi.Combi.vectNK.html#vect_n_k"><span class="id" title="definition">vect_n_k</span></a> <a class="idref" href="Combi.Combi.vectNK.html#n:17"><span class="id" title="variable">n</span></a> <a class="idref" href="Combi.Combi.vectNK.html#k:18"><span class="id" title="variable">k</span></a>) <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> 1.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <a id="uniq_vect_n_k" class="idref" href="#uniq_vect_n_k"><span class="id" title="lemma">uniq_vect_n_k</span></a> <a id="n:26" class="idref" href="#n:26"><span class="id" title="binder">n</span></a> <a id="k:27" class="idref" href="#k:27"><span class="id" title="binder">k</span></a> : <span class="id" title="definition">uniq</span> (<a class="idref" href="Combi.Combi.vectNK.html#vect_n_k"><span class="id" title="definition">vect_n_k</span></a> <a class="idref" href="Combi.Combi.vectNK.html#n:26"><span class="id" title="variable">n</span></a> <a class="idref" href="Combi.Combi.vectNK.html#k:27"><span class="id" title="variable">k</span></a>).<br/>
<br/>
<span class="id" title="keyword">End</span> <a class="idref" href="Combi.Combi.vectNK.html#VectNK"><span class="id" title="section">VectNK</span></a>.<br/>
<br/>
</div>
<div class="doc">
Cutting a seq in k slices : the result is of type <span class="inlinecode"><span class="id" title="var">seq</span></span> <span class="inlinecode">(<span class="id" title="var">seq</span></span> <span class="inlinecode"><span class="id" title="var">T</span>)</span>
</div>
<div class="code">
<br/>
<span class="id" title="keyword">Section</span> <a id="CutK" class="idref" href="#CutK"><span class="id" title="section">CutK</span></a>.<br/>
<br/>
<span class="id" title="keyword">Variable</span> <a id="CutK.T" class="idref" href="#CutK.T"><span class="id" title="variable">T</span></a> : <span class="id" title="abbreviation">eqType</span>.<br/>
<span class="id" title="keyword">Implicit</span> <span class="id" title="keyword">Type</span> (<span class="id" title="var">s</span> : <span class="id" title="abbreviation">seq</span> <a class="idref" href="Combi.Combi.vectNK.html#CutK.T"><span class="id" title="variable">T</span></a>) (<span class="id" title="var">ss</span> : <span class="id" title="abbreviation">seq</span> (<span class="id" title="abbreviation">seq</span> <a class="idref" href="Combi.Combi.vectNK.html#CutK.T"><span class="id" title="variable">T</span></a>)).<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <a id="mem_shape_vect_n_k" class="idref" href="#mem_shape_vect_n_k"><span class="id" title="lemma">mem_shape_vect_n_k</span></a> <a id="ss:30" class="idref" href="#ss:30"><span class="id" title="binder">ss</span></a> :<br/>
<a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">(</span></a><span class="id" title="definition">shape</span> <a class="idref" href="Combi.Combi.vectNK.html#ss:30"><span class="id" title="variable">ss</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">)</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">\</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">in</span></a> <a class="idref" href="Combi.Combi.vectNK.html#vect_n_k"><span class="id" title="definition">vect_n_k</span></a> (<span class="id" title="definition">size</span> (<span class="id" title="definition">flatten</span> <a class="idref" href="Combi.Combi.vectNK.html#ss:30"><span class="id" title="variable">ss</span></a>)) (<span class="id" title="definition">size</span> <a class="idref" href="Combi.Combi.vectNK.html#ss:30"><span class="id" title="variable">ss</span></a>).<br/>
<br/>
<span class="id" title="keyword">Definition</span> <a id="cut_k" class="idref" href="#cut_k"><span class="id" title="definition">cut_k</span></a> <a id="k:31" class="idref" href="#k:31"><span class="id" title="binder">k</span></a> <a id="s:32" class="idref" href="#s:32"><span class="id" title="binder">s</span></a> := <span class="id" title="notation">[</span><span class="id" title="notation">seq</span> <span class="id" title="definition">reshape</span> <a class="idref" href="Combi.Combi.vectNK.html#sh:33"><span class="id" title="variable">sh</span></a> <a class="idref" href="Combi.Combi.vectNK.html#s:32"><span class="id" title="variable">s</span></a> <span class="id" title="notation">|</span> <a id="sh:33" class="idref" href="#sh:33"><span class="id" title="binder"><span id="sh:34" class="id">sh</span></span></a> <span class="id" title="notation"><-</span> <a class="idref" href="Combi.Combi.vectNK.html#vect_n_k"><span class="id" title="definition">vect_n_k</span></a> (<span class="id" title="definition">size</span> <a class="idref" href="Combi.Combi.vectNK.html#s:32"><span class="id" title="variable">s</span></a>) <a class="idref" href="Combi.Combi.vectNK.html#k:31"><span class="id" title="variable">k</span></a><span class="id" title="notation">]</span>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <a id="cut_k_flatten" class="idref" href="#cut_k_flatten"><span class="id" title="lemma">cut_k_flatten</span></a> <a id="ss:35" class="idref" href="#ss:35"><span class="id" title="binder">ss</span></a> : <a class="idref" href="Combi.Combi.vectNK.html#ss:35"><span class="id" title="variable">ss</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">\</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">in</span></a> <a class="idref" href="Combi.Combi.vectNK.html#cut_k"><span class="id" title="definition">cut_k</span></a> (<span class="id" title="definition">size</span> <a class="idref" href="Combi.Combi.vectNK.html#ss:35"><span class="id" title="variable">ss</span></a>) (<span class="id" title="definition">flatten</span> <a class="idref" href="Combi.Combi.vectNK.html#ss:35"><span class="id" title="variable">ss</span></a>).<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <a id="flatten_equiv_cut_k" class="idref" href="#flatten_equiv_cut_k"><span class="id" title="lemma">flatten_equiv_cut_k</span></a> <a id="s:36" class="idref" href="#s:36"><span class="id" title="binder">s</span></a> <a id="ss:37" class="idref" href="#ss:37"><span class="id" title="binder">ss</span></a> : <a class="idref" href="Combi.Combi.vectNK.html#s:36"><span class="id" title="variable">s</span></a> <span class="id" title="notation">==</span> <span class="id" title="definition">flatten</span> <a class="idref" href="Combi.Combi.vectNK.html#ss:37"><span class="id" title="variable">ss</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Logic.html#::type_scope:x_'<->'_x"><span class="id" title="notation"><-></span></a> <a class="idref" href="Combi.Combi.vectNK.html#ss:37"><span class="id" title="variable">ss</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">\</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">in</span></a> <a class="idref" href="Combi.Combi.vectNK.html#cut_k"><span class="id" title="definition">cut_k</span></a> (<span class="id" title="definition">size</span> <a class="idref" href="Combi.Combi.vectNK.html#ss:37"><span class="id" title="variable">ss</span></a>) <a class="idref" href="Combi.Combi.vectNK.html#s:36"><span class="id" title="variable">s</span></a>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <a id="size_cut_k" class="idref" href="#size_cut_k"><span class="id" title="lemma">size_cut_k</span></a> <a id="k:38" class="idref" href="#k:38"><span class="id" title="binder">k</span></a> <a id="s:39" class="idref" href="#s:39"><span class="id" title="binder">s</span></a> <a id="ss:40" class="idref" href="#ss:40"><span class="id" title="binder">ss</span></a> : <a class="idref" href="Combi.Combi.vectNK.html#ss:40"><span class="id" title="variable">ss</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">\</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">in</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">(</span></a><a class="idref" href="Combi.Combi.vectNK.html#cut_k"><span class="id" title="definition">cut_k</span></a> <a class="idref" href="Combi.Combi.vectNK.html#k:38"><span class="id" title="variable">k</span></a> <a class="idref" href="Combi.Combi.vectNK.html#s:39"><span class="id" title="variable">s</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">)</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Logic.html#::type_scope:x_'->'_x"><span class="id" title="notation">-></span></a> <span class="id" title="definition">size</span> <a class="idref" href="Combi.Combi.vectNK.html#ss:40"><span class="id" title="variable">ss</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Logic.html#6cd0f7b28b6092304087c7049437bb1a"><span class="id" title="notation">=</span></a> <a class="idref" href="Combi.Combi.vectNK.html#k:38"><span class="id" title="variable">k</span></a>.<br/>
<br/>
<span class="id" title="keyword">End</span> <a class="idref" href="Combi.Combi.vectNK.html#CutK"><span class="id" title="section">CutK</span></a>.<br/>
<br/>
</div>
<div class="doc">
Cutting a seq in 3 slices : the result is of type
<span class="inlinecode"><span class="id" title="var">seq</span></span> <span class="inlinecode">(<span class="id" title="var">seq</span></span> <span class="inlinecode"><span class="id" title="var">T</span>)</span> <span class="inlinecode">*</span> <span class="inlinecode">(<span class="id" title="var">seq</span></span> <span class="inlinecode"><span class="id" title="var">T</span>)</span> <span class="inlinecode">*</span> <span class="inlinecode">(<span class="id" title="var">seq</span></span> <span class="inlinecode"><span class="id" title="var">T</span>)</span>
</div>
<div class="code">
<br/>
<span class="id" title="keyword">Section</span> <a id="Cut3" class="idref" href="#Cut3"><span class="id" title="section">Cut3</span></a>.<br/>
<br/>
<span class="id" title="keyword">Variable</span> <a id="Cut3.T" class="idref" href="#Cut3.T"><span class="id" title="variable">T</span></a> : <span class="id" title="abbreviation">eqType</span>.<br/>
<span class="id" title="keyword">Implicit</span> <span class="id" title="keyword">Type</span> (<span class="id" title="var">s</span> : <span class="id" title="abbreviation">seq</span> <a class="idref" href="Combi.Combi.vectNK.html#Cut3.T"><span class="id" title="variable">T</span></a>) (<span class="id" title="var">ss</span> : <span class="id" title="abbreviation">seq</span> (<span class="id" title="abbreviation">seq</span> <a class="idref" href="Combi.Combi.vectNK.html#Cut3.T"><span class="id" title="variable">T</span></a>)).<br/>
<br/>
<span class="id" title="keyword">Let</span> <a id="Cut3.match3" class="idref" href="#Cut3.match3"><span class="id" title="variable">match3</span></a> :=<br/>
<span class="id" title="keyword">fun</span> <a id="ss:43" class="idref" href="#ss:43"><span class="id" title="binder">ss</span></a> => <span class="id" title="keyword">match</span> <a class="idref" href="Combi.Combi.vectNK.html#ss:43"><span class="id" title="variable">ss</span></a> <span class="id" title="keyword">return</span> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">(</span></a><span class="id" title="abbreviation">seq</span> <a class="idref" href="Combi.Combi.vectNK.html#Cut3.T"><span class="id" title="variable">T</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">)</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">*</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">(</span></a><span class="id" title="abbreviation">seq</span> <a class="idref" href="Combi.Combi.vectNK.html#Cut3.T"><span class="id" title="variable">T</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">)</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">*</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">(</span></a><span class="id" title="abbreviation">seq</span> <a class="idref" href="Combi.Combi.vectNK.html#Cut3.T"><span class="id" title="variable">T</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">)</span></a> <span class="id" title="keyword">with</span><br/>
| <span class="id" title="notation">[::</span> <span class="id" title="var">a</span><span class="id" title="notation">;</span> <span class="id" title="var">b</span><span class="id" title="notation">;</span> <span class="id" title="var">c</span><span class="id" title="notation">]</span> => <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="var">a</span><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <span class="id" title="var">b</span><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <span class="id" title="var">c</span><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a> | <span class="id" title="var">_</span> => <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><span class="id" title="notation">[::]</span><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <span class="id" title="notation">[::]</span><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <span class="id" title="notation">[::]</span><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a> <span class="id" title="keyword">end</span>.<br/>
<br/>
<span class="id" title="keyword">Definition</span> <a id="cut3" class="idref" href="#cut3"><span class="id" title="definition">cut3</span></a> <a id="s:45" class="idref" href="#s:45"><span class="id" title="binder">s</span></a> : <span class="id" title="abbreviation">seq</span> (<a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">(</span></a><span class="id" title="abbreviation">seq</span> <a class="idref" href="Combi.Combi.vectNK.html#Cut3.T"><span class="id" title="variable">T</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">)</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">*</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">(</span></a><span class="id" title="abbreviation">seq</span> <a class="idref" href="Combi.Combi.vectNK.html#Cut3.T"><span class="id" title="variable">T</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">)</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">*</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">(</span></a><span class="id" title="abbreviation">seq</span> <a class="idref" href="Combi.Combi.vectNK.html#Cut3.T"><span class="id" title="variable">T</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#11c698c8685bb8ab1cf725545c085ac4"><span class="id" title="notation">)</span></a>) :=<br/>
<span class="id" title="notation">[</span><span class="id" title="notation">seq</span> <a class="idref" href="Combi.Combi.vectNK.html#Cut3.match3"><span class="id" title="variable">match3</span></a> <a class="idref" href="Combi.Combi.vectNK.html#ss:46"><span class="id" title="variable">ss</span></a> <span class="id" title="notation">|</span> <a id="ss:46" class="idref" href="#ss:46"><span class="id" title="binder"><span id="ss:47" class="id">ss</span></span></a> <span class="id" title="notation"><-</span> <a class="idref" href="Combi.Combi.vectNK.html#cut_k"><span class="id" title="definition">cut_k</span></a> 3 <a class="idref" href="Combi.Combi.vectNK.html#s:45"><span class="id" title="variable">s</span></a><span class="id" title="notation">]</span>.<br/>
<br/>
<span class="id" title="keyword">Lemma</span> <a id="cat3_equiv_cut3" class="idref" href="#cat3_equiv_cut3"><span class="id" title="lemma">cat3_equiv_cut3</span></a> <a id="s:48" class="idref" href="#s:48"><span class="id" title="binder">s</span></a> <a id="a:49" class="idref" href="#a:49"><span class="id" title="binder">a</span></a> <a id="b:50" class="idref" href="#b:50"><span class="id" title="binder">b</span></a> <a id="c:51" class="idref" href="#c:51"><span class="id" title="binder">c</span></a> : <a class="idref" href="Combi.Combi.vectNK.html#s:48"><span class="id" title="variable">s</span></a> <span class="id" title="notation">==</span> <a class="idref" href="Combi.Combi.vectNK.html#a:49"><span class="id" title="variable">a</span></a> <span class="id" title="notation">++</span> <a class="idref" href="Combi.Combi.vectNK.html#b:50"><span class="id" title="variable">b</span></a> <span class="id" title="notation">++</span> <a class="idref" href="Combi.Combi.vectNK.html#c:51"><span class="id" title="variable">c</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Logic.html#::type_scope:x_'<->'_x"><span class="id" title="notation"><-></span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">(</span></a><a class="idref" href="Combi.Combi.vectNK.html#a:49"><span class="id" title="variable">a</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <a class="idref" href="Combi.Combi.vectNK.html#b:50"><span class="id" title="variable">b</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">,</span></a> <a class="idref" href="Combi.Combi.vectNK.html#c:51"><span class="id" title="variable">c</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.Init.Datatypes.html#e6756e10c36f149b18b4a8741ed83079"><span class="id" title="notation">)</span></a> <a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">\</span></a><a class="idref" href="http://rocq-prover.org/doc/V9.1.1/stdlib//Corelib.ssr.ssrbool.html#b09457274bcb94927e289b8a9e9cd3f7"><span class="id" title="notation">in</span></a> <a class="idref" href="Combi.Combi.vectNK.html#cut3"><span class="id" title="definition">cut3</span></a> <a class="idref" href="Combi.Combi.vectNK.html#s:48"><span class="id" title="variable">s</span></a>.<br/>
<br/>
<span class="id" title="keyword">End</span> <a class="idref" href="Combi.Combi.vectNK.html#Cut3"><span class="id" title="section">Cut3</span></a>.<br/>
</div>
</div>
<div id="footer">
<hr/><a href="index.html">Index</a><hr/>This page has been generated by <a href="http://rocq-prover.org/">coqdoc</a>
</div>
</div>
</body>
</html>