Built with Alectryon, running Coq+SerAPI v8.15.0+0.15.0. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑ Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use instead of Ctrl.
(* -------------------------------------------------------------------- *)
(* Copyright (c) - 2015--2016 - IMDEA Software Institute                *)
(* Copyright (c) - 2015--2018 - Inria                                   *)
(* Copyright (c) - 2016--2018 - Polytechnique                           *)

(* -------------------------------------------------------------------- *)
Notation "[ predI _ & _ ]" was already used in scope fun_scope. [notation-overridden,parsing]
Notation "[ predU _ & _ ]" was already used in scope fun_scope. [notation-overridden,parsing]
Notation "[ predD _ & _ ]" was already used in scope fun_scope. [notation-overridden,parsing]
Notation "[ predC _ ]" was already used in scope fun_scope. [notation-overridden,parsing]
Notation "[ preim _ of _ ]" was already used in scope fun_scope. [notation-overridden,parsing]
Notation "_ + _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ - _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ <= _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ < _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ >= _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ > _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ <= _ <= _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ < _ <= _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ <= _ < _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ < _ < _" was already used in scope nat_scope. [notation-overridden,parsing]
Notation "_ * _" was already used in scope nat_scope. [notation-overridden,parsing]
New coercion path [GRing.subring_closedM; GRing.smulr_closedN] : GRing.subring_closed >-> GRing.oppr_closed is ambiguous with existing [GRing.subring_closedB; GRing.zmod_closedN] : GRing.subring_closed >-> GRing.oppr_closed. [ambiguous-paths,typechecker]
New coercion path [GRing.subring_closed_semi; GRing.semiring_closedM] : GRing.subring_closed >-> GRing.mulr_closed is ambiguous with existing [GRing.subring_closedM; GRing.smulr_closedM] : GRing.subring_closed >-> GRing.mulr_closed. New coercion path [GRing.subring_closed_semi; GRing.semiring_closedD] : GRing.subring_closed >-> GRing.addr_closed is ambiguous with existing [GRing.subring_closedB; GRing.zmod_closedD] : GRing.subring_closed >-> GRing.addr_closed. [ambiguous-paths,typechecker]
New coercion path [GRing.sdivr_closed_div; GRing.divr_closedM] : GRing.sdivr_closed >-> GRing.mulr_closed is ambiguous with existing [GRing.sdivr_closedM; GRing.smulr_closedM] : GRing.sdivr_closed >-> GRing.mulr_closed. [ambiguous-paths,typechecker]
New coercion path [GRing.subalg_closedBM; GRing.subring_closedB] : GRing.subalg_closed >-> GRing.zmod_closed is ambiguous with existing [GRing.subalg_closedZ; GRing.submod_closedB] : GRing.subalg_closed >-> GRing.zmod_closed. [ambiguous-paths,typechecker]
New coercion path [GRing.divring_closed_div; GRing.sdivr_closedM] : GRing.divring_closed >-> GRing.smulr_closed is ambiguous with existing [GRing.divring_closedBM; GRing.subring_closedM] : GRing.divring_closed >-> GRing.smulr_closed. [ambiguous-paths,typechecker]
New coercion path [GRing.divalg_closedBdiv; GRing.divring_closedBM] : GRing.divalg_closed >-> GRing.subring_closed is ambiguous with existing [GRing.divalg_closedZ; GRing.subalg_closedBM] : GRing.divalg_closed >-> GRing.subring_closed. [ambiguous-paths,typechecker]
New coercion path [GRing.Pred.subring_smul; GRing.Pred.smul_mul] : GRing.Pred.subring >-> GRing.Pred.mul is ambiguous with existing [GRing.Pred.subring_semi; GRing.Pred.semiring_mul] : GRing.Pred.subring >-> GRing.Pred.mul. [ambiguous-paths,typechecker]
From mathcomp Require Export finmap. Set Implicit Arguments. Unset Strict Implicit. Unset Printing Implicit Defensive. Set Asymmetric Patterns. Import Order.TTheory GRing.Theory Num.Theory. Local Open Scope ring_scope. Local Open Scope fset_scope. (* -------------------------------------------------------------------- *)
K: choiceType
J: {fset K}

uniq J
2
by case: J => J /= /canonical_uniq. Qed. #[global] Hint Resolve uniq_fset_keys : core. (* -------------------------------------------------------------------- *)
T: choiceType

enum [finType of fset0] = [::]
a
by rewrite enumT unlock. Qed.
d
x: T

enum [finType of [fset x]] = [:: [` fset11 x]]
11
13
uniq (enum [finType of [fset x]])
13
enum [finType of [fset x]] =i [:: [` fset11 x]]
13
1d
d
x, y: T
hy: y \in [fset x]

true = ([` hy] == [` fset11 x])
by rewrite eqE /=; rewrite in_fset1 in hy. Qed. (* -------------------------------------------------------------------- *) Section BigFSet. Variable (R : Type) (idx : R) (op : Monoid.law idx). Variable (I : choiceType).
R: Type
idx: R
op: Monoid.law idx
I: choiceType
P: pred fset0
F: fset0 -> R

\big[op/idx]_(i | P i) F i = idx
29
by apply: big_pred0 => -[j hj]; have := hj; rewrite in_fset0. Qed.
2c
2d
2e
2f
31

