Library prosa.util.bigcat
Require Export mathcomp.zify.zify.
Require Export prosa.util.tactics prosa.util.notation.
From mathcomp Require Import ssreflect ssrbool eqtype ssrnat seq fintype bigop.
Require Export prosa.util.bigop prosa.util.tactics prosa.util.list.
Require Export prosa.util.tactics prosa.util.notation.
From mathcomp Require Import ssreflect ssrbool eqtype ssrnat seq fintype bigop.
Require Export prosa.util.bigop prosa.util.tactics prosa.util.list.
Lemmas Awaiting the Next MathComp Release
First, we show that the concatenation comprises all the elements of each sequence;
i.e. any element contained in one of the sequences will also be an element of the
result of the concatenation. TODO: MathComp's mem_bigcatP covers this lemma and is expected
in the next MathComp release (PR 1660:
https://github.com/math-comp/math-comp/pull/1660).
Conversely, we prove that any element belonging to a concatenation of sequences
must come from one of the sequences. TODO: MathComp's mem_bigcatP covers this lemma and is expected
in the next MathComp release (PR 1660:
https://github.com/math-comp/math-comp/pull/1660).
In this section, we show how we can preserve uniqueness of the elements
(i.e. the absence of a duplicate) over a concatenation of sequences.
Consider a list xs, ...
... a filter predicate P, ...
... assume that there are no duplicates in each of the possible
sequences to concatenate...
...and that there are no elements in common between the sequences.
We prove that the concatenation will yield a sequence with unique elements. TODO: MathComp's bigcat_uniq covers this lemma and is expected
in the next MathComp release (PR 1660:
https://github.com/math-comp/math-comp/pull/1660).
Lemma bigcat_uniq :
uniq xs →
uniq (\cat_(x <- xs | P x) (f x)).
End BigCatDistinctElements.
End BigCatSeqLemmas.
uniq xs →
uniq (\cat_(x <- xs | P x) (f x)).
End BigCatDistinctElements.
End BigCatSeqLemmas.
In this section, we introduce lemmas about the concatenation
operation performed over arbitrary sequences.
Consider any type T supporting equality comparisons...
...and a function f that, given an index, yields a sequence.
First, we show that the concatenation comprises all the elements of each sequence;
i.e., any element contained in one of the sequences will also be an element of the
result of the concatenation. TODO: MathComp's mem_bigcatP covers this lemma and is expected
in the next MathComp release (PR 1660:
https://github.com/math-comp/math-comp/pull/1660).
Conversely, we prove that any element belonging to a concatenation of sequences
must come from one of the sequences. TODO: MathComp's mem_bigcatP covers this lemma and is expected
in the next MathComp release (PR 1660:
https://github.com/math-comp/math-comp/pull/1660).
We also restate lemma mem_bigcat_nat in terms of ordinals. TODO: MathComp's mem_bigcatP covers this lemma and is expected
in the next MathComp release (PR 1660:
https://github.com/math-comp/math-comp/pull/1660).
Lemma mem_bigcat_ord :
∀ (x : T) (n : nat) (j : 'I_n) (f : 'I_n → seq T),
j < n →
x \in (f j) →
x \in \cat_(i < n) (f i).
∀ (x : T) (n : nat) (j : 'I_n) (f : 'I_n → seq T),
j < n →
x \in (f j) →
x \in \cat_(i < n) (f i).
In this section, we show how we can preserve uniqueness of the elements
(i.e. the absence of a duplicate) over a concatenation of sequences.
Assume that there are no duplicates in each of the possible
sequences to concatenate...
...and that there are no elements in common between the sequences.
We prove that the concatenation will yield a sequence with unique elements. TODO: MathComp's bigcat_uniq covers this lemma and is expected
in the next MathComp release (PR 1660:
https://github.com/math-comp/math-comp/pull/1660).
Lemma bigcat_nat_uniq :
∀ n1 n2,
uniq (\cat_(n1 ≤ i < n2) (f i)).
End BigCatNatDistinctElements.
End BigCatNatLemmas.
∀ n1 n2,
uniq (\cat_(n1 ≤ i < n2) (f i)).
End BigCatNatDistinctElements.
End BigCatNatLemmas.
Recovering a Component of a Concatenation
Consider a function g...