From 18b3daf52b880a7d0df6d6ddd83e38a7bb9d1780 Mon Sep 17 00:00:00 2001 From: Kazuhiko Sakaguchi Date: Mon, 9 Nov 2026 16:28:28 +0100 Subject: [PATCH 1/2] Generalise eq_fbig, eq_fbigl, eq_fbigr from Monoid.com_law to Monoid.law --- finmap.v | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/finmap.v b/finmap.v index bb680e4..8bd2e9b 100644 --- a/finmap.v +++ b/finmap.v @@ -2296,6 +2296,23 @@ Lemma big_seq_fset1 (a : I) (F : I -> R) : \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. @@ -2325,27 +2342,11 @@ rewrite big_seq_cond [in RHS]big_seq_cond; apply: eq_bigr => i. 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) From 4c1087a0b1539219c06be9103498caffdc95cdfb Mon Sep 17 00:00:00 2001 From: Kazuhiko Sakaguchi Date: Mon, 9 Nov 2026 16:38:59 +0100 Subject: [PATCH 2/2] [CI] Update Nix toolbox --- .github/workflows/nix-action-9.3.yml | 70 ++++++++++++++++++++++++++++ .nix/config.nix | 2 +- .nix/coq-nix-toolbox.nix | 2 +- 3 files changed, 72 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nix-action-9.3.yml b/.github/workflows/nix-action-9.3.yml index 837127b..d06ca08 100644 --- a/.github/workflows/nix-action-9.3.yml +++ b/.github/workflows/nix-action-9.3.yml @@ -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 diff --git a/.nix/config.nix b/.nix/config.nix index 9bedcf9..b8436a8 100644 --- a/.nix/config.nix +++ b/.nix/config.nix @@ -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 diff --git a/.nix/coq-nix-toolbox.nix b/.nix/coq-nix-toolbox.nix index c7de824..e37c56f 100644 --- a/.nix/coq-nix-toolbox.nix +++ b/.nix/coq-nix-toolbox.nix @@ -1 +1 @@ -"43fefb6ef26448ca64c348f0533edc950cffb8d1" +"4823f30a362c18d44db9fff3b1f273fc85e6218b"