Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application of s-finite kernels to program semantics #912

Draft
wants to merge 31 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
cd8a4c4
probabilistic language using mca's kernels
affeldt-aist Apr 12, 2023
1dc9ecf
syntax and denotational semantics
AyumuSaito Feb 14, 2023
4d81519
rm duplicate, more uniform naming
affeldt-aist Sep 16, 2023
002fee9
add binary operations
AyumuSaito Sep 23, 2023
349e227
minor fixes, updates, rebases
affeldt-aist Oct 10, 2023
1fc0252
casino example and extensions
AyumuSaito Feb 14, 2023
bb0b030
bernoulli_trunc measurable
affeldt-aist Jan 9, 2024
aaf8c53
add Nat and 0<=p<=1 problem
AyumuSaito Jan 12, 2024
49e926d
progress
affeldt-aist Jan 16, 2024
b02175b
minor fixes
AyumuSaito Feb 14, 2023
177ee65
several admits proved
affeldt-aist Jan 16, 2024
dabde4b
definition beta
AyumuSaito Jan 18, 2024
8649b5a
fix
affeldt-aist Feb 15, 2024
63e011a
write casino (wip)
AyumuSaito Feb 16, 2024
1abe53e
WIP
affeldt-aist Feb 20, 2024
0e73db9
progress in proving the casino exampl
AyumuSaito Feb 20, 2024
4162893
admit about fact and adjustment of exp but casino broken
affeldt-aist Feb 27, 2024
a1a624c
fix
AyumuSaito Feb 27, 2024
98344f0
minor progress
affeldt-aist Mar 1, 2024
ff9223a
casion example (wip)
AyumuSaito Mar 6, 2024
f692e1d
complete the casino example
affeldt-aist Mar 24, 2024
37e75cd
shorter measurability proofs
affeldt-aist May 5, 2024
40cb574
cleaning/rebase
affeldt-aist May 8, 2024
395c350
wip
affeldt-aist Feb 14, 2023
5018703
beta_bdf_uniq_ae
IshiguroYoshihiro Aug 25, 2024
867d065
integral_indicator_function
IshiguroYoshihiro Sep 18, 2024
2088ec3
fix
IshiguroYoshihiro Sep 18, 2024
882dc3f
rebase
affeldt-aist Oct 9, 2024
702bde5
add dep to algebra-tactics in nix
affeldt-aist Oct 10, 2024
6db6439
rebase
affeldt-aist Oct 24, 2024
639b4dd
fix
affeldt-aist Dec 2, 2024
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
8 changes: 8 additions & 0 deletions .github/workflows/nix-action-8.19.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ jobs:
name: 'Building/fetching previous CI target: mathcomp-bigenough'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "8.19" --argstr
job "mathcomp-bigenough"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra-tactics'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "8.19" --argstr
job "mathcomp-algebra-tactics"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "8.19" --argstr
Expand Down Expand Up @@ -263,6 +267,10 @@ jobs:
name: 'Building/fetching previous CI target: mathcomp-bigenough'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "8.19" --argstr
job "mathcomp-bigenough"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra-tactics'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "8.19" --argstr
job "mathcomp-algebra-tactics"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "8.19" --argstr
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/nix-action-8.20.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ jobs:
name: 'Building/fetching previous CI target: mathcomp-bigenough'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "8.20" --argstr
job "mathcomp-bigenough"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra-tactics'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "8.20" --argstr
job "mathcomp-algebra-tactics"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "8.20" --argstr
Expand Down Expand Up @@ -263,6 +267,10 @@ jobs:
name: 'Building/fetching previous CI target: mathcomp-bigenough'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "8.20" --argstr
job "mathcomp-bigenough"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: mathcomp-algebra-tactics'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "8.20" --argstr
job "mathcomp-algebra-tactics"
- if: steps.stepCheck.outputs.status == 'built'
name: 'Building/fetching previous CI target: hierarchy-builder'
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "8.20" --argstr
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/nix-action-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ jobs:
needs:
- coq
- mathcomp-finmap
- hierarchy-builder
- mathcomp-bigenough
- mathcomp-bigenough
- hierarchy-builder
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/nix-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This file was generated from `meta.yml`, please do not edit manually.
# Follow the instructions on https://github.com/coq-community/templates to regenerate.
name: Nix CI

