probability.notationMathlib.Probability.Notation

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Rémy Degenne
 -/
-import Mathbin.Probability.ProbabilityMassFunction.Basic
-import Mathbin.MeasureTheory.Function.ConditionalExpectation.Basic
+import Probability.ProbabilityMassFunction.Basic
+import MeasureTheory.Function.ConditionalExpectation.Basic
 
 #align_import probability.notation from "leanprover-community/mathlib"@"e160cefedc932ce41c7049bf0c4b0f061d06216e"
 
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2021 Rémy Degenne. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Rémy Degenne
-
-! This file was ported from Lean 3 source module probability.notation
-! leanprover-community/mathlib commit e160cefedc932ce41c7049bf0c4b0f061d06216e
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Probability.ProbabilityMassFunction.Basic
 import Mathbin.MeasureTheory.Function.ConditionalExpectation.Basic
 
+#align_import probability.notation from "leanprover-community/mathlib"@"e160cefedc932ce41c7049bf0c4b0f061d06216e"
+
 /-! # Notations for probability theory
 
 > THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Rémy Degenne
 
 ! This file was ported from Lean 3 source module probability.notation
-! leanprover-community/mathlib commit 00abe0695d8767201e6d008afa22393978bb324d
+! leanprover-community/mathlib commit e160cefedc932ce41c7049bf0c4b0f061d06216e
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -13,6 +13,9 @@ import Mathbin.MeasureTheory.Function.ConditionalExpectation.Basic
 
 /-! # Notations for probability theory
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file defines the following notations, for functions `X,Y`, measures `P, Q` defined on a
 measurable space `m0`, and another measurable space structure `m` with `hm : m ≤ m0`,
 - `P[X] = ∫ a, X a ∂P`
Diff
@@ -36,30 +36,22 @@ open MeasureTheory
 
 open scoped MeasureTheory
 
--- mathport name: condexp.volume
 -- We define notations `𝔼[f|m]` for the conditional expectation of `f` with respect to `m`.
 scoped[ProbabilityTheory]
   notation "𝔼[" X "|" m "]" => MeasureTheory.condexp m MeasureTheory.MeasureSpace.volume X
 
--- mathport name: condexp.probability
 scoped[ProbabilityTheory] notation P "[" X "]" => ∫ x, X x ∂P
 
--- mathport name: expected_value
 scoped[ProbabilityTheory] notation "𝔼[" X "]" => ∫ a, X a
 
--- mathport name: condexp_indicator
 scoped[ProbabilityTheory]
   notation P "⟦" s "|" m "⟧" => MeasureTheory.condexp m P (s.indicator fun ω => (1 : ℝ))
 
--- mathport name: eq_ae_volume
 scoped[ProbabilityTheory] notation:50 X " =ₐₛ " Y:50 => X =ᵐ[MeasureTheory.MeasureSpace.volume] Y
 
--- mathport name: le_ae_volume
 scoped[ProbabilityTheory] notation:50 X " ≤ₐₛ " Y:50 => X ≤ᵐ[MeasureTheory.MeasureSpace.volume] Y
 
--- mathport name: rn_deriv
 scoped[ProbabilityTheory] notation "∂" P "/∂" Q:50 => P.rn_deriv Q
 
--- mathport name: measure_space.volume
 scoped[ProbabilityTheory] notation "ℙ" => MeasureTheory.MeasureSpace.volume
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Rémy Degenne
 
 ! This file was ported from Lean 3 source module probability.notation
