Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/nix-action-9.3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,76 @@ jobs:
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "9.3"
--argstr job "mathcomp-finmap"
mathcomp-infotheo:
needs:
- coq
- mathcomp-analysis-stdlib
runs-on: ubuntu-latest
steps:
- name: Determine which commit to initially checkout
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{
github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha
}}\" >> $GITHUB_ENV\nfi\n"
- name: Git checkout
uses: actions/checkout@v7
with:
allow-unsafe-pr-checkout: true
fetch-depth: 0
ref: ${{ env.target_commit }}
- name: Determine which commit to test
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{
github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{ github.event.repository.html_url
}} refs/pull/${{ github.event.number }}/merge | cut -f1)\n mergeable=$(git
merge --no-commit --no-ff ${{ github.event.pull_request.base.sha }} > /dev/null
2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n if [ -z \"$merge_commit\"\
\ -o \"x$mergeable\" != \"x0\" ]; then\n echo \"tested_commit=${{ github.event.pull_request.head.sha
}}\" >> $GITHUB_ENV\n else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n\
\ fi\nfi\n"
- name: Git checkout
uses: actions/checkout@v7
with:
allow-unsafe-pr-checkout: true
fetch-depth: 0
ref: ${{ env.tested_commit }}
- name: Cachix install
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Cachix setup math-comp
uses: cachix/cachix-action@v16
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
extraPullNames: coq, coq-community
name: math-comp
- id: stepGetDerivation
name: Getting derivation for current job (mathcomp-infotheo)
run: "NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr bundle
\"9.3\" --argstr job \"mathcomp-infotheo\" \\\n --dry-run 2> err > out ||
(touch fail; true)\ncat out err\nif [ -e fail ]; then echo \"Error: getting
derivation failed\"; exit 1; fi\n"
- id: stepCheck
name: Checking presence of CI target for current job
run: "if $(cat out err | grep -q \"built:\") ; then\n echo \"CI target needs
actual building\"\n if $(cat out err | grep -q \"derivations will be built:\"\
) ; then\n echo \"waiting a bit for derivations that should be in cache\"\
\n sleep 30\n fi\nelse\n echo \"CI target already built\"\n echo \"\
status=fetched\" >> $GITHUB_OUTPUT\nfi\n"
- if: steps.stepCheck.outputs.status != 'fetched'
name: 'Building/fetching previous CI target: coq'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "9.3"
--argstr job "coq"
- if: steps.stepCheck.outputs.status != 'fetched'
name: 'Building/fetching previous CI target: mathcomp-analysis-stdlib'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "9.3"
--argstr job "mathcomp-analysis-stdlib"
- if: steps.stepCheck.outputs.status != 'fetched'
name: 'Building/fetching previous CI target: interval'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "9.3"
--argstr job "interval"
- if: steps.stepCheck.outputs.status != 'fetched'
name: Building/fetching current CI target
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "9.3"
--argstr job "mathcomp-infotheo"
mathcomp-reals:
needs:
- rocq-core
Expand Down
2 changes: 1 addition & 1 deletion .nix/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

## select an entry to build in the following `bundles` set
## defaults to "default"
default-bundle = "8.20";
default-bundle = "9.3";

## Cachix caches to use in CI
## Below we list some standard ones
Expand Down
2 changes: 1 addition & 1 deletion .nix/coq-nix-toolbox.nix
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"43fefb6ef26448ca64c348f0533edc950cffb8d1"
"4823f30a362c18d44db9fff3b1f273fc85e6218b"
33 changes: 17 additions & 16 deletions finmap.v
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@
Reserved Notation "A `=P` B" (at level 70, no associativity).

Reserved Notation "f @`[ key ] A" (at level 24, key at level 0).
Reserved Notation "f @2`[ key ] ( A , B )"

Check warning on line 151 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.5.0-rocq-prover-9.1)

Postfix notations (i.e. starting with a nonterminal symbol and

Check warning on line 151 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.5.0-rocq-prover-9.0)

Postfix notations (i.e. starting with a nonterminal symbol and

Check warning on line 151 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-dev)

Postfix notations (i.e. starting with a nonterminal symbol and

Check warning on line 151 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-9.1)

Postfix notations (i.e. starting with a nonterminal symbol and
(at level 24, format "f @2`[ key ] ( A , B )").
Reserved Notation "f @` A" (at level 24).
Reserved Notation "f @2` ( A , B )" (at level 24, format "f @2` ( A , B )").

Check warning on line 154 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.5.0-rocq-prover-9.1)

Postfix notations (i.e. starting with a nonterminal symbol and

Check warning on line 154 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.5.0-rocq-prover-9.0)

Postfix notations (i.e. starting with a nonterminal symbol and

Check warning on line 154 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-dev)