\big[op/idx]_i F i = idx
35
by rewrite /index_enum -enumT /= enum_fset0 big_nil. Qed.
2c
2d
2e
2f
a: I
F: [fset a] -> R

\big[op/idx]_i F i = (F.[fset11 a])%fmap
3b
by rewrite /index_enum -enumT enum_fset1 big_seq1. Qed. End BigFSet. (* -------------------------------------------------------------------- *) Section BigFSetCom. Variable (R : Type) (idx : R). Local Notation "1" := idx. Variable op : Monoid.com_law 1. Local Notation "'*%M'" := op (at level 0). Local Notation "x * y" := (op x y).
2c
2d
op: Monoid.com_law 1
d
J: {fset T}
P: T -> bool
F: T -> R

\big[*%M/1]_(x | P (val x)) F (val x) = \big[*%M/1]_(x <- J | P x) F x
43
2c
2d
46
d
48
49
J: seq T
c: canonical_keys J

\big[*%M/1]_(i <- [seq val i | i <- locked_with index_enum_key (Finite.enum (fset_sub_finType (mkFinSet c)))] | P i) F i = \big[*%M/1]_(x <- mkFinSet c | P x) F x
by rewrite !unlock val_fset_sub_enum ?canonical_uniq. Qed.
2c
2d
46
d
47
49

\big[*%M/1]_x F (val x) = \big[*%M/1]_(x <- J) F x
54
by apply/big_fset_seq_cond. Qed.
2c
2d
46
d
s: seq T
48
49

uniq s -> \big[*%M/1]_(x | P (val x)) F (val x) = \big[*%M/1]_(x <- s | P x) F x
5a
2c
2d
46
d
5d
48
49
eq_s: uniq s

perm_eq [fset x | x in s] s
by apply/uniq_perm=> //= x; rewrite in_fset. Qed.
2c
2d
46
d
5d
49

uniq s -> \big[*%M/1]_x F (val x) = \big[*%M/1]_(x <- s) F x
67
by apply/big_seq_fset_cond. Qed. End BigFSetCom. Arguments big_fset_seq_cond [R idx op T J] P F. Arguments big_fset_seq [R idx op T J] F. Arguments big_seq_fset_cond [R idx op T s] P F _. Arguments big_seq_fset [R idx op T s] F _. (* -------------------------------------------------------------------- *) Section BigFSetU. Context {R : Type} {T : choiceType} (idx : R) (op : Monoid.com_law idx).
2c
d
2d
op: Monoid.com_law idx
A, B: {fset T}
49

[disjoint A & B] -> \big[op/idx]_j F (val j) = op (\big[op/idx]_j F (val j)) (\big[op/idx]_j F (val j))
6d
2c
d
2d
70
71
49
dj_AB: [disjoint A & B]

perm_eq (A `|` B) (A ++ B)
77
uniq (A ++ B)
77
A `|` B =i A ++ B
7b
2c
d
2d
70
71
49
78
14

x \in B -> x \notin A
7e
77
80
88
by move=> x; rewrite mem_cat in_fsetE. Qed. End BigFSetU. (* -------------------------------------------------------------------- *) Section BigFSetOrder. Variable (R : realDomainType) (T : choiceType).
R: realDomainType
d
I, J: {fset T}
49

(forall x : T, 0 <= F x) -> {subset I <= J} -> \sum_i F (val i) <= \sum_j F (val j)
8c
8f
d
90
49
ge0_F: forall x : T, 0 <= F x
le_IJ: {subset I <= J}

\sum_(x <- I) F x <= \sum_(x <- J) F x
96
\sum_(x <- I) F x <= (\sum_(i <- J | i \in I) F i + \sum_(i <- J | i \notin I) F i)%R
96
\sum_(x <- I) F x <= \sum_(i <- [seq i <- J | i \in I]) F i
96
perm_eq I [seq i <- J | i \in I]
8f
d
90
49
97
98
i: T

(i \in I) = (i \in [seq i <- J | i \in I])
a9
i \in I -> true = (i \in J)
by move/le_IJ => ->. Qed.
8f
d
F: nat -> R
n: nat

\sum_(0 <= i < n) F i = \sum_i F (val i)
b1
b3
perm_eq (index_iota 0 n) [seq fsval i | i <- index_enum (fset_sub_finType [fset x | x in iota 0 n])]
b3
uniq [seq fsval i | i <- index_enum (fset_sub_finType [fset x | x in iota 0 n])]
b3
index_iota 0 n =i [seq fsval i | i <- index_enum (fset_sub_finType [fset x | x in iota 0 n])]
b3
uniq (index_enum (fset_sub_finType [fset x | x in iota 0 n]))
c0
b3
c2
by move=> i; rewrite /index_enum -enumT -enum_fsetE in_fset /index_iota subn0. Qed.
b3
\sum_(i < n) F i = \sum_i F (val i)
cb
by rewrite -(big_mkord xpredT) big_nat_mkfset. Qed. End BigFSetOrder. (* -------------------------------------------------------------------- *)
I: finType

perm_eq (enum [fset i | i in I]) (enum I)
d0
d2
enum [fset i | i in I] =i enum I
by move=> i /=; rewrite !mem_enum in_imfset. Qed. (* -------------------------------------------------------------------- *)