-! leanprover-community/mathlib commit 70fd9563a21e7b963887c9360bd29b2393e6225a
+! leanprover-community/mathlib commit 00abe0695d8767201e6d008afa22393978bb324d
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -20,6 +20,7 @@ measurable space `m0`, and another measurable space structure `m` with `hm : m 
 - `𝔼[X|m]`: conditional expectation of `X` with respect to the measure `volume` and the
   measurable space `m`. The similar `P[X|m]` for a measure `P` is defined in
   measure_theory.function.conditional_expectation.
+- `P⟦s|m⟧ = P[s.indicator (λ ω, (1 : ℝ)) | m]`, conditional probability of a set.
 - `X =ₐₛ Y`: `X =ᵐ[volume] Y`
 - `X ≤ₐₛ Y`: `X ≤ᵐ[volume] Y`
 - `∂P/∂Q = P.rn_deriv Q`
@@ -33,6 +34,8 @@ We note that the notation `∂P/∂Q` applies to three different cases, namely,
 
 open MeasureTheory
 
+open scoped MeasureTheory
+
 -- mathport name: condexp.volume
 -- We define notations `𝔼[f|m]` for the conditional expectation of `f` with respect to `m`.
 scoped[ProbabilityTheory]
@@ -44,6 +47,10 @@ scoped[ProbabilityTheory] notation P "[" X "]" => ∫ x, X x ∂P
 -- mathport name: expected_value
 scoped[ProbabilityTheory] notation "𝔼[" X "]" => ∫ a, X a
 
+-- mathport name: condexp_indicator
+scoped[ProbabilityTheory]
+  notation P "⟦" s "|" m "⟧" => MeasureTheory.condexp m P (s.indicator fun ω => (1 : ℝ))
+
 -- mathport name: eq_ae_volume
 scoped[ProbabilityTheory] notation:50 X " =ₐₛ " Y:50 => X =ᵐ[MeasureTheory.MeasureSpace.volume] Y
 

Changes in mathlib4

mathlib3
mathlib4
fix: shake the import tree (#9749)

cherry-picked from #9347

Co-Authored-By: @digama0

Diff
@@ -3,7 +3,6 @@ Copyright (c) 2021 Rémy Degenne. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Rémy Degenne
 -/
-import Mathlib.Probability.ProbabilityMassFunction.Basic
 import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic
 import Mathlib.MeasureTheory.Decomposition.Lebesgue
 
chore: bump to v4.3.0-rc2 (#8366)

PR contents

This is the supremum of

along with some minor fixes from failures on nightly-testing as Mathlib master is merged into it.

Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.

I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0 branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.

Lean PRs involved in this bump

In particular this includes adjustments for the Lean PRs

leanprover/lean4#2778

We can get rid of all the

local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)

macros across Mathlib (and in any projects that want to write natural number powers of reals).

leanprover/lean4#2722

Changes the default behaviour of simp to (config := {decide := false}). This makes simp (and consequentially norm_num) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp or norm_num to decide or rfl, or adding (config := {decide := true}).

leanprover/lean4#2783

This changed the behaviour of simp so that simp [f] will only unfold "fully applied" occurrences of f. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true }). We may in future add a syntax for this, e.g. simp [!f]; please provide feedback! In the meantime, we have made the following changes:

  • switching to using explicit lemmas that have the intended level of application
  • (config := { unfoldPartialApp := true }) in some places, to recover the old behaviour
  • Using @[eqns] to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp and Function.flip.

This change in Lean may require further changes down the line (e.g. adding the !f syntax, and/or upstreaming the special treatment for Function.comp and Function.flip, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!

Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>

Diff
@@ -38,10 +38,11 @@ open scoped MeasureTheory
 scoped[ProbabilityTheory] notation "𝔼[" X "|" m "]" =>
   MeasureTheory.condexp m MeasureTheory.MeasureSpace.volume X
 
+-- Note(kmill): this notation tends to lead to ambiguity with GetElem notation.
 set_option quotPrecheck false in
 scoped[ProbabilityTheory] notation P "[" X "]" => ∫ x, ↑(X x) ∂P
 
-scoped[ProbabilityTheory] notation "𝔼[" X "]" => ∫ a, X a
+scoped[ProbabilityTheory] notation "𝔼[" X "]" => ∫ a, (X : _ → _) a
 
 scoped[ProbabilityTheory] notation P "⟦" s "|" m "⟧" =>
   MeasureTheory.condexp m P (Set.indicator s fun ω => (1 : ℝ))
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,16 +2,13 @@
 Copyright (c) 2021 Rémy Degenne. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Rémy Degenne
-
-! This file was ported from Lean 3 source module probability.notation
-! leanprover-community/mathlib commit 00abe0695d8767201e6d008afa22393978bb324d
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Probability.ProbabilityMassFunction.Basic
 import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic
 import Mathlib.MeasureTheory.Decomposition.Lebesgue
 
+#align_import probability.notation from "leanprover-community/mathlib"@"00abe0695d8767201e6d008afa22393978bb324d"
+
 /-! # Notations for probability theory
 
 This file defines the following notations, for functions `X,Y`, measures `P, Q` defined on a
fix(Probability/Notation): fix notation for rnDeriv (#5361)

This PR fixes the ∂P/∂Q notation for the Radon-Nikodym derivative.

I chose a priority to ensure that ∂P/∂Q = 0 parses correctly, but I didn't extensively investigate this.

Diff
@@ -10,6 +10,7 @@ Authors: Rémy Degenne
 -/
 import Mathlib.Probability.ProbabilityMassFunction.Basic
 import Mathlib.MeasureTheory.Function.ConditionalExpectation.Basic
+import Mathlib.MeasureTheory.Decomposition.Lebesgue
 
 /-! # Notations for probability theory
 
@@ -52,7 +53,6 @@ scoped[ProbabilityTheory] notation:50 X " =ₐₛ " Y:50 => X =ᵐ[MeasureTheory
 
 scoped[ProbabilityTheory] notation:50 X " ≤ₐₛ " Y:50 => X ≤ᵐ[MeasureTheory.MeasureSpace.volume] Y
 
-set_option quotPrecheck false in
-scoped[ProbabilityTheory] notation "∂" _P "/∂" Q:50 => P.rnDeriv Q
+scoped[ProbabilityTheory] notation "∂" P "/∂" Q:100 => MeasureTheory.Measure.rnDeriv P Q
 
 scoped[ProbabilityTheory] notation "ℙ" => MeasureTheory.MeasureSpace.volume
feat: port Probability.Martingale.Upcrossing (#5281)
Diff
@@ -40,7 +40,8 @@ open scoped MeasureTheory
 scoped[ProbabilityTheory] notation "𝔼[" X "|" m "]" =>
   MeasureTheory.condexp m MeasureTheory.MeasureSpace.volume X
 
-scoped[ProbabilityTheory] notation P "[" X "]" => ∫ x, X x ∂P
+set_option quotPrecheck false in
+scoped[ProbabilityTheory] notation P "[" X "]" => ∫ x, ↑(X x) ∂P
 
 scoped[ProbabilityTheory] notation "𝔼[" X "]" => ∫ a, X a
 
feat: port Probability.Notation (#5187)

Dependencies 12 + 986

987 files ported (98.8%)
450036 lines ported (98.8%)
Show graph

The unported dependencies are

The following 1 dependencies have changed in mathlib3 since they were ported, which may complicate porting this file