Postfix notations (i.e. starting with a nonterminal symbol and

Check warning on line 154 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-9.1)

Postfix notations (i.e. starting with a nonterminal symbol and

(* unary *)
Reserved Notation "[ 'fset' E | x : T 'in' A ]" (at level 0, E, x at level 99).
Expand All @@ -169,9 +169,9 @@
Reserved Notation "[ 'fset' x 'in' A | P & Q ]" (at level 0, x at level 99).

(* binary *)
Reserved Notation "[ 'fset' E | x : T 'in' A , y : T' 'in' B ]"

Check warning on line 172 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.5.0-rocq-prover-9.1)

Notations "[ fset _ | _ : _ in _ ]" defined at level 0

Check warning on line 172 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.5.0-rocq-prover-9.0)

Notations "[ fset _ | _ : _ in _ ]" defined at level 0

Check warning on line 172 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-dev)

Notations "[ fset _ | _ : _ in _ ]" defined at level 0

Check warning on line 172 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-9.1)

Notations "[ fset _ | _ : _ in _ ]" defined at level 0
(at level 0, E, x at level 99, A at level 200, y at level 99).
Reserved Notation "[ 'fset' E | x 'in' A , y 'in' B ]"

Check warning on line 174 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.5.0-rocq-prover-9.1)

Notations "[ fset _ | _ in _ ]" defined at level 0 with arguments

Check warning on line 174 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.5.0-rocq-prover-9.0)

Notations "[ fset _ | _ in _ ]" defined at level 0 with arguments

Check warning on line 174 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-dev)

Notations "[ fset _ | _ in _ ]" defined at level 0 with arguments

Check warning on line 174 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-9.1)

Notations "[ fset _ | _ in _ ]" defined at level 0 with arguments
(at level 0, E, x at level 99, A at level 200, y at level 99).

(* keyed parse only *)
Expand All @@ -184,11 +184,11 @@
(at level 0, E, x at level 99).
Reserved Notation "[ 'fset[' key ] E | x : A & P ]"
(at level 0, E, x at level 99).
Reserved Notation "[ 'fset[' key ] E | x : T 'in' A , y : T' 'in' B ]"

Check warning on line 187 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.5.0-rocq-prover-9.1)

Notations "[ fset[ _ ] _ | _ : _ in _ ]" defined at level 0

Check warning on line 187 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.5.0-rocq-prover-9.0)

Notations "[ fset[ _ ] _ | _ : _ in _ ]" defined at level 0

Check warning on line 187 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-dev)

Notations "[ fset[ _ ] _ | _ : _ in _ ]" defined at level 0

Check warning on line 187 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-9.1)

Notations "[ fset[ _ ] _ | _ : _ in _ ]" defined at level 0
(at level 0, E, x at level 99, A at level 200, y at level 99).
Reserved Notation "[ 'fset[' key ] E | x 'in' A , y 'in' B ]"

Check warning on line 189 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.5.0-rocq-prover-9.1)

Notations "[ fset[ _ ] _ | _ in _ ]" defined at level 0

Check warning on line 189 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.5.0-rocq-prover-9.0)

Notations "[ fset[ _ ] _ | _ in _ ]" defined at level 0

Check warning on line 189 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-dev)

Notations "[ fset[ _ ] _ | _ in _ ]" defined at level 0

Check warning on line 189 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-9.1)

Notations "[ fset[ _ ] _ | _ in _ ]" defined at level 0
(at level 0, E, x at level 99, A at level 200, y at level 99).
Reserved Notation "[ 'fset[' key ] E | x : A , y : B ]"

Check warning on line 191 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.5.0-rocq-prover-9.1)

Notations "[ fset[ _ ] _ | _ : _ in _ ]" defined at level 0

Check warning on line 191 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.5.0-rocq-prover-9.0)

Notations "[ fset[ _ ] _ | _ : _ in _ ]" defined at level 0

Check warning on line 191 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-dev)

Notations "[ fset[ _ ] _ | _ : _ in _ ]" defined at level 0

Check warning on line 191 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-9.1)

Notations "[ fset[ _ ] _ | _ : _ in _ ]" defined at level 0
(at level 0, E, x at level 99, A at level 200, y at level 99).
Reserved Notation "[ 'fset[' key ] E | x : A , y 'in' B ]"
(at level 0, E, x, y at level 99).
Expand Down Expand Up @@ -234,7 +234,7 @@
Reserved Notation "[ 'f' 'set' x 'in' A | P & Q ]"
(at level 0, x at level 99, format "[ 'f' 'set' x 'in' A | P & Q ]").
(* binary printing only *)
Reserved Notation "[ 'f' 'set' E | x 'in' A , y 'in' B ]"

