Skip to content

Commit

Permalink
style: recover Is of Foo which is ported from is_foo (leanprove…
Browse files Browse the repository at this point in the history
…r-community#4639)

I have misported `is_foo` to `Foo` because I misunderstood the rule for `IsLawfulFoo`.
This PR recover `Is` of `Foo` which is ported from `is_foo`.
This PR also renames some misported theorems.
  • Loading branch information
Komyyy authored and qawbecrdtey committed Jun 12, 2023
1 parent 79192f6 commit 8230dc8
Show file tree
Hide file tree
Showing 38 changed files with 678 additions and 673 deletions.
2 changes: 1 addition & 1 deletion Mathlib/Dynamics/Ergodic/Conservative.lean
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ structure Conservative (f : α → α) (μ : Measure α) extends QuasiMeasurePre
#align measure_theory.conservative MeasureTheory.Conservative

/-- A self-map preserving a finite measure is conservative. -/
protected theorem MeasurePreserving.conservative [FiniteMeasure μ] (h : MeasurePreserving f μ μ) :
protected theorem MeasurePreserving.conservative [IsFiniteMeasure μ] (h : MeasurePreserving f μ μ) :
Conservative f μ :=
⟨h.quasiMeasurePreserving, fun _ hsm h0 => h.exists_mem_image_mem hsm h0⟩
#align measure_theory.measure_preserving.conservative MeasureTheory.MeasurePreserving.conservative
Expand Down
4 changes: 2 additions & 2 deletions Mathlib/Dynamics/Ergodic/Ergodic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ theorem measure_self_or_compl_eq_zero (hf : PreErgodic f μ) (hs : MeasurableSet
#align pre_ergodic.measure_self_or_compl_eq_zero PreErgodic.measure_self_or_compl_eq_zero

/-- On a probability space, the (pre)ergodicity condition is a zero one law. -/
theorem prob_eq_zero_or_one [ProbabilityMeasure μ] (hf : PreErgodic f μ) (hs : MeasurableSet s)
theorem prob_eq_zero_or_one [IsProbabilityMeasure μ] (hf : PreErgodic f μ) (hs : MeasurableSet s)
(hs' : f ⁻¹' s = s) : μ s = 0 ∨ μ s = 1 := by
simpa [hs] using hf.measure_self_or_compl_eq_zero hs hs'
#align pre_ergodic.prob_eq_zero_or_one PreErgodic.prob_eq_zero_or_one
Expand Down Expand Up @@ -162,7 +162,7 @@ theorem ae_empty_or_univ_of_image_ae_le' (hf : Ergodic f μ) (hs : MeasurableSet

section IsFiniteMeasure

variable [FiniteMeasure μ]
variable [IsFiniteMeasure μ]

theorem ae_empty_or_univ_of_preimage_ae_le (hf : Ergodic f μ) (hs : MeasurableSet s)
(hs' : f ⁻¹' s ≤ᵐ[μ] s) : s =ᵐ[μ] (∅ : Set α) ∨ s =ᵐ[μ] univ :=
Expand Down
2 changes: 1 addition & 1 deletion Mathlib/Dynamics/Ergodic/MeasurePreserving.lean
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ theorem exists_mem_image_mem_of_volume_lt_mul_volume (hf : MeasurePreserving f
`x ∈ s` comes back to `s` under iterations of `f`. Actually, a.e. point of `s` comes back to `s`
infinitely many times, see `MeasureTheory.MeasurePreserving.conservative` and theorems about
`MeasureTheory.Conservative`. -/
theorem exists_mem_image_mem [FiniteMeasure μ] (hf : MeasurePreserving f μ μ)
theorem exists_mem_image_mem [IsFiniteMeasure μ] (hf : MeasurePreserving f μ μ)
(hs : MeasurableSet s) (hs' : μ s ≠ 0) : ∃ x ∈ s, ∃ (m : _) (_ : m ≠ 0), (f^[m]) x ∈ s := by
rcases ENNReal.exists_nat_mul_gt hs' (measure_ne_top μ (Set.univ : Set α)) with ⟨N, hN⟩
rcases hf.exists_mem_image_mem_of_volume_lt_mul_volume hs hN with ⟨x, hx, m, hm, hmx⟩
Expand Down
33 changes: 17 additions & 16 deletions Mathlib/MeasureTheory/Constructions/BorelSpace/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ namespace MeasureTheory.Measure
`ν`. -/
theorem ext_of_Ico_finite {α : Type _} [TopologicalSpace α] {m : MeasurableSpace α}
[SecondCountableTopology α] [LinearOrder α] [OrderTopology α] [BorelSpace α] (μ ν : Measure α)
[FiniteMeasure μ] (hμν : μ univ = ν univ) (h : ∀ ⦃a b⦄, a < b → μ (Ico a b) = ν (Ico a b)) :
[IsFiniteMeasure μ] (hμν : μ univ = ν univ) (h : ∀ ⦃a b⦄, a < b → μ (Ico a b) = ν (Ico a b)) :
μ = ν := by
refine'
ext_of_generate_finite _ (BorelSpace.measurable_eq.trans (borel_eq_generateFrom_Ico α))
Expand All @@ -680,7 +680,7 @@ theorem ext_of_Ico_finite {α : Type _} [TopologicalSpace α] {m : MeasurableSpa
`ν`. -/
theorem ext_of_Ioc_finite {α : Type _} [TopologicalSpace α] {m : MeasurableSpace α}
[SecondCountableTopology α] [LinearOrder α] [OrderTopology α] [BorelSpace α] (μ ν : Measure α)
[FiniteMeasure μ] (hμν : μ univ = ν univ) (h : ∀ ⦃a b⦄, a < b → μ (Ioc a b) = ν (Ioc a b)) :
[IsFiniteMeasure μ] (hμν : μ univ = ν univ) (h : ∀ ⦃a b⦄, a < b → μ (Ioc a b) = ν (Ioc a b)) :
μ = ν := by
refine' @ext_of_Ico_finite αᵒᵈ _ _ _ _ _ ‹_› μ ν _ hμν fun a b hab => _
erw [dual_Ico (α := α)]
Expand Down Expand Up @@ -727,7 +727,7 @@ theorem ext_of_Ioc' {α : Type _} [TopologicalSpace α] {m : MeasurableSpace α}
closed-open intervals. -/
theorem ext_of_Ico {α : Type _} [TopologicalSpace α] {_m : MeasurableSpace α}
[SecondCountableTopology α] [ConditionallyCompleteLinearOrder α] [OrderTopology α]
[BorelSpace α] [NoMaxOrder α] (μ ν : Measure α) [LocallyFiniteMeasure μ]
[BorelSpace α] [NoMaxOrder α] (μ ν : Measure α) [IsLocallyFiniteMeasure μ]
(h : ∀ ⦃a b⦄, a < b → μ (Ico a b) = ν (Ico a b)) : μ = ν :=
μ.ext_of_Ico' ν (fun _ _ _ => measure_Ico_lt_top.ne) h
#align measure_theory.measure.ext_of_Ico MeasureTheory.Measure.ext_of_Ico
Expand All @@ -736,7 +736,7 @@ theorem ext_of_Ico {α : Type _} [TopologicalSpace α] {_m : MeasurableSpace α}
open-closed intervals. -/
theorem ext_of_Ioc {α : Type _} [TopologicalSpace α] {_m : MeasurableSpace α}
[SecondCountableTopology α] [ConditionallyCompleteLinearOrder α] [OrderTopology α]
[BorelSpace α] [NoMinOrder α] (μ ν : Measure α) [LocallyFiniteMeasure μ]
[BorelSpace α] [NoMinOrder α] (μ ν : Measure α) [IsLocallyFiniteMeasure μ]
(h : ∀ ⦃a b⦄, a < b → μ (Ioc a b) = ν (Ioc a b)) : μ = ν :=
μ.ext_of_Ioc' ν (fun _ _ _ => measure_Ioc_lt_top.ne) h
#align measure_theory.measure.ext_of_Ioc MeasureTheory.Measure.ext_of_Ioc
Expand All @@ -745,7 +745,7 @@ theorem ext_of_Ioc {α : Type _} [TopologicalSpace α] {_m : MeasurableSpace α}
intervals. -/
theorem ext_of_Iic {α : Type _} [TopologicalSpace α] {m : MeasurableSpace α}
[SecondCountableTopology α] [LinearOrder α] [OrderTopology α] [BorelSpace α] (μ ν : Measure α)
[FiniteMeasure μ] (h : ∀ a, μ (Iic a) = ν (Iic a)) : μ = ν := by
[IsFiniteMeasure μ] (h : ∀ a, μ (Iic a) = ν (Iic a)) : μ = ν := by
refine' ext_of_Ioc_finite μ ν _ fun a b hlt => _
· rcases exists_countable_dense_bot_top α with ⟨s, hsc, hsd, -, hst⟩
have : DirectedOn (· ≤ ·) s := directedOn_iff_directed.2 (directed_of_sup fun _ _ => id)
Expand All @@ -761,7 +761,7 @@ theorem ext_of_Iic {α : Type _} [TopologicalSpace α] {m : MeasurableSpace α}
intervals. -/
theorem ext_of_Ici {α : Type _} [TopologicalSpace α] {m : MeasurableSpace α}
[SecondCountableTopology α] [LinearOrder α] [OrderTopology α] [BorelSpace α] (μ ν : Measure α)
[FiniteMeasure μ] (h : ∀ a, μ (Ici a) = ν (Ici a)) : μ = ν :=
[IsFiniteMeasure μ] (h : ∀ a, μ (Ici a) = ν (Ici a)) : μ = ν :=
@ext_of_Iic αᵒᵈ _ _ _ _ _ ‹_› _ _ _ h
#align measure_theory.measure.ext_of_Ici MeasureTheory.Measure.ext_of_Ici

Expand Down Expand Up @@ -829,13 +829,13 @@ theorem ClosedEmbedding.measurable {f : α → γ} (hf : ClosedEmbedding f) : Me
hf.continuous.measurable
#align closed_embedding.measurable ClosedEmbedding.measurable

theorem Continuous.openPosMeasure_map {f : β → γ} (hf : Continuous f)
(hf_surj : Function.Surjective f) {μ : Measure β} [μ.OpenPosMeasure] :
(Measure.map f μ).OpenPosMeasure := by
theorem Continuous.isOpenPosMeasure_map {f : β → γ} (hf : Continuous f)
(hf_surj : Function.Surjective f) {μ : Measure β} [μ.IsOpenPosMeasure] :
(Measure.map f μ).IsOpenPosMeasure := by
refine' ⟨fun U hUo hUne => _⟩
rw [Measure.map_apply hf.measurable hUo.measurableSet]
exact (hUo.preimage hf).measure_ne_zero μ (hf_surj.nonempty_preimage.mpr hUne)
#align continuous.is_open_pos_measure_map Continuous.openPosMeasure_map
#align continuous.is_open_pos_measure_map Continuous.isOpenPosMeasure_map

/-- If a function is defined piecewise in terms of functions which are continuous on their
respective pieces, then it is measurable. -/
Expand Down Expand Up @@ -1387,8 +1387,8 @@ def Homemorph.toMeasurableEquiv (h : α ≃ₜ β) : α ≃ᵐ β where

protected theorem IsFiniteMeasureOnCompacts.map {α : Type _} {m0 : MeasurableSpace α}
[TopologicalSpace α] [OpensMeasurableSpace α] {β : Type _} [MeasurableSpace β]
[TopologicalSpace β] [BorelSpace β] [T2Space β] (μ : Measure α) [FiniteMeasureOnCompacts μ]
(f : α ≃ₜ β) : FiniteMeasureOnCompacts (Measure.map f μ) :=
[TopologicalSpace β] [BorelSpace β] [T2Space β] (μ : Measure α) [IsFiniteMeasureOnCompacts μ]
(f : α ≃ₜ β) : IsFiniteMeasureOnCompacts (Measure.map f μ) :=
by
intro K hK
rw [Measure.map_apply f.measurable hK.measurableSet]
Expand Down Expand Up @@ -1611,8 +1611,9 @@ end PseudoMetricSpace
/-- Given a compact set in a proper space, the measure of its `r`-closed thickenings converges to
its measure as `r` tends to `0`. -/
theorem tendsto_measure_cthickening_of_isCompact [MetricSpace α] [MeasurableSpace α]
[OpensMeasurableSpace α] [ProperSpace α] {μ : Measure α} [FiniteMeasureOnCompacts μ] {s : Set α}
(hs : IsCompact s) : Tendsto (fun r => μ (Metric.cthickening r s)) (𝓝 0) (𝓝 (μ s)) :=
[OpensMeasurableSpace α] [ProperSpace α] {μ : Measure α} [IsFiniteMeasureOnCompacts μ]
{s : Set α} (hs : IsCompact s) :
Tendsto (fun r => μ (Metric.cthickening r s)) (𝓝 0) (𝓝 (μ s)) :=
tendsto_measure_cthickening_of_isClosed ⟨1, zero_lt_one, hs.bounded.cthickening.measure_lt_top.ne⟩
hs.isClosed
#align tendsto_measure_cthickening_of_is_compact tendsto_measure_cthickening_of_isCompact
Expand Down Expand Up @@ -1690,7 +1691,7 @@ theorem isPiSystem_Ioo_rat :

/-- The intervals `(-(n + 1), (n + 1))` form a finite spanning sets in the set of open intervals
with rational endpoints for a locally finite measure `μ` on `ℝ`. -/
def finiteSpanningSetsInIooRat (μ : Measure ℝ) [LocallyFiniteMeasure μ] :
def finiteSpanningSetsInIooRat (μ : Measure ℝ) [IsLocallyFiniteMeasure μ] :
μ.FiniteSpanningSetsIn (⋃ (a : ℚ) (b : ℚ) (_h : a < b), {Ioo (a : ℝ) (b : ℝ)}) where
set n := Ioo (-(n + 1)) (n + 1)
set_mem n := by
Expand All @@ -1705,7 +1706,7 @@ def finiteSpanningSetsInIooRat (μ : Measure ℝ) [LocallyFiniteMeasure μ] :
(le_abs_self x).trans_lt (Nat.lt_floor_add_one _)⟩
#align real.finite_spanning_sets_in_Ioo_rat Real.finiteSpanningSetsInIooRat

theorem measure_ext_Ioo_rat {μ ν : Measure ℝ} [LocallyFiniteMeasure μ]
theorem measure_ext_Ioo_rat {μ ν : Measure ℝ} [IsLocallyFiniteMeasure μ]
(h : ∀ a b : ℚ, μ (Ioo a b) = ν (Ioo a b)) : μ = ν :=
(finiteSpanningSetsInIooRat μ).ext borel_eq_generateFrom_Ioo_rat isPiSystem_Ioo_rat <| by
simp only [mem_iUnion, mem_singleton_iff]
Expand Down
34 changes: 17 additions & 17 deletions Mathlib/MeasureTheory/Constructions/Pi.lean
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,8 @@ theorem pi_noAtoms (i : ι) [NoAtoms (μ i)] : NoAtoms (Measure.pi μ) :=
instance [h : Nonempty ι] [∀ i, NoAtoms (μ i)] : NoAtoms (Measure.pi μ) :=
h.elim fun i => pi_noAtoms i

instance [∀ i, TopologicalSpace (α i)] [∀ i, LocallyFiniteMeasure (μ i)] :
LocallyFiniteMeasure (Measure.pi μ) := by
instance [∀ i, TopologicalSpace (α i)] [∀ i, IsLocallyFiniteMeasure (μ i)] :
IsLocallyFiniteMeasure (Measure.pi μ) := by
refine' ⟨fun x => _⟩
choose s hxs ho hμ using fun i => (μ i).exists_isOpen_measure_lt_top (x i)
refine' ⟨pi univ s, set_pi_mem_nhds finite_univ fun i _ => IsOpen.mem_nhds (ho i) (hxs i), _⟩
Expand All @@ -553,7 +553,7 @@ variable (μ)

@[to_additive]
instance pi.isMulLeftInvariant [∀ i, Group (α i)] [∀ i, MeasurableMul (α i)]
[∀ i, MulLeftInvariant (μ i)] : MulLeftInvariant (Measure.pi μ) := by
[∀ i, IsMulLeftInvariant (μ i)] : IsMulLeftInvariant (Measure.pi μ) := by
refine' ⟨fun v => (pi_eq fun s hs => _).symm⟩
rw [map_apply (measurable_const_mul _) (MeasurableSet.univ_pi hs),
show (· * ·) v ⁻¹' univ.pi s = univ.pi fun i => (· * ·) (v i) ⁻¹' s i by rfl, pi_pi]
Expand All @@ -563,7 +563,7 @@ instance pi.isMulLeftInvariant [∀ i, Group (α i)] [∀ i, MeasurableMul (α i

@[to_additive]
instance pi.isMulRightInvariant [∀ i, Group (α i)] [∀ i, MeasurableMul (α i)]
[∀ i, MulRightInvariant (μ i)] : MulRightInvariant (Measure.pi μ) := by
[∀ i, IsMulRightInvariant (μ i)] : IsMulRightInvariant (Measure.pi μ) := by
refine' ⟨fun v => (pi_eq fun s hs => _).symm⟩
rw [map_apply (measurable_mul_const _) (MeasurableSet.univ_pi hs),
show (· * v) ⁻¹' univ.pi s = univ.pi fun i => (· * v i) ⁻¹' s i by rfl, pi_pi]
Expand All @@ -573,16 +573,16 @@ instance pi.isMulRightInvariant [∀ i, Group (α i)] [∀ i, MeasurableMul (α

@[to_additive]
instance pi.isInvInvariant [∀ i, Group (α i)] [∀ i, MeasurableInv (α i)]
[∀ i, InvInvariant (μ i)] : InvInvariant (Measure.pi μ) := by
[∀ i, IsInvInvariant (μ i)] : IsInvInvariant (Measure.pi μ) := by
refine' ⟨(Measure.pi_eq fun s hs => _).symm⟩
have A : Inv.inv ⁻¹' pi univ s = Set.pi univ fun i => Inv.inv ⁻¹' s i := by ext; simp
simp_rw [Measure.inv, Measure.map_apply measurable_inv (MeasurableSet.univ_pi hs), A, pi_pi,
measure_preimage_inv]
#align measure_theory.measure.pi.is_inv_invariant MeasureTheory.Measure.pi.isInvInvariant
#align measure_theory.measure.pi.is_neg_invariant MeasureTheory.Measure.pi.isNegInvariant

instance pi.openPosMeasure [∀ i, TopologicalSpace (α i)] [∀ i, OpenPosMeasure (μ i)] :
OpenPosMeasure (MeasureTheory.Measure.pi μ) := by
instance pi.isOpenPosMeasure [∀ i, TopologicalSpace (α i)] [∀ i, IsOpenPosMeasure (μ i)] :
IsOpenPosMeasure (MeasureTheory.Measure.pi μ) := by
constructor
rintro U U_open ⟨a, ha⟩
obtain ⟨s, ⟨hs, hsU⟩⟩ := isOpen_pi_iff'.1 U_open a ha
Expand All @@ -591,23 +591,23 @@ instance pi.openPosMeasure [∀ i, TopologicalSpace (α i)] [∀ i, OpenPosMeasu
rw [CanonicallyOrderedCommSemiring.prod_pos]
intro i _
apply (hs i).1.measure_pos (μ i) ⟨a i, (hs i).2
#align measure_theory.measure.pi.is_open_pos_measure MeasureTheory.Measure.pi.openPosMeasure
#align measure_theory.measure.pi.is_open_pos_measure MeasureTheory.Measure.pi.isOpenPosMeasure

instance pi.finiteMeasureOnCompacts [∀ i, TopologicalSpace (α i)]
[∀ i, FiniteMeasureOnCompacts (μ i)] :
FiniteMeasureOnCompacts (MeasureTheory.Measure.pi μ) := by
instance pi.isFiniteMeasureOnCompacts [∀ i, TopologicalSpace (α i)]
[∀ i, IsFiniteMeasureOnCompacts (μ i)] :
IsFiniteMeasureOnCompacts (MeasureTheory.Measure.pi μ) := by
constructor
intro K hK
suffices Measure.pi μ (Set.univ.pi fun j => Function.eval j '' K) < ⊤ by
exact lt_of_le_of_lt (measure_mono (univ.subset_pi_eval_image K)) this
rw [Measure.pi_pi]
refine' WithTop.prod_lt_top _
exact fun i _ => ne_of_lt (IsCompact.measure_lt_top (IsCompact.image hK (continuous_apply i)))
#align measure_theory.measure.pi.is_finite_measure_on_compacts MeasureTheory.Measure.pi.finiteMeasureOnCompacts
#align measure_theory.measure.pi.is_finite_measure_on_compacts MeasureTheory.Measure.pi.isFiniteMeasureOnCompacts

@[to_additive]
instance pi.isHaarMeasure [∀ i, Group (α i)] [∀ i, TopologicalSpace (α i)]
[∀ i, HaarMeasure (μ i)] [∀ i, MeasurableMul (α i)] : HaarMeasure (Measure.pi μ) where
[∀ i, IsHaarMeasure (μ i)] [∀ i, MeasurableMul (α i)] : IsHaarMeasure (Measure.pi μ) where
#align measure_theory.measure.pi.is_haar_measure MeasureTheory.Measure.pi.isHaarMeasure
#align measure_theory.measure.pi.is_add_haar_measure MeasureTheory.Measure.pi.isAddHaarMeasure

Expand Down Expand Up @@ -647,8 +647,8 @@ inference cannot find an instance for `ι → ℝ` when this is stated for depen
type-class inference cannot find an instance for `ι → ℝ` when this is stated for dependent function
spaces."]
instance Pi.isMulLeftInvariant_volume {α} [Group α] [MeasureSpace α]
[SigmaFinite (volume : Measure α)] [MeasurableMul α] [MulLeftInvariant (volume : Measure α)] :
MulLeftInvariant (volume : Measure (ι → α)) :=
[SigmaFinite (volume : Measure α)] [MeasurableMul α] [IsMulLeftInvariant (volume : Measure α)] :
IsMulLeftInvariant (volume : Measure (ι → α)) :=
pi.isMulLeftInvariant _
#align measure_theory.pi.is_mul_left_invariant_volume MeasureTheory.Pi.isMulLeftInvariant_volume
#align measure_theory.pi.is_add_left_invariant_volume MeasureTheory.Pi.isAddLeftInvariant_volume
Expand All @@ -659,8 +659,8 @@ inference cannot find an instance for `ι → ℝ` when this is stated for depen
type-class inference cannot find an instance for `ι → ℝ` when this is stated for dependent function
spaces."]
instance Pi.isInvInvariant_volume {α} [Group α] [MeasureSpace α] [SigmaFinite (volume : Measure α)]
[MeasurableInv α] [InvInvariant (volume : Measure α)] :
InvInvariant (volume : Measure (ι → α)) :=
[MeasurableInv α] [IsInvInvariant (volume : Measure α)] :
IsInvInvariant (volume : Measure (ι → α)) :=
pi.isInvInvariant _
#align measure_theory.pi.is_inv_invariant_volume MeasureTheory.Pi.isInvInvariant_volume
#align measure_theory.pi.is_neg_invariant_volume MeasureTheory.Pi.isNegInvariant_volume
Expand Down
Loading

0 comments on commit 8230dc8

Please sign in to comment.