on:
push:
branches:
- master
pull_request:
paths:
- .github/workflows/**
pull_request_target:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
overrides:
- 'coq = "master"'
fail-fast: false
steps:
- name: Determine which commit to test
run: |
if [[ ${{ github.event_name }} =~ "pull_request" ]]; then
merge_commit=$(git ls-remote ${{ github.event.repository.html_url }} refs/pull/${{ github.event.number }}/merge | cut -f1)
if [ -z "$merge_commit" ]; then
echo "tested_commit=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
else
echo "tested_commit=$merge_commit" >> $GITHUB_ENV
fi
else
echo "tested_commit=${{ github.sha }}" >> $GITHUB_ENV
fi
- uses: cachix/install-nix-action@v14
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- uses: cachix/cachix-action@v10
with:
name: coq-community
extraPullNames: coq, math-comp
- uses: actions/checkout@v2
with:
ref: ${{ env.tested_ref }}
- run: >
nix-build https://coq.inria.fr/nix/toolbox --argstr job analysis --arg override '{ ${{ matrix.overrides }}; analysis = builtins.filterSource (path: _: baseNameOf path != ".git") ./.; }'
93 changes: 93 additions & 0 deletions .nix/coq-overlays/mathcomp-analysis/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{ lib,
mkCoqDerivation, recurseIntoAttrs,
mathcomp, mathcomp-finmap, mathcomp-bigenough,
hierarchy-builder, mathcomp-algebra-tactics,
single ? false,
coqPackages, coq, version ? null }@args:
with builtins // lib;
let
repo = "analysis";
owner = "math-comp";

release."0.6.1".sha256 = "sha256-1VyNXu11/pDMuH4DmFYSUF/qZ4Bo+/Zl3Y0JkyrH/r0=";
release."0.6.0".sha256 = "sha256-0msICcIrK6jbOSiBu0gIVU3RHwoEEvB88CMQqW/06rg=";
release."0.5.3".sha256 = "sha256-1NjFsi5TITF8ZWx1NyppRmi8g6YaoUtTdS9bU/sUe5k=";
release."0.5.2".sha256 = "0yx5p9zyl8jv1vg7rgkyq8dqzkdnkqv969mi62whmhkvxbavgzbw";
release."0.5.1".sha256 = "1hnzqb1gxf88wgj2n1b0f2xm6sxg9j0735zdsv6j12hlvx5lwk68";
release."0.3.13".sha256 = "sha256-Yaztew79KWRC933kGFOAUIIoqukaZOdNOdw4XszR1Hg=";
release."0.3.10".sha256 = "sha256-FBH2c8QRibq5Ycw/ieB8mZl0fDiPrYdIzZ6W/A3pIhI=";
release."0.3.9".sha256 = "sha256-uUU9diBwUqBrNRLiDc0kz0CGkwTZCUmigPwLbpDOeg4=";
release."0.3.6".sha256 = "0g2j7b2hca4byz62ssgg90bkbc8wwp7xkb2d3225bbvihi92b4c5";
release."0.3.4".sha256 = "18mgycjgg829dbr7ps77z6lcj03h3dchjbj5iir0pybxby7gd45c";
release."0.3.3".sha256 = "1m2mxcngj368vbdb8mlr91hsygl430spl7lgyn9qmn3jykack867";
release."0.3.1".sha256 = "1iad288yvrjv8ahl9v18vfblgqb1l5z6ax644w49w9hwxs93f2k8";
release."0.2.3".sha256 = "0p9mr8g1qma6h10qf7014dv98ln90dfkwn76ynagpww7qap8s966";

defaultVersion = with versions; lib.switch [ coq.version mathcomp.version ] [
{ cases = [ (isGe "8.14") (isGe "1.13.0") ]; out = "0.6.1"; }
{ cases = [ (isGe "8.14") (range "1.13" "1.15") ]; out = "0.5.2"; }
{ cases = [ (range "8.13" "8.15") (range "1.13" "1.14") ]; out = "0.5.1"; }
{ cases = [ (range "8.13" "8.15") (range "1.12" "1.14") ]; out = "0.3.13"; }
{ cases = [ (range "8.11" "8.14") (range "1.12" "1.13") ]; out = "0.3.10"; }
{ cases = [ (range "8.11" "8.12") "1.11.0" ]; out = "0.3.4"; }
{ cases = [ (range "8.10" "8.12") "1.11.0" ]; out = "0.3.3"; }
{ cases = [ (range "8.10" "8.11") "1.11.0" ]; out = "0.3.1"; }
{ cases = [ (range "8.8" "8.11") (range "1.8" "1.10") ]; out = "0.2.3"; }
] null;

# list of analysis packages sorted by dependency order
packages = [ "classical" "analysis" ];

mathcomp_ = package: let
classical-deps = [ mathcomp.algebra mathcomp-finmap hierarchy-builder ];
analysis-deps = [ mathcomp.field mathcomp-bigenough ];
intra-deps = if package == "single" then []
else map mathcomp_ (head (splitList (lib.pred.equal package) packages));
pkgpath = if package == "single" then "."
else if package == "analysis" then "theories" else "${package}";
pname = if package == "single" then "mathcomp-analysis-single"
else "mathcomp-${package}";
derivation = mkCoqDerivation ({
inherit version pname defaultVersion release repo owner;

namePrefix = [ "coq" "mathcomp" ];

propagatedBuildInputs =
intra-deps
++ optionals (elem package [ "classical" "single" ]) classical-deps
++ optionals (elem package [ "analysis" "single" ]) analysis-deps
++ optionals (elem package [ "analysis" "single" ]) [mathcomp-algebra-tactics];

preBuild = ''
cd ${pkgpath}
'';

meta = {
description = "Analysis library compatible with Mathematical Components";
maintainers = [ maintainers.cohencyril ];
license = licenses.cecill-c;
};

passthru = genAttrs packages mathcomp_;
});
# split packages didn't exist before 0.6, so bulding nothing in that case
patched-derivation1 = derivation.overrideAttrs (o:
optionalAttrs (o.pname != null && o.pname != "mathcomp-analysis" &&
o.version != null && o.version != "dev" && versions.isLt "0.6" o.version)
{ preBuild = ""; buildPhase = "echo doing nothing"; installPhase = "echo doing nothing"; }
);
patched-derivation2 = patched-derivation1.overrideAttrs (o:
optionalAttrs (o.pname != null && o.pname == "mathcomp-analysis" &&
o.version != null && o.version != "dev" && versions.isLt "0.6" o.version)
{ preBuild = ""; }
);
patched-derivation = patched-derivation2.overrideAttrs (o:
optionalAttrs (o.version != null
&& (o.version == "dev" || versions.isGe "0.3.4" o.version))
{
propagatedBuildInputs = o.propagatedBuildInputs ++ [ hierarchy-builder ];
}
);
in patched-derivation;
in
mathcomp_ (if single then "single" else "analysis")
7 changes: 7 additions & 0 deletions _CoqProject
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,10 @@ theories/kernel.v
theories/showcase/summability.v
analysis_stdlib/Rstruct_topology.v
analysis_stdlib/showcase/uniform_bigO.v
theories/prob_lang.v
theories/prob_lang_wip.v
theories/lang_syntax_util.v
theories/lang_syntax_toy.v
theories/lang_syntax.v
theories/lang_syntax_examples.v
theories/lang_syntax_table_game.v
2 changes: 2 additions & 0 deletions coq-mathcomp-analysis.opam
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ depends: [
"coq-mathcomp-solvable"
"coq-mathcomp-field"
"coq-mathcomp-bigenough" { (>= "1.0.0") }
"coq-mathcomp-algebra-tactics" { (>= "1.2.3") }
"coq-mathcomp-zify" { (>= "1.5.0") }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that you are depending on mczify only transitively, and not directly using it. If so, this line can be removed.

]

tags: [
Expand Down
7 changes: 7 additions & 0 deletions theories/Make
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,10 @@ charge.v
kernel.v
all_analysis.v
showcase/summability.v
prob_lang.v
prob_lang_wip.v
lang_syntax_util.v
lang_syntax_toy.v
lang_syntax.v
lang_syntax_examples.v
lang_syntax_table_game.v
19 changes: 18 additions & 1 deletion theories/ftc.v
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@ Notation mu := (@lebesgue_measure R).
Local Open Scope ereal_scope.
Implicit Types (f : R -> R) (a : itv_bound R).

Let integrable_locally f (A : set R) : measurable A ->
mu.-integrable A (EFin \o f) -> locally_integrable [set: R] (f \_ A).
Proof.
move=> mA intf; split.
- move/integrableP : intf => [mf _].
by apply/(measurable_restrictT _ _).1 => //; exact/EFin_measurable_fun.
- exact: openT.
- move=> K _ cK.
move/integrableP : intf => [mf].
rewrite integral_mkcond/=.
under eq_integral do rewrite restrict_EFin restrict_normr.
apply: le_lt_trans.
apply: ge0_subset_integral => //=; first exact: compact_measurable.
apply/EFin_measurable_fun/measurableT_comp/EFin_measurable_fun => //=.
move/(measurable_restrictT _ _).1 : mf => /=.
by rewrite restrict_EFin; exact.
Qed.

Let FTC0 f a : mu.-integrable setT (EFin \o f) ->
let F x := (\int[mu]_(t in [set` Interval a (BRight x)]) f t)%R in
forall x, a < BRight x -> lebesgue_pt f x ->
Expand Down Expand Up @@ -679,7 +697,6 @@ Qed.

End Rintegration_by_parts.

(* TODO: move to realfun.v? *)
Section integration_by_substitution_preliminaries.
Context {R : realType}.
Notation mu := lebesgue_measure.
Expand Down
1 change: 0 additions & 1 deletion theories/kernel.v
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,6 @@ HB.instance Definition _ (P : probability Y R):=

End knormalize.

(* TODO: useful? *)
Lemma measurable_fun_mnormalize d d' (X : measurableType d)
(Y : measurableType d') (R : realType) (k : R.-ker X ~> Y) :
measurable_fun [set: X] (fun x =>
Expand Down
Loading
Loading