Check warning on line 237 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.5.0-rocq-prover-9.1)

Notations "[ f set _ | _ in _ ]" defined at level 0 with arguments

Check warning on line 237 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp:2.5.0-rocq-prover-9.0)

Notations "[ f set _ | _ in _ ]" defined at level 0 with arguments

Check warning on line 237 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-dev)

Notations "[ f set _ | _ in _ ]" defined at level 0 with arguments

Check warning on line 237 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-9.1)

Notations "[ f set _ | _ in _ ]" defined at level 0 with arguments
(at level 0, E, x at level 99, A at level 200, y at level 99,
format "[ '[hv' 'f' 'set' E '/ ' | x 'in' A , '/' y 'in' B ] ']'").

Expand Down Expand Up @@ -354,11 +354,11 @@

(* Copy of the ssrbool shim to ensure compatibility with MathComp v1.8.0. *)
Definition PredType : forall T pT, (pT -> pred T) -> predType T.
exact PredType || exact mkPredType.

Check warning on line 357 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-dev)

This interactive proof is not started by the "Proof" command.
Defined.
Arguments PredType [T pT] toP.

Local Notation predOfType T := (pred_of_simpl (@pred_of_argType T)).

Check warning on line 361 in finmap.v

View workflow job for this annotation

GitHub Actions / build (mathcomp/mathcomp-dev:rocq-prover-dev)

Use of "Notation" keyword for abbreviations is deprecated, use

Definition oextract (T : Type) (o : option T) : o -> T :=
if o is Some t return o -> T then fun=> t else False_rect T \o notF.
Expand Down Expand Up @@ -2296,6 +2296,23 @@
\big[op/idx]_(i <- [fset a]) F i = F a.
Proof. by rewrite big_seq_fsetE big_fset1. Qed.

Lemma eq_fbig (A B : {fset I}) (F G : I -> R) :
A =i B -> (forall x, x \in A -> F x = G x) ->
\big[op/idx]_(i <- A) F i = \big[op/idx]_(i <- B) G i.
Proof. by move=> /fsetP<- FG; rewrite big_seq [RHS]big_seq; apply: eq_bigr. Qed.

Lemma eq_fbigl (A B : {fset I}) (F : I -> R) :
A =i B -> \big[op/idx]_(i <- A) F i = \big[op/idx]_(i <- B) F i.
Proof. by move=> AB; apply: eq_fbig. Qed.

Lemma eq_fbigr (A : {fset I}) (P : pred I) (F G : I -> R) :
(forall x, x \in A -> P x -> F x = G x) ->
\big[op/idx]_(i <- A | P i) F i = \big[op/idx]_(i <- A | P i) G i.
Proof.
move=> FG; rewrite big_seq_cond [RHS]big_seq_cond.
by apply: eq_bigr => ? /andP[]; apply: FG.
Qed.

End BigFSet.

Lemma card_fset_sum1 (T : choiceType) (A : {fset T}) : #|` A| = \sum_(i <- A) 1.
Expand Down Expand Up @@ -2325,27 +2342,11 @@
by rewrite in_fset !inE => /andP[/andP[??] _]; apply: FG.
Qed.

Lemma eq_fbig (A B : {fset I}) (F G : I -> R) :
A =i B -> (forall x, x \in A -> F x = G x) ->
\big[op/idx]_(i <- A) F i = \big[op/idx]_(i <- B) G i.
Proof.
by move=> AB FG; apply: eq_fbig_cond => x; rewrite ?inE/= -?AB// => /FG.
Qed.

Lemma eq_fbigl_cond (A B : {fset I}) (P Q : pred I) (F : I -> R) :
[fset x in A | P x] =i [fset x in B | Q x] ->
\big[op/idx]_(i <- A | P i) F i = \big[op/idx]_(i <- B | Q i) F i.
Proof. by move=> AB; apply: eq_fbig_cond. Qed.

Lemma eq_fbigl (A B : {fset I}) (F : I -> R) :
A =i B -> \big[op/idx]_(i <- A) F i = \big[op/idx]_(i <- B) F i.
Proof. by move=> AB; apply: eq_fbig. Qed.

Lemma eq_fbigr (A : {fset I}) (P : pred I) (F G : I -> R) :
(forall x, x \in A -> P x -> F x = G x) ->
\big[op/idx]_(i <- A | P i) F i = \big[op/idx]_(i <- A | P i) G i.
Proof. by apply: eq_fbig_cond. Qed.

Lemma big_fsetID (B : pred I) (A : {fset I}) (F : I -> R) :
\big[op/idx]_(i <- A) F i =
op (\big[op/idx]_(i <- [fset x in A | B x]) F i)
Expand Down
Loading