Context
stringlengths
57
6.04k
file_name
stringlengths
21
79
start
int64
14
1.49k
end
int64
18
1.5k
theorem
stringlengths
25
1.55k
proof
stringlengths
5
7.36k
num_lines
int64
1
150
complexity_score
float64
2.72
139,370,958,066,637,970,000,000,000,000,000,000,000,000,000,000,000,000,000B
diff_level
int64
0
2
file_diff_level
float64
0
2
theorem_same_file
int64
1
32
rank_file
int64
0
2.51k
import Mathlib.Analysis.Convex.Between import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic import Mathlib.MeasureTheory.Measure.Lebesgue.Basic import Mathlib.Topology.MetricSpace.Holder import Mathlib.Topology.MetricSpace.MetricSeparated #align_import measure_theory.measure.hausdorff from "leanprover-community/mathlib"@"3d5c4a7a5fb0d982f97ed953161264f1dbd90ead" open scoped NNReal ENNReal Topology open EMetric Set Function Filter Encodable FiniteDimensional TopologicalSpace noncomputable section variable {ΞΉ X Y : Type*} [EMetricSpace X] [EMetricSpace Y] namespace MeasureTheory namespace OuterMeasure def IsMetric (ΞΌ : OuterMeasure X) : Prop := βˆ€ s t : Set X, IsMetricSeparated s t β†’ ΞΌ (s βˆͺ t) = ΞΌ s + ΞΌ t #align measure_theory.outer_measure.is_metric MeasureTheory.OuterMeasure.IsMetric def mkMetric'.pre (m : Set X β†’ ℝβ‰₯0∞) (r : ℝβ‰₯0∞) : OuterMeasure X := boundedBy <| extend fun s (_ : diam s ≀ r) => m s #align measure_theory.outer_measure.mk_metric'.pre MeasureTheory.OuterMeasure.mkMetric'.pre def mkMetric' (m : Set X β†’ ℝβ‰₯0∞) : OuterMeasure X := ⨆ r > 0, mkMetric'.pre m r #align measure_theory.outer_measure.mk_metric' MeasureTheory.OuterMeasure.mkMetric' def mkMetric (m : ℝβ‰₯0∞ β†’ ℝβ‰₯0∞) : OuterMeasure X := mkMetric' fun s => m (diam s) #align measure_theory.outer_measure.mk_metric MeasureTheory.OuterMeasure.mkMetric namespace mkMetric' variable {m : Set X β†’ ℝβ‰₯0∞} {r : ℝβ‰₯0∞} {ΞΌ : OuterMeasure X} {s : Set X} theorem le_pre : ΞΌ ≀ pre m r ↔ βˆ€ s : Set X, diam s ≀ r β†’ ΞΌ s ≀ m s := by simp only [pre, le_boundedBy, extend, le_iInf_iff] #align measure_theory.outer_measure.mk_metric'.le_pre MeasureTheory.OuterMeasure.mkMetric'.le_pre theorem pre_le (hs : diam s ≀ r) : pre m r s ≀ m s := (boundedBy_le _).trans <| iInf_le _ hs #align measure_theory.outer_measure.mk_metric'.pre_le MeasureTheory.OuterMeasure.mkMetric'.pre_le theorem mono_pre (m : Set X β†’ ℝβ‰₯0∞) {r r' : ℝβ‰₯0∞} (h : r ≀ r') : pre m r' ≀ pre m r := le_pre.2 fun _ hs => pre_le (hs.trans h) #align measure_theory.outer_measure.mk_metric'.mono_pre MeasureTheory.OuterMeasure.mkMetric'.mono_pre theorem mono_pre_nat (m : Set X β†’ ℝβ‰₯0∞) : Monotone fun k : β„• => pre m k⁻¹ := fun k l h => le_pre.2 fun s hs => pre_le (hs.trans <| by simpa) #align measure_theory.outer_measure.mk_metric'.mono_pre_nat MeasureTheory.OuterMeasure.mkMetric'.mono_pre_nat
Mathlib/MeasureTheory/Measure/Hausdorff.lean
286
290
theorem tendsto_pre (m : Set X β†’ ℝβ‰₯0∞) (s : Set X) : Tendsto (fun r => pre m r s) (𝓝[>] 0) (𝓝 <| mkMetric' m s) := by
rw [← map_coe_Ioi_atBot, tendsto_map'_iff] simp only [mkMetric', OuterMeasure.iSup_apply, iSup_subtype'] exact tendsto_atBot_iSup fun r r' hr => mono_pre _ hr _
3
20.085537
1
1.428571
7
1,520
import Mathlib.Analysis.Convex.Between import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic import Mathlib.MeasureTheory.Measure.Lebesgue.Basic import Mathlib.Topology.MetricSpace.Holder import Mathlib.Topology.MetricSpace.MetricSeparated #align_import measure_theory.measure.hausdorff from "leanprover-community/mathlib"@"3d5c4a7a5fb0d982f97ed953161264f1dbd90ead" open scoped NNReal ENNReal Topology open EMetric Set Function Filter Encodable FiniteDimensional TopologicalSpace noncomputable section variable {ΞΉ X Y : Type*} [EMetricSpace X] [EMetricSpace Y] namespace MeasureTheory namespace OuterMeasure def IsMetric (ΞΌ : OuterMeasure X) : Prop := βˆ€ s t : Set X, IsMetricSeparated s t β†’ ΞΌ (s βˆͺ t) = ΞΌ s + ΞΌ t #align measure_theory.outer_measure.is_metric MeasureTheory.OuterMeasure.IsMetric def mkMetric'.pre (m : Set X β†’ ℝβ‰₯0∞) (r : ℝβ‰₯0∞) : OuterMeasure X := boundedBy <| extend fun s (_ : diam s ≀ r) => m s #align measure_theory.outer_measure.mk_metric'.pre MeasureTheory.OuterMeasure.mkMetric'.pre def mkMetric' (m : Set X β†’ ℝβ‰₯0∞) : OuterMeasure X := ⨆ r > 0, mkMetric'.pre m r #align measure_theory.outer_measure.mk_metric' MeasureTheory.OuterMeasure.mkMetric' def mkMetric (m : ℝβ‰₯0∞ β†’ ℝβ‰₯0∞) : OuterMeasure X := mkMetric' fun s => m (diam s) #align measure_theory.outer_measure.mk_metric MeasureTheory.OuterMeasure.mkMetric namespace mkMetric' variable {m : Set X β†’ ℝβ‰₯0∞} {r : ℝβ‰₯0∞} {ΞΌ : OuterMeasure X} {s : Set X} theorem le_pre : ΞΌ ≀ pre m r ↔ βˆ€ s : Set X, diam s ≀ r β†’ ΞΌ s ≀ m s := by simp only [pre, le_boundedBy, extend, le_iInf_iff] #align measure_theory.outer_measure.mk_metric'.le_pre MeasureTheory.OuterMeasure.mkMetric'.le_pre theorem pre_le (hs : diam s ≀ r) : pre m r s ≀ m s := (boundedBy_le _).trans <| iInf_le _ hs #align measure_theory.outer_measure.mk_metric'.pre_le MeasureTheory.OuterMeasure.mkMetric'.pre_le theorem mono_pre (m : Set X β†’ ℝβ‰₯0∞) {r r' : ℝβ‰₯0∞} (h : r ≀ r') : pre m r' ≀ pre m r := le_pre.2 fun _ hs => pre_le (hs.trans h) #align measure_theory.outer_measure.mk_metric'.mono_pre MeasureTheory.OuterMeasure.mkMetric'.mono_pre theorem mono_pre_nat (m : Set X β†’ ℝβ‰₯0∞) : Monotone fun k : β„• => pre m k⁻¹ := fun k l h => le_pre.2 fun s hs => pre_le (hs.trans <| by simpa) #align measure_theory.outer_measure.mk_metric'.mono_pre_nat MeasureTheory.OuterMeasure.mkMetric'.mono_pre_nat theorem tendsto_pre (m : Set X β†’ ℝβ‰₯0∞) (s : Set X) : Tendsto (fun r => pre m r s) (𝓝[>] 0) (𝓝 <| mkMetric' m s) := by rw [← map_coe_Ioi_atBot, tendsto_map'_iff] simp only [mkMetric', OuterMeasure.iSup_apply, iSup_subtype'] exact tendsto_atBot_iSup fun r r' hr => mono_pre _ hr _ #align measure_theory.outer_measure.mk_metric'.tendsto_pre MeasureTheory.OuterMeasure.mkMetric'.tendsto_pre
Mathlib/MeasureTheory/Measure/Hausdorff.lean
293
297
theorem tendsto_pre_nat (m : Set X β†’ ℝβ‰₯0∞) (s : Set X) : Tendsto (fun n : β„• => pre m n⁻¹ s) atTop (𝓝 <| mkMetric' m s) := by
refine (tendsto_pre m s).comp (tendsto_inf.2 ⟨ENNReal.tendsto_inv_nat_nhds_zero, ?_⟩) refine tendsto_principal.2 (eventually_of_forall fun n => ?_) simp
3
20.085537
1
1.428571
7
1,520
import Mathlib.Analysis.Convex.Between import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic import Mathlib.MeasureTheory.Measure.Lebesgue.Basic import Mathlib.Topology.MetricSpace.Holder import Mathlib.Topology.MetricSpace.MetricSeparated #align_import measure_theory.measure.hausdorff from "leanprover-community/mathlib"@"3d5c4a7a5fb0d982f97ed953161264f1dbd90ead" open scoped NNReal ENNReal Topology open EMetric Set Function Filter Encodable FiniteDimensional TopologicalSpace noncomputable section variable {ΞΉ X Y : Type*} [EMetricSpace X] [EMetricSpace Y] namespace MeasureTheory namespace OuterMeasure def IsMetric (ΞΌ : OuterMeasure X) : Prop := βˆ€ s t : Set X, IsMetricSeparated s t β†’ ΞΌ (s βˆͺ t) = ΞΌ s + ΞΌ t #align measure_theory.outer_measure.is_metric MeasureTheory.OuterMeasure.IsMetric def mkMetric'.pre (m : Set X β†’ ℝβ‰₯0∞) (r : ℝβ‰₯0∞) : OuterMeasure X := boundedBy <| extend fun s (_ : diam s ≀ r) => m s #align measure_theory.outer_measure.mk_metric'.pre MeasureTheory.OuterMeasure.mkMetric'.pre def mkMetric' (m : Set X β†’ ℝβ‰₯0∞) : OuterMeasure X := ⨆ r > 0, mkMetric'.pre m r #align measure_theory.outer_measure.mk_metric' MeasureTheory.OuterMeasure.mkMetric' def mkMetric (m : ℝβ‰₯0∞ β†’ ℝβ‰₯0∞) : OuterMeasure X := mkMetric' fun s => m (diam s) #align measure_theory.outer_measure.mk_metric MeasureTheory.OuterMeasure.mkMetric namespace mkMetric' variable {m : Set X β†’ ℝβ‰₯0∞} {r : ℝβ‰₯0∞} {ΞΌ : OuterMeasure X} {s : Set X} theorem le_pre : ΞΌ ≀ pre m r ↔ βˆ€ s : Set X, diam s ≀ r β†’ ΞΌ s ≀ m s := by simp only [pre, le_boundedBy, extend, le_iInf_iff] #align measure_theory.outer_measure.mk_metric'.le_pre MeasureTheory.OuterMeasure.mkMetric'.le_pre theorem pre_le (hs : diam s ≀ r) : pre m r s ≀ m s := (boundedBy_le _).trans <| iInf_le _ hs #align measure_theory.outer_measure.mk_metric'.pre_le MeasureTheory.OuterMeasure.mkMetric'.pre_le theorem mono_pre (m : Set X β†’ ℝβ‰₯0∞) {r r' : ℝβ‰₯0∞} (h : r ≀ r') : pre m r' ≀ pre m r := le_pre.2 fun _ hs => pre_le (hs.trans h) #align measure_theory.outer_measure.mk_metric'.mono_pre MeasureTheory.OuterMeasure.mkMetric'.mono_pre theorem mono_pre_nat (m : Set X β†’ ℝβ‰₯0∞) : Monotone fun k : β„• => pre m k⁻¹ := fun k l h => le_pre.2 fun s hs => pre_le (hs.trans <| by simpa) #align measure_theory.outer_measure.mk_metric'.mono_pre_nat MeasureTheory.OuterMeasure.mkMetric'.mono_pre_nat theorem tendsto_pre (m : Set X β†’ ℝβ‰₯0∞) (s : Set X) : Tendsto (fun r => pre m r s) (𝓝[>] 0) (𝓝 <| mkMetric' m s) := by rw [← map_coe_Ioi_atBot, tendsto_map'_iff] simp only [mkMetric', OuterMeasure.iSup_apply, iSup_subtype'] exact tendsto_atBot_iSup fun r r' hr => mono_pre _ hr _ #align measure_theory.outer_measure.mk_metric'.tendsto_pre MeasureTheory.OuterMeasure.mkMetric'.tendsto_pre theorem tendsto_pre_nat (m : Set X β†’ ℝβ‰₯0∞) (s : Set X) : Tendsto (fun n : β„• => pre m n⁻¹ s) atTop (𝓝 <| mkMetric' m s) := by refine (tendsto_pre m s).comp (tendsto_inf.2 ⟨ENNReal.tendsto_inv_nat_nhds_zero, ?_⟩) refine tendsto_principal.2 (eventually_of_forall fun n => ?_) simp #align measure_theory.outer_measure.mk_metric'.tendsto_pre_nat MeasureTheory.OuterMeasure.mkMetric'.tendsto_pre_nat
Mathlib/MeasureTheory/Measure/Hausdorff.lean
300
304
theorem eq_iSup_nat (m : Set X β†’ ℝβ‰₯0∞) : mkMetric' m = ⨆ n : β„•, mkMetric'.pre m n⁻¹ := by
ext1 s rw [iSup_apply] refine tendsto_nhds_unique (mkMetric'.tendsto_pre_nat m s) (tendsto_atTop_iSup fun k l hkl => mkMetric'.mono_pre_nat m hkl s)
4
54.59815
2
1.428571
7
1,520
import Mathlib.Analysis.Convex.Between import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic import Mathlib.MeasureTheory.Measure.Lebesgue.Basic import Mathlib.Topology.MetricSpace.Holder import Mathlib.Topology.MetricSpace.MetricSeparated #align_import measure_theory.measure.hausdorff from "leanprover-community/mathlib"@"3d5c4a7a5fb0d982f97ed953161264f1dbd90ead" open scoped NNReal ENNReal Topology open EMetric Set Function Filter Encodable FiniteDimensional TopologicalSpace noncomputable section variable {ΞΉ X Y : Type*} [EMetricSpace X] [EMetricSpace Y] namespace MeasureTheory namespace OuterMeasure def IsMetric (ΞΌ : OuterMeasure X) : Prop := βˆ€ s t : Set X, IsMetricSeparated s t β†’ ΞΌ (s βˆͺ t) = ΞΌ s + ΞΌ t #align measure_theory.outer_measure.is_metric MeasureTheory.OuterMeasure.IsMetric def mkMetric'.pre (m : Set X β†’ ℝβ‰₯0∞) (r : ℝβ‰₯0∞) : OuterMeasure X := boundedBy <| extend fun s (_ : diam s ≀ r) => m s #align measure_theory.outer_measure.mk_metric'.pre MeasureTheory.OuterMeasure.mkMetric'.pre def mkMetric' (m : Set X β†’ ℝβ‰₯0∞) : OuterMeasure X := ⨆ r > 0, mkMetric'.pre m r #align measure_theory.outer_measure.mk_metric' MeasureTheory.OuterMeasure.mkMetric' def mkMetric (m : ℝβ‰₯0∞ β†’ ℝβ‰₯0∞) : OuterMeasure X := mkMetric' fun s => m (diam s) #align measure_theory.outer_measure.mk_metric MeasureTheory.OuterMeasure.mkMetric namespace mkMetric' variable {m : Set X β†’ ℝβ‰₯0∞} {r : ℝβ‰₯0∞} {ΞΌ : OuterMeasure X} {s : Set X} theorem le_pre : ΞΌ ≀ pre m r ↔ βˆ€ s : Set X, diam s ≀ r β†’ ΞΌ s ≀ m s := by simp only [pre, le_boundedBy, extend, le_iInf_iff] #align measure_theory.outer_measure.mk_metric'.le_pre MeasureTheory.OuterMeasure.mkMetric'.le_pre theorem pre_le (hs : diam s ≀ r) : pre m r s ≀ m s := (boundedBy_le _).trans <| iInf_le _ hs #align measure_theory.outer_measure.mk_metric'.pre_le MeasureTheory.OuterMeasure.mkMetric'.pre_le theorem mono_pre (m : Set X β†’ ℝβ‰₯0∞) {r r' : ℝβ‰₯0∞} (h : r ≀ r') : pre m r' ≀ pre m r := le_pre.2 fun _ hs => pre_le (hs.trans h) #align measure_theory.outer_measure.mk_metric'.mono_pre MeasureTheory.OuterMeasure.mkMetric'.mono_pre theorem mono_pre_nat (m : Set X β†’ ℝβ‰₯0∞) : Monotone fun k : β„• => pre m k⁻¹ := fun k l h => le_pre.2 fun s hs => pre_le (hs.trans <| by simpa) #align measure_theory.outer_measure.mk_metric'.mono_pre_nat MeasureTheory.OuterMeasure.mkMetric'.mono_pre_nat theorem tendsto_pre (m : Set X β†’ ℝβ‰₯0∞) (s : Set X) : Tendsto (fun r => pre m r s) (𝓝[>] 0) (𝓝 <| mkMetric' m s) := by rw [← map_coe_Ioi_atBot, tendsto_map'_iff] simp only [mkMetric', OuterMeasure.iSup_apply, iSup_subtype'] exact tendsto_atBot_iSup fun r r' hr => mono_pre _ hr _ #align measure_theory.outer_measure.mk_metric'.tendsto_pre MeasureTheory.OuterMeasure.mkMetric'.tendsto_pre theorem tendsto_pre_nat (m : Set X β†’ ℝβ‰₯0∞) (s : Set X) : Tendsto (fun n : β„• => pre m n⁻¹ s) atTop (𝓝 <| mkMetric' m s) := by refine (tendsto_pre m s).comp (tendsto_inf.2 ⟨ENNReal.tendsto_inv_nat_nhds_zero, ?_⟩) refine tendsto_principal.2 (eventually_of_forall fun n => ?_) simp #align measure_theory.outer_measure.mk_metric'.tendsto_pre_nat MeasureTheory.OuterMeasure.mkMetric'.tendsto_pre_nat theorem eq_iSup_nat (m : Set X β†’ ℝβ‰₯0∞) : mkMetric' m = ⨆ n : β„•, mkMetric'.pre m n⁻¹ := by ext1 s rw [iSup_apply] refine tendsto_nhds_unique (mkMetric'.tendsto_pre_nat m s) (tendsto_atTop_iSup fun k l hkl => mkMetric'.mono_pre_nat m hkl s) #align measure_theory.outer_measure.mk_metric'.eq_supr_nat MeasureTheory.OuterMeasure.mkMetric'.eq_iSup_nat
Mathlib/MeasureTheory/Measure/Hausdorff.lean
309
315
theorem trim_pre [MeasurableSpace X] [OpensMeasurableSpace X] (m : Set X β†’ ℝβ‰₯0∞) (hcl : βˆ€ s, m (closure s) = m s) (r : ℝβ‰₯0∞) : (pre m r).trim = pre m r := by
refine le_antisymm (le_pre.2 fun s hs => ?_) (le_trim _) rw [trim_eq_iInf] refine iInf_le_of_le (closure s) <| iInf_le_of_le subset_closure <| iInf_le_of_le measurableSet_closure ((pre_le ?_).trans_eq (hcl _)) rwa [diam_closure]
5
148.413159
2
1.428571
7
1,520
import Mathlib.SetTheory.Game.State #align_import set_theory.game.domineering from "leanprover-community/mathlib"@"b134b2f5cf6dd25d4bbfd3c498b6e36c11a17225" namespace SetTheory namespace PGame namespace Domineering open Function @[simps!] def shiftUp : β„€ Γ— β„€ ≃ β„€ Γ— β„€ := (Equiv.refl β„€).prodCongr (Equiv.addRight (1 : β„€)) #align pgame.domineering.shift_up SetTheory.PGame.Domineering.shiftUp @[simps!] def shiftRight : β„€ Γ— β„€ ≃ β„€ Γ— β„€ := (Equiv.addRight (1 : β„€)).prodCongr (Equiv.refl β„€) #align pgame.domineering.shift_right SetTheory.PGame.Domineering.shiftRight -- Porting note: reducibility cannot be `local`. For now there are no dependents of this file so -- being globally reducible is fine. abbrev Board := Finset (β„€ Γ— β„€) #align pgame.domineering.board SetTheory.PGame.Domineering.Board def left (b : Board) : Finset (β„€ Γ— β„€) := b ∩ b.map shiftUp #align pgame.domineering.left SetTheory.PGame.Domineering.left def right (b : Board) : Finset (β„€ Γ— β„€) := b ∩ b.map shiftRight #align pgame.domineering.right SetTheory.PGame.Domineering.right theorem mem_left {b : Board} (x : β„€ Γ— β„€) : x ∈ left b ↔ x ∈ b ∧ (x.1, x.2 - 1) ∈ b := Finset.mem_inter.trans (and_congr Iff.rfl Finset.mem_map_equiv) #align pgame.domineering.mem_left SetTheory.PGame.Domineering.mem_left theorem mem_right {b : Board} (x : β„€ Γ— β„€) : x ∈ right b ↔ x ∈ b ∧ (x.1 - 1, x.2) ∈ b := Finset.mem_inter.trans (and_congr Iff.rfl Finset.mem_map_equiv) #align pgame.domineering.mem_right SetTheory.PGame.Domineering.mem_right def moveLeft (b : Board) (m : β„€ Γ— β„€) : Board := (b.erase m).erase (m.1, m.2 - 1) #align pgame.domineering.move_left SetTheory.PGame.Domineering.moveLeft def moveRight (b : Board) (m : β„€ Γ— β„€) : Board := (b.erase m).erase (m.1 - 1, m.2) #align pgame.domineering.move_right SetTheory.PGame.Domineering.moveRight
Mathlib/SetTheory/Game/Domineering.lean
79
83
theorem fst_pred_mem_erase_of_mem_right {b : Board} {m : β„€ Γ— β„€} (h : m ∈ right b) : (m.1 - 1, m.2) ∈ b.erase m := by
rw [mem_right] at h apply Finset.mem_erase_of_ne_of_mem _ h.2 exact ne_of_apply_ne Prod.fst (pred_ne_self m.1)
3
20.085537
1
1.428571
7
1,521
import Mathlib.SetTheory.Game.State #align_import set_theory.game.domineering from "leanprover-community/mathlib"@"b134b2f5cf6dd25d4bbfd3c498b6e36c11a17225" namespace SetTheory namespace PGame namespace Domineering open Function @[simps!] def shiftUp : β„€ Γ— β„€ ≃ β„€ Γ— β„€ := (Equiv.refl β„€).prodCongr (Equiv.addRight (1 : β„€)) #align pgame.domineering.shift_up SetTheory.PGame.Domineering.shiftUp @[simps!] def shiftRight : β„€ Γ— β„€ ≃ β„€ Γ— β„€ := (Equiv.addRight (1 : β„€)).prodCongr (Equiv.refl β„€) #align pgame.domineering.shift_right SetTheory.PGame.Domineering.shiftRight -- Porting note: reducibility cannot be `local`. For now there are no dependents of this file so -- being globally reducible is fine. abbrev Board := Finset (β„€ Γ— β„€) #align pgame.domineering.board SetTheory.PGame.Domineering.Board def left (b : Board) : Finset (β„€ Γ— β„€) := b ∩ b.map shiftUp #align pgame.domineering.left SetTheory.PGame.Domineering.left def right (b : Board) : Finset (β„€ Γ— β„€) := b ∩ b.map shiftRight #align pgame.domineering.right SetTheory.PGame.Domineering.right theorem mem_left {b : Board} (x : β„€ Γ— β„€) : x ∈ left b ↔ x ∈ b ∧ (x.1, x.2 - 1) ∈ b := Finset.mem_inter.trans (and_congr Iff.rfl Finset.mem_map_equiv) #align pgame.domineering.mem_left SetTheory.PGame.Domineering.mem_left theorem mem_right {b : Board} (x : β„€ Γ— β„€) : x ∈ right b ↔ x ∈ b ∧ (x.1 - 1, x.2) ∈ b := Finset.mem_inter.trans (and_congr Iff.rfl Finset.mem_map_equiv) #align pgame.domineering.mem_right SetTheory.PGame.Domineering.mem_right def moveLeft (b : Board) (m : β„€ Γ— β„€) : Board := (b.erase m).erase (m.1, m.2 - 1) #align pgame.domineering.move_left SetTheory.PGame.Domineering.moveLeft def moveRight (b : Board) (m : β„€ Γ— β„€) : Board := (b.erase m).erase (m.1 - 1, m.2) #align pgame.domineering.move_right SetTheory.PGame.Domineering.moveRight theorem fst_pred_mem_erase_of_mem_right {b : Board} {m : β„€ Γ— β„€} (h : m ∈ right b) : (m.1 - 1, m.2) ∈ b.erase m := by rw [mem_right] at h apply Finset.mem_erase_of_ne_of_mem _ h.2 exact ne_of_apply_ne Prod.fst (pred_ne_self m.1) #align pgame.domineering.fst_pred_mem_erase_of_mem_right SetTheory.PGame.Domineering.fst_pred_mem_erase_of_mem_right
Mathlib/SetTheory/Game/Domineering.lean
86
90
theorem snd_pred_mem_erase_of_mem_left {b : Board} {m : β„€ Γ— β„€} (h : m ∈ left b) : (m.1, m.2 - 1) ∈ b.erase m := by
rw [mem_left] at h apply Finset.mem_erase_of_ne_of_mem _ h.2 exact ne_of_apply_ne Prod.snd (pred_ne_self m.2)
3
20.085537
1
1.428571
7
1,521
import Mathlib.SetTheory.Game.State #align_import set_theory.game.domineering from "leanprover-community/mathlib"@"b134b2f5cf6dd25d4bbfd3c498b6e36c11a17225" namespace SetTheory namespace PGame namespace Domineering open Function @[simps!] def shiftUp : β„€ Γ— β„€ ≃ β„€ Γ— β„€ := (Equiv.refl β„€).prodCongr (Equiv.addRight (1 : β„€)) #align pgame.domineering.shift_up SetTheory.PGame.Domineering.shiftUp @[simps!] def shiftRight : β„€ Γ— β„€ ≃ β„€ Γ— β„€ := (Equiv.addRight (1 : β„€)).prodCongr (Equiv.refl β„€) #align pgame.domineering.shift_right SetTheory.PGame.Domineering.shiftRight -- Porting note: reducibility cannot be `local`. For now there are no dependents of this file so -- being globally reducible is fine. abbrev Board := Finset (β„€ Γ— β„€) #align pgame.domineering.board SetTheory.PGame.Domineering.Board def left (b : Board) : Finset (β„€ Γ— β„€) := b ∩ b.map shiftUp #align pgame.domineering.left SetTheory.PGame.Domineering.left def right (b : Board) : Finset (β„€ Γ— β„€) := b ∩ b.map shiftRight #align pgame.domineering.right SetTheory.PGame.Domineering.right theorem mem_left {b : Board} (x : β„€ Γ— β„€) : x ∈ left b ↔ x ∈ b ∧ (x.1, x.2 - 1) ∈ b := Finset.mem_inter.trans (and_congr Iff.rfl Finset.mem_map_equiv) #align pgame.domineering.mem_left SetTheory.PGame.Domineering.mem_left theorem mem_right {b : Board} (x : β„€ Γ— β„€) : x ∈ right b ↔ x ∈ b ∧ (x.1 - 1, x.2) ∈ b := Finset.mem_inter.trans (and_congr Iff.rfl Finset.mem_map_equiv) #align pgame.domineering.mem_right SetTheory.PGame.Domineering.mem_right def moveLeft (b : Board) (m : β„€ Γ— β„€) : Board := (b.erase m).erase (m.1, m.2 - 1) #align pgame.domineering.move_left SetTheory.PGame.Domineering.moveLeft def moveRight (b : Board) (m : β„€ Γ— β„€) : Board := (b.erase m).erase (m.1 - 1, m.2) #align pgame.domineering.move_right SetTheory.PGame.Domineering.moveRight theorem fst_pred_mem_erase_of_mem_right {b : Board} {m : β„€ Γ— β„€} (h : m ∈ right b) : (m.1 - 1, m.2) ∈ b.erase m := by rw [mem_right] at h apply Finset.mem_erase_of_ne_of_mem _ h.2 exact ne_of_apply_ne Prod.fst (pred_ne_self m.1) #align pgame.domineering.fst_pred_mem_erase_of_mem_right SetTheory.PGame.Domineering.fst_pred_mem_erase_of_mem_right theorem snd_pred_mem_erase_of_mem_left {b : Board} {m : β„€ Γ— β„€} (h : m ∈ left b) : (m.1, m.2 - 1) ∈ b.erase m := by rw [mem_left] at h apply Finset.mem_erase_of_ne_of_mem _ h.2 exact ne_of_apply_ne Prod.snd (pred_ne_self m.2) #align pgame.domineering.snd_pred_mem_erase_of_mem_left SetTheory.PGame.Domineering.snd_pred_mem_erase_of_mem_left
Mathlib/SetTheory/Game/Domineering.lean
93
98
theorem card_of_mem_left {b : Board} {m : β„€ Γ— β„€} (h : m ∈ left b) : 2 ≀ Finset.card b := by
have w₁ : m ∈ b := (Finset.mem_inter.1 h).1 have wβ‚‚ : (m.1, m.2 - 1) ∈ b.erase m := snd_pred_mem_erase_of_mem_left h have i₁ := Finset.card_erase_lt_of_mem w₁ have iβ‚‚ := Nat.lt_of_le_of_lt (Nat.zero_le _) (Finset.card_erase_lt_of_mem wβ‚‚) exact Nat.lt_of_le_of_lt iβ‚‚ i₁
5
148.413159
2
1.428571
7
1,521
import Mathlib.SetTheory.Game.State #align_import set_theory.game.domineering from "leanprover-community/mathlib"@"b134b2f5cf6dd25d4bbfd3c498b6e36c11a17225" namespace SetTheory namespace PGame namespace Domineering open Function @[simps!] def shiftUp : β„€ Γ— β„€ ≃ β„€ Γ— β„€ := (Equiv.refl β„€).prodCongr (Equiv.addRight (1 : β„€)) #align pgame.domineering.shift_up SetTheory.PGame.Domineering.shiftUp @[simps!] def shiftRight : β„€ Γ— β„€ ≃ β„€ Γ— β„€ := (Equiv.addRight (1 : β„€)).prodCongr (Equiv.refl β„€) #align pgame.domineering.shift_right SetTheory.PGame.Domineering.shiftRight -- Porting note: reducibility cannot be `local`. For now there are no dependents of this file so -- being globally reducible is fine. abbrev Board := Finset (β„€ Γ— β„€) #align pgame.domineering.board SetTheory.PGame.Domineering.Board def left (b : Board) : Finset (β„€ Γ— β„€) := b ∩ b.map shiftUp #align pgame.domineering.left SetTheory.PGame.Domineering.left def right (b : Board) : Finset (β„€ Γ— β„€) := b ∩ b.map shiftRight #align pgame.domineering.right SetTheory.PGame.Domineering.right theorem mem_left {b : Board} (x : β„€ Γ— β„€) : x ∈ left b ↔ x ∈ b ∧ (x.1, x.2 - 1) ∈ b := Finset.mem_inter.trans (and_congr Iff.rfl Finset.mem_map_equiv) #align pgame.domineering.mem_left SetTheory.PGame.Domineering.mem_left theorem mem_right {b : Board} (x : β„€ Γ— β„€) : x ∈ right b ↔ x ∈ b ∧ (x.1 - 1, x.2) ∈ b := Finset.mem_inter.trans (and_congr Iff.rfl Finset.mem_map_equiv) #align pgame.domineering.mem_right SetTheory.PGame.Domineering.mem_right def moveLeft (b : Board) (m : β„€ Γ— β„€) : Board := (b.erase m).erase (m.1, m.2 - 1) #align pgame.domineering.move_left SetTheory.PGame.Domineering.moveLeft def moveRight (b : Board) (m : β„€ Γ— β„€) : Board := (b.erase m).erase (m.1 - 1, m.2) #align pgame.domineering.move_right SetTheory.PGame.Domineering.moveRight theorem fst_pred_mem_erase_of_mem_right {b : Board} {m : β„€ Γ— β„€} (h : m ∈ right b) : (m.1 - 1, m.2) ∈ b.erase m := by rw [mem_right] at h apply Finset.mem_erase_of_ne_of_mem _ h.2 exact ne_of_apply_ne Prod.fst (pred_ne_self m.1) #align pgame.domineering.fst_pred_mem_erase_of_mem_right SetTheory.PGame.Domineering.fst_pred_mem_erase_of_mem_right theorem snd_pred_mem_erase_of_mem_left {b : Board} {m : β„€ Γ— β„€} (h : m ∈ left b) : (m.1, m.2 - 1) ∈ b.erase m := by rw [mem_left] at h apply Finset.mem_erase_of_ne_of_mem _ h.2 exact ne_of_apply_ne Prod.snd (pred_ne_self m.2) #align pgame.domineering.snd_pred_mem_erase_of_mem_left SetTheory.PGame.Domineering.snd_pred_mem_erase_of_mem_left theorem card_of_mem_left {b : Board} {m : β„€ Γ— β„€} (h : m ∈ left b) : 2 ≀ Finset.card b := by have w₁ : m ∈ b := (Finset.mem_inter.1 h).1 have wβ‚‚ : (m.1, m.2 - 1) ∈ b.erase m := snd_pred_mem_erase_of_mem_left h have i₁ := Finset.card_erase_lt_of_mem w₁ have iβ‚‚ := Nat.lt_of_le_of_lt (Nat.zero_le _) (Finset.card_erase_lt_of_mem wβ‚‚) exact Nat.lt_of_le_of_lt iβ‚‚ i₁ #align pgame.domineering.card_of_mem_left SetTheory.PGame.Domineering.card_of_mem_left
Mathlib/SetTheory/Game/Domineering.lean
101
106
theorem card_of_mem_right {b : Board} {m : β„€ Γ— β„€} (h : m ∈ right b) : 2 ≀ Finset.card b := by
have w₁ : m ∈ b := (Finset.mem_inter.1 h).1 have wβ‚‚ := fst_pred_mem_erase_of_mem_right h have i₁ := Finset.card_erase_lt_of_mem w₁ have iβ‚‚ := Nat.lt_of_le_of_lt (Nat.zero_le _) (Finset.card_erase_lt_of_mem wβ‚‚) exact Nat.lt_of_le_of_lt iβ‚‚ i₁
5
148.413159
2
1.428571
7
1,521
import Mathlib.SetTheory.Game.State #align_import set_theory.game.domineering from "leanprover-community/mathlib"@"b134b2f5cf6dd25d4bbfd3c498b6e36c11a17225" namespace SetTheory namespace PGame namespace Domineering open Function @[simps!] def shiftUp : β„€ Γ— β„€ ≃ β„€ Γ— β„€ := (Equiv.refl β„€).prodCongr (Equiv.addRight (1 : β„€)) #align pgame.domineering.shift_up SetTheory.PGame.Domineering.shiftUp @[simps!] def shiftRight : β„€ Γ— β„€ ≃ β„€ Γ— β„€ := (Equiv.addRight (1 : β„€)).prodCongr (Equiv.refl β„€) #align pgame.domineering.shift_right SetTheory.PGame.Domineering.shiftRight -- Porting note: reducibility cannot be `local`. For now there are no dependents of this file so -- being globally reducible is fine. abbrev Board := Finset (β„€ Γ— β„€) #align pgame.domineering.board SetTheory.PGame.Domineering.Board def left (b : Board) : Finset (β„€ Γ— β„€) := b ∩ b.map shiftUp #align pgame.domineering.left SetTheory.PGame.Domineering.left def right (b : Board) : Finset (β„€ Γ— β„€) := b ∩ b.map shiftRight #align pgame.domineering.right SetTheory.PGame.Domineering.right theorem mem_left {b : Board} (x : β„€ Γ— β„€) : x ∈ left b ↔ x ∈ b ∧ (x.1, x.2 - 1) ∈ b := Finset.mem_inter.trans (and_congr Iff.rfl Finset.mem_map_equiv) #align pgame.domineering.mem_left SetTheory.PGame.Domineering.mem_left theorem mem_right {b : Board} (x : β„€ Γ— β„€) : x ∈ right b ↔ x ∈ b ∧ (x.1 - 1, x.2) ∈ b := Finset.mem_inter.trans (and_congr Iff.rfl Finset.mem_map_equiv) #align pgame.domineering.mem_right SetTheory.PGame.Domineering.mem_right def moveLeft (b : Board) (m : β„€ Γ— β„€) : Board := (b.erase m).erase (m.1, m.2 - 1) #align pgame.domineering.move_left SetTheory.PGame.Domineering.moveLeft def moveRight (b : Board) (m : β„€ Γ— β„€) : Board := (b.erase m).erase (m.1 - 1, m.2) #align pgame.domineering.move_right SetTheory.PGame.Domineering.moveRight theorem fst_pred_mem_erase_of_mem_right {b : Board} {m : β„€ Γ— β„€} (h : m ∈ right b) : (m.1 - 1, m.2) ∈ b.erase m := by rw [mem_right] at h apply Finset.mem_erase_of_ne_of_mem _ h.2 exact ne_of_apply_ne Prod.fst (pred_ne_self m.1) #align pgame.domineering.fst_pred_mem_erase_of_mem_right SetTheory.PGame.Domineering.fst_pred_mem_erase_of_mem_right theorem snd_pred_mem_erase_of_mem_left {b : Board} {m : β„€ Γ— β„€} (h : m ∈ left b) : (m.1, m.2 - 1) ∈ b.erase m := by rw [mem_left] at h apply Finset.mem_erase_of_ne_of_mem _ h.2 exact ne_of_apply_ne Prod.snd (pred_ne_self m.2) #align pgame.domineering.snd_pred_mem_erase_of_mem_left SetTheory.PGame.Domineering.snd_pred_mem_erase_of_mem_left theorem card_of_mem_left {b : Board} {m : β„€ Γ— β„€} (h : m ∈ left b) : 2 ≀ Finset.card b := by have w₁ : m ∈ b := (Finset.mem_inter.1 h).1 have wβ‚‚ : (m.1, m.2 - 1) ∈ b.erase m := snd_pred_mem_erase_of_mem_left h have i₁ := Finset.card_erase_lt_of_mem w₁ have iβ‚‚ := Nat.lt_of_le_of_lt (Nat.zero_le _) (Finset.card_erase_lt_of_mem wβ‚‚) exact Nat.lt_of_le_of_lt iβ‚‚ i₁ #align pgame.domineering.card_of_mem_left SetTheory.PGame.Domineering.card_of_mem_left theorem card_of_mem_right {b : Board} {m : β„€ Γ— β„€} (h : m ∈ right b) : 2 ≀ Finset.card b := by have w₁ : m ∈ b := (Finset.mem_inter.1 h).1 have wβ‚‚ := fst_pred_mem_erase_of_mem_right h have i₁ := Finset.card_erase_lt_of_mem w₁ have iβ‚‚ := Nat.lt_of_le_of_lt (Nat.zero_le _) (Finset.card_erase_lt_of_mem wβ‚‚) exact Nat.lt_of_le_of_lt iβ‚‚ i₁ #align pgame.domineering.card_of_mem_right SetTheory.PGame.Domineering.card_of_mem_right
Mathlib/SetTheory/Game/Domineering.lean
109
114
theorem moveLeft_card {b : Board} {m : β„€ Γ— β„€} (h : m ∈ left b) : Finset.card (moveLeft b m) + 2 = Finset.card b := by
dsimp [moveLeft] rw [Finset.card_erase_of_mem (snd_pred_mem_erase_of_mem_left h)] rw [Finset.card_erase_of_mem (Finset.mem_of_mem_inter_left h)] exact tsub_add_cancel_of_le (card_of_mem_left h)
4
54.59815
2
1.428571
7
1,521
import Mathlib.SetTheory.Game.State #align_import set_theory.game.domineering from "leanprover-community/mathlib"@"b134b2f5cf6dd25d4bbfd3c498b6e36c11a17225" namespace SetTheory namespace PGame namespace Domineering open Function @[simps!] def shiftUp : β„€ Γ— β„€ ≃ β„€ Γ— β„€ := (Equiv.refl β„€).prodCongr (Equiv.addRight (1 : β„€)) #align pgame.domineering.shift_up SetTheory.PGame.Domineering.shiftUp @[simps!] def shiftRight : β„€ Γ— β„€ ≃ β„€ Γ— β„€ := (Equiv.addRight (1 : β„€)).prodCongr (Equiv.refl β„€) #align pgame.domineering.shift_right SetTheory.PGame.Domineering.shiftRight -- Porting note: reducibility cannot be `local`. For now there are no dependents of this file so -- being globally reducible is fine. abbrev Board := Finset (β„€ Γ— β„€) #align pgame.domineering.board SetTheory.PGame.Domineering.Board def left (b : Board) : Finset (β„€ Γ— β„€) := b ∩ b.map shiftUp #align pgame.domineering.left SetTheory.PGame.Domineering.left def right (b : Board) : Finset (β„€ Γ— β„€) := b ∩ b.map shiftRight #align pgame.domineering.right SetTheory.PGame.Domineering.right theorem mem_left {b : Board} (x : β„€ Γ— β„€) : x ∈ left b ↔ x ∈ b ∧ (x.1, x.2 - 1) ∈ b := Finset.mem_inter.trans (and_congr Iff.rfl Finset.mem_map_equiv) #align pgame.domineering.mem_left SetTheory.PGame.Domineering.mem_left theorem mem_right {b : Board} (x : β„€ Γ— β„€) : x ∈ right b ↔ x ∈ b ∧ (x.1 - 1, x.2) ∈ b := Finset.mem_inter.trans (and_congr Iff.rfl Finset.mem_map_equiv) #align pgame.domineering.mem_right SetTheory.PGame.Domineering.mem_right def moveLeft (b : Board) (m : β„€ Γ— β„€) : Board := (b.erase m).erase (m.1, m.2 - 1) #align pgame.domineering.move_left SetTheory.PGame.Domineering.moveLeft def moveRight (b : Board) (m : β„€ Γ— β„€) : Board := (b.erase m).erase (m.1 - 1, m.2) #align pgame.domineering.move_right SetTheory.PGame.Domineering.moveRight theorem fst_pred_mem_erase_of_mem_right {b : Board} {m : β„€ Γ— β„€} (h : m ∈ right b) : (m.1 - 1, m.2) ∈ b.erase m := by rw [mem_right] at h apply Finset.mem_erase_of_ne_of_mem _ h.2 exact ne_of_apply_ne Prod.fst (pred_ne_self m.1) #align pgame.domineering.fst_pred_mem_erase_of_mem_right SetTheory.PGame.Domineering.fst_pred_mem_erase_of_mem_right theorem snd_pred_mem_erase_of_mem_left {b : Board} {m : β„€ Γ— β„€} (h : m ∈ left b) : (m.1, m.2 - 1) ∈ b.erase m := by rw [mem_left] at h apply Finset.mem_erase_of_ne_of_mem _ h.2 exact ne_of_apply_ne Prod.snd (pred_ne_self m.2) #align pgame.domineering.snd_pred_mem_erase_of_mem_left SetTheory.PGame.Domineering.snd_pred_mem_erase_of_mem_left theorem card_of_mem_left {b : Board} {m : β„€ Γ— β„€} (h : m ∈ left b) : 2 ≀ Finset.card b := by have w₁ : m ∈ b := (Finset.mem_inter.1 h).1 have wβ‚‚ : (m.1, m.2 - 1) ∈ b.erase m := snd_pred_mem_erase_of_mem_left h have i₁ := Finset.card_erase_lt_of_mem w₁ have iβ‚‚ := Nat.lt_of_le_of_lt (Nat.zero_le _) (Finset.card_erase_lt_of_mem wβ‚‚) exact Nat.lt_of_le_of_lt iβ‚‚ i₁ #align pgame.domineering.card_of_mem_left SetTheory.PGame.Domineering.card_of_mem_left theorem card_of_mem_right {b : Board} {m : β„€ Γ— β„€} (h : m ∈ right b) : 2 ≀ Finset.card b := by have w₁ : m ∈ b := (Finset.mem_inter.1 h).1 have wβ‚‚ := fst_pred_mem_erase_of_mem_right h have i₁ := Finset.card_erase_lt_of_mem w₁ have iβ‚‚ := Nat.lt_of_le_of_lt (Nat.zero_le _) (Finset.card_erase_lt_of_mem wβ‚‚) exact Nat.lt_of_le_of_lt iβ‚‚ i₁ #align pgame.domineering.card_of_mem_right SetTheory.PGame.Domineering.card_of_mem_right theorem moveLeft_card {b : Board} {m : β„€ Γ— β„€} (h : m ∈ left b) : Finset.card (moveLeft b m) + 2 = Finset.card b := by dsimp [moveLeft] rw [Finset.card_erase_of_mem (snd_pred_mem_erase_of_mem_left h)] rw [Finset.card_erase_of_mem (Finset.mem_of_mem_inter_left h)] exact tsub_add_cancel_of_le (card_of_mem_left h) #align pgame.domineering.move_left_card SetTheory.PGame.Domineering.moveLeft_card
Mathlib/SetTheory/Game/Domineering.lean
117
122
theorem moveRight_card {b : Board} {m : β„€ Γ— β„€} (h : m ∈ right b) : Finset.card (moveRight b m) + 2 = Finset.card b := by
dsimp [moveRight] rw [Finset.card_erase_of_mem (fst_pred_mem_erase_of_mem_right h)] rw [Finset.card_erase_of_mem (Finset.mem_of_mem_inter_left h)] exact tsub_add_cancel_of_le (card_of_mem_right h)
4
54.59815
2
1.428571
7
1,521
import Mathlib.SetTheory.Game.State #align_import set_theory.game.domineering from "leanprover-community/mathlib"@"b134b2f5cf6dd25d4bbfd3c498b6e36c11a17225" namespace SetTheory namespace PGame namespace Domineering open Function @[simps!] def shiftUp : β„€ Γ— β„€ ≃ β„€ Γ— β„€ := (Equiv.refl β„€).prodCongr (Equiv.addRight (1 : β„€)) #align pgame.domineering.shift_up SetTheory.PGame.Domineering.shiftUp @[simps!] def shiftRight : β„€ Γ— β„€ ≃ β„€ Γ— β„€ := (Equiv.addRight (1 : β„€)).prodCongr (Equiv.refl β„€) #align pgame.domineering.shift_right SetTheory.PGame.Domineering.shiftRight -- Porting note: reducibility cannot be `local`. For now there are no dependents of this file so -- being globally reducible is fine. abbrev Board := Finset (β„€ Γ— β„€) #align pgame.domineering.board SetTheory.PGame.Domineering.Board def left (b : Board) : Finset (β„€ Γ— β„€) := b ∩ b.map shiftUp #align pgame.domineering.left SetTheory.PGame.Domineering.left def right (b : Board) : Finset (β„€ Γ— β„€) := b ∩ b.map shiftRight #align pgame.domineering.right SetTheory.PGame.Domineering.right theorem mem_left {b : Board} (x : β„€ Γ— β„€) : x ∈ left b ↔ x ∈ b ∧ (x.1, x.2 - 1) ∈ b := Finset.mem_inter.trans (and_congr Iff.rfl Finset.mem_map_equiv) #align pgame.domineering.mem_left SetTheory.PGame.Domineering.mem_left theorem mem_right {b : Board} (x : β„€ Γ— β„€) : x ∈ right b ↔ x ∈ b ∧ (x.1 - 1, x.2) ∈ b := Finset.mem_inter.trans (and_congr Iff.rfl Finset.mem_map_equiv) #align pgame.domineering.mem_right SetTheory.PGame.Domineering.mem_right def moveLeft (b : Board) (m : β„€ Γ— β„€) : Board := (b.erase m).erase (m.1, m.2 - 1) #align pgame.domineering.move_left SetTheory.PGame.Domineering.moveLeft def moveRight (b : Board) (m : β„€ Γ— β„€) : Board := (b.erase m).erase (m.1 - 1, m.2) #align pgame.domineering.move_right SetTheory.PGame.Domineering.moveRight theorem fst_pred_mem_erase_of_mem_right {b : Board} {m : β„€ Γ— β„€} (h : m ∈ right b) : (m.1 - 1, m.2) ∈ b.erase m := by rw [mem_right] at h apply Finset.mem_erase_of_ne_of_mem _ h.2 exact ne_of_apply_ne Prod.fst (pred_ne_self m.1) #align pgame.domineering.fst_pred_mem_erase_of_mem_right SetTheory.PGame.Domineering.fst_pred_mem_erase_of_mem_right theorem snd_pred_mem_erase_of_mem_left {b : Board} {m : β„€ Γ— β„€} (h : m ∈ left b) : (m.1, m.2 - 1) ∈ b.erase m := by rw [mem_left] at h apply Finset.mem_erase_of_ne_of_mem _ h.2 exact ne_of_apply_ne Prod.snd (pred_ne_self m.2) #align pgame.domineering.snd_pred_mem_erase_of_mem_left SetTheory.PGame.Domineering.snd_pred_mem_erase_of_mem_left theorem card_of_mem_left {b : Board} {m : β„€ Γ— β„€} (h : m ∈ left b) : 2 ≀ Finset.card b := by have w₁ : m ∈ b := (Finset.mem_inter.1 h).1 have wβ‚‚ : (m.1, m.2 - 1) ∈ b.erase m := snd_pred_mem_erase_of_mem_left h have i₁ := Finset.card_erase_lt_of_mem w₁ have iβ‚‚ := Nat.lt_of_le_of_lt (Nat.zero_le _) (Finset.card_erase_lt_of_mem wβ‚‚) exact Nat.lt_of_le_of_lt iβ‚‚ i₁ #align pgame.domineering.card_of_mem_left SetTheory.PGame.Domineering.card_of_mem_left theorem card_of_mem_right {b : Board} {m : β„€ Γ— β„€} (h : m ∈ right b) : 2 ≀ Finset.card b := by have w₁ : m ∈ b := (Finset.mem_inter.1 h).1 have wβ‚‚ := fst_pred_mem_erase_of_mem_right h have i₁ := Finset.card_erase_lt_of_mem w₁ have iβ‚‚ := Nat.lt_of_le_of_lt (Nat.zero_le _) (Finset.card_erase_lt_of_mem wβ‚‚) exact Nat.lt_of_le_of_lt iβ‚‚ i₁ #align pgame.domineering.card_of_mem_right SetTheory.PGame.Domineering.card_of_mem_right theorem moveLeft_card {b : Board} {m : β„€ Γ— β„€} (h : m ∈ left b) : Finset.card (moveLeft b m) + 2 = Finset.card b := by dsimp [moveLeft] rw [Finset.card_erase_of_mem (snd_pred_mem_erase_of_mem_left h)] rw [Finset.card_erase_of_mem (Finset.mem_of_mem_inter_left h)] exact tsub_add_cancel_of_le (card_of_mem_left h) #align pgame.domineering.move_left_card SetTheory.PGame.Domineering.moveLeft_card theorem moveRight_card {b : Board} {m : β„€ Γ— β„€} (h : m ∈ right b) : Finset.card (moveRight b m) + 2 = Finset.card b := by dsimp [moveRight] rw [Finset.card_erase_of_mem (fst_pred_mem_erase_of_mem_right h)] rw [Finset.card_erase_of_mem (Finset.mem_of_mem_inter_left h)] exact tsub_add_cancel_of_le (card_of_mem_right h) #align pgame.domineering.move_right_card SetTheory.PGame.Domineering.moveRight_card
Mathlib/SetTheory/Game/Domineering.lean
125
126
theorem moveLeft_smaller {b : Board} {m : β„€ Γ— β„€} (h : m ∈ left b) : Finset.card (moveLeft b m) / 2 < Finset.card b / 2 := by
simp [← moveLeft_card h, lt_add_one]
1
2.718282
0
1.428571
7
1,521
import Mathlib.Algebra.Order.Group.TypeTags import Mathlib.FieldTheory.RatFunc.Degree import Mathlib.RingTheory.DedekindDomain.IntegralClosure import Mathlib.RingTheory.IntegrallyClosed import Mathlib.Topology.Algebra.ValuedField #align_import number_theory.function_field from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section open scoped nonZeroDivisors Polynomial DiscreteValuation variable (Fq F : Type) [Field Fq] [Field F] abbrev FunctionField [Algebra (RatFunc Fq) F] : Prop := FiniteDimensional (RatFunc Fq) F #align function_field FunctionField -- Porting note: Removed `protected`
Mathlib/NumberTheory/FunctionField.lean
62
80
theorem functionField_iff (Fqt : Type*) [Field Fqt] [Algebra Fq[X] Fqt] [IsFractionRing Fq[X] Fqt] [Algebra (RatFunc Fq) F] [Algebra Fqt F] [Algebra Fq[X] F] [IsScalarTower Fq[X] Fqt F] [IsScalarTower Fq[X] (RatFunc Fq) F] : FunctionField Fq F ↔ FiniteDimensional Fqt F := by
let e := IsLocalization.algEquiv Fq[X]⁰ (RatFunc Fq) Fqt have : βˆ€ (c) (x : F), e c β€’ x = c β€’ x := by intro c x rw [Algebra.smul_def, Algebra.smul_def] congr refine congr_fun (f := fun c => algebraMap Fqt F (e c)) ?_ c -- Porting note: Added `(f := _)` refine IsLocalization.ext (nonZeroDivisors Fq[X]) _ _ ?_ ?_ ?_ ?_ ?_ <;> intros <;> simp only [AlgEquiv.map_one, RingHom.map_one, AlgEquiv.map_mul, RingHom.map_mul, AlgEquiv.commutes, ← IsScalarTower.algebraMap_apply] constructor <;> intro h Β· let b := FiniteDimensional.finBasis (RatFunc Fq) F exact FiniteDimensional.of_fintype_basis (b.mapCoeffs e this) Β· let b := FiniteDimensional.finBasis Fqt F refine FiniteDimensional.of_fintype_basis (b.mapCoeffs e.symm ?_) intro c x; convert (this (e.symm c) x).symm; simp only [e.apply_symm_apply]
15
3,269,017.372472
2
1.428571
7
1,522
import Mathlib.Algebra.Order.Group.TypeTags import Mathlib.FieldTheory.RatFunc.Degree import Mathlib.RingTheory.DedekindDomain.IntegralClosure import Mathlib.RingTheory.IntegrallyClosed import Mathlib.Topology.Algebra.ValuedField #align_import number_theory.function_field from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section open scoped nonZeroDivisors Polynomial DiscreteValuation variable (Fq F : Type) [Field Fq] [Field F] abbrev FunctionField [Algebra (RatFunc Fq) F] : Prop := FiniteDimensional (RatFunc Fq) F #align function_field FunctionField -- Porting note: Removed `protected` theorem functionField_iff (Fqt : Type*) [Field Fqt] [Algebra Fq[X] Fqt] [IsFractionRing Fq[X] Fqt] [Algebra (RatFunc Fq) F] [Algebra Fqt F] [Algebra Fq[X] F] [IsScalarTower Fq[X] Fqt F] [IsScalarTower Fq[X] (RatFunc Fq) F] : FunctionField Fq F ↔ FiniteDimensional Fqt F := by let e := IsLocalization.algEquiv Fq[X]⁰ (RatFunc Fq) Fqt have : βˆ€ (c) (x : F), e c β€’ x = c β€’ x := by intro c x rw [Algebra.smul_def, Algebra.smul_def] congr refine congr_fun (f := fun c => algebraMap Fqt F (e c)) ?_ c -- Porting note: Added `(f := _)` refine IsLocalization.ext (nonZeroDivisors Fq[X]) _ _ ?_ ?_ ?_ ?_ ?_ <;> intros <;> simp only [AlgEquiv.map_one, RingHom.map_one, AlgEquiv.map_mul, RingHom.map_mul, AlgEquiv.commutes, ← IsScalarTower.algebraMap_apply] constructor <;> intro h Β· let b := FiniteDimensional.finBasis (RatFunc Fq) F exact FiniteDimensional.of_fintype_basis (b.mapCoeffs e this) Β· let b := FiniteDimensional.finBasis Fqt F refine FiniteDimensional.of_fintype_basis (b.mapCoeffs e.symm ?_) intro c x; convert (this (e.symm c) x).symm; simp only [e.apply_symm_apply] #align function_field_iff functionField_iff
Mathlib/NumberTheory/FunctionField.lean
83
86
theorem algebraMap_injective [Algebra Fq[X] F] [Algebra (RatFunc Fq) F] [IsScalarTower Fq[X] (RatFunc Fq) F] : Function.Injective (⇑(algebraMap Fq[X] F)) := by
rw [IsScalarTower.algebraMap_eq Fq[X] (RatFunc Fq) F] exact (algebraMap (RatFunc Fq) F).injective.comp (IsFractionRing.injective Fq[X] (RatFunc Fq))
2
7.389056
1
1.428571
7
1,522
import Mathlib.Algebra.Order.Group.TypeTags import Mathlib.FieldTheory.RatFunc.Degree import Mathlib.RingTheory.DedekindDomain.IntegralClosure import Mathlib.RingTheory.IntegrallyClosed import Mathlib.Topology.Algebra.ValuedField #align_import number_theory.function_field from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section open scoped nonZeroDivisors Polynomial DiscreteValuation variable (Fq F : Type) [Field Fq] [Field F] abbrev FunctionField [Algebra (RatFunc Fq) F] : Prop := FiniteDimensional (RatFunc Fq) F #align function_field FunctionField -- Porting note: Removed `protected` theorem functionField_iff (Fqt : Type*) [Field Fqt] [Algebra Fq[X] Fqt] [IsFractionRing Fq[X] Fqt] [Algebra (RatFunc Fq) F] [Algebra Fqt F] [Algebra Fq[X] F] [IsScalarTower Fq[X] Fqt F] [IsScalarTower Fq[X] (RatFunc Fq) F] : FunctionField Fq F ↔ FiniteDimensional Fqt F := by let e := IsLocalization.algEquiv Fq[X]⁰ (RatFunc Fq) Fqt have : βˆ€ (c) (x : F), e c β€’ x = c β€’ x := by intro c x rw [Algebra.smul_def, Algebra.smul_def] congr refine congr_fun (f := fun c => algebraMap Fqt F (e c)) ?_ c -- Porting note: Added `(f := _)` refine IsLocalization.ext (nonZeroDivisors Fq[X]) _ _ ?_ ?_ ?_ ?_ ?_ <;> intros <;> simp only [AlgEquiv.map_one, RingHom.map_one, AlgEquiv.map_mul, RingHom.map_mul, AlgEquiv.commutes, ← IsScalarTower.algebraMap_apply] constructor <;> intro h Β· let b := FiniteDimensional.finBasis (RatFunc Fq) F exact FiniteDimensional.of_fintype_basis (b.mapCoeffs e this) Β· let b := FiniteDimensional.finBasis Fqt F refine FiniteDimensional.of_fintype_basis (b.mapCoeffs e.symm ?_) intro c x; convert (this (e.symm c) x).symm; simp only [e.apply_symm_apply] #align function_field_iff functionField_iff theorem algebraMap_injective [Algebra Fq[X] F] [Algebra (RatFunc Fq) F] [IsScalarTower Fq[X] (RatFunc Fq) F] : Function.Injective (⇑(algebraMap Fq[X] F)) := by rw [IsScalarTower.algebraMap_eq Fq[X] (RatFunc Fq) F] exact (algebraMap (RatFunc Fq) F).injective.comp (IsFractionRing.injective Fq[X] (RatFunc Fq)) #align algebra_map_injective algebraMap_injective namespace FunctionField def ringOfIntegers [Algebra Fq[X] F] := integralClosure Fq[X] F #align function_field.ring_of_integers FunctionField.ringOfIntegers namespace ringOfIntegers variable [Algebra Fq[X] F] instance : IsDomain (ringOfIntegers Fq F) := (ringOfIntegers Fq F).isDomain instance : IsIntegralClosure (ringOfIntegers Fq F) Fq[X] F := integralClosure.isIntegralClosure _ _ variable [Algebra (RatFunc Fq) F] [IsScalarTower Fq[X] (RatFunc Fq) F]
Mathlib/NumberTheory/FunctionField.lean
113
121
theorem algebraMap_injective : Function.Injective (⇑(algebraMap Fq[X] (ringOfIntegers Fq F))) := by
have hinj : Function.Injective (⇑(algebraMap Fq[X] F)) := by rw [IsScalarTower.algebraMap_eq Fq[X] (RatFunc Fq) F] exact (algebraMap (RatFunc Fq) F).injective.comp (IsFractionRing.injective Fq[X] (RatFunc Fq)) rw [injective_iff_map_eq_zero (algebraMap Fq[X] (β†₯(ringOfIntegers Fq F)))] intro p hp rw [← Subtype.coe_inj, Subalgebra.coe_zero] at hp rw [injective_iff_map_eq_zero (algebraMap Fq[X] F)] at hinj exact hinj p hp
8
2,980.957987
2
1.428571
7
1,522
import Mathlib.Algebra.Order.Group.TypeTags import Mathlib.FieldTheory.RatFunc.Degree import Mathlib.RingTheory.DedekindDomain.IntegralClosure import Mathlib.RingTheory.IntegrallyClosed import Mathlib.Topology.Algebra.ValuedField #align_import number_theory.function_field from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section open scoped nonZeroDivisors Polynomial DiscreteValuation variable (Fq F : Type) [Field Fq] [Field F] abbrev FunctionField [Algebra (RatFunc Fq) F] : Prop := FiniteDimensional (RatFunc Fq) F #align function_field FunctionField -- Porting note: Removed `protected` theorem functionField_iff (Fqt : Type*) [Field Fqt] [Algebra Fq[X] Fqt] [IsFractionRing Fq[X] Fqt] [Algebra (RatFunc Fq) F] [Algebra Fqt F] [Algebra Fq[X] F] [IsScalarTower Fq[X] Fqt F] [IsScalarTower Fq[X] (RatFunc Fq) F] : FunctionField Fq F ↔ FiniteDimensional Fqt F := by let e := IsLocalization.algEquiv Fq[X]⁰ (RatFunc Fq) Fqt have : βˆ€ (c) (x : F), e c β€’ x = c β€’ x := by intro c x rw [Algebra.smul_def, Algebra.smul_def] congr refine congr_fun (f := fun c => algebraMap Fqt F (e c)) ?_ c -- Porting note: Added `(f := _)` refine IsLocalization.ext (nonZeroDivisors Fq[X]) _ _ ?_ ?_ ?_ ?_ ?_ <;> intros <;> simp only [AlgEquiv.map_one, RingHom.map_one, AlgEquiv.map_mul, RingHom.map_mul, AlgEquiv.commutes, ← IsScalarTower.algebraMap_apply] constructor <;> intro h Β· let b := FiniteDimensional.finBasis (RatFunc Fq) F exact FiniteDimensional.of_fintype_basis (b.mapCoeffs e this) Β· let b := FiniteDimensional.finBasis Fqt F refine FiniteDimensional.of_fintype_basis (b.mapCoeffs e.symm ?_) intro c x; convert (this (e.symm c) x).symm; simp only [e.apply_symm_apply] #align function_field_iff functionField_iff theorem algebraMap_injective [Algebra Fq[X] F] [Algebra (RatFunc Fq) F] [IsScalarTower Fq[X] (RatFunc Fq) F] : Function.Injective (⇑(algebraMap Fq[X] F)) := by rw [IsScalarTower.algebraMap_eq Fq[X] (RatFunc Fq) F] exact (algebraMap (RatFunc Fq) F).injective.comp (IsFractionRing.injective Fq[X] (RatFunc Fq)) #align algebra_map_injective algebraMap_injective namespace FunctionField def ringOfIntegers [Algebra Fq[X] F] := integralClosure Fq[X] F #align function_field.ring_of_integers FunctionField.ringOfIntegers namespace ringOfIntegers variable [Algebra Fq[X] F] instance : IsDomain (ringOfIntegers Fq F) := (ringOfIntegers Fq F).isDomain instance : IsIntegralClosure (ringOfIntegers Fq F) Fq[X] F := integralClosure.isIntegralClosure _ _ variable [Algebra (RatFunc Fq) F] [IsScalarTower Fq[X] (RatFunc Fq) F] theorem algebraMap_injective : Function.Injective (⇑(algebraMap Fq[X] (ringOfIntegers Fq F))) := by have hinj : Function.Injective (⇑(algebraMap Fq[X] F)) := by rw [IsScalarTower.algebraMap_eq Fq[X] (RatFunc Fq) F] exact (algebraMap (RatFunc Fq) F).injective.comp (IsFractionRing.injective Fq[X] (RatFunc Fq)) rw [injective_iff_map_eq_zero (algebraMap Fq[X] (β†₯(ringOfIntegers Fq F)))] intro p hp rw [← Subtype.coe_inj, Subalgebra.coe_zero] at hp rw [injective_iff_map_eq_zero (algebraMap Fq[X] F)] at hinj exact hinj p hp #align function_field.ring_of_integers.algebra_map_injective FunctionField.ringOfIntegers.algebraMap_injective
Mathlib/NumberTheory/FunctionField.lean
124
127
theorem not_isField : Β¬IsField (ringOfIntegers Fq F) := by
simpa [← (IsIntegralClosure.isIntegral_algebra Fq[X] F).isField_iff_isField (algebraMap_injective Fq F)] using Polynomial.not_isField Fq
3
20.085537
1
1.428571
7
1,522
import Mathlib.Algebra.Order.Group.TypeTags import Mathlib.FieldTheory.RatFunc.Degree import Mathlib.RingTheory.DedekindDomain.IntegralClosure import Mathlib.RingTheory.IntegrallyClosed import Mathlib.Topology.Algebra.ValuedField #align_import number_theory.function_field from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section open scoped nonZeroDivisors Polynomial DiscreteValuation variable (Fq F : Type) [Field Fq] [Field F] abbrev FunctionField [Algebra (RatFunc Fq) F] : Prop := FiniteDimensional (RatFunc Fq) F #align function_field FunctionField -- Porting note: Removed `protected` theorem functionField_iff (Fqt : Type*) [Field Fqt] [Algebra Fq[X] Fqt] [IsFractionRing Fq[X] Fqt] [Algebra (RatFunc Fq) F] [Algebra Fqt F] [Algebra Fq[X] F] [IsScalarTower Fq[X] Fqt F] [IsScalarTower Fq[X] (RatFunc Fq) F] : FunctionField Fq F ↔ FiniteDimensional Fqt F := by let e := IsLocalization.algEquiv Fq[X]⁰ (RatFunc Fq) Fqt have : βˆ€ (c) (x : F), e c β€’ x = c β€’ x := by intro c x rw [Algebra.smul_def, Algebra.smul_def] congr refine congr_fun (f := fun c => algebraMap Fqt F (e c)) ?_ c -- Porting note: Added `(f := _)` refine IsLocalization.ext (nonZeroDivisors Fq[X]) _ _ ?_ ?_ ?_ ?_ ?_ <;> intros <;> simp only [AlgEquiv.map_one, RingHom.map_one, AlgEquiv.map_mul, RingHom.map_mul, AlgEquiv.commutes, ← IsScalarTower.algebraMap_apply] constructor <;> intro h Β· let b := FiniteDimensional.finBasis (RatFunc Fq) F exact FiniteDimensional.of_fintype_basis (b.mapCoeffs e this) Β· let b := FiniteDimensional.finBasis Fqt F refine FiniteDimensional.of_fintype_basis (b.mapCoeffs e.symm ?_) intro c x; convert (this (e.symm c) x).symm; simp only [e.apply_symm_apply] #align function_field_iff functionField_iff theorem algebraMap_injective [Algebra Fq[X] F] [Algebra (RatFunc Fq) F] [IsScalarTower Fq[X] (RatFunc Fq) F] : Function.Injective (⇑(algebraMap Fq[X] F)) := by rw [IsScalarTower.algebraMap_eq Fq[X] (RatFunc Fq) F] exact (algebraMap (RatFunc Fq) F).injective.comp (IsFractionRing.injective Fq[X] (RatFunc Fq)) #align algebra_map_injective algebraMap_injective namespace FunctionField def ringOfIntegers [Algebra Fq[X] F] := integralClosure Fq[X] F #align function_field.ring_of_integers FunctionField.ringOfIntegers section InftyValuation variable [DecidableEq (RatFunc Fq)] def inftyValuationDef (r : RatFunc Fq) : β„€β‚˜β‚€ := if r = 0 then 0 else ↑(Multiplicative.ofAdd r.intDegree) #align function_field.infty_valuation_def FunctionField.inftyValuationDef theorem InftyValuation.map_zero' : inftyValuationDef Fq 0 = 0 := if_pos rfl #align function_field.infty_valuation.map_zero' FunctionField.InftyValuation.map_zero' theorem InftyValuation.map_one' : inftyValuationDef Fq 1 = 1 := (if_neg one_ne_zero).trans <| by rw [RatFunc.intDegree_one, ofAdd_zero, WithZero.coe_one] #align function_field.infty_valuation.map_one' FunctionField.InftyValuation.map_one'
Mathlib/NumberTheory/FunctionField.lean
168
176
theorem InftyValuation.map_mul' (x y : RatFunc Fq) : inftyValuationDef Fq (x * y) = inftyValuationDef Fq x * inftyValuationDef Fq y := by
rw [inftyValuationDef, inftyValuationDef, inftyValuationDef] by_cases hx : x = 0 Β· rw [hx, zero_mul, if_pos (Eq.refl _), zero_mul] Β· by_cases hy : y = 0 Β· rw [hy, mul_zero, if_pos (Eq.refl _), mul_zero] Β· rw [if_neg hx, if_neg hy, if_neg (mul_ne_zero hx hy), ← WithZero.coe_mul, WithZero.coe_inj, ← ofAdd_add, RatFunc.intDegree_mul hx hy]
7
1,096.633158
2
1.428571
7
1,522
import Mathlib.Algebra.Order.Group.TypeTags import Mathlib.FieldTheory.RatFunc.Degree import Mathlib.RingTheory.DedekindDomain.IntegralClosure import Mathlib.RingTheory.IntegrallyClosed import Mathlib.Topology.Algebra.ValuedField #align_import number_theory.function_field from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section open scoped nonZeroDivisors Polynomial DiscreteValuation variable (Fq F : Type) [Field Fq] [Field F] abbrev FunctionField [Algebra (RatFunc Fq) F] : Prop := FiniteDimensional (RatFunc Fq) F #align function_field FunctionField -- Porting note: Removed `protected` theorem functionField_iff (Fqt : Type*) [Field Fqt] [Algebra Fq[X] Fqt] [IsFractionRing Fq[X] Fqt] [Algebra (RatFunc Fq) F] [Algebra Fqt F] [Algebra Fq[X] F] [IsScalarTower Fq[X] Fqt F] [IsScalarTower Fq[X] (RatFunc Fq) F] : FunctionField Fq F ↔ FiniteDimensional Fqt F := by let e := IsLocalization.algEquiv Fq[X]⁰ (RatFunc Fq) Fqt have : βˆ€ (c) (x : F), e c β€’ x = c β€’ x := by intro c x rw [Algebra.smul_def, Algebra.smul_def] congr refine congr_fun (f := fun c => algebraMap Fqt F (e c)) ?_ c -- Porting note: Added `(f := _)` refine IsLocalization.ext (nonZeroDivisors Fq[X]) _ _ ?_ ?_ ?_ ?_ ?_ <;> intros <;> simp only [AlgEquiv.map_one, RingHom.map_one, AlgEquiv.map_mul, RingHom.map_mul, AlgEquiv.commutes, ← IsScalarTower.algebraMap_apply] constructor <;> intro h Β· let b := FiniteDimensional.finBasis (RatFunc Fq) F exact FiniteDimensional.of_fintype_basis (b.mapCoeffs e this) Β· let b := FiniteDimensional.finBasis Fqt F refine FiniteDimensional.of_fintype_basis (b.mapCoeffs e.symm ?_) intro c x; convert (this (e.symm c) x).symm; simp only [e.apply_symm_apply] #align function_field_iff functionField_iff theorem algebraMap_injective [Algebra Fq[X] F] [Algebra (RatFunc Fq) F] [IsScalarTower Fq[X] (RatFunc Fq) F] : Function.Injective (⇑(algebraMap Fq[X] F)) := by rw [IsScalarTower.algebraMap_eq Fq[X] (RatFunc Fq) F] exact (algebraMap (RatFunc Fq) F).injective.comp (IsFractionRing.injective Fq[X] (RatFunc Fq)) #align algebra_map_injective algebraMap_injective namespace FunctionField def ringOfIntegers [Algebra Fq[X] F] := integralClosure Fq[X] F #align function_field.ring_of_integers FunctionField.ringOfIntegers section InftyValuation variable [DecidableEq (RatFunc Fq)] def inftyValuationDef (r : RatFunc Fq) : β„€β‚˜β‚€ := if r = 0 then 0 else ↑(Multiplicative.ofAdd r.intDegree) #align function_field.infty_valuation_def FunctionField.inftyValuationDef theorem InftyValuation.map_zero' : inftyValuationDef Fq 0 = 0 := if_pos rfl #align function_field.infty_valuation.map_zero' FunctionField.InftyValuation.map_zero' theorem InftyValuation.map_one' : inftyValuationDef Fq 1 = 1 := (if_neg one_ne_zero).trans <| by rw [RatFunc.intDegree_one, ofAdd_zero, WithZero.coe_one] #align function_field.infty_valuation.map_one' FunctionField.InftyValuation.map_one' theorem InftyValuation.map_mul' (x y : RatFunc Fq) : inftyValuationDef Fq (x * y) = inftyValuationDef Fq x * inftyValuationDef Fq y := by rw [inftyValuationDef, inftyValuationDef, inftyValuationDef] by_cases hx : x = 0 Β· rw [hx, zero_mul, if_pos (Eq.refl _), zero_mul] Β· by_cases hy : y = 0 Β· rw [hy, mul_zero, if_pos (Eq.refl _), mul_zero] Β· rw [if_neg hx, if_neg hy, if_neg (mul_ne_zero hx hy), ← WithZero.coe_mul, WithZero.coe_inj, ← ofAdd_add, RatFunc.intDegree_mul hx hy] #align function_field.infty_valuation.map_mul' FunctionField.InftyValuation.map_mul'
Mathlib/NumberTheory/FunctionField.lean
179
195
theorem InftyValuation.map_add_le_max' (x y : RatFunc Fq) : inftyValuationDef Fq (x + y) ≀ max (inftyValuationDef Fq x) (inftyValuationDef Fq y) := by
by_cases hx : x = 0 Β· rw [hx, zero_add] conv_rhs => rw [inftyValuationDef, if_pos (Eq.refl _)] rw [max_eq_right (WithZero.zero_le (inftyValuationDef Fq y))] Β· by_cases hy : y = 0 Β· rw [hy, add_zero] conv_rhs => rw [max_comm, inftyValuationDef, if_pos (Eq.refl _)] rw [max_eq_right (WithZero.zero_le (inftyValuationDef Fq x))] Β· by_cases hxy : x + y = 0 Β· rw [inftyValuationDef, if_pos hxy]; exact zero_le' Β· rw [inftyValuationDef, inftyValuationDef, inftyValuationDef, if_neg hx, if_neg hy, if_neg hxy] rw [le_max_iff, WithZero.coe_le_coe, Multiplicative.ofAdd_le, WithZero.coe_le_coe, Multiplicative.ofAdd_le, ← le_max_iff] exact RatFunc.intDegree_add_le hy hxy
15
3,269,017.372472
2
1.428571
7
1,522
import Mathlib.Algebra.Order.Group.TypeTags import Mathlib.FieldTheory.RatFunc.Degree import Mathlib.RingTheory.DedekindDomain.IntegralClosure import Mathlib.RingTheory.IntegrallyClosed import Mathlib.Topology.Algebra.ValuedField #align_import number_theory.function_field from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" noncomputable section open scoped nonZeroDivisors Polynomial DiscreteValuation variable (Fq F : Type) [Field Fq] [Field F] abbrev FunctionField [Algebra (RatFunc Fq) F] : Prop := FiniteDimensional (RatFunc Fq) F #align function_field FunctionField -- Porting note: Removed `protected` theorem functionField_iff (Fqt : Type*) [Field Fqt] [Algebra Fq[X] Fqt] [IsFractionRing Fq[X] Fqt] [Algebra (RatFunc Fq) F] [Algebra Fqt F] [Algebra Fq[X] F] [IsScalarTower Fq[X] Fqt F] [IsScalarTower Fq[X] (RatFunc Fq) F] : FunctionField Fq F ↔ FiniteDimensional Fqt F := by let e := IsLocalization.algEquiv Fq[X]⁰ (RatFunc Fq) Fqt have : βˆ€ (c) (x : F), e c β€’ x = c β€’ x := by intro c x rw [Algebra.smul_def, Algebra.smul_def] congr refine congr_fun (f := fun c => algebraMap Fqt F (e c)) ?_ c -- Porting note: Added `(f := _)` refine IsLocalization.ext (nonZeroDivisors Fq[X]) _ _ ?_ ?_ ?_ ?_ ?_ <;> intros <;> simp only [AlgEquiv.map_one, RingHom.map_one, AlgEquiv.map_mul, RingHom.map_mul, AlgEquiv.commutes, ← IsScalarTower.algebraMap_apply] constructor <;> intro h Β· let b := FiniteDimensional.finBasis (RatFunc Fq) F exact FiniteDimensional.of_fintype_basis (b.mapCoeffs e this) Β· let b := FiniteDimensional.finBasis Fqt F refine FiniteDimensional.of_fintype_basis (b.mapCoeffs e.symm ?_) intro c x; convert (this (e.symm c) x).symm; simp only [e.apply_symm_apply] #align function_field_iff functionField_iff theorem algebraMap_injective [Algebra Fq[X] F] [Algebra (RatFunc Fq) F] [IsScalarTower Fq[X] (RatFunc Fq) F] : Function.Injective (⇑(algebraMap Fq[X] F)) := by rw [IsScalarTower.algebraMap_eq Fq[X] (RatFunc Fq) F] exact (algebraMap (RatFunc Fq) F).injective.comp (IsFractionRing.injective Fq[X] (RatFunc Fq)) #align algebra_map_injective algebraMap_injective namespace FunctionField def ringOfIntegers [Algebra Fq[X] F] := integralClosure Fq[X] F #align function_field.ring_of_integers FunctionField.ringOfIntegers section InftyValuation variable [DecidableEq (RatFunc Fq)] def inftyValuationDef (r : RatFunc Fq) : β„€β‚˜β‚€ := if r = 0 then 0 else ↑(Multiplicative.ofAdd r.intDegree) #align function_field.infty_valuation_def FunctionField.inftyValuationDef theorem InftyValuation.map_zero' : inftyValuationDef Fq 0 = 0 := if_pos rfl #align function_field.infty_valuation.map_zero' FunctionField.InftyValuation.map_zero' theorem InftyValuation.map_one' : inftyValuationDef Fq 1 = 1 := (if_neg one_ne_zero).trans <| by rw [RatFunc.intDegree_one, ofAdd_zero, WithZero.coe_one] #align function_field.infty_valuation.map_one' FunctionField.InftyValuation.map_one' theorem InftyValuation.map_mul' (x y : RatFunc Fq) : inftyValuationDef Fq (x * y) = inftyValuationDef Fq x * inftyValuationDef Fq y := by rw [inftyValuationDef, inftyValuationDef, inftyValuationDef] by_cases hx : x = 0 Β· rw [hx, zero_mul, if_pos (Eq.refl _), zero_mul] Β· by_cases hy : y = 0 Β· rw [hy, mul_zero, if_pos (Eq.refl _), mul_zero] Β· rw [if_neg hx, if_neg hy, if_neg (mul_ne_zero hx hy), ← WithZero.coe_mul, WithZero.coe_inj, ← ofAdd_add, RatFunc.intDegree_mul hx hy] #align function_field.infty_valuation.map_mul' FunctionField.InftyValuation.map_mul' theorem InftyValuation.map_add_le_max' (x y : RatFunc Fq) : inftyValuationDef Fq (x + y) ≀ max (inftyValuationDef Fq x) (inftyValuationDef Fq y) := by by_cases hx : x = 0 Β· rw [hx, zero_add] conv_rhs => rw [inftyValuationDef, if_pos (Eq.refl _)] rw [max_eq_right (WithZero.zero_le (inftyValuationDef Fq y))] Β· by_cases hy : y = 0 Β· rw [hy, add_zero] conv_rhs => rw [max_comm, inftyValuationDef, if_pos (Eq.refl _)] rw [max_eq_right (WithZero.zero_le (inftyValuationDef Fq x))] Β· by_cases hxy : x + y = 0 Β· rw [inftyValuationDef, if_pos hxy]; exact zero_le' Β· rw [inftyValuationDef, inftyValuationDef, inftyValuationDef, if_neg hx, if_neg hy, if_neg hxy] rw [le_max_iff, WithZero.coe_le_coe, Multiplicative.ofAdd_le, WithZero.coe_le_coe, Multiplicative.ofAdd_le, ← le_max_iff] exact RatFunc.intDegree_add_le hy hxy #align function_field.infty_valuation.map_add_le_max' FunctionField.InftyValuation.map_add_le_max' @[simp]
Mathlib/NumberTheory/FunctionField.lean
199
201
theorem inftyValuation_of_nonzero {x : RatFunc Fq} (hx : x β‰  0) : inftyValuationDef Fq x = Multiplicative.ofAdd x.intDegree := by
rw [inftyValuationDef, if_neg hx]
1
2.718282
0
1.428571
7
1,522
import Mathlib.Topology.GDelta #align_import topology.metric_space.baire from "leanprover-community/mathlib"@"b9e46fe101fc897fb2e7edaf0bf1f09ea49eb81a" noncomputable section open scoped Topology open Filter Set TopologicalSpace variable {X Ξ± : Type*} {ΞΉ : Sort*} section BaireTheorem variable [TopologicalSpace X] [BaireSpace X] theorem dense_iInter_of_isOpen_nat {f : β„• β†’ Set X} (ho : βˆ€ n, IsOpen (f n)) (hd : βˆ€ n, Dense (f n)) : Dense (β‹‚ n, f n) := BaireSpace.baire_property f ho hd #align dense_Inter_of_open_nat dense_iInter_of_isOpen_nat
Mathlib/Topology/Baire/Lemmas.lean
50
55
theorem dense_sInter_of_isOpen {S : Set (Set X)} (ho : βˆ€ s ∈ S, IsOpen s) (hS : S.Countable) (hd : βˆ€ s ∈ S, Dense s) : Dense (β‹‚β‚€ S) := by
rcases S.eq_empty_or_nonempty with h | h · simp [h] · rcases hS.exists_eq_range h with ⟨f, rfl⟩ exact dense_iInter_of_isOpen_nat (forall_mem_range.1 ho) (forall_mem_range.1 hd)
4
54.59815
2
1.428571
7
1,523
import Mathlib.Topology.GDelta #align_import topology.metric_space.baire from "leanprover-community/mathlib"@"b9e46fe101fc897fb2e7edaf0bf1f09ea49eb81a" noncomputable section open scoped Topology open Filter Set TopologicalSpace variable {X Ξ± : Type*} {ΞΉ : Sort*} section BaireTheorem variable [TopologicalSpace X] [BaireSpace X] theorem dense_iInter_of_isOpen_nat {f : β„• β†’ Set X} (ho : βˆ€ n, IsOpen (f n)) (hd : βˆ€ n, Dense (f n)) : Dense (β‹‚ n, f n) := BaireSpace.baire_property f ho hd #align dense_Inter_of_open_nat dense_iInter_of_isOpen_nat theorem dense_sInter_of_isOpen {S : Set (Set X)} (ho : βˆ€ s ∈ S, IsOpen s) (hS : S.Countable) (hd : βˆ€ s ∈ S, Dense s) : Dense (β‹‚β‚€ S) := by rcases S.eq_empty_or_nonempty with h | h Β· simp [h] Β· rcases hS.exists_eq_range h with ⟨f, rfl⟩ exact dense_iInter_of_isOpen_nat (forall_mem_range.1 ho) (forall_mem_range.1 hd) #align dense_sInter_of_open dense_sInter_of_isOpen
Mathlib/Topology/Baire/Lemmas.lean
60
63
theorem dense_biInter_of_isOpen {S : Set Ξ±} {f : Ξ± β†’ Set X} (ho : βˆ€ s ∈ S, IsOpen (f s)) (hS : S.Countable) (hd : βˆ€ s ∈ S, Dense (f s)) : Dense (β‹‚ s ∈ S, f s) := by
rw [← sInter_image] refine dense_sInter_of_isOpen ?_ (hS.image _) ?_ <;> rwa [forall_mem_image]
2
7.389056
1
1.428571
7
1,523
import Mathlib.Topology.GDelta #align_import topology.metric_space.baire from "leanprover-community/mathlib"@"b9e46fe101fc897fb2e7edaf0bf1f09ea49eb81a" noncomputable section open scoped Topology open Filter Set TopologicalSpace variable {X Ξ± : Type*} {ΞΉ : Sort*} section BaireTheorem variable [TopologicalSpace X] [BaireSpace X] theorem dense_iInter_of_isOpen_nat {f : β„• β†’ Set X} (ho : βˆ€ n, IsOpen (f n)) (hd : βˆ€ n, Dense (f n)) : Dense (β‹‚ n, f n) := BaireSpace.baire_property f ho hd #align dense_Inter_of_open_nat dense_iInter_of_isOpen_nat theorem dense_sInter_of_isOpen {S : Set (Set X)} (ho : βˆ€ s ∈ S, IsOpen s) (hS : S.Countable) (hd : βˆ€ s ∈ S, Dense s) : Dense (β‹‚β‚€ S) := by rcases S.eq_empty_or_nonempty with h | h Β· simp [h] Β· rcases hS.exists_eq_range h with ⟨f, rfl⟩ exact dense_iInter_of_isOpen_nat (forall_mem_range.1 ho) (forall_mem_range.1 hd) #align dense_sInter_of_open dense_sInter_of_isOpen theorem dense_biInter_of_isOpen {S : Set Ξ±} {f : Ξ± β†’ Set X} (ho : βˆ€ s ∈ S, IsOpen (f s)) (hS : S.Countable) (hd : βˆ€ s ∈ S, Dense (f s)) : Dense (β‹‚ s ∈ S, f s) := by rw [← sInter_image] refine dense_sInter_of_isOpen ?_ (hS.image _) ?_ <;> rwa [forall_mem_image] #align dense_bInter_of_open dense_biInter_of_isOpen theorem dense_iInter_of_isOpen [Countable ΞΉ] {f : ΞΉ β†’ Set X} (ho : βˆ€ i, IsOpen (f i)) (hd : βˆ€ i, Dense (f i)) : Dense (β‹‚ s, f s) := dense_sInter_of_isOpen (forall_mem_range.2 ho) (countable_range _) (forall_mem_range.2 hd) #align dense_Inter_of_open dense_iInter_of_isOpen
Mathlib/Topology/Baire/Lemmas.lean
74
81
theorem mem_residual {s : Set X} : s ∈ residual X ↔ βˆƒ t βŠ† s, IsGΞ΄ t ∧ Dense t := by
constructor · rw [mem_residual_iff] rintro ⟨S, hSo, hSd, Sct, Ss⟩ refine ⟨_, Ss, ⟨_, fun t ht => hSo _ ht, Sct, rfl⟩, ?_⟩ exact dense_sInter_of_isOpen hSo Sct hSd rintro ⟨t, ts, ho, hd⟩ exact mem_of_superset (residual_of_dense_Gδ ho hd) ts
7
1,096.633158
2
1.428571
7
1,523
import Mathlib.Topology.GDelta #align_import topology.metric_space.baire from "leanprover-community/mathlib"@"b9e46fe101fc897fb2e7edaf0bf1f09ea49eb81a" noncomputable section open scoped Topology open Filter Set TopologicalSpace variable {X Ξ± : Type*} {ΞΉ : Sort*} section BaireTheorem variable [TopologicalSpace X] [BaireSpace X] theorem dense_iInter_of_isOpen_nat {f : β„• β†’ Set X} (ho : βˆ€ n, IsOpen (f n)) (hd : βˆ€ n, Dense (f n)) : Dense (β‹‚ n, f n) := BaireSpace.baire_property f ho hd #align dense_Inter_of_open_nat dense_iInter_of_isOpen_nat theorem dense_sInter_of_isOpen {S : Set (Set X)} (ho : βˆ€ s ∈ S, IsOpen s) (hS : S.Countable) (hd : βˆ€ s ∈ S, Dense s) : Dense (β‹‚β‚€ S) := by rcases S.eq_empty_or_nonempty with h | h Β· simp [h] Β· rcases hS.exists_eq_range h with ⟨f, rfl⟩ exact dense_iInter_of_isOpen_nat (forall_mem_range.1 ho) (forall_mem_range.1 hd) #align dense_sInter_of_open dense_sInter_of_isOpen theorem dense_biInter_of_isOpen {S : Set Ξ±} {f : Ξ± β†’ Set X} (ho : βˆ€ s ∈ S, IsOpen (f s)) (hS : S.Countable) (hd : βˆ€ s ∈ S, Dense (f s)) : Dense (β‹‚ s ∈ S, f s) := by rw [← sInter_image] refine dense_sInter_of_isOpen ?_ (hS.image _) ?_ <;> rwa [forall_mem_image] #align dense_bInter_of_open dense_biInter_of_isOpen theorem dense_iInter_of_isOpen [Countable ΞΉ] {f : ΞΉ β†’ Set X} (ho : βˆ€ i, IsOpen (f i)) (hd : βˆ€ i, Dense (f i)) : Dense (β‹‚ s, f s) := dense_sInter_of_isOpen (forall_mem_range.2 ho) (countable_range _) (forall_mem_range.2 hd) #align dense_Inter_of_open dense_iInter_of_isOpen theorem mem_residual {s : Set X} : s ∈ residual X ↔ βˆƒ t βŠ† s, IsGΞ΄ t ∧ Dense t := by constructor Β· rw [mem_residual_iff] rintro ⟨S, hSo, hSd, Sct, Ss⟩ refine ⟨_, Ss, ⟨_, fun t ht => hSo _ ht, Sct, rfl⟩, ?_⟩ exact dense_sInter_of_isOpen hSo Sct hSd rintro ⟨t, ts, ho, hd⟩ exact mem_of_superset (residual_of_dense_GΞ΄ ho hd) ts #align mem_residual mem_residual
Mathlib/Topology/Baire/Lemmas.lean
85
88
theorem eventually_residual {p : X β†’ Prop} : (βˆ€αΆ  x in residual X, p x) ↔ βˆƒ t : Set X, IsGΞ΄ t ∧ Dense t ∧ βˆ€ x ∈ t, p x := by
simp only [Filter.Eventually, mem_residual, subset_def, mem_setOf_eq] tauto
2
7.389056
1
1.428571
7
1,523
import Mathlib.Topology.GDelta #align_import topology.metric_space.baire from "leanprover-community/mathlib"@"b9e46fe101fc897fb2e7edaf0bf1f09ea49eb81a" noncomputable section open scoped Topology open Filter Set TopologicalSpace variable {X Ξ± : Type*} {ΞΉ : Sort*} section BaireTheorem variable [TopologicalSpace X] [BaireSpace X] theorem dense_iInter_of_isOpen_nat {f : β„• β†’ Set X} (ho : βˆ€ n, IsOpen (f n)) (hd : βˆ€ n, Dense (f n)) : Dense (β‹‚ n, f n) := BaireSpace.baire_property f ho hd #align dense_Inter_of_open_nat dense_iInter_of_isOpen_nat theorem dense_sInter_of_isOpen {S : Set (Set X)} (ho : βˆ€ s ∈ S, IsOpen s) (hS : S.Countable) (hd : βˆ€ s ∈ S, Dense s) : Dense (β‹‚β‚€ S) := by rcases S.eq_empty_or_nonempty with h | h Β· simp [h] Β· rcases hS.exists_eq_range h with ⟨f, rfl⟩ exact dense_iInter_of_isOpen_nat (forall_mem_range.1 ho) (forall_mem_range.1 hd) #align dense_sInter_of_open dense_sInter_of_isOpen theorem dense_biInter_of_isOpen {S : Set Ξ±} {f : Ξ± β†’ Set X} (ho : βˆ€ s ∈ S, IsOpen (f s)) (hS : S.Countable) (hd : βˆ€ s ∈ S, Dense (f s)) : Dense (β‹‚ s ∈ S, f s) := by rw [← sInter_image] refine dense_sInter_of_isOpen ?_ (hS.image _) ?_ <;> rwa [forall_mem_image] #align dense_bInter_of_open dense_biInter_of_isOpen theorem dense_iInter_of_isOpen [Countable ΞΉ] {f : ΞΉ β†’ Set X} (ho : βˆ€ i, IsOpen (f i)) (hd : βˆ€ i, Dense (f i)) : Dense (β‹‚ s, f s) := dense_sInter_of_isOpen (forall_mem_range.2 ho) (countable_range _) (forall_mem_range.2 hd) #align dense_Inter_of_open dense_iInter_of_isOpen theorem mem_residual {s : Set X} : s ∈ residual X ↔ βˆƒ t βŠ† s, IsGΞ΄ t ∧ Dense t := by constructor Β· rw [mem_residual_iff] rintro ⟨S, hSo, hSd, Sct, Ss⟩ refine ⟨_, Ss, ⟨_, fun t ht => hSo _ ht, Sct, rfl⟩, ?_⟩ exact dense_sInter_of_isOpen hSo Sct hSd rintro ⟨t, ts, ho, hd⟩ exact mem_of_superset (residual_of_dense_GΞ΄ ho hd) ts #align mem_residual mem_residual theorem eventually_residual {p : X β†’ Prop} : (βˆ€αΆ  x in residual X, p x) ↔ βˆƒ t : Set X, IsGΞ΄ t ∧ Dense t ∧ βˆ€ x ∈ t, p x := by simp only [Filter.Eventually, mem_residual, subset_def, mem_setOf_eq] tauto #align eventually_residual eventually_residual theorem dense_of_mem_residual {s : Set X} (hs : s ∈ residual X) : Dense s := let ⟨_, hts, _, hd⟩ := mem_residual.1 hs hd.mono hts #align dense_of_mem_residual dense_of_mem_residual theorem dense_sInter_of_GΞ΄ {S : Set (Set X)} (ho : βˆ€ s ∈ S, IsGΞ΄ s) (hS : S.Countable) (hd : βˆ€ s ∈ S, Dense s) : Dense (β‹‚β‚€ S) := dense_of_mem_residual ((countable_sInter_mem hS).mpr (fun _ hs => residual_of_dense_GΞ΄ (ho _ hs) (hd _ hs))) set_option linter.uppercaseLean3 false in #align dense_sInter_of_GΞ΄ dense_sInter_of_GΞ΄ theorem dense_iInter_of_GΞ΄ [Countable ΞΉ] {f : ΞΉ β†’ Set X} (ho : βˆ€ s, IsGΞ΄ (f s)) (hd : βˆ€ s, Dense (f s)) : Dense (β‹‚ s, f s) := dense_sInter_of_GΞ΄ (forall_mem_range.2 β€Ή_β€Ί) (countable_range _) (forall_mem_range.2 β€Ή_β€Ί) set_option linter.uppercaseLean3 false in #align dense_Inter_of_GΞ΄ dense_iInter_of_GΞ΄
Mathlib/Topology/Baire/Lemmas.lean
114
118
theorem dense_biInter_of_GΞ΄ {S : Set Ξ±} {f : βˆ€ x ∈ S, Set X} (ho : βˆ€ s (H : s ∈ S), IsGΞ΄ (f s H)) (hS : S.Countable) (hd : βˆ€ s (H : s ∈ S), Dense (f s H)) : Dense (β‹‚ s ∈ S, f s β€Ή_β€Ί) := by
rw [biInter_eq_iInter] haveI := hS.to_subtype exact dense_iInter_of_GΞ΄ (fun s => ho s s.2) fun s => hd s s.2
3
20.085537
1
1.428571
7
1,523
import Mathlib.Topology.GDelta #align_import topology.metric_space.baire from "leanprover-community/mathlib"@"b9e46fe101fc897fb2e7edaf0bf1f09ea49eb81a" noncomputable section open scoped Topology open Filter Set TopologicalSpace variable {X Ξ± : Type*} {ΞΉ : Sort*} section BaireTheorem variable [TopologicalSpace X] [BaireSpace X] theorem dense_iInter_of_isOpen_nat {f : β„• β†’ Set X} (ho : βˆ€ n, IsOpen (f n)) (hd : βˆ€ n, Dense (f n)) : Dense (β‹‚ n, f n) := BaireSpace.baire_property f ho hd #align dense_Inter_of_open_nat dense_iInter_of_isOpen_nat theorem dense_sInter_of_isOpen {S : Set (Set X)} (ho : βˆ€ s ∈ S, IsOpen s) (hS : S.Countable) (hd : βˆ€ s ∈ S, Dense s) : Dense (β‹‚β‚€ S) := by rcases S.eq_empty_or_nonempty with h | h Β· simp [h] Β· rcases hS.exists_eq_range h with ⟨f, rfl⟩ exact dense_iInter_of_isOpen_nat (forall_mem_range.1 ho) (forall_mem_range.1 hd) #align dense_sInter_of_open dense_sInter_of_isOpen theorem dense_biInter_of_isOpen {S : Set Ξ±} {f : Ξ± β†’ Set X} (ho : βˆ€ s ∈ S, IsOpen (f s)) (hS : S.Countable) (hd : βˆ€ s ∈ S, Dense (f s)) : Dense (β‹‚ s ∈ S, f s) := by rw [← sInter_image] refine dense_sInter_of_isOpen ?_ (hS.image _) ?_ <;> rwa [forall_mem_image] #align dense_bInter_of_open dense_biInter_of_isOpen theorem dense_iInter_of_isOpen [Countable ΞΉ] {f : ΞΉ β†’ Set X} (ho : βˆ€ i, IsOpen (f i)) (hd : βˆ€ i, Dense (f i)) : Dense (β‹‚ s, f s) := dense_sInter_of_isOpen (forall_mem_range.2 ho) (countable_range _) (forall_mem_range.2 hd) #align dense_Inter_of_open dense_iInter_of_isOpen theorem mem_residual {s : Set X} : s ∈ residual X ↔ βˆƒ t βŠ† s, IsGΞ΄ t ∧ Dense t := by constructor Β· rw [mem_residual_iff] rintro ⟨S, hSo, hSd, Sct, Ss⟩ refine ⟨_, Ss, ⟨_, fun t ht => hSo _ ht, Sct, rfl⟩, ?_⟩ exact dense_sInter_of_isOpen hSo Sct hSd rintro ⟨t, ts, ho, hd⟩ exact mem_of_superset (residual_of_dense_GΞ΄ ho hd) ts #align mem_residual mem_residual theorem eventually_residual {p : X β†’ Prop} : (βˆ€αΆ  x in residual X, p x) ↔ βˆƒ t : Set X, IsGΞ΄ t ∧ Dense t ∧ βˆ€ x ∈ t, p x := by simp only [Filter.Eventually, mem_residual, subset_def, mem_setOf_eq] tauto #align eventually_residual eventually_residual theorem dense_of_mem_residual {s : Set X} (hs : s ∈ residual X) : Dense s := let ⟨_, hts, _, hd⟩ := mem_residual.1 hs hd.mono hts #align dense_of_mem_residual dense_of_mem_residual theorem dense_sInter_of_GΞ΄ {S : Set (Set X)} (ho : βˆ€ s ∈ S, IsGΞ΄ s) (hS : S.Countable) (hd : βˆ€ s ∈ S, Dense s) : Dense (β‹‚β‚€ S) := dense_of_mem_residual ((countable_sInter_mem hS).mpr (fun _ hs => residual_of_dense_GΞ΄ (ho _ hs) (hd _ hs))) set_option linter.uppercaseLean3 false in #align dense_sInter_of_GΞ΄ dense_sInter_of_GΞ΄ theorem dense_iInter_of_GΞ΄ [Countable ΞΉ] {f : ΞΉ β†’ Set X} (ho : βˆ€ s, IsGΞ΄ (f s)) (hd : βˆ€ s, Dense (f s)) : Dense (β‹‚ s, f s) := dense_sInter_of_GΞ΄ (forall_mem_range.2 β€Ή_β€Ί) (countable_range _) (forall_mem_range.2 β€Ή_β€Ί) set_option linter.uppercaseLean3 false in #align dense_Inter_of_GΞ΄ dense_iInter_of_GΞ΄ theorem dense_biInter_of_GΞ΄ {S : Set Ξ±} {f : βˆ€ x ∈ S, Set X} (ho : βˆ€ s (H : s ∈ S), IsGΞ΄ (f s H)) (hS : S.Countable) (hd : βˆ€ s (H : s ∈ S), Dense (f s H)) : Dense (β‹‚ s ∈ S, f s β€Ή_β€Ί) := by rw [biInter_eq_iInter] haveI := hS.to_subtype exact dense_iInter_of_GΞ΄ (fun s => ho s s.2) fun s => hd s s.2 set_option linter.uppercaseLean3 false in #align dense_bInter_of_GΞ΄ dense_biInter_of_GΞ΄
Mathlib/Topology/Baire/Lemmas.lean
123
126
theorem Dense.inter_of_Gδ {s t : Set X} (hs : IsGδ s) (ht : IsGδ t) (hsc : Dense s) (htc : Dense t) : Dense (s ∩ t) := by
rw [inter_eq_iInter] apply dense_iInter_of_GΞ΄ <;> simp [Bool.forall_bool, *]
2
7.389056
1
1.428571
7
1,523
import Mathlib.Topology.GDelta #align_import topology.metric_space.baire from "leanprover-community/mathlib"@"b9e46fe101fc897fb2e7edaf0bf1f09ea49eb81a" noncomputable section open scoped Topology open Filter Set TopologicalSpace variable {X Ξ± : Type*} {ΞΉ : Sort*} section BaireTheorem variable [TopologicalSpace X] [BaireSpace X] theorem dense_iInter_of_isOpen_nat {f : β„• β†’ Set X} (ho : βˆ€ n, IsOpen (f n)) (hd : βˆ€ n, Dense (f n)) : Dense (β‹‚ n, f n) := BaireSpace.baire_property f ho hd #align dense_Inter_of_open_nat dense_iInter_of_isOpen_nat theorem dense_sInter_of_isOpen {S : Set (Set X)} (ho : βˆ€ s ∈ S, IsOpen s) (hS : S.Countable) (hd : βˆ€ s ∈ S, Dense s) : Dense (β‹‚β‚€ S) := by rcases S.eq_empty_or_nonempty with h | h Β· simp [h] Β· rcases hS.exists_eq_range h with ⟨f, rfl⟩ exact dense_iInter_of_isOpen_nat (forall_mem_range.1 ho) (forall_mem_range.1 hd) #align dense_sInter_of_open dense_sInter_of_isOpen theorem dense_biInter_of_isOpen {S : Set Ξ±} {f : Ξ± β†’ Set X} (ho : βˆ€ s ∈ S, IsOpen (f s)) (hS : S.Countable) (hd : βˆ€ s ∈ S, Dense (f s)) : Dense (β‹‚ s ∈ S, f s) := by rw [← sInter_image] refine dense_sInter_of_isOpen ?_ (hS.image _) ?_ <;> rwa [forall_mem_image] #align dense_bInter_of_open dense_biInter_of_isOpen theorem dense_iInter_of_isOpen [Countable ΞΉ] {f : ΞΉ β†’ Set X} (ho : βˆ€ i, IsOpen (f i)) (hd : βˆ€ i, Dense (f i)) : Dense (β‹‚ s, f s) := dense_sInter_of_isOpen (forall_mem_range.2 ho) (countable_range _) (forall_mem_range.2 hd) #align dense_Inter_of_open dense_iInter_of_isOpen theorem mem_residual {s : Set X} : s ∈ residual X ↔ βˆƒ t βŠ† s, IsGΞ΄ t ∧ Dense t := by constructor Β· rw [mem_residual_iff] rintro ⟨S, hSo, hSd, Sct, Ss⟩ refine ⟨_, Ss, ⟨_, fun t ht => hSo _ ht, Sct, rfl⟩, ?_⟩ exact dense_sInter_of_isOpen hSo Sct hSd rintro ⟨t, ts, ho, hd⟩ exact mem_of_superset (residual_of_dense_GΞ΄ ho hd) ts #align mem_residual mem_residual theorem eventually_residual {p : X β†’ Prop} : (βˆ€αΆ  x in residual X, p x) ↔ βˆƒ t : Set X, IsGΞ΄ t ∧ Dense t ∧ βˆ€ x ∈ t, p x := by simp only [Filter.Eventually, mem_residual, subset_def, mem_setOf_eq] tauto #align eventually_residual eventually_residual theorem dense_of_mem_residual {s : Set X} (hs : s ∈ residual X) : Dense s := let ⟨_, hts, _, hd⟩ := mem_residual.1 hs hd.mono hts #align dense_of_mem_residual dense_of_mem_residual theorem dense_sInter_of_GΞ΄ {S : Set (Set X)} (ho : βˆ€ s ∈ S, IsGΞ΄ s) (hS : S.Countable) (hd : βˆ€ s ∈ S, Dense s) : Dense (β‹‚β‚€ S) := dense_of_mem_residual ((countable_sInter_mem hS).mpr (fun _ hs => residual_of_dense_GΞ΄ (ho _ hs) (hd _ hs))) set_option linter.uppercaseLean3 false in #align dense_sInter_of_GΞ΄ dense_sInter_of_GΞ΄ theorem dense_iInter_of_GΞ΄ [Countable ΞΉ] {f : ΞΉ β†’ Set X} (ho : βˆ€ s, IsGΞ΄ (f s)) (hd : βˆ€ s, Dense (f s)) : Dense (β‹‚ s, f s) := dense_sInter_of_GΞ΄ (forall_mem_range.2 β€Ή_β€Ί) (countable_range _) (forall_mem_range.2 β€Ή_β€Ί) set_option linter.uppercaseLean3 false in #align dense_Inter_of_GΞ΄ dense_iInter_of_GΞ΄ theorem dense_biInter_of_GΞ΄ {S : Set Ξ±} {f : βˆ€ x ∈ S, Set X} (ho : βˆ€ s (H : s ∈ S), IsGΞ΄ (f s H)) (hS : S.Countable) (hd : βˆ€ s (H : s ∈ S), Dense (f s H)) : Dense (β‹‚ s ∈ S, f s β€Ή_β€Ί) := by rw [biInter_eq_iInter] haveI := hS.to_subtype exact dense_iInter_of_GΞ΄ (fun s => ho s s.2) fun s => hd s s.2 set_option linter.uppercaseLean3 false in #align dense_bInter_of_GΞ΄ dense_biInter_of_GΞ΄ theorem Dense.inter_of_GΞ΄ {s t : Set X} (hs : IsGΞ΄ s) (ht : IsGΞ΄ t) (hsc : Dense s) (htc : Dense t) : Dense (s ∩ t) := by rw [inter_eq_iInter] apply dense_iInter_of_GΞ΄ <;> simp [Bool.forall_bool, *] set_option linter.uppercaseLean3 false in #align dense.inter_of_GΞ΄ Dense.inter_of_GΞ΄
Mathlib/Topology/Baire/Lemmas.lean
132
145
theorem IsGΞ΄.dense_iUnion_interior_of_closed [Countable ΞΉ] {s : Set X} (hs : IsGΞ΄ s) (hd : Dense s) {f : ΞΉ β†’ Set X} (hc : βˆ€ i, IsClosed (f i)) (hU : s βŠ† ⋃ i, f i) : Dense (⋃ i, interior (f i)) := by
let g i := (frontier (f i))ᢜ have hgo : βˆ€ i, IsOpen (g i) := fun i => isClosed_frontier.isOpen_compl have hgd : Dense (β‹‚ i, g i) := by refine dense_iInter_of_isOpen hgo fun i x => ?_ rw [closure_compl, interior_frontier (hc _)] exact id refine (hd.inter_of_GΞ΄ hs (.iInter_of_isOpen fun i => (hgo i)) hgd).mono ?_ rintro x ⟨hxs, hxg⟩ rw [mem_iInter] at hxg rcases mem_iUnion.1 (hU hxs) with ⟨i, hi⟩ exact mem_iUnion.2 ⟨i, self_diff_frontier (f i) β–Έ ⟨hi, hxg _⟩⟩
11
59,874.141715
2
1.428571
7
1,523
import Mathlib.Combinatorics.Enumerative.DoubleCounting import Mathlib.Combinatorics.SimpleGraph.AdjMatrix import Mathlib.Combinatorics.SimpleGraph.Basic import Mathlib.Data.Set.Finite #align_import combinatorics.simple_graph.strongly_regular from "leanprover-community/mathlib"@"2b35fc7bea4640cb75e477e83f32fbd538920822" open Finset universe u namespace SimpleGraph variable {V : Type u} [Fintype V] [DecidableEq V] variable (G : SimpleGraph V) [DecidableRel G.Adj] structure IsSRGWith (n k β„“ ΞΌ : β„•) : Prop where card : Fintype.card V = n regular : G.IsRegularOfDegree k of_adj : βˆ€ v w : V, G.Adj v w β†’ Fintype.card (G.commonNeighbors v w) = β„“ of_not_adj : Pairwise fun v w => Β¬G.Adj v w β†’ Fintype.card (G.commonNeighbors v w) = ΞΌ set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with SimpleGraph.IsSRGWith variable {G} {n k β„“ ΞΌ : β„•} theorem bot_strongly_regular : (βŠ₯ : SimpleGraph V).IsSRGWith (Fintype.card V) 0 β„“ 0 where card := rfl regular := bot_degree of_adj := fun v w h => h.elim of_not_adj := fun v w _h => by simp only [card_eq_zero, Fintype.card_ofFinset, forall_true_left, not_false_iff, bot_adj] ext simp [mem_commonNeighbors] #align simple_graph.bot_strongly_regular SimpleGraph.bot_strongly_regular theorem IsSRGWith.top : (⊀ : SimpleGraph V).IsSRGWith (Fintype.card V) (Fintype.card V - 1) (Fintype.card V - 2) ΞΌ where card := rfl regular := IsRegularOfDegree.top of_adj := fun v w h => by rw [card_commonNeighbors_top] exact h of_not_adj := fun v w h h' => False.elim (h' ((top_adj v w).2 h)) set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.top SimpleGraph.IsSRGWith.top
Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean
84
95
theorem IsSRGWith.card_neighborFinset_union_eq {v w : V} (h : G.IsSRGWith n k β„“ ΞΌ) : (G.neighborFinset v βˆͺ G.neighborFinset w).card = 2 * k - Fintype.card (G.commonNeighbors v w) := by
apply Nat.add_right_cancel (m := Fintype.card (G.commonNeighbors v w)) rw [Nat.sub_add_cancel, ← Set.toFinset_card] -- Porting note: Set.toFinset_inter needs workaround to use unification to solve for one of the -- instance arguments: Β· simp [commonNeighbors, @Set.toFinset_inter _ _ _ _ _ _ (_), ← neighborFinset_def, Finset.card_union_add_card_inter, card_neighborFinset_eq_degree, h.regular.degree_eq, two_mul] Β· apply le_trans (card_commonNeighbors_le_degree_left _ _ _) simp [h.regular.degree_eq, two_mul]
9
8,103.083928
2
1.428571
7
1,524
import Mathlib.Combinatorics.Enumerative.DoubleCounting import Mathlib.Combinatorics.SimpleGraph.AdjMatrix import Mathlib.Combinatorics.SimpleGraph.Basic import Mathlib.Data.Set.Finite #align_import combinatorics.simple_graph.strongly_regular from "leanprover-community/mathlib"@"2b35fc7bea4640cb75e477e83f32fbd538920822" open Finset universe u namespace SimpleGraph variable {V : Type u} [Fintype V] [DecidableEq V] variable (G : SimpleGraph V) [DecidableRel G.Adj] structure IsSRGWith (n k β„“ ΞΌ : β„•) : Prop where card : Fintype.card V = n regular : G.IsRegularOfDegree k of_adj : βˆ€ v w : V, G.Adj v w β†’ Fintype.card (G.commonNeighbors v w) = β„“ of_not_adj : Pairwise fun v w => Β¬G.Adj v w β†’ Fintype.card (G.commonNeighbors v w) = ΞΌ set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with SimpleGraph.IsSRGWith variable {G} {n k β„“ ΞΌ : β„•} theorem bot_strongly_regular : (βŠ₯ : SimpleGraph V).IsSRGWith (Fintype.card V) 0 β„“ 0 where card := rfl regular := bot_degree of_adj := fun v w h => h.elim of_not_adj := fun v w _h => by simp only [card_eq_zero, Fintype.card_ofFinset, forall_true_left, not_false_iff, bot_adj] ext simp [mem_commonNeighbors] #align simple_graph.bot_strongly_regular SimpleGraph.bot_strongly_regular theorem IsSRGWith.top : (⊀ : SimpleGraph V).IsSRGWith (Fintype.card V) (Fintype.card V - 1) (Fintype.card V - 2) ΞΌ where card := rfl regular := IsRegularOfDegree.top of_adj := fun v w h => by rw [card_commonNeighbors_top] exact h of_not_adj := fun v w h h' => False.elim (h' ((top_adj v w).2 h)) set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.top SimpleGraph.IsSRGWith.top theorem IsSRGWith.card_neighborFinset_union_eq {v w : V} (h : G.IsSRGWith n k β„“ ΞΌ) : (G.neighborFinset v βˆͺ G.neighborFinset w).card = 2 * k - Fintype.card (G.commonNeighbors v w) := by apply Nat.add_right_cancel (m := Fintype.card (G.commonNeighbors v w)) rw [Nat.sub_add_cancel, ← Set.toFinset_card] -- Porting note: Set.toFinset_inter needs workaround to use unification to solve for one of the -- instance arguments: Β· simp [commonNeighbors, @Set.toFinset_inter _ _ _ _ _ _ (_), ← neighborFinset_def, Finset.card_union_add_card_inter, card_neighborFinset_eq_degree, h.regular.degree_eq, two_mul] Β· apply le_trans (card_commonNeighbors_le_degree_left _ _ _) simp [h.regular.degree_eq, two_mul] set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.card_neighbor_finset_union_eq SimpleGraph.IsSRGWith.card_neighborFinset_union_eq
Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean
102
106
theorem IsSRGWith.card_neighborFinset_union_of_not_adj {v w : V} (h : G.IsSRGWith n k β„“ ΞΌ) (hne : v β‰  w) (ha : Β¬G.Adj v w) : (G.neighborFinset v βˆͺ G.neighborFinset w).card = 2 * k - ΞΌ := by
rw [← h.of_not_adj hne ha] apply h.card_neighborFinset_union_eq
2
7.389056
1
1.428571
7
1,524
import Mathlib.Combinatorics.Enumerative.DoubleCounting import Mathlib.Combinatorics.SimpleGraph.AdjMatrix import Mathlib.Combinatorics.SimpleGraph.Basic import Mathlib.Data.Set.Finite #align_import combinatorics.simple_graph.strongly_regular from "leanprover-community/mathlib"@"2b35fc7bea4640cb75e477e83f32fbd538920822" open Finset universe u namespace SimpleGraph variable {V : Type u} [Fintype V] [DecidableEq V] variable (G : SimpleGraph V) [DecidableRel G.Adj] structure IsSRGWith (n k β„“ ΞΌ : β„•) : Prop where card : Fintype.card V = n regular : G.IsRegularOfDegree k of_adj : βˆ€ v w : V, G.Adj v w β†’ Fintype.card (G.commonNeighbors v w) = β„“ of_not_adj : Pairwise fun v w => Β¬G.Adj v w β†’ Fintype.card (G.commonNeighbors v w) = ΞΌ set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with SimpleGraph.IsSRGWith variable {G} {n k β„“ ΞΌ : β„•} theorem bot_strongly_regular : (βŠ₯ : SimpleGraph V).IsSRGWith (Fintype.card V) 0 β„“ 0 where card := rfl regular := bot_degree of_adj := fun v w h => h.elim of_not_adj := fun v w _h => by simp only [card_eq_zero, Fintype.card_ofFinset, forall_true_left, not_false_iff, bot_adj] ext simp [mem_commonNeighbors] #align simple_graph.bot_strongly_regular SimpleGraph.bot_strongly_regular theorem IsSRGWith.top : (⊀ : SimpleGraph V).IsSRGWith (Fintype.card V) (Fintype.card V - 1) (Fintype.card V - 2) ΞΌ where card := rfl regular := IsRegularOfDegree.top of_adj := fun v w h => by rw [card_commonNeighbors_top] exact h of_not_adj := fun v w h h' => False.elim (h' ((top_adj v w).2 h)) set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.top SimpleGraph.IsSRGWith.top theorem IsSRGWith.card_neighborFinset_union_eq {v w : V} (h : G.IsSRGWith n k β„“ ΞΌ) : (G.neighborFinset v βˆͺ G.neighborFinset w).card = 2 * k - Fintype.card (G.commonNeighbors v w) := by apply Nat.add_right_cancel (m := Fintype.card (G.commonNeighbors v w)) rw [Nat.sub_add_cancel, ← Set.toFinset_card] -- Porting note: Set.toFinset_inter needs workaround to use unification to solve for one of the -- instance arguments: Β· simp [commonNeighbors, @Set.toFinset_inter _ _ _ _ _ _ (_), ← neighborFinset_def, Finset.card_union_add_card_inter, card_neighborFinset_eq_degree, h.regular.degree_eq, two_mul] Β· apply le_trans (card_commonNeighbors_le_degree_left _ _ _) simp [h.regular.degree_eq, two_mul] set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.card_neighbor_finset_union_eq SimpleGraph.IsSRGWith.card_neighborFinset_union_eq theorem IsSRGWith.card_neighborFinset_union_of_not_adj {v w : V} (h : G.IsSRGWith n k β„“ ΞΌ) (hne : v β‰  w) (ha : Β¬G.Adj v w) : (G.neighborFinset v βˆͺ G.neighborFinset w).card = 2 * k - ΞΌ := by rw [← h.of_not_adj hne ha] apply h.card_neighborFinset_union_eq set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.card_neighbor_finset_union_of_not_adj SimpleGraph.IsSRGWith.card_neighborFinset_union_of_not_adj
Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean
110
113
theorem IsSRGWith.card_neighborFinset_union_of_adj {v w : V} (h : G.IsSRGWith n k β„“ ΞΌ) (ha : G.Adj v w) : (G.neighborFinset v βˆͺ G.neighborFinset w).card = 2 * k - β„“ := by
rw [← h.of_adj v w ha] apply h.card_neighborFinset_union_eq
2
7.389056
1
1.428571
7
1,524
import Mathlib.Combinatorics.Enumerative.DoubleCounting import Mathlib.Combinatorics.SimpleGraph.AdjMatrix import Mathlib.Combinatorics.SimpleGraph.Basic import Mathlib.Data.Set.Finite #align_import combinatorics.simple_graph.strongly_regular from "leanprover-community/mathlib"@"2b35fc7bea4640cb75e477e83f32fbd538920822" open Finset universe u namespace SimpleGraph variable {V : Type u} [Fintype V] [DecidableEq V] variable (G : SimpleGraph V) [DecidableRel G.Adj] structure IsSRGWith (n k β„“ ΞΌ : β„•) : Prop where card : Fintype.card V = n regular : G.IsRegularOfDegree k of_adj : βˆ€ v w : V, G.Adj v w β†’ Fintype.card (G.commonNeighbors v w) = β„“ of_not_adj : Pairwise fun v w => Β¬G.Adj v w β†’ Fintype.card (G.commonNeighbors v w) = ΞΌ set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with SimpleGraph.IsSRGWith variable {G} {n k β„“ ΞΌ : β„•} theorem bot_strongly_regular : (βŠ₯ : SimpleGraph V).IsSRGWith (Fintype.card V) 0 β„“ 0 where card := rfl regular := bot_degree of_adj := fun v w h => h.elim of_not_adj := fun v w _h => by simp only [card_eq_zero, Fintype.card_ofFinset, forall_true_left, not_false_iff, bot_adj] ext simp [mem_commonNeighbors] #align simple_graph.bot_strongly_regular SimpleGraph.bot_strongly_regular theorem IsSRGWith.top : (⊀ : SimpleGraph V).IsSRGWith (Fintype.card V) (Fintype.card V - 1) (Fintype.card V - 2) ΞΌ where card := rfl regular := IsRegularOfDegree.top of_adj := fun v w h => by rw [card_commonNeighbors_top] exact h of_not_adj := fun v w h h' => False.elim (h' ((top_adj v w).2 h)) set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.top SimpleGraph.IsSRGWith.top theorem IsSRGWith.card_neighborFinset_union_eq {v w : V} (h : G.IsSRGWith n k β„“ ΞΌ) : (G.neighborFinset v βˆͺ G.neighborFinset w).card = 2 * k - Fintype.card (G.commonNeighbors v w) := by apply Nat.add_right_cancel (m := Fintype.card (G.commonNeighbors v w)) rw [Nat.sub_add_cancel, ← Set.toFinset_card] -- Porting note: Set.toFinset_inter needs workaround to use unification to solve for one of the -- instance arguments: Β· simp [commonNeighbors, @Set.toFinset_inter _ _ _ _ _ _ (_), ← neighborFinset_def, Finset.card_union_add_card_inter, card_neighborFinset_eq_degree, h.regular.degree_eq, two_mul] Β· apply le_trans (card_commonNeighbors_le_degree_left _ _ _) simp [h.regular.degree_eq, two_mul] set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.card_neighbor_finset_union_eq SimpleGraph.IsSRGWith.card_neighborFinset_union_eq theorem IsSRGWith.card_neighborFinset_union_of_not_adj {v w : V} (h : G.IsSRGWith n k β„“ ΞΌ) (hne : v β‰  w) (ha : Β¬G.Adj v w) : (G.neighborFinset v βˆͺ G.neighborFinset w).card = 2 * k - ΞΌ := by rw [← h.of_not_adj hne ha] apply h.card_neighborFinset_union_eq set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.card_neighbor_finset_union_of_not_adj SimpleGraph.IsSRGWith.card_neighborFinset_union_of_not_adj theorem IsSRGWith.card_neighborFinset_union_of_adj {v w : V} (h : G.IsSRGWith n k β„“ ΞΌ) (ha : G.Adj v w) : (G.neighborFinset v βˆͺ G.neighborFinset w).card = 2 * k - β„“ := by rw [← h.of_adj v w ha] apply h.card_neighborFinset_union_eq set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.card_neighbor_finset_union_of_adj SimpleGraph.IsSRGWith.card_neighborFinset_union_of_adj
Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean
117
122
theorem compl_neighborFinset_sdiff_inter_eq {v w : V} : (G.neighborFinset v)ᢜ \ {v} ∩ ((G.neighborFinset w)ᢜ \ {w}) = ((G.neighborFinset v)ᢜ ∩ (G.neighborFinset w)ᢜ) \ ({w} βˆͺ {v}) := by
ext rw [← not_iff_not] simp [imp_iff_not_or, or_assoc, or_comm, or_left_comm]
3
20.085537
1
1.428571
7
1,524
import Mathlib.Combinatorics.Enumerative.DoubleCounting import Mathlib.Combinatorics.SimpleGraph.AdjMatrix import Mathlib.Combinatorics.SimpleGraph.Basic import Mathlib.Data.Set.Finite #align_import combinatorics.simple_graph.strongly_regular from "leanprover-community/mathlib"@"2b35fc7bea4640cb75e477e83f32fbd538920822" open Finset universe u namespace SimpleGraph variable {V : Type u} [Fintype V] [DecidableEq V] variable (G : SimpleGraph V) [DecidableRel G.Adj] structure IsSRGWith (n k β„“ ΞΌ : β„•) : Prop where card : Fintype.card V = n regular : G.IsRegularOfDegree k of_adj : βˆ€ v w : V, G.Adj v w β†’ Fintype.card (G.commonNeighbors v w) = β„“ of_not_adj : Pairwise fun v w => Β¬G.Adj v w β†’ Fintype.card (G.commonNeighbors v w) = ΞΌ set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with SimpleGraph.IsSRGWith variable {G} {n k β„“ ΞΌ : β„•} theorem bot_strongly_regular : (βŠ₯ : SimpleGraph V).IsSRGWith (Fintype.card V) 0 β„“ 0 where card := rfl regular := bot_degree of_adj := fun v w h => h.elim of_not_adj := fun v w _h => by simp only [card_eq_zero, Fintype.card_ofFinset, forall_true_left, not_false_iff, bot_adj] ext simp [mem_commonNeighbors] #align simple_graph.bot_strongly_regular SimpleGraph.bot_strongly_regular theorem IsSRGWith.top : (⊀ : SimpleGraph V).IsSRGWith (Fintype.card V) (Fintype.card V - 1) (Fintype.card V - 2) ΞΌ where card := rfl regular := IsRegularOfDegree.top of_adj := fun v w h => by rw [card_commonNeighbors_top] exact h of_not_adj := fun v w h h' => False.elim (h' ((top_adj v w).2 h)) set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.top SimpleGraph.IsSRGWith.top theorem IsSRGWith.card_neighborFinset_union_eq {v w : V} (h : G.IsSRGWith n k β„“ ΞΌ) : (G.neighborFinset v βˆͺ G.neighborFinset w).card = 2 * k - Fintype.card (G.commonNeighbors v w) := by apply Nat.add_right_cancel (m := Fintype.card (G.commonNeighbors v w)) rw [Nat.sub_add_cancel, ← Set.toFinset_card] -- Porting note: Set.toFinset_inter needs workaround to use unification to solve for one of the -- instance arguments: Β· simp [commonNeighbors, @Set.toFinset_inter _ _ _ _ _ _ (_), ← neighborFinset_def, Finset.card_union_add_card_inter, card_neighborFinset_eq_degree, h.regular.degree_eq, two_mul] Β· apply le_trans (card_commonNeighbors_le_degree_left _ _ _) simp [h.regular.degree_eq, two_mul] set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.card_neighbor_finset_union_eq SimpleGraph.IsSRGWith.card_neighborFinset_union_eq theorem IsSRGWith.card_neighborFinset_union_of_not_adj {v w : V} (h : G.IsSRGWith n k β„“ ΞΌ) (hne : v β‰  w) (ha : Β¬G.Adj v w) : (G.neighborFinset v βˆͺ G.neighborFinset w).card = 2 * k - ΞΌ := by rw [← h.of_not_adj hne ha] apply h.card_neighborFinset_union_eq set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.card_neighbor_finset_union_of_not_adj SimpleGraph.IsSRGWith.card_neighborFinset_union_of_not_adj theorem IsSRGWith.card_neighborFinset_union_of_adj {v w : V} (h : G.IsSRGWith n k β„“ ΞΌ) (ha : G.Adj v w) : (G.neighborFinset v βˆͺ G.neighborFinset w).card = 2 * k - β„“ := by rw [← h.of_adj v w ha] apply h.card_neighborFinset_union_eq set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.card_neighbor_finset_union_of_adj SimpleGraph.IsSRGWith.card_neighborFinset_union_of_adj theorem compl_neighborFinset_sdiff_inter_eq {v w : V} : (G.neighborFinset v)ᢜ \ {v} ∩ ((G.neighborFinset w)ᢜ \ {w}) = ((G.neighborFinset v)ᢜ ∩ (G.neighborFinset w)ᢜ) \ ({w} βˆͺ {v}) := by ext rw [← not_iff_not] simp [imp_iff_not_or, or_assoc, or_comm, or_left_comm] #align simple_graph.compl_neighbor_finset_sdiff_inter_eq SimpleGraph.compl_neighborFinset_sdiff_inter_eq
Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean
125
134
theorem sdiff_compl_neighborFinset_inter_eq {v w : V} (h : G.Adj v w) : ((G.neighborFinset v)ᢜ ∩ (G.neighborFinset w)ᢜ) \ ({w} βˆͺ {v}) = (G.neighborFinset v)ᢜ ∩ (G.neighborFinset w)ᢜ := by
ext simp only [and_imp, mem_union, mem_sdiff, mem_compl, and_iff_left_iff_imp, mem_neighborFinset, mem_inter, mem_singleton] rintro hnv hnw (rfl | rfl) Β· exact hnv h Β· apply hnw rwa [adj_comm]
7
1,096.633158
2
1.428571
7
1,524
import Mathlib.Combinatorics.Enumerative.DoubleCounting import Mathlib.Combinatorics.SimpleGraph.AdjMatrix import Mathlib.Combinatorics.SimpleGraph.Basic import Mathlib.Data.Set.Finite #align_import combinatorics.simple_graph.strongly_regular from "leanprover-community/mathlib"@"2b35fc7bea4640cb75e477e83f32fbd538920822" open Finset universe u namespace SimpleGraph variable {V : Type u} [Fintype V] [DecidableEq V] variable (G : SimpleGraph V) [DecidableRel G.Adj] structure IsSRGWith (n k β„“ ΞΌ : β„•) : Prop where card : Fintype.card V = n regular : G.IsRegularOfDegree k of_adj : βˆ€ v w : V, G.Adj v w β†’ Fintype.card (G.commonNeighbors v w) = β„“ of_not_adj : Pairwise fun v w => Β¬G.Adj v w β†’ Fintype.card (G.commonNeighbors v w) = ΞΌ set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with SimpleGraph.IsSRGWith variable {G} {n k β„“ ΞΌ : β„•} theorem bot_strongly_regular : (βŠ₯ : SimpleGraph V).IsSRGWith (Fintype.card V) 0 β„“ 0 where card := rfl regular := bot_degree of_adj := fun v w h => h.elim of_not_adj := fun v w _h => by simp only [card_eq_zero, Fintype.card_ofFinset, forall_true_left, not_false_iff, bot_adj] ext simp [mem_commonNeighbors] #align simple_graph.bot_strongly_regular SimpleGraph.bot_strongly_regular theorem IsSRGWith.top : (⊀ : SimpleGraph V).IsSRGWith (Fintype.card V) (Fintype.card V - 1) (Fintype.card V - 2) ΞΌ where card := rfl regular := IsRegularOfDegree.top of_adj := fun v w h => by rw [card_commonNeighbors_top] exact h of_not_adj := fun v w h h' => False.elim (h' ((top_adj v w).2 h)) set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.top SimpleGraph.IsSRGWith.top theorem IsSRGWith.card_neighborFinset_union_eq {v w : V} (h : G.IsSRGWith n k β„“ ΞΌ) : (G.neighborFinset v βˆͺ G.neighborFinset w).card = 2 * k - Fintype.card (G.commonNeighbors v w) := by apply Nat.add_right_cancel (m := Fintype.card (G.commonNeighbors v w)) rw [Nat.sub_add_cancel, ← Set.toFinset_card] -- Porting note: Set.toFinset_inter needs workaround to use unification to solve for one of the -- instance arguments: Β· simp [commonNeighbors, @Set.toFinset_inter _ _ _ _ _ _ (_), ← neighborFinset_def, Finset.card_union_add_card_inter, card_neighborFinset_eq_degree, h.regular.degree_eq, two_mul] Β· apply le_trans (card_commonNeighbors_le_degree_left _ _ _) simp [h.regular.degree_eq, two_mul] set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.card_neighbor_finset_union_eq SimpleGraph.IsSRGWith.card_neighborFinset_union_eq theorem IsSRGWith.card_neighborFinset_union_of_not_adj {v w : V} (h : G.IsSRGWith n k β„“ ΞΌ) (hne : v β‰  w) (ha : Β¬G.Adj v w) : (G.neighborFinset v βˆͺ G.neighborFinset w).card = 2 * k - ΞΌ := by rw [← h.of_not_adj hne ha] apply h.card_neighborFinset_union_eq set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.card_neighbor_finset_union_of_not_adj SimpleGraph.IsSRGWith.card_neighborFinset_union_of_not_adj theorem IsSRGWith.card_neighborFinset_union_of_adj {v w : V} (h : G.IsSRGWith n k β„“ ΞΌ) (ha : G.Adj v w) : (G.neighborFinset v βˆͺ G.neighborFinset w).card = 2 * k - β„“ := by rw [← h.of_adj v w ha] apply h.card_neighborFinset_union_eq set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.card_neighbor_finset_union_of_adj SimpleGraph.IsSRGWith.card_neighborFinset_union_of_adj theorem compl_neighborFinset_sdiff_inter_eq {v w : V} : (G.neighborFinset v)ᢜ \ {v} ∩ ((G.neighborFinset w)ᢜ \ {w}) = ((G.neighborFinset v)ᢜ ∩ (G.neighborFinset w)ᢜ) \ ({w} βˆͺ {v}) := by ext rw [← not_iff_not] simp [imp_iff_not_or, or_assoc, or_comm, or_left_comm] #align simple_graph.compl_neighbor_finset_sdiff_inter_eq SimpleGraph.compl_neighborFinset_sdiff_inter_eq theorem sdiff_compl_neighborFinset_inter_eq {v w : V} (h : G.Adj v w) : ((G.neighborFinset v)ᢜ ∩ (G.neighborFinset w)ᢜ) \ ({w} βˆͺ {v}) = (G.neighborFinset v)ᢜ ∩ (G.neighborFinset w)ᢜ := by ext simp only [and_imp, mem_union, mem_sdiff, mem_compl, and_iff_left_iff_imp, mem_neighborFinset, mem_inter, mem_singleton] rintro hnv hnw (rfl | rfl) Β· exact hnv h Β· apply hnw rwa [adj_comm] #align simple_graph.sdiff_compl_neighbor_finset_inter_eq SimpleGraph.sdiff_compl_neighborFinset_inter_eq
Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean
137
140
theorem IsSRGWith.compl_is_regular (h : G.IsSRGWith n k β„“ ΞΌ) : Gᢜ.IsRegularOfDegree (n - k - 1) := by
rw [← h.card, Nat.sub_sub, add_comm, ← Nat.sub_sub] exact h.regular.compl
2
7.389056
1
1.428571
7
1,524
import Mathlib.Combinatorics.Enumerative.DoubleCounting import Mathlib.Combinatorics.SimpleGraph.AdjMatrix import Mathlib.Combinatorics.SimpleGraph.Basic import Mathlib.Data.Set.Finite #align_import combinatorics.simple_graph.strongly_regular from "leanprover-community/mathlib"@"2b35fc7bea4640cb75e477e83f32fbd538920822" open Finset universe u namespace SimpleGraph variable {V : Type u} [Fintype V] [DecidableEq V] variable (G : SimpleGraph V) [DecidableRel G.Adj] structure IsSRGWith (n k β„“ ΞΌ : β„•) : Prop where card : Fintype.card V = n regular : G.IsRegularOfDegree k of_adj : βˆ€ v w : V, G.Adj v w β†’ Fintype.card (G.commonNeighbors v w) = β„“ of_not_adj : Pairwise fun v w => Β¬G.Adj v w β†’ Fintype.card (G.commonNeighbors v w) = ΞΌ set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with SimpleGraph.IsSRGWith variable {G} {n k β„“ ΞΌ : β„•} theorem bot_strongly_regular : (βŠ₯ : SimpleGraph V).IsSRGWith (Fintype.card V) 0 β„“ 0 where card := rfl regular := bot_degree of_adj := fun v w h => h.elim of_not_adj := fun v w _h => by simp only [card_eq_zero, Fintype.card_ofFinset, forall_true_left, not_false_iff, bot_adj] ext simp [mem_commonNeighbors] #align simple_graph.bot_strongly_regular SimpleGraph.bot_strongly_regular theorem IsSRGWith.top : (⊀ : SimpleGraph V).IsSRGWith (Fintype.card V) (Fintype.card V - 1) (Fintype.card V - 2) ΞΌ where card := rfl regular := IsRegularOfDegree.top of_adj := fun v w h => by rw [card_commonNeighbors_top] exact h of_not_adj := fun v w h h' => False.elim (h' ((top_adj v w).2 h)) set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.top SimpleGraph.IsSRGWith.top theorem IsSRGWith.card_neighborFinset_union_eq {v w : V} (h : G.IsSRGWith n k β„“ ΞΌ) : (G.neighborFinset v βˆͺ G.neighborFinset w).card = 2 * k - Fintype.card (G.commonNeighbors v w) := by apply Nat.add_right_cancel (m := Fintype.card (G.commonNeighbors v w)) rw [Nat.sub_add_cancel, ← Set.toFinset_card] -- Porting note: Set.toFinset_inter needs workaround to use unification to solve for one of the -- instance arguments: Β· simp [commonNeighbors, @Set.toFinset_inter _ _ _ _ _ _ (_), ← neighborFinset_def, Finset.card_union_add_card_inter, card_neighborFinset_eq_degree, h.regular.degree_eq, two_mul] Β· apply le_trans (card_commonNeighbors_le_degree_left _ _ _) simp [h.regular.degree_eq, two_mul] set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.card_neighbor_finset_union_eq SimpleGraph.IsSRGWith.card_neighborFinset_union_eq theorem IsSRGWith.card_neighborFinset_union_of_not_adj {v w : V} (h : G.IsSRGWith n k β„“ ΞΌ) (hne : v β‰  w) (ha : Β¬G.Adj v w) : (G.neighborFinset v βˆͺ G.neighborFinset w).card = 2 * k - ΞΌ := by rw [← h.of_not_adj hne ha] apply h.card_neighborFinset_union_eq set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.card_neighbor_finset_union_of_not_adj SimpleGraph.IsSRGWith.card_neighborFinset_union_of_not_adj theorem IsSRGWith.card_neighborFinset_union_of_adj {v w : V} (h : G.IsSRGWith n k β„“ ΞΌ) (ha : G.Adj v w) : (G.neighborFinset v βˆͺ G.neighborFinset w).card = 2 * k - β„“ := by rw [← h.of_adj v w ha] apply h.card_neighborFinset_union_eq set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.card_neighbor_finset_union_of_adj SimpleGraph.IsSRGWith.card_neighborFinset_union_of_adj theorem compl_neighborFinset_sdiff_inter_eq {v w : V} : (G.neighborFinset v)ᢜ \ {v} ∩ ((G.neighborFinset w)ᢜ \ {w}) = ((G.neighborFinset v)ᢜ ∩ (G.neighborFinset w)ᢜ) \ ({w} βˆͺ {v}) := by ext rw [← not_iff_not] simp [imp_iff_not_or, or_assoc, or_comm, or_left_comm] #align simple_graph.compl_neighbor_finset_sdiff_inter_eq SimpleGraph.compl_neighborFinset_sdiff_inter_eq theorem sdiff_compl_neighborFinset_inter_eq {v w : V} (h : G.Adj v w) : ((G.neighborFinset v)ᢜ ∩ (G.neighborFinset w)ᢜ) \ ({w} βˆͺ {v}) = (G.neighborFinset v)ᢜ ∩ (G.neighborFinset w)ᢜ := by ext simp only [and_imp, mem_union, mem_sdiff, mem_compl, and_iff_left_iff_imp, mem_neighborFinset, mem_inter, mem_singleton] rintro hnv hnw (rfl | rfl) Β· exact hnv h Β· apply hnw rwa [adj_comm] #align simple_graph.sdiff_compl_neighbor_finset_inter_eq SimpleGraph.sdiff_compl_neighborFinset_inter_eq theorem IsSRGWith.compl_is_regular (h : G.IsSRGWith n k β„“ ΞΌ) : Gᢜ.IsRegularOfDegree (n - k - 1) := by rw [← h.card, Nat.sub_sub, add_comm, ← Nat.sub_sub] exact h.regular.compl set_option linter.uppercaseLean3 false in #align simple_graph.is_SRG_with.compl_is_regular SimpleGraph.IsSRGWith.compl_is_regular
Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean
144
156
theorem IsSRGWith.card_commonNeighbors_eq_of_adj_compl (h : G.IsSRGWith n k β„“ ΞΌ) {v w : V} (ha : Gᢜ.Adj v w) : Fintype.card (Gᢜ.commonNeighbors v w) = n - (2 * k - ΞΌ) - 2 := by
simp only [← Set.toFinset_card, commonNeighbors, Set.toFinset_inter, neighborSet_compl, Set.toFinset_diff, Set.toFinset_singleton, Set.toFinset_compl, ← neighborFinset_def] simp_rw [compl_neighborFinset_sdiff_inter_eq] have hne : v β‰  w := ne_of_adj _ ha rw [compl_adj] at ha rw [card_sdiff, ← insert_eq, card_insert_of_not_mem, card_singleton, ← Finset.compl_union] Β· rw [card_compl, h.card_neighborFinset_union_of_not_adj hne ha.2, ← h.card] Β· simp only [hne.symm, not_false_iff, mem_singleton] Β· intro u simp only [mem_union, mem_compl, mem_neighborFinset, mem_inter, mem_singleton] rintro (rfl | rfl) <;> simpa [adj_comm] using ha.2
11
59,874.141715
2
1.428571
7
1,524
import Mathlib.Init.Core import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" open Polynomial Algebra FiniteDimensional Set universe u v w z variable (n : β„•+) (S T : Set β„•+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section @[mk_iff] class IsCyclotomicExtension : Prop where exists_prim_root {n : β„•+} (ha : n ∈ S) : βˆƒ r : B, IsPrimitiveRoot r n adjoin_roots : βˆ€ x : B, x ∈ adjoin A {b : B | βˆƒ n : β„•+, n ∈ S ∧ b ^ (n : β„•) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (βˆ€ n : β„•+, n ∈ S β†’ βˆƒ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | βˆƒ n : β„•+, n ∈ S ∧ b ^ (n : β„•) = 1} = ⊀ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top
Mathlib/NumberTheory/Cyclotomic/Basic.lean
100
103
theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (βˆƒ r : B, IsPrimitiveRoot r n) ∧ βˆ€ x, x ∈ adjoin A {b : B | b ^ (n : β„•) = 1} := by
simp [isCyclotomicExtension_iff]
1
2.718282
0
1.428571
7
1,525
import Mathlib.Init.Core import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" open Polynomial Algebra FiniteDimensional Set universe u v w z variable (n : β„•+) (S T : Set β„•+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section @[mk_iff] class IsCyclotomicExtension : Prop where exists_prim_root {n : β„•+} (ha : n ∈ S) : βˆƒ r : B, IsPrimitiveRoot r n adjoin_roots : βˆ€ x : B, x ∈ adjoin A {b : B | βˆƒ n : β„•+, n ∈ S ∧ b ^ (n : β„•) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (βˆ€ n : β„•+, n ∈ S β†’ βˆƒ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | βˆƒ n : β„•+, n ∈ S ∧ b ^ (n : β„•) = 1} = ⊀ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (βˆƒ r : B, IsPrimitiveRoot r n) ∧ βˆ€ x, x ∈ adjoin A {b : B | b ^ (n : β„•) = 1} := by simp [isCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton
Mathlib/NumberTheory/Cyclotomic/Basic.lean
107
108
theorem empty [h : IsCyclotomicExtension βˆ… A B] : (βŠ₯ : Subalgebra A B) = ⊀ := by
simpa [Algebra.eq_top_iff, isCyclotomicExtension_iff] using h
1
2.718282
0
1.428571
7
1,525
import Mathlib.Init.Core import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" open Polynomial Algebra FiniteDimensional Set universe u v w z variable (n : β„•+) (S T : Set β„•+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section @[mk_iff] class IsCyclotomicExtension : Prop where exists_prim_root {n : β„•+} (ha : n ∈ S) : βˆƒ r : B, IsPrimitiveRoot r n adjoin_roots : βˆ€ x : B, x ∈ adjoin A {b : B | βˆƒ n : β„•+, n ∈ S ∧ b ^ (n : β„•) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (βˆ€ n : β„•+, n ∈ S β†’ βˆƒ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | βˆƒ n : β„•+, n ∈ S ∧ b ^ (n : β„•) = 1} = ⊀ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (βˆƒ r : B, IsPrimitiveRoot r n) ∧ βˆ€ x, x ∈ adjoin A {b : B | b ^ (n : β„•) = 1} := by simp [isCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton theorem empty [h : IsCyclotomicExtension βˆ… A B] : (βŠ₯ : Subalgebra A B) = ⊀ := by simpa [Algebra.eq_top_iff, isCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (βŠ₯ : Subalgebra A B) = ⊀ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((isCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B}
Mathlib/NumberTheory/Cyclotomic/Basic.lean
120
126
theorem singleton_zero_of_bot_eq_top (h : (βŠ₯ : Subalgebra A B) = ⊀) : IsCyclotomicExtension βˆ… A B := by
-- Porting note: Lean3 is able to infer `A`. refine (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => ?_⟩ rw [← h] at hx simpa using hx
5
148.413159
2
1.428571
7
1,525
import Mathlib.Init.Core import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" open Polynomial Algebra FiniteDimensional Set universe u v w z variable (n : β„•+) (S T : Set β„•+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section @[mk_iff] class IsCyclotomicExtension : Prop where exists_prim_root {n : β„•+} (ha : n ∈ S) : βˆƒ r : B, IsPrimitiveRoot r n adjoin_roots : βˆ€ x : B, x ∈ adjoin A {b : B | βˆƒ n : β„•+, n ∈ S ∧ b ^ (n : β„•) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (βˆ€ n : β„•+, n ∈ S β†’ βˆƒ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | βˆƒ n : β„•+, n ∈ S ∧ b ^ (n : β„•) = 1} = ⊀ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (βˆƒ r : B, IsPrimitiveRoot r n) ∧ βˆ€ x, x ∈ adjoin A {b : B | b ^ (n : β„•) = 1} := by simp [isCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton theorem empty [h : IsCyclotomicExtension βˆ… A B] : (βŠ₯ : Subalgebra A B) = ⊀ := by simpa [Algebra.eq_top_iff, isCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (βŠ₯ : Subalgebra A B) = ⊀ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((isCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} theorem singleton_zero_of_bot_eq_top (h : (βŠ₯ : Subalgebra A B) = ⊀) : IsCyclotomicExtension βˆ… A B := by -- Porting note: Lean3 is able to infer `A`. refine (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => ?_⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B)
Mathlib/NumberTheory/Cyclotomic/Basic.lean
132
150
theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S βˆͺ T) A C := by
refine ⟨fun hn => ?_, fun x => ?_⟩ Β· cases' hn with hn hn Β· obtain ⟨b, hb⟩ := ((isCyclotomicExtension_iff _ _ _).1 hS).1 hn refine ⟨algebraMap B C b, ?_⟩ exact hb.map_of_injective h Β· exact ((isCyclotomicExtension_iff _ _ _).1 hT).1 hn Β· refine adjoin_induction (((isCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => ?_) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | βˆƒ a : β„•+, a ∈ S ∧ b ^ (a : β„•) = 1}).map f := ⟨b, ((isCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine adjoin_mono (fun y hy => ?_) hb obtain ⟨b₁, ⟨⟨n, hn⟩, hβ‚βŸ©βŸ© := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩
16
8,886,110.520508
2
1.428571
7
1,525
import Mathlib.Init.Core import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" open Polynomial Algebra FiniteDimensional Set universe u v w z variable (n : β„•+) (S T : Set β„•+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section @[mk_iff] class IsCyclotomicExtension : Prop where exists_prim_root {n : β„•+} (ha : n ∈ S) : βˆƒ r : B, IsPrimitiveRoot r n adjoin_roots : βˆ€ x : B, x ∈ adjoin A {b : B | βˆƒ n : β„•+, n ∈ S ∧ b ^ (n : β„•) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section Basic theorem iff_adjoin_eq_top : IsCyclotomicExtension S A B ↔ (βˆ€ n : β„•+, n ∈ S β†’ βˆƒ r : B, IsPrimitiveRoot r n) ∧ adjoin A {b : B | βˆƒ n : β„•+, n ∈ S ∧ b ^ (n : β„•) = 1} = ⊀ := ⟨fun h => ⟨fun _ => h.exists_prim_root, Algebra.eq_top_iff.2 h.adjoin_roots⟩, fun h => ⟨h.1 _, Algebra.eq_top_iff.1 h.2⟩⟩ #align is_cyclotomic_extension.iff_adjoin_eq_top IsCyclotomicExtension.iff_adjoin_eq_top theorem iff_singleton : IsCyclotomicExtension {n} A B ↔ (βˆƒ r : B, IsPrimitiveRoot r n) ∧ βˆ€ x, x ∈ adjoin A {b : B | b ^ (n : β„•) = 1} := by simp [isCyclotomicExtension_iff] #align is_cyclotomic_extension.iff_singleton IsCyclotomicExtension.iff_singleton theorem empty [h : IsCyclotomicExtension βˆ… A B] : (βŠ₯ : Subalgebra A B) = ⊀ := by simpa [Algebra.eq_top_iff, isCyclotomicExtension_iff] using h #align is_cyclotomic_extension.empty IsCyclotomicExtension.empty theorem singleton_one [h : IsCyclotomicExtension {1} A B] : (βŠ₯ : Subalgebra A B) = ⊀ := Algebra.eq_top_iff.2 fun x => by simpa [adjoin_singleton_one] using ((isCyclotomicExtension_iff _ _ _).1 h).2 x #align is_cyclotomic_extension.singleton_one IsCyclotomicExtension.singleton_one variable {A B} theorem singleton_zero_of_bot_eq_top (h : (βŠ₯ : Subalgebra A B) = ⊀) : IsCyclotomicExtension βˆ… A B := by -- Porting note: Lean3 is able to infer `A`. refine (iff_adjoin_eq_top _ A _).2 ⟨fun s hs => by simp at hs, _root_.eq_top_iff.2 fun x hx => ?_⟩ rw [← h] at hx simpa using hx #align is_cyclotomic_extension.singleton_zero_of_bot_eq_top IsCyclotomicExtension.singleton_zero_of_bot_eq_top variable (A B) theorem trans (C : Type w) [CommRing C] [Algebra A C] [Algebra B C] [IsScalarTower A B C] [hS : IsCyclotomicExtension S A B] [hT : IsCyclotomicExtension T B C] (h : Function.Injective (algebraMap B C)) : IsCyclotomicExtension (S βˆͺ T) A C := by refine ⟨fun hn => ?_, fun x => ?_⟩ Β· cases' hn with hn hn Β· obtain ⟨b, hb⟩ := ((isCyclotomicExtension_iff _ _ _).1 hS).1 hn refine ⟨algebraMap B C b, ?_⟩ exact hb.map_of_injective h Β· exact ((isCyclotomicExtension_iff _ _ _).1 hT).1 hn Β· refine adjoin_induction (((isCyclotomicExtension_iff T B _).1 hT).2 x) (fun c ⟨n, hn⟩ => subset_adjoin ⟨n, Or.inr hn.1, hn.2⟩) (fun b => ?_) (fun x y hx hy => Subalgebra.add_mem _ hx hy) fun x y hx hy => Subalgebra.mul_mem _ hx hy let f := IsScalarTower.toAlgHom A B C have hb : f b ∈ (adjoin A {b : B | βˆƒ a : β„•+, a ∈ S ∧ b ^ (a : β„•) = 1}).map f := ⟨b, ((isCyclotomicExtension_iff _ _ _).1 hS).2 b, rfl⟩ rw [IsScalarTower.toAlgHom_apply, ← adjoin_image] at hb refine adjoin_mono (fun y hy => ?_) hb obtain ⟨b₁, ⟨⟨n, hn⟩, hβ‚βŸ©βŸ© := hy exact ⟨n, ⟨mem_union_left T hn.1, by rw [← h₁, ← AlgHom.map_pow, hn.2, AlgHom.map_one]⟩⟩ #align is_cyclotomic_extension.trans IsCyclotomicExtension.trans @[nontriviality]
Mathlib/NumberTheory/Cyclotomic/Basic.lean
154
168
theorem subsingleton_iff [Subsingleton B] : IsCyclotomicExtension S A B ↔ S = { } ∨ S = {1} := by
have : Subsingleton (Subalgebra A B) := inferInstance constructor Β· rintro ⟨hprim, -⟩ rw [← subset_singleton_iff_eq] intro t ht obtain ⟨΢, h΢⟩ := hprim ht rw [mem_singleton_iff, ← PNat.coe_eq_one_iff] exact mod_cast hΞΆ.unique (IsPrimitiveRoot.of_subsingleton ΞΆ) Β· rintro (rfl | rfl) -- Porting note: `R := A` was not needed. Β· exact ⟨fun h => h.elim, fun x => by convert (mem_top (R := A) : x ∈ ⊀)⟩ Β· rw [iff_singleton] exact ⟨⟨0, IsPrimitiveRoot.of_subsingleton 0⟩, fun x => by convert (mem_top (R := A) : x ∈ ⊀)⟩
14
1,202,604.284165
2
1.428571
7
1,525
import Mathlib.Init.Core import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" open Polynomial Algebra FiniteDimensional Set universe u v w z variable (n : β„•+) (S T : Set β„•+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section @[mk_iff] class IsCyclotomicExtension : Prop where exists_prim_root {n : β„•+} (ha : n ∈ S) : βˆƒ r : B, IsPrimitiveRoot r n adjoin_roots : βˆ€ x : B, x ∈ adjoin A {b : B | βˆƒ n : β„•+, n ∈ S ∧ b ^ (n : β„•) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section variable {A B}
Mathlib/NumberTheory/Cyclotomic/Basic.lean
368
384
theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ΞΆ : B} {n : β„•+} (hΞΆ : IsPrimitiveRoot ΞΆ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | βˆƒ a : β„•+, a ∈ ({n} : Set β„•+) ∧ b ^ (a : β„•) = 1} := by
simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine le_antisymm (adjoin_mono fun x hx => ?_) (adjoin_le fun x hx => ?_) Β· rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine ⟨n, Nat.mem_divisors_self n n.ne_zero, ?_⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 Β· simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hΞΆ.eq_pow_of_pow_eq_one hx n.pos refine SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin ?_) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] exact ⟨cyclotomic_ne_zero n B, hΞΆ.isRoot_cyclotomic n.pos⟩
13
442,413.392009
2
1.428571
7
1,525
import Mathlib.Init.Core import Mathlib.RingTheory.Polynomial.Cyclotomic.Roots import Mathlib.NumberTheory.NumberField.Basic import Mathlib.FieldTheory.Galois #align_import number_theory.cyclotomic.basic from "leanprover-community/mathlib"@"4b05d3f4f0601dca8abf99c4ec99187682ed0bba" open Polynomial Algebra FiniteDimensional Set universe u v w z variable (n : β„•+) (S T : Set β„•+) (A : Type u) (B : Type v) (K : Type w) (L : Type z) variable [CommRing A] [CommRing B] [Algebra A B] variable [Field K] [Field L] [Algebra K L] noncomputable section @[mk_iff] class IsCyclotomicExtension : Prop where exists_prim_root {n : β„•+} (ha : n ∈ S) : βˆƒ r : B, IsPrimitiveRoot r n adjoin_roots : βˆ€ x : B, x ∈ adjoin A {b : B | βˆƒ n : β„•+, n ∈ S ∧ b ^ (n : β„•) = 1} #align is_cyclotomic_extension IsCyclotomicExtension namespace IsCyclotomicExtension section variable {A B} theorem adjoin_roots_cyclotomic_eq_adjoin_nth_roots [IsDomain B] {ΞΆ : B} {n : β„•+} (hΞΆ : IsPrimitiveRoot ΞΆ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {b : B | βˆƒ a : β„•+, a ∈ ({n} : Set β„•+) ∧ b ^ (a : β„•) = 1} := by simp only [mem_singleton_iff, exists_eq_left, map_cyclotomic] refine le_antisymm (adjoin_mono fun x hx => ?_) (adjoin_le fun x hx => ?_) Β· rw [mem_rootSet'] at hx simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] rw [isRoot_of_unity_iff n.pos] refine ⟨n, Nat.mem_divisors_self n n.ne_zero, ?_⟩ rw [IsRoot.def, ← map_cyclotomic n (algebraMap A B), eval_map, ← aeval_def] exact hx.2 Β· simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx obtain ⟨i, _, rfl⟩ := hΞΆ.eq_pow_of_pow_eq_one hx n.pos refine SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin ?_) _) rw [mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] exact ⟨cyclotomic_ne_zero n B, hΞΆ.isRoot_cyclotomic n.pos⟩ #align is_cyclotomic_extension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots IsCyclotomicExtension.adjoin_roots_cyclotomic_eq_adjoin_nth_roots
Mathlib/NumberTheory/Cyclotomic/Basic.lean
387
399
theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : β„•+} [IsDomain B] {ΞΆ : B} (hΞΆ : IsPrimitiveRoot ΞΆ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ΞΆ} := by
refine le_antisymm (adjoin_le fun x hx => ?_) (adjoin_mono fun x hx => ?_) Β· suffices hx : x ^ n.1 = 1 by obtain ⟨i, _, rfl⟩ := hΞΆ.eq_pow_of_pow_eq_one hx n.pos exact SetLike.mem_coe.2 (Subalgebra.pow_mem _ (subset_adjoin <| mem_singleton ΞΆ) _) refine (isRoot_of_unity_iff n.pos B).2 ?_ refine ⟨n, Nat.mem_divisors_self n n.ne_zero, ?_⟩ rw [mem_rootSet', aeval_def, ← eval_map, map_cyclotomic, ← IsRoot] at hx exact hx.2 Β· simp only [mem_singleton_iff, exists_eq_left, mem_setOf_eq] at hx simpa only [hx, mem_rootSet', map_cyclotomic, aeval_def, ← eval_map, IsRoot] using And.intro (cyclotomic_ne_zero n B) (hΞΆ.isRoot_cyclotomic n.pos)
11
59,874.141715
2
1.428571
7
1,525
import Mathlib.Algebra.Polynomial.Div import Mathlib.RingTheory.Polynomial.Basic import Mathlib.RingTheory.Ideal.QuotientOperations #align_import ring_theory.polynomial.quotient from "leanprover-community/mathlib"@"4f840b8d28320b20c87db17b3a6eef3d325fca87" set_option linter.uppercaseLean3 false open Polynomial namespace Ideal noncomputable section open Polynomial variable {R : Type*} [CommRing R]
Mathlib/RingTheory/Polynomial/Quotient.lean
87
91
theorem quotient_map_C_eq_zero {I : Ideal R} : βˆ€ a ∈ I, ((Quotient.mk (map (C : R β†’+* R[X]) I : Ideal R[X])).comp C) a = 0 := by
intro a ha rw [RingHom.comp_apply, Quotient.eq_zero_iff_mem] exact mem_map_of_mem _ ha
3
20.085537
1
1.428571
7
1,526
import Mathlib.Algebra.Polynomial.Div import Mathlib.RingTheory.Polynomial.Basic import Mathlib.RingTheory.Ideal.QuotientOperations #align_import ring_theory.polynomial.quotient from "leanprover-community/mathlib"@"4f840b8d28320b20c87db17b3a6eef3d325fca87" set_option linter.uppercaseLean3 false open Polynomial namespace Ideal noncomputable section open Polynomial variable {R : Type*} [CommRing R] theorem quotient_map_C_eq_zero {I : Ideal R} : βˆ€ a ∈ I, ((Quotient.mk (map (C : R β†’+* R[X]) I : Ideal R[X])).comp C) a = 0 := by intro a ha rw [RingHom.comp_apply, Quotient.eq_zero_iff_mem] exact mem_map_of_mem _ ha #align ideal.quotient_map_C_eq_zero Ideal.quotient_map_C_eq_zero
Mathlib/RingTheory/Polynomial/Quotient.lean
94
107
theorem evalβ‚‚_C_mk_eq_zero {I : Ideal R} : βˆ€ f ∈ (map (C : R β†’+* R[X]) I : Ideal R[X]), evalβ‚‚RingHom (C.comp (Quotient.mk I)) X f = 0 := by
intro a ha rw [← sum_monomial_eq a] dsimp rw [evalβ‚‚_sum] refine Finset.sum_eq_zero fun n _ => ?_ dsimp rw [evalβ‚‚_monomial (C.comp (Quotient.mk I)) X] refine mul_eq_zero_of_left (Polynomial.ext fun m => ?_) (X ^ n) erw [coeff_C] by_cases h : m = 0 Β· simpa [h] using Quotient.eq_zero_iff_mem.2 ((mem_map_C_iff.1 ha) n) Β· simp [h]
12
162,754.791419
2
1.428571
7
1,526
import Mathlib.Algebra.Polynomial.Div import Mathlib.RingTheory.Polynomial.Basic import Mathlib.RingTheory.Ideal.QuotientOperations #align_import ring_theory.polynomial.quotient from "leanprover-community/mathlib"@"4f840b8d28320b20c87db17b3a6eef3d325fca87" set_option linter.uppercaseLean3 false open Polynomial namespace Ideal noncomputable section open Polynomial variable {R : Type*} [CommRing R] theorem quotient_map_C_eq_zero {I : Ideal R} : βˆ€ a ∈ I, ((Quotient.mk (map (C : R β†’+* R[X]) I : Ideal R[X])).comp C) a = 0 := by intro a ha rw [RingHom.comp_apply, Quotient.eq_zero_iff_mem] exact mem_map_of_mem _ ha #align ideal.quotient_map_C_eq_zero Ideal.quotient_map_C_eq_zero theorem evalβ‚‚_C_mk_eq_zero {I : Ideal R} : βˆ€ f ∈ (map (C : R β†’+* R[X]) I : Ideal R[X]), evalβ‚‚RingHom (C.comp (Quotient.mk I)) X f = 0 := by intro a ha rw [← sum_monomial_eq a] dsimp rw [evalβ‚‚_sum] refine Finset.sum_eq_zero fun n _ => ?_ dsimp rw [evalβ‚‚_monomial (C.comp (Quotient.mk I)) X] refine mul_eq_zero_of_left (Polynomial.ext fun m => ?_) (X ^ n) erw [coeff_C] by_cases h : m = 0 Β· simpa [h] using Quotient.eq_zero_iff_mem.2 ((mem_map_C_iff.1 ha) n) Β· simp [h] #align ideal.evalβ‚‚_C_mk_eq_zero Ideal.evalβ‚‚_C_mk_eq_zero def polynomialQuotientEquivQuotientPolynomial (I : Ideal R) : (R β§Έ I)[X] ≃+* R[X] β§Έ (map C I : Ideal R[X]) where toFun := evalβ‚‚RingHom (Quotient.lift I ((Quotient.mk (map C I : Ideal R[X])).comp C) quotient_map_C_eq_zero) (Quotient.mk (map C I : Ideal R[X]) X) invFun := Quotient.lift (map C I : Ideal R[X]) (evalβ‚‚RingHom (C.comp (Quotient.mk I)) X) evalβ‚‚_C_mk_eq_zero map_mul' f g := by simp only [coe_evalβ‚‚RingHom, evalβ‚‚_mul] map_add' f g := by simp only [evalβ‚‚_add, coe_evalβ‚‚RingHom] left_inv := by intro f refine Polynomial.induction_on' f ?_ ?_ Β· intro p q hp hq simp only [coe_evalβ‚‚RingHom] at hp hq simp only [coe_evalβ‚‚RingHom, hp, hq, RingHom.map_add] Β· rintro n ⟨x⟩ simp only [← smul_X_eq_monomial, C_mul', Quotient.lift_mk, Submodule.Quotient.quot_mk_eq_mk, Quotient.mk_eq_mk, evalβ‚‚_X_pow, evalβ‚‚_smul, coe_evalβ‚‚RingHom, RingHom.map_pow, evalβ‚‚_C, RingHom.coe_comp, RingHom.map_mul, evalβ‚‚_X, Function.comp_apply] right_inv := by rintro ⟨f⟩ refine Polynomial.induction_on' f ?_ ?_ Β· -- Porting note: was `simp_intro p q hp hq` intros p q hp hq simp only [Submodule.Quotient.quot_mk_eq_mk, Quotient.mk_eq_mk, map_add, Quotient.lift_mk, coe_evalβ‚‚RingHom] at hp hq ⊒ rw [hp, hq] Β· intro n a simp only [← smul_X_eq_monomial, ← C_mul' a (X ^ n), Quotient.lift_mk, Submodule.Quotient.quot_mk_eq_mk, Quotient.mk_eq_mk, evalβ‚‚_X_pow, evalβ‚‚_smul, coe_evalβ‚‚RingHom, RingHom.map_pow, evalβ‚‚_C, RingHom.coe_comp, RingHom.map_mul, evalβ‚‚_X, Function.comp_apply] #align ideal.polynomial_quotient_equiv_quotient_polynomial Ideal.polynomialQuotientEquivQuotientPolynomial @[simp]
Mathlib/RingTheory/Polynomial/Quotient.lean
150
154
theorem polynomialQuotientEquivQuotientPolynomial_symm_mk (I : Ideal R) (f : R[X]) : I.polynomialQuotientEquivQuotientPolynomial.symm (Quotient.mk _ f) = f.map (Quotient.mk I) := by
rw [polynomialQuotientEquivQuotientPolynomial, RingEquiv.symm_mk, RingEquiv.coe_mk, Equiv.coe_fn_mk, Quotient.lift_mk, coe_evalβ‚‚RingHom, evalβ‚‚_eq_eval_map, ← Polynomial.map_map, ← evalβ‚‚_eq_eval_map, Polynomial.evalβ‚‚_C_X]
3
20.085537
1
1.428571
7
1,526
import Mathlib.Algebra.Polynomial.Div import Mathlib.RingTheory.Polynomial.Basic import Mathlib.RingTheory.Ideal.QuotientOperations #align_import ring_theory.polynomial.quotient from "leanprover-community/mathlib"@"4f840b8d28320b20c87db17b3a6eef3d325fca87" set_option linter.uppercaseLean3 false open Polynomial namespace Ideal noncomputable section open Polynomial variable {R : Type*} [CommRing R] theorem quotient_map_C_eq_zero {I : Ideal R} : βˆ€ a ∈ I, ((Quotient.mk (map (C : R β†’+* R[X]) I : Ideal R[X])).comp C) a = 0 := by intro a ha rw [RingHom.comp_apply, Quotient.eq_zero_iff_mem] exact mem_map_of_mem _ ha #align ideal.quotient_map_C_eq_zero Ideal.quotient_map_C_eq_zero theorem evalβ‚‚_C_mk_eq_zero {I : Ideal R} : βˆ€ f ∈ (map (C : R β†’+* R[X]) I : Ideal R[X]), evalβ‚‚RingHom (C.comp (Quotient.mk I)) X f = 0 := by intro a ha rw [← sum_monomial_eq a] dsimp rw [evalβ‚‚_sum] refine Finset.sum_eq_zero fun n _ => ?_ dsimp rw [evalβ‚‚_monomial (C.comp (Quotient.mk I)) X] refine mul_eq_zero_of_left (Polynomial.ext fun m => ?_) (X ^ n) erw [coeff_C] by_cases h : m = 0 Β· simpa [h] using Quotient.eq_zero_iff_mem.2 ((mem_map_C_iff.1 ha) n) Β· simp [h] #align ideal.evalβ‚‚_C_mk_eq_zero Ideal.evalβ‚‚_C_mk_eq_zero def polynomialQuotientEquivQuotientPolynomial (I : Ideal R) : (R β§Έ I)[X] ≃+* R[X] β§Έ (map C I : Ideal R[X]) where toFun := evalβ‚‚RingHom (Quotient.lift I ((Quotient.mk (map C I : Ideal R[X])).comp C) quotient_map_C_eq_zero) (Quotient.mk (map C I : Ideal R[X]) X) invFun := Quotient.lift (map C I : Ideal R[X]) (evalβ‚‚RingHom (C.comp (Quotient.mk I)) X) evalβ‚‚_C_mk_eq_zero map_mul' f g := by simp only [coe_evalβ‚‚RingHom, evalβ‚‚_mul] map_add' f g := by simp only [evalβ‚‚_add, coe_evalβ‚‚RingHom] left_inv := by intro f refine Polynomial.induction_on' f ?_ ?_ Β· intro p q hp hq simp only [coe_evalβ‚‚RingHom] at hp hq simp only [coe_evalβ‚‚RingHom, hp, hq, RingHom.map_add] Β· rintro n ⟨x⟩ simp only [← smul_X_eq_monomial, C_mul', Quotient.lift_mk, Submodule.Quotient.quot_mk_eq_mk, Quotient.mk_eq_mk, evalβ‚‚_X_pow, evalβ‚‚_smul, coe_evalβ‚‚RingHom, RingHom.map_pow, evalβ‚‚_C, RingHom.coe_comp, RingHom.map_mul, evalβ‚‚_X, Function.comp_apply] right_inv := by rintro ⟨f⟩ refine Polynomial.induction_on' f ?_ ?_ Β· -- Porting note: was `simp_intro p q hp hq` intros p q hp hq simp only [Submodule.Quotient.quot_mk_eq_mk, Quotient.mk_eq_mk, map_add, Quotient.lift_mk, coe_evalβ‚‚RingHom] at hp hq ⊒ rw [hp, hq] Β· intro n a simp only [← smul_X_eq_monomial, ← C_mul' a (X ^ n), Quotient.lift_mk, Submodule.Quotient.quot_mk_eq_mk, Quotient.mk_eq_mk, evalβ‚‚_X_pow, evalβ‚‚_smul, coe_evalβ‚‚RingHom, RingHom.map_pow, evalβ‚‚_C, RingHom.coe_comp, RingHom.map_mul, evalβ‚‚_X, Function.comp_apply] #align ideal.polynomial_quotient_equiv_quotient_polynomial Ideal.polynomialQuotientEquivQuotientPolynomial @[simp] theorem polynomialQuotientEquivQuotientPolynomial_symm_mk (I : Ideal R) (f : R[X]) : I.polynomialQuotientEquivQuotientPolynomial.symm (Quotient.mk _ f) = f.map (Quotient.mk I) := by rw [polynomialQuotientEquivQuotientPolynomial, RingEquiv.symm_mk, RingEquiv.coe_mk, Equiv.coe_fn_mk, Quotient.lift_mk, coe_evalβ‚‚RingHom, evalβ‚‚_eq_eval_map, ← Polynomial.map_map, ← evalβ‚‚_eq_eval_map, Polynomial.evalβ‚‚_C_X] #align ideal.polynomial_quotient_equiv_quotient_polynomial_symm_mk Ideal.polynomialQuotientEquivQuotientPolynomial_symm_mk @[simp]
Mathlib/RingTheory/Polynomial/Quotient.lean
158
162
theorem polynomialQuotientEquivQuotientPolynomial_map_mk (I : Ideal R) (f : R[X]) : I.polynomialQuotientEquivQuotientPolynomial (f.map <| Quotient.mk I) = Quotient.mk (map C I : Ideal R[X]) f := by
apply (polynomialQuotientEquivQuotientPolynomial I).symm.injective rw [RingEquiv.symm_apply_apply, polynomialQuotientEquivQuotientPolynomial_symm_mk]
2
7.389056
1
1.428571
7
1,526
import Mathlib.Algebra.Polynomial.Div import Mathlib.RingTheory.Polynomial.Basic import Mathlib.RingTheory.Ideal.QuotientOperations #align_import ring_theory.polynomial.quotient from "leanprover-community/mathlib"@"4f840b8d28320b20c87db17b3a6eef3d325fca87" set_option linter.uppercaseLean3 false open Polynomial namespace Ideal noncomputable section open Polynomial variable {R : Type*} [CommRing R] theorem quotient_map_C_eq_zero {I : Ideal R} : βˆ€ a ∈ I, ((Quotient.mk (map (C : R β†’+* R[X]) I : Ideal R[X])).comp C) a = 0 := by intro a ha rw [RingHom.comp_apply, Quotient.eq_zero_iff_mem] exact mem_map_of_mem _ ha #align ideal.quotient_map_C_eq_zero Ideal.quotient_map_C_eq_zero theorem evalβ‚‚_C_mk_eq_zero {I : Ideal R} : βˆ€ f ∈ (map (C : R β†’+* R[X]) I : Ideal R[X]), evalβ‚‚RingHom (C.comp (Quotient.mk I)) X f = 0 := by intro a ha rw [← sum_monomial_eq a] dsimp rw [evalβ‚‚_sum] refine Finset.sum_eq_zero fun n _ => ?_ dsimp rw [evalβ‚‚_monomial (C.comp (Quotient.mk I)) X] refine mul_eq_zero_of_left (Polynomial.ext fun m => ?_) (X ^ n) erw [coeff_C] by_cases h : m = 0 Β· simpa [h] using Quotient.eq_zero_iff_mem.2 ((mem_map_C_iff.1 ha) n) Β· simp [h] #align ideal.evalβ‚‚_C_mk_eq_zero Ideal.evalβ‚‚_C_mk_eq_zero def polynomialQuotientEquivQuotientPolynomial (I : Ideal R) : (R β§Έ I)[X] ≃+* R[X] β§Έ (map C I : Ideal R[X]) where toFun := evalβ‚‚RingHom (Quotient.lift I ((Quotient.mk (map C I : Ideal R[X])).comp C) quotient_map_C_eq_zero) (Quotient.mk (map C I : Ideal R[X]) X) invFun := Quotient.lift (map C I : Ideal R[X]) (evalβ‚‚RingHom (C.comp (Quotient.mk I)) X) evalβ‚‚_C_mk_eq_zero map_mul' f g := by simp only [coe_evalβ‚‚RingHom, evalβ‚‚_mul] map_add' f g := by simp only [evalβ‚‚_add, coe_evalβ‚‚RingHom] left_inv := by intro f refine Polynomial.induction_on' f ?_ ?_ Β· intro p q hp hq simp only [coe_evalβ‚‚RingHom] at hp hq simp only [coe_evalβ‚‚RingHom, hp, hq, RingHom.map_add] Β· rintro n ⟨x⟩ simp only [← smul_X_eq_monomial, C_mul', Quotient.lift_mk, Submodule.Quotient.quot_mk_eq_mk, Quotient.mk_eq_mk, evalβ‚‚_X_pow, evalβ‚‚_smul, coe_evalβ‚‚RingHom, RingHom.map_pow, evalβ‚‚_C, RingHom.coe_comp, RingHom.map_mul, evalβ‚‚_X, Function.comp_apply] right_inv := by rintro ⟨f⟩ refine Polynomial.induction_on' f ?_ ?_ Β· -- Porting note: was `simp_intro p q hp hq` intros p q hp hq simp only [Submodule.Quotient.quot_mk_eq_mk, Quotient.mk_eq_mk, map_add, Quotient.lift_mk, coe_evalβ‚‚RingHom] at hp hq ⊒ rw [hp, hq] Β· intro n a simp only [← smul_X_eq_monomial, ← C_mul' a (X ^ n), Quotient.lift_mk, Submodule.Quotient.quot_mk_eq_mk, Quotient.mk_eq_mk, evalβ‚‚_X_pow, evalβ‚‚_smul, coe_evalβ‚‚RingHom, RingHom.map_pow, evalβ‚‚_C, RingHom.coe_comp, RingHom.map_mul, evalβ‚‚_X, Function.comp_apply] #align ideal.polynomial_quotient_equiv_quotient_polynomial Ideal.polynomialQuotientEquivQuotientPolynomial @[simp] theorem polynomialQuotientEquivQuotientPolynomial_symm_mk (I : Ideal R) (f : R[X]) : I.polynomialQuotientEquivQuotientPolynomial.symm (Quotient.mk _ f) = f.map (Quotient.mk I) := by rw [polynomialQuotientEquivQuotientPolynomial, RingEquiv.symm_mk, RingEquiv.coe_mk, Equiv.coe_fn_mk, Quotient.lift_mk, coe_evalβ‚‚RingHom, evalβ‚‚_eq_eval_map, ← Polynomial.map_map, ← evalβ‚‚_eq_eval_map, Polynomial.evalβ‚‚_C_X] #align ideal.polynomial_quotient_equiv_quotient_polynomial_symm_mk Ideal.polynomialQuotientEquivQuotientPolynomial_symm_mk @[simp] theorem polynomialQuotientEquivQuotientPolynomial_map_mk (I : Ideal R) (f : R[X]) : I.polynomialQuotientEquivQuotientPolynomial (f.map <| Quotient.mk I) = Quotient.mk (map C I : Ideal R[X]) f := by apply (polynomialQuotientEquivQuotientPolynomial I).symm.injective rw [RingEquiv.symm_apply_apply, polynomialQuotientEquivQuotientPolynomial_symm_mk] #align ideal.polynomial_quotient_equiv_quotient_polynomial_map_mk Ideal.polynomialQuotientEquivQuotientPolynomial_map_mk theorem isDomain_map_C_quotient {P : Ideal R} (_ : IsPrime P) : IsDomain (R[X] β§Έ (map (C : R β†’+* R[X]) P : Ideal R[X])) := MulEquiv.isDomain (Polynomial (R β§Έ P)) (polynomialQuotientEquivQuotientPolynomial P).symm #align ideal.is_domain_map_C_quotient Ideal.isDomain_map_C_quotient
Mathlib/RingTheory/Polynomial/Quotient.lean
175
194
theorem eq_zero_of_polynomial_mem_map_range (I : Ideal R[X]) (x : ((Quotient.mk I).comp C).range) (hx : C x ∈ I.map (Polynomial.mapRingHom ((Quotient.mk I).comp C).rangeRestrict)) : x = 0 := by
let i := ((Quotient.mk I).comp C).rangeRestrict have hi' : RingHom.ker (Polynomial.mapRingHom i) ≀ I := by refine fun f hf => polynomial_mem_ideal_of_coeff_mem_ideal I f fun n => ?_ rw [mem_comap, ← Quotient.eq_zero_iff_mem, ← RingHom.comp_apply] rw [RingHom.mem_ker, coe_mapRingHom] at hf replace hf := congr_arg (fun f : Polynomial _ => f.coeff n) hf simp only [coeff_map, coeff_zero] at hf rwa [Subtype.ext_iff, RingHom.coe_rangeRestrict] at hf obtain ⟨x, hx'⟩ := x obtain ⟨y, rfl⟩ := RingHom.mem_range.1 hx' refine Subtype.eq ?_ simp only [RingHom.comp_apply, Quotient.eq_zero_iff_mem, ZeroMemClass.coe_zero] suffices C (i y) ∈ I.map (Polynomial.mapRingHom i) by obtain ⟨f, hf⟩ := mem_image_of_mem_map_of_surjective (Polynomial.mapRingHom i) (Polynomial.map_surjective _ (RingHom.rangeRestrict_surjective ((Quotient.mk I).comp C))) this refine sub_add_cancel (C y) f β–Έ I.add_mem (hi' ?_ : C y - f ∈ I) hf.1 rw [RingHom.mem_ker, RingHom.map_sub, hf.2, sub_eq_zero, coe_mapRingHom, map_C] exact hx
18
65,659,969.137331
2
1.428571
7
1,526
import Mathlib.Algebra.Polynomial.Div import Mathlib.RingTheory.Polynomial.Basic import Mathlib.RingTheory.Ideal.QuotientOperations #align_import ring_theory.polynomial.quotient from "leanprover-community/mathlib"@"4f840b8d28320b20c87db17b3a6eef3d325fca87" set_option linter.uppercaseLean3 false open Polynomial namespace MvPolynomial variable {R : Type*} {Οƒ : Type*} [CommRing R] {r : R}
Mathlib/RingTheory/Polynomial/Quotient.lean
205
209
theorem quotient_map_C_eq_zero {I : Ideal R} {i : R} (hi : i ∈ I) : (Ideal.Quotient.mk (Ideal.map (C : R β†’+* MvPolynomial Οƒ R) I : Ideal (MvPolynomial Οƒ R))).comp C i = 0 := by
simp only [Function.comp_apply, RingHom.coe_comp, Ideal.Quotient.eq_zero_iff_mem] exact Ideal.mem_map_of_mem _ hi
2
7.389056
1
1.428571
7
1,526
import Mathlib.Algebra.Polynomial.Div import Mathlib.RingTheory.Polynomial.Basic import Mathlib.RingTheory.Ideal.QuotientOperations #align_import ring_theory.polynomial.quotient from "leanprover-community/mathlib"@"4f840b8d28320b20c87db17b3a6eef3d325fca87" set_option linter.uppercaseLean3 false open Polynomial namespace MvPolynomial variable {R : Type*} {Οƒ : Type*} [CommRing R] {r : R} theorem quotient_map_C_eq_zero {I : Ideal R} {i : R} (hi : i ∈ I) : (Ideal.Quotient.mk (Ideal.map (C : R β†’+* MvPolynomial Οƒ R) I : Ideal (MvPolynomial Οƒ R))).comp C i = 0 := by simp only [Function.comp_apply, RingHom.coe_comp, Ideal.Quotient.eq_zero_iff_mem] exact Ideal.mem_map_of_mem _ hi #align mv_polynomial.quotient_map_C_eq_zero MvPolynomial.quotient_map_C_eq_zero
Mathlib/RingTheory/Polynomial/Quotient.lean
212
223
theorem evalβ‚‚_C_mk_eq_zero {I : Ideal R} {a : MvPolynomial Οƒ R} (ha : a ∈ (Ideal.map (C : R β†’+* MvPolynomial Οƒ R) I : Ideal (MvPolynomial Οƒ R))) : evalβ‚‚Hom (C.comp (Ideal.Quotient.mk I)) X a = 0 := by
rw [as_sum a] rw [coe_evalβ‚‚Hom, evalβ‚‚_sum] refine Finset.sum_eq_zero fun n _ => ?_ simp only [evalβ‚‚_monomial, Function.comp_apply, RingHom.coe_comp] refine mul_eq_zero_of_left ?_ _ suffices coeff n a ∈ I by rw [← @Ideal.mk_ker R _ I, RingHom.mem_ker] at this simp only [this, C_0] exact mem_map_C_iff.1 ha n
9
8,103.083928
2
1.428571
7
1,526
import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff import Mathlib.LinearAlgebra.Matrix.ToLin #align_import linear_algebra.matrix.charpoly.linear_map from "leanprover-community/mathlib"@"62c0a4ef1441edb463095ea02a06e87f3dfe135c" variable {ΞΉ : Type*} [Fintype ΞΉ] variable {M : Type*} [AddCommGroup M] (R : Type*) [CommRing R] [Module R M] (I : Ideal R) variable (b : ΞΉ β†’ M) (hb : Submodule.span R (Set.range b) = ⊀) open Polynomial Matrix def PiToModule.fromMatrix [DecidableEq ΞΉ] : Matrix ΞΉ ΞΉ R β†’β‚—[R] (ΞΉ β†’ R) β†’β‚—[R] M := (LinearMap.llcomp R _ _ _ (Fintype.total R R b)).comp algEquivMatrix'.symm.toLinearMap #align pi_to_module.from_matrix PiToModule.fromMatrix theorem PiToModule.fromMatrix_apply [DecidableEq ΞΉ] (A : Matrix ΞΉ ΞΉ R) (w : ΞΉ β†’ R) : PiToModule.fromMatrix R b A w = Fintype.total R R b (A *α΅₯ w) := rfl #align pi_to_module.from_matrix_apply PiToModule.fromMatrix_apply
Mathlib/LinearAlgebra/Matrix/Charpoly/LinearMap.lean
43
46
theorem PiToModule.fromMatrix_apply_single_one [DecidableEq ΞΉ] (A : Matrix ΞΉ ΞΉ R) (j : ΞΉ) : PiToModule.fromMatrix R b A (Pi.single j 1) = βˆ‘ i : ΞΉ, A i j β€’ b i := by
rw [PiToModule.fromMatrix_apply, Fintype.total_apply, Matrix.mulVec_single] simp_rw [mul_one]
2
7.389056
1
1.444444
9
1,527
import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff import Mathlib.LinearAlgebra.Matrix.ToLin #align_import linear_algebra.matrix.charpoly.linear_map from "leanprover-community/mathlib"@"62c0a4ef1441edb463095ea02a06e87f3dfe135c" variable {ΞΉ : Type*} [Fintype ΞΉ] variable {M : Type*} [AddCommGroup M] (R : Type*) [CommRing R] [Module R M] (I : Ideal R) variable (b : ΞΉ β†’ M) (hb : Submodule.span R (Set.range b) = ⊀) open Polynomial Matrix def PiToModule.fromMatrix [DecidableEq ΞΉ] : Matrix ΞΉ ΞΉ R β†’β‚—[R] (ΞΉ β†’ R) β†’β‚—[R] M := (LinearMap.llcomp R _ _ _ (Fintype.total R R b)).comp algEquivMatrix'.symm.toLinearMap #align pi_to_module.from_matrix PiToModule.fromMatrix theorem PiToModule.fromMatrix_apply [DecidableEq ΞΉ] (A : Matrix ΞΉ ΞΉ R) (w : ΞΉ β†’ R) : PiToModule.fromMatrix R b A w = Fintype.total R R b (A *α΅₯ w) := rfl #align pi_to_module.from_matrix_apply PiToModule.fromMatrix_apply theorem PiToModule.fromMatrix_apply_single_one [DecidableEq ΞΉ] (A : Matrix ΞΉ ΞΉ R) (j : ΞΉ) : PiToModule.fromMatrix R b A (Pi.single j 1) = βˆ‘ i : ΞΉ, A i j β€’ b i := by rw [PiToModule.fromMatrix_apply, Fintype.total_apply, Matrix.mulVec_single] simp_rw [mul_one] #align pi_to_module.from_matrix_apply_single_one PiToModule.fromMatrix_apply_single_one def PiToModule.fromEnd : Module.End R M β†’β‚—[R] (ΞΉ β†’ R) β†’β‚—[R] M := LinearMap.lcomp _ _ (Fintype.total R R b) #align pi_to_module.from_End PiToModule.fromEnd theorem PiToModule.fromEnd_apply (f : Module.End R M) (w : ΞΉ β†’ R) : PiToModule.fromEnd R b f w = f (Fintype.total R R b w) := rfl #align pi_to_module.from_End_apply PiToModule.fromEnd_apply
Mathlib/LinearAlgebra/Matrix/Charpoly/LinearMap.lean
60
65
theorem PiToModule.fromEnd_apply_single_one [DecidableEq ΞΉ] (f : Module.End R M) (i : ΞΉ) : PiToModule.fromEnd R b f (Pi.single i 1) = f (b i) := by
rw [PiToModule.fromEnd_apply] congr convert Fintype.total_apply_single (S := R) R b i (1 : R) rw [one_smul]
4
54.59815
2
1.444444
9
1,527
import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff import Mathlib.LinearAlgebra.Matrix.ToLin #align_import linear_algebra.matrix.charpoly.linear_map from "leanprover-community/mathlib"@"62c0a4ef1441edb463095ea02a06e87f3dfe135c" variable {ΞΉ : Type*} [Fintype ΞΉ] variable {M : Type*} [AddCommGroup M] (R : Type*) [CommRing R] [Module R M] (I : Ideal R) variable (b : ΞΉ β†’ M) (hb : Submodule.span R (Set.range b) = ⊀) open Polynomial Matrix def PiToModule.fromMatrix [DecidableEq ΞΉ] : Matrix ΞΉ ΞΉ R β†’β‚—[R] (ΞΉ β†’ R) β†’β‚—[R] M := (LinearMap.llcomp R _ _ _ (Fintype.total R R b)).comp algEquivMatrix'.symm.toLinearMap #align pi_to_module.from_matrix PiToModule.fromMatrix theorem PiToModule.fromMatrix_apply [DecidableEq ΞΉ] (A : Matrix ΞΉ ΞΉ R) (w : ΞΉ β†’ R) : PiToModule.fromMatrix R b A w = Fintype.total R R b (A *α΅₯ w) := rfl #align pi_to_module.from_matrix_apply PiToModule.fromMatrix_apply theorem PiToModule.fromMatrix_apply_single_one [DecidableEq ΞΉ] (A : Matrix ΞΉ ΞΉ R) (j : ΞΉ) : PiToModule.fromMatrix R b A (Pi.single j 1) = βˆ‘ i : ΞΉ, A i j β€’ b i := by rw [PiToModule.fromMatrix_apply, Fintype.total_apply, Matrix.mulVec_single] simp_rw [mul_one] #align pi_to_module.from_matrix_apply_single_one PiToModule.fromMatrix_apply_single_one def PiToModule.fromEnd : Module.End R M β†’β‚—[R] (ΞΉ β†’ R) β†’β‚—[R] M := LinearMap.lcomp _ _ (Fintype.total R R b) #align pi_to_module.from_End PiToModule.fromEnd theorem PiToModule.fromEnd_apply (f : Module.End R M) (w : ΞΉ β†’ R) : PiToModule.fromEnd R b f w = f (Fintype.total R R b w) := rfl #align pi_to_module.from_End_apply PiToModule.fromEnd_apply theorem PiToModule.fromEnd_apply_single_one [DecidableEq ΞΉ] (f : Module.End R M) (i : ΞΉ) : PiToModule.fromEnd R b f (Pi.single i 1) = f (b i) := by rw [PiToModule.fromEnd_apply] congr convert Fintype.total_apply_single (S := R) R b i (1 : R) rw [one_smul] #align pi_to_module.from_End_apply_single_one PiToModule.fromEnd_apply_single_one
Mathlib/LinearAlgebra/Matrix/Charpoly/LinearMap.lean
68
75
theorem PiToModule.fromEnd_injective (hb : Submodule.span R (Set.range b) = ⊀) : Function.Injective (PiToModule.fromEnd R b) := by
intro x y e ext m obtain ⟨m, rfl⟩ : m ∈ LinearMap.range (Fintype.total R R b) := by rw [(Fintype.range_total R b).trans hb] exact Submodule.mem_top exact (LinearMap.congr_fun e m : _)
6
403.428793
2
1.444444
9
1,527
import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff import Mathlib.LinearAlgebra.Matrix.ToLin #align_import linear_algebra.matrix.charpoly.linear_map from "leanprover-community/mathlib"@"62c0a4ef1441edb463095ea02a06e87f3dfe135c" variable {ΞΉ : Type*} [Fintype ΞΉ] variable {M : Type*} [AddCommGroup M] (R : Type*) [CommRing R] [Module R M] (I : Ideal R) variable (b : ΞΉ β†’ M) (hb : Submodule.span R (Set.range b) = ⊀) open Polynomial Matrix def PiToModule.fromMatrix [DecidableEq ΞΉ] : Matrix ΞΉ ΞΉ R β†’β‚—[R] (ΞΉ β†’ R) β†’β‚—[R] M := (LinearMap.llcomp R _ _ _ (Fintype.total R R b)).comp algEquivMatrix'.symm.toLinearMap #align pi_to_module.from_matrix PiToModule.fromMatrix theorem PiToModule.fromMatrix_apply [DecidableEq ΞΉ] (A : Matrix ΞΉ ΞΉ R) (w : ΞΉ β†’ R) : PiToModule.fromMatrix R b A w = Fintype.total R R b (A *α΅₯ w) := rfl #align pi_to_module.from_matrix_apply PiToModule.fromMatrix_apply theorem PiToModule.fromMatrix_apply_single_one [DecidableEq ΞΉ] (A : Matrix ΞΉ ΞΉ R) (j : ΞΉ) : PiToModule.fromMatrix R b A (Pi.single j 1) = βˆ‘ i : ΞΉ, A i j β€’ b i := by rw [PiToModule.fromMatrix_apply, Fintype.total_apply, Matrix.mulVec_single] simp_rw [mul_one] #align pi_to_module.from_matrix_apply_single_one PiToModule.fromMatrix_apply_single_one def PiToModule.fromEnd : Module.End R M β†’β‚—[R] (ΞΉ β†’ R) β†’β‚—[R] M := LinearMap.lcomp _ _ (Fintype.total R R b) #align pi_to_module.from_End PiToModule.fromEnd theorem PiToModule.fromEnd_apply (f : Module.End R M) (w : ΞΉ β†’ R) : PiToModule.fromEnd R b f w = f (Fintype.total R R b w) := rfl #align pi_to_module.from_End_apply PiToModule.fromEnd_apply theorem PiToModule.fromEnd_apply_single_one [DecidableEq ΞΉ] (f : Module.End R M) (i : ΞΉ) : PiToModule.fromEnd R b f (Pi.single i 1) = f (b i) := by rw [PiToModule.fromEnd_apply] congr convert Fintype.total_apply_single (S := R) R b i (1 : R) rw [one_smul] #align pi_to_module.from_End_apply_single_one PiToModule.fromEnd_apply_single_one theorem PiToModule.fromEnd_injective (hb : Submodule.span R (Set.range b) = ⊀) : Function.Injective (PiToModule.fromEnd R b) := by intro x y e ext m obtain ⟨m, rfl⟩ : m ∈ LinearMap.range (Fintype.total R R b) := by rw [(Fintype.range_total R b).trans hb] exact Submodule.mem_top exact (LinearMap.congr_fun e m : _) #align pi_to_module.from_End_injective PiToModule.fromEnd_injective section variable {R} [DecidableEq ΞΉ] def Matrix.Represents (A : Matrix ΞΉ ΞΉ R) (f : Module.End R M) : Prop := PiToModule.fromMatrix R b A = PiToModule.fromEnd R b f #align matrix.represents Matrix.Represents variable {b} theorem Matrix.Represents.congr_fun {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} (h : A.Represents b f) (x) : Fintype.total R R b (A *α΅₯ x) = f (Fintype.total R R b x) := LinearMap.congr_fun h x #align matrix.represents.congr_fun Matrix.Represents.congr_fun theorem Matrix.represents_iff {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} : A.Represents b f ↔ βˆ€ x, Fintype.total R R b (A *α΅₯ x) = f (Fintype.total R R b x) := ⟨fun e x => e.congr_fun x, fun H => LinearMap.ext fun x => H x⟩ #align matrix.represents_iff Matrix.represents_iff
Mathlib/LinearAlgebra/Matrix/Charpoly/LinearMap.lean
100
111
theorem Matrix.represents_iff' {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} : A.Represents b f ↔ βˆ€ j, βˆ‘ i : ΞΉ, A i j β€’ b i = f (b j) := by
constructor Β· intro h i have := LinearMap.congr_fun h (Pi.single i 1) rwa [PiToModule.fromEnd_apply_single_one, PiToModule.fromMatrix_apply_single_one] at this Β· intro h -- Porting note: was `ext` refine LinearMap.pi_ext' (fun i => LinearMap.ext_ring ?_) simp_rw [LinearMap.comp_apply, LinearMap.coe_single, PiToModule.fromEnd_apply_single_one, PiToModule.fromMatrix_apply_single_one] apply h
10
22,026.465795
2
1.444444
9
1,527
import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff import Mathlib.LinearAlgebra.Matrix.ToLin #align_import linear_algebra.matrix.charpoly.linear_map from "leanprover-community/mathlib"@"62c0a4ef1441edb463095ea02a06e87f3dfe135c" variable {ΞΉ : Type*} [Fintype ΞΉ] variable {M : Type*} [AddCommGroup M] (R : Type*) [CommRing R] [Module R M] (I : Ideal R) variable (b : ΞΉ β†’ M) (hb : Submodule.span R (Set.range b) = ⊀) open Polynomial Matrix def PiToModule.fromMatrix [DecidableEq ΞΉ] : Matrix ΞΉ ΞΉ R β†’β‚—[R] (ΞΉ β†’ R) β†’β‚—[R] M := (LinearMap.llcomp R _ _ _ (Fintype.total R R b)).comp algEquivMatrix'.symm.toLinearMap #align pi_to_module.from_matrix PiToModule.fromMatrix theorem PiToModule.fromMatrix_apply [DecidableEq ΞΉ] (A : Matrix ΞΉ ΞΉ R) (w : ΞΉ β†’ R) : PiToModule.fromMatrix R b A w = Fintype.total R R b (A *α΅₯ w) := rfl #align pi_to_module.from_matrix_apply PiToModule.fromMatrix_apply theorem PiToModule.fromMatrix_apply_single_one [DecidableEq ΞΉ] (A : Matrix ΞΉ ΞΉ R) (j : ΞΉ) : PiToModule.fromMatrix R b A (Pi.single j 1) = βˆ‘ i : ΞΉ, A i j β€’ b i := by rw [PiToModule.fromMatrix_apply, Fintype.total_apply, Matrix.mulVec_single] simp_rw [mul_one] #align pi_to_module.from_matrix_apply_single_one PiToModule.fromMatrix_apply_single_one def PiToModule.fromEnd : Module.End R M β†’β‚—[R] (ΞΉ β†’ R) β†’β‚—[R] M := LinearMap.lcomp _ _ (Fintype.total R R b) #align pi_to_module.from_End PiToModule.fromEnd theorem PiToModule.fromEnd_apply (f : Module.End R M) (w : ΞΉ β†’ R) : PiToModule.fromEnd R b f w = f (Fintype.total R R b w) := rfl #align pi_to_module.from_End_apply PiToModule.fromEnd_apply theorem PiToModule.fromEnd_apply_single_one [DecidableEq ΞΉ] (f : Module.End R M) (i : ΞΉ) : PiToModule.fromEnd R b f (Pi.single i 1) = f (b i) := by rw [PiToModule.fromEnd_apply] congr convert Fintype.total_apply_single (S := R) R b i (1 : R) rw [one_smul] #align pi_to_module.from_End_apply_single_one PiToModule.fromEnd_apply_single_one theorem PiToModule.fromEnd_injective (hb : Submodule.span R (Set.range b) = ⊀) : Function.Injective (PiToModule.fromEnd R b) := by intro x y e ext m obtain ⟨m, rfl⟩ : m ∈ LinearMap.range (Fintype.total R R b) := by rw [(Fintype.range_total R b).trans hb] exact Submodule.mem_top exact (LinearMap.congr_fun e m : _) #align pi_to_module.from_End_injective PiToModule.fromEnd_injective section variable {R} [DecidableEq ΞΉ] def Matrix.Represents (A : Matrix ΞΉ ΞΉ R) (f : Module.End R M) : Prop := PiToModule.fromMatrix R b A = PiToModule.fromEnd R b f #align matrix.represents Matrix.Represents variable {b} theorem Matrix.Represents.congr_fun {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} (h : A.Represents b f) (x) : Fintype.total R R b (A *α΅₯ x) = f (Fintype.total R R b x) := LinearMap.congr_fun h x #align matrix.represents.congr_fun Matrix.Represents.congr_fun theorem Matrix.represents_iff {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} : A.Represents b f ↔ βˆ€ x, Fintype.total R R b (A *α΅₯ x) = f (Fintype.total R R b x) := ⟨fun e x => e.congr_fun x, fun H => LinearMap.ext fun x => H x⟩ #align matrix.represents_iff Matrix.represents_iff theorem Matrix.represents_iff' {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} : A.Represents b f ↔ βˆ€ j, βˆ‘ i : ΞΉ, A i j β€’ b i = f (b j) := by constructor Β· intro h i have := LinearMap.congr_fun h (Pi.single i 1) rwa [PiToModule.fromEnd_apply_single_one, PiToModule.fromMatrix_apply_single_one] at this Β· intro h -- Porting note: was `ext` refine LinearMap.pi_ext' (fun i => LinearMap.ext_ring ?_) simp_rw [LinearMap.comp_apply, LinearMap.coe_single, PiToModule.fromEnd_apply_single_one, PiToModule.fromMatrix_apply_single_one] apply h #align matrix.represents_iff' Matrix.represents_iff'
Mathlib/LinearAlgebra/Matrix/Charpoly/LinearMap.lean
114
121
theorem Matrix.Represents.mul {A A' : Matrix ΞΉ ΞΉ R} {f f' : Module.End R M} (h : A.Represents b f) (h' : Matrix.Represents b A' f') : (A * A').Represents b (f * f') := by
delta Matrix.Represents PiToModule.fromMatrix rw [LinearMap.comp_apply, AlgEquiv.toLinearMap_apply, _root_.map_mul] ext dsimp [PiToModule.fromEnd] rw [← h'.congr_fun, ← h.congr_fun] rfl
6
403.428793
2
1.444444
9
1,527
import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff import Mathlib.LinearAlgebra.Matrix.ToLin #align_import linear_algebra.matrix.charpoly.linear_map from "leanprover-community/mathlib"@"62c0a4ef1441edb463095ea02a06e87f3dfe135c" variable {ΞΉ : Type*} [Fintype ΞΉ] variable {M : Type*} [AddCommGroup M] (R : Type*) [CommRing R] [Module R M] (I : Ideal R) variable (b : ΞΉ β†’ M) (hb : Submodule.span R (Set.range b) = ⊀) open Polynomial Matrix def PiToModule.fromMatrix [DecidableEq ΞΉ] : Matrix ΞΉ ΞΉ R β†’β‚—[R] (ΞΉ β†’ R) β†’β‚—[R] M := (LinearMap.llcomp R _ _ _ (Fintype.total R R b)).comp algEquivMatrix'.symm.toLinearMap #align pi_to_module.from_matrix PiToModule.fromMatrix theorem PiToModule.fromMatrix_apply [DecidableEq ΞΉ] (A : Matrix ΞΉ ΞΉ R) (w : ΞΉ β†’ R) : PiToModule.fromMatrix R b A w = Fintype.total R R b (A *α΅₯ w) := rfl #align pi_to_module.from_matrix_apply PiToModule.fromMatrix_apply theorem PiToModule.fromMatrix_apply_single_one [DecidableEq ΞΉ] (A : Matrix ΞΉ ΞΉ R) (j : ΞΉ) : PiToModule.fromMatrix R b A (Pi.single j 1) = βˆ‘ i : ΞΉ, A i j β€’ b i := by rw [PiToModule.fromMatrix_apply, Fintype.total_apply, Matrix.mulVec_single] simp_rw [mul_one] #align pi_to_module.from_matrix_apply_single_one PiToModule.fromMatrix_apply_single_one def PiToModule.fromEnd : Module.End R M β†’β‚—[R] (ΞΉ β†’ R) β†’β‚—[R] M := LinearMap.lcomp _ _ (Fintype.total R R b) #align pi_to_module.from_End PiToModule.fromEnd theorem PiToModule.fromEnd_apply (f : Module.End R M) (w : ΞΉ β†’ R) : PiToModule.fromEnd R b f w = f (Fintype.total R R b w) := rfl #align pi_to_module.from_End_apply PiToModule.fromEnd_apply theorem PiToModule.fromEnd_apply_single_one [DecidableEq ΞΉ] (f : Module.End R M) (i : ΞΉ) : PiToModule.fromEnd R b f (Pi.single i 1) = f (b i) := by rw [PiToModule.fromEnd_apply] congr convert Fintype.total_apply_single (S := R) R b i (1 : R) rw [one_smul] #align pi_to_module.from_End_apply_single_one PiToModule.fromEnd_apply_single_one theorem PiToModule.fromEnd_injective (hb : Submodule.span R (Set.range b) = ⊀) : Function.Injective (PiToModule.fromEnd R b) := by intro x y e ext m obtain ⟨m, rfl⟩ : m ∈ LinearMap.range (Fintype.total R R b) := by rw [(Fintype.range_total R b).trans hb] exact Submodule.mem_top exact (LinearMap.congr_fun e m : _) #align pi_to_module.from_End_injective PiToModule.fromEnd_injective section variable {R} [DecidableEq ΞΉ] def Matrix.Represents (A : Matrix ΞΉ ΞΉ R) (f : Module.End R M) : Prop := PiToModule.fromMatrix R b A = PiToModule.fromEnd R b f #align matrix.represents Matrix.Represents variable {b} theorem Matrix.Represents.congr_fun {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} (h : A.Represents b f) (x) : Fintype.total R R b (A *α΅₯ x) = f (Fintype.total R R b x) := LinearMap.congr_fun h x #align matrix.represents.congr_fun Matrix.Represents.congr_fun theorem Matrix.represents_iff {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} : A.Represents b f ↔ βˆ€ x, Fintype.total R R b (A *α΅₯ x) = f (Fintype.total R R b x) := ⟨fun e x => e.congr_fun x, fun H => LinearMap.ext fun x => H x⟩ #align matrix.represents_iff Matrix.represents_iff theorem Matrix.represents_iff' {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} : A.Represents b f ↔ βˆ€ j, βˆ‘ i : ΞΉ, A i j β€’ b i = f (b j) := by constructor Β· intro h i have := LinearMap.congr_fun h (Pi.single i 1) rwa [PiToModule.fromEnd_apply_single_one, PiToModule.fromMatrix_apply_single_one] at this Β· intro h -- Porting note: was `ext` refine LinearMap.pi_ext' (fun i => LinearMap.ext_ring ?_) simp_rw [LinearMap.comp_apply, LinearMap.coe_single, PiToModule.fromEnd_apply_single_one, PiToModule.fromMatrix_apply_single_one] apply h #align matrix.represents_iff' Matrix.represents_iff' theorem Matrix.Represents.mul {A A' : Matrix ΞΉ ΞΉ R} {f f' : Module.End R M} (h : A.Represents b f) (h' : Matrix.Represents b A' f') : (A * A').Represents b (f * f') := by delta Matrix.Represents PiToModule.fromMatrix rw [LinearMap.comp_apply, AlgEquiv.toLinearMap_apply, _root_.map_mul] ext dsimp [PiToModule.fromEnd] rw [← h'.congr_fun, ← h.congr_fun] rfl #align matrix.represents.mul Matrix.Represents.mul
Mathlib/LinearAlgebra/Matrix/Charpoly/LinearMap.lean
124
128
theorem Matrix.Represents.one : (1 : Matrix ΞΉ ΞΉ R).Represents b 1 := by
delta Matrix.Represents PiToModule.fromMatrix rw [LinearMap.comp_apply, AlgEquiv.toLinearMap_apply, _root_.map_one] ext rfl
4
54.59815
2
1.444444
9
1,527
import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff import Mathlib.LinearAlgebra.Matrix.ToLin #align_import linear_algebra.matrix.charpoly.linear_map from "leanprover-community/mathlib"@"62c0a4ef1441edb463095ea02a06e87f3dfe135c" variable {ΞΉ : Type*} [Fintype ΞΉ] variable {M : Type*} [AddCommGroup M] (R : Type*) [CommRing R] [Module R M] (I : Ideal R) variable (b : ΞΉ β†’ M) (hb : Submodule.span R (Set.range b) = ⊀) open Polynomial Matrix def PiToModule.fromMatrix [DecidableEq ΞΉ] : Matrix ΞΉ ΞΉ R β†’β‚—[R] (ΞΉ β†’ R) β†’β‚—[R] M := (LinearMap.llcomp R _ _ _ (Fintype.total R R b)).comp algEquivMatrix'.symm.toLinearMap #align pi_to_module.from_matrix PiToModule.fromMatrix theorem PiToModule.fromMatrix_apply [DecidableEq ΞΉ] (A : Matrix ΞΉ ΞΉ R) (w : ΞΉ β†’ R) : PiToModule.fromMatrix R b A w = Fintype.total R R b (A *α΅₯ w) := rfl #align pi_to_module.from_matrix_apply PiToModule.fromMatrix_apply theorem PiToModule.fromMatrix_apply_single_one [DecidableEq ΞΉ] (A : Matrix ΞΉ ΞΉ R) (j : ΞΉ) : PiToModule.fromMatrix R b A (Pi.single j 1) = βˆ‘ i : ΞΉ, A i j β€’ b i := by rw [PiToModule.fromMatrix_apply, Fintype.total_apply, Matrix.mulVec_single] simp_rw [mul_one] #align pi_to_module.from_matrix_apply_single_one PiToModule.fromMatrix_apply_single_one def PiToModule.fromEnd : Module.End R M β†’β‚—[R] (ΞΉ β†’ R) β†’β‚—[R] M := LinearMap.lcomp _ _ (Fintype.total R R b) #align pi_to_module.from_End PiToModule.fromEnd theorem PiToModule.fromEnd_apply (f : Module.End R M) (w : ΞΉ β†’ R) : PiToModule.fromEnd R b f w = f (Fintype.total R R b w) := rfl #align pi_to_module.from_End_apply PiToModule.fromEnd_apply theorem PiToModule.fromEnd_apply_single_one [DecidableEq ΞΉ] (f : Module.End R M) (i : ΞΉ) : PiToModule.fromEnd R b f (Pi.single i 1) = f (b i) := by rw [PiToModule.fromEnd_apply] congr convert Fintype.total_apply_single (S := R) R b i (1 : R) rw [one_smul] #align pi_to_module.from_End_apply_single_one PiToModule.fromEnd_apply_single_one theorem PiToModule.fromEnd_injective (hb : Submodule.span R (Set.range b) = ⊀) : Function.Injective (PiToModule.fromEnd R b) := by intro x y e ext m obtain ⟨m, rfl⟩ : m ∈ LinearMap.range (Fintype.total R R b) := by rw [(Fintype.range_total R b).trans hb] exact Submodule.mem_top exact (LinearMap.congr_fun e m : _) #align pi_to_module.from_End_injective PiToModule.fromEnd_injective section variable {R} [DecidableEq ΞΉ] def Matrix.Represents (A : Matrix ΞΉ ΞΉ R) (f : Module.End R M) : Prop := PiToModule.fromMatrix R b A = PiToModule.fromEnd R b f #align matrix.represents Matrix.Represents variable {b} theorem Matrix.Represents.congr_fun {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} (h : A.Represents b f) (x) : Fintype.total R R b (A *α΅₯ x) = f (Fintype.total R R b x) := LinearMap.congr_fun h x #align matrix.represents.congr_fun Matrix.Represents.congr_fun theorem Matrix.represents_iff {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} : A.Represents b f ↔ βˆ€ x, Fintype.total R R b (A *α΅₯ x) = f (Fintype.total R R b x) := ⟨fun e x => e.congr_fun x, fun H => LinearMap.ext fun x => H x⟩ #align matrix.represents_iff Matrix.represents_iff theorem Matrix.represents_iff' {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} : A.Represents b f ↔ βˆ€ j, βˆ‘ i : ΞΉ, A i j β€’ b i = f (b j) := by constructor Β· intro h i have := LinearMap.congr_fun h (Pi.single i 1) rwa [PiToModule.fromEnd_apply_single_one, PiToModule.fromMatrix_apply_single_one] at this Β· intro h -- Porting note: was `ext` refine LinearMap.pi_ext' (fun i => LinearMap.ext_ring ?_) simp_rw [LinearMap.comp_apply, LinearMap.coe_single, PiToModule.fromEnd_apply_single_one, PiToModule.fromMatrix_apply_single_one] apply h #align matrix.represents_iff' Matrix.represents_iff' theorem Matrix.Represents.mul {A A' : Matrix ΞΉ ΞΉ R} {f f' : Module.End R M} (h : A.Represents b f) (h' : Matrix.Represents b A' f') : (A * A').Represents b (f * f') := by delta Matrix.Represents PiToModule.fromMatrix rw [LinearMap.comp_apply, AlgEquiv.toLinearMap_apply, _root_.map_mul] ext dsimp [PiToModule.fromEnd] rw [← h'.congr_fun, ← h.congr_fun] rfl #align matrix.represents.mul Matrix.Represents.mul theorem Matrix.Represents.one : (1 : Matrix ΞΉ ΞΉ R).Represents b 1 := by delta Matrix.Represents PiToModule.fromMatrix rw [LinearMap.comp_apply, AlgEquiv.toLinearMap_apply, _root_.map_one] ext rfl #align matrix.represents.one Matrix.Represents.one
Mathlib/LinearAlgebra/Matrix/Charpoly/LinearMap.lean
131
133
theorem Matrix.Represents.add {A A' : Matrix ΞΉ ΞΉ R} {f f' : Module.End R M} (h : A.Represents b f) (h' : Matrix.Represents b A' f') : (A + A').Represents b (f + f') := by
delta Matrix.Represents at h h' ⊒; rw [map_add, map_add, h, h']
1
2.718282
0
1.444444
9
1,527
import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff import Mathlib.LinearAlgebra.Matrix.ToLin #align_import linear_algebra.matrix.charpoly.linear_map from "leanprover-community/mathlib"@"62c0a4ef1441edb463095ea02a06e87f3dfe135c" variable {ΞΉ : Type*} [Fintype ΞΉ] variable {M : Type*} [AddCommGroup M] (R : Type*) [CommRing R] [Module R M] (I : Ideal R) variable (b : ΞΉ β†’ M) (hb : Submodule.span R (Set.range b) = ⊀) open Polynomial Matrix def PiToModule.fromMatrix [DecidableEq ΞΉ] : Matrix ΞΉ ΞΉ R β†’β‚—[R] (ΞΉ β†’ R) β†’β‚—[R] M := (LinearMap.llcomp R _ _ _ (Fintype.total R R b)).comp algEquivMatrix'.symm.toLinearMap #align pi_to_module.from_matrix PiToModule.fromMatrix theorem PiToModule.fromMatrix_apply [DecidableEq ΞΉ] (A : Matrix ΞΉ ΞΉ R) (w : ΞΉ β†’ R) : PiToModule.fromMatrix R b A w = Fintype.total R R b (A *α΅₯ w) := rfl #align pi_to_module.from_matrix_apply PiToModule.fromMatrix_apply theorem PiToModule.fromMatrix_apply_single_one [DecidableEq ΞΉ] (A : Matrix ΞΉ ΞΉ R) (j : ΞΉ) : PiToModule.fromMatrix R b A (Pi.single j 1) = βˆ‘ i : ΞΉ, A i j β€’ b i := by rw [PiToModule.fromMatrix_apply, Fintype.total_apply, Matrix.mulVec_single] simp_rw [mul_one] #align pi_to_module.from_matrix_apply_single_one PiToModule.fromMatrix_apply_single_one def PiToModule.fromEnd : Module.End R M β†’β‚—[R] (ΞΉ β†’ R) β†’β‚—[R] M := LinearMap.lcomp _ _ (Fintype.total R R b) #align pi_to_module.from_End PiToModule.fromEnd theorem PiToModule.fromEnd_apply (f : Module.End R M) (w : ΞΉ β†’ R) : PiToModule.fromEnd R b f w = f (Fintype.total R R b w) := rfl #align pi_to_module.from_End_apply PiToModule.fromEnd_apply theorem PiToModule.fromEnd_apply_single_one [DecidableEq ΞΉ] (f : Module.End R M) (i : ΞΉ) : PiToModule.fromEnd R b f (Pi.single i 1) = f (b i) := by rw [PiToModule.fromEnd_apply] congr convert Fintype.total_apply_single (S := R) R b i (1 : R) rw [one_smul] #align pi_to_module.from_End_apply_single_one PiToModule.fromEnd_apply_single_one theorem PiToModule.fromEnd_injective (hb : Submodule.span R (Set.range b) = ⊀) : Function.Injective (PiToModule.fromEnd R b) := by intro x y e ext m obtain ⟨m, rfl⟩ : m ∈ LinearMap.range (Fintype.total R R b) := by rw [(Fintype.range_total R b).trans hb] exact Submodule.mem_top exact (LinearMap.congr_fun e m : _) #align pi_to_module.from_End_injective PiToModule.fromEnd_injective section variable {R} [DecidableEq ΞΉ] def Matrix.Represents (A : Matrix ΞΉ ΞΉ R) (f : Module.End R M) : Prop := PiToModule.fromMatrix R b A = PiToModule.fromEnd R b f #align matrix.represents Matrix.Represents variable {b} theorem Matrix.Represents.congr_fun {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} (h : A.Represents b f) (x) : Fintype.total R R b (A *α΅₯ x) = f (Fintype.total R R b x) := LinearMap.congr_fun h x #align matrix.represents.congr_fun Matrix.Represents.congr_fun theorem Matrix.represents_iff {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} : A.Represents b f ↔ βˆ€ x, Fintype.total R R b (A *α΅₯ x) = f (Fintype.total R R b x) := ⟨fun e x => e.congr_fun x, fun H => LinearMap.ext fun x => H x⟩ #align matrix.represents_iff Matrix.represents_iff theorem Matrix.represents_iff' {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} : A.Represents b f ↔ βˆ€ j, βˆ‘ i : ΞΉ, A i j β€’ b i = f (b j) := by constructor Β· intro h i have := LinearMap.congr_fun h (Pi.single i 1) rwa [PiToModule.fromEnd_apply_single_one, PiToModule.fromMatrix_apply_single_one] at this Β· intro h -- Porting note: was `ext` refine LinearMap.pi_ext' (fun i => LinearMap.ext_ring ?_) simp_rw [LinearMap.comp_apply, LinearMap.coe_single, PiToModule.fromEnd_apply_single_one, PiToModule.fromMatrix_apply_single_one] apply h #align matrix.represents_iff' Matrix.represents_iff' theorem Matrix.Represents.mul {A A' : Matrix ΞΉ ΞΉ R} {f f' : Module.End R M} (h : A.Represents b f) (h' : Matrix.Represents b A' f') : (A * A').Represents b (f * f') := by delta Matrix.Represents PiToModule.fromMatrix rw [LinearMap.comp_apply, AlgEquiv.toLinearMap_apply, _root_.map_mul] ext dsimp [PiToModule.fromEnd] rw [← h'.congr_fun, ← h.congr_fun] rfl #align matrix.represents.mul Matrix.Represents.mul theorem Matrix.Represents.one : (1 : Matrix ΞΉ ΞΉ R).Represents b 1 := by delta Matrix.Represents PiToModule.fromMatrix rw [LinearMap.comp_apply, AlgEquiv.toLinearMap_apply, _root_.map_one] ext rfl #align matrix.represents.one Matrix.Represents.one theorem Matrix.Represents.add {A A' : Matrix ΞΉ ΞΉ R} {f f' : Module.End R M} (h : A.Represents b f) (h' : Matrix.Represents b A' f') : (A + A').Represents b (f + f') := by delta Matrix.Represents at h h' ⊒; rw [map_add, map_add, h, h'] #align matrix.represents.add Matrix.Represents.add
Mathlib/LinearAlgebra/Matrix/Charpoly/LinearMap.lean
136
138
theorem Matrix.Represents.zero : (0 : Matrix ΞΉ ΞΉ R).Represents b 0 := by
delta Matrix.Represents rw [map_zero, map_zero]
2
7.389056
1
1.444444
9
1,527
import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff import Mathlib.LinearAlgebra.Matrix.ToLin #align_import linear_algebra.matrix.charpoly.linear_map from "leanprover-community/mathlib"@"62c0a4ef1441edb463095ea02a06e87f3dfe135c" variable {ΞΉ : Type*} [Fintype ΞΉ] variable {M : Type*} [AddCommGroup M] (R : Type*) [CommRing R] [Module R M] (I : Ideal R) variable (b : ΞΉ β†’ M) (hb : Submodule.span R (Set.range b) = ⊀) open Polynomial Matrix def PiToModule.fromMatrix [DecidableEq ΞΉ] : Matrix ΞΉ ΞΉ R β†’β‚—[R] (ΞΉ β†’ R) β†’β‚—[R] M := (LinearMap.llcomp R _ _ _ (Fintype.total R R b)).comp algEquivMatrix'.symm.toLinearMap #align pi_to_module.from_matrix PiToModule.fromMatrix theorem PiToModule.fromMatrix_apply [DecidableEq ΞΉ] (A : Matrix ΞΉ ΞΉ R) (w : ΞΉ β†’ R) : PiToModule.fromMatrix R b A w = Fintype.total R R b (A *α΅₯ w) := rfl #align pi_to_module.from_matrix_apply PiToModule.fromMatrix_apply theorem PiToModule.fromMatrix_apply_single_one [DecidableEq ΞΉ] (A : Matrix ΞΉ ΞΉ R) (j : ΞΉ) : PiToModule.fromMatrix R b A (Pi.single j 1) = βˆ‘ i : ΞΉ, A i j β€’ b i := by rw [PiToModule.fromMatrix_apply, Fintype.total_apply, Matrix.mulVec_single] simp_rw [mul_one] #align pi_to_module.from_matrix_apply_single_one PiToModule.fromMatrix_apply_single_one def PiToModule.fromEnd : Module.End R M β†’β‚—[R] (ΞΉ β†’ R) β†’β‚—[R] M := LinearMap.lcomp _ _ (Fintype.total R R b) #align pi_to_module.from_End PiToModule.fromEnd theorem PiToModule.fromEnd_apply (f : Module.End R M) (w : ΞΉ β†’ R) : PiToModule.fromEnd R b f w = f (Fintype.total R R b w) := rfl #align pi_to_module.from_End_apply PiToModule.fromEnd_apply theorem PiToModule.fromEnd_apply_single_one [DecidableEq ΞΉ] (f : Module.End R M) (i : ΞΉ) : PiToModule.fromEnd R b f (Pi.single i 1) = f (b i) := by rw [PiToModule.fromEnd_apply] congr convert Fintype.total_apply_single (S := R) R b i (1 : R) rw [one_smul] #align pi_to_module.from_End_apply_single_one PiToModule.fromEnd_apply_single_one theorem PiToModule.fromEnd_injective (hb : Submodule.span R (Set.range b) = ⊀) : Function.Injective (PiToModule.fromEnd R b) := by intro x y e ext m obtain ⟨m, rfl⟩ : m ∈ LinearMap.range (Fintype.total R R b) := by rw [(Fintype.range_total R b).trans hb] exact Submodule.mem_top exact (LinearMap.congr_fun e m : _) #align pi_to_module.from_End_injective PiToModule.fromEnd_injective section variable {R} [DecidableEq ΞΉ] def Matrix.Represents (A : Matrix ΞΉ ΞΉ R) (f : Module.End R M) : Prop := PiToModule.fromMatrix R b A = PiToModule.fromEnd R b f #align matrix.represents Matrix.Represents variable {b} theorem Matrix.Represents.congr_fun {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} (h : A.Represents b f) (x) : Fintype.total R R b (A *α΅₯ x) = f (Fintype.total R R b x) := LinearMap.congr_fun h x #align matrix.represents.congr_fun Matrix.Represents.congr_fun theorem Matrix.represents_iff {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} : A.Represents b f ↔ βˆ€ x, Fintype.total R R b (A *α΅₯ x) = f (Fintype.total R R b x) := ⟨fun e x => e.congr_fun x, fun H => LinearMap.ext fun x => H x⟩ #align matrix.represents_iff Matrix.represents_iff theorem Matrix.represents_iff' {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} : A.Represents b f ↔ βˆ€ j, βˆ‘ i : ΞΉ, A i j β€’ b i = f (b j) := by constructor Β· intro h i have := LinearMap.congr_fun h (Pi.single i 1) rwa [PiToModule.fromEnd_apply_single_one, PiToModule.fromMatrix_apply_single_one] at this Β· intro h -- Porting note: was `ext` refine LinearMap.pi_ext' (fun i => LinearMap.ext_ring ?_) simp_rw [LinearMap.comp_apply, LinearMap.coe_single, PiToModule.fromEnd_apply_single_one, PiToModule.fromMatrix_apply_single_one] apply h #align matrix.represents_iff' Matrix.represents_iff' theorem Matrix.Represents.mul {A A' : Matrix ΞΉ ΞΉ R} {f f' : Module.End R M} (h : A.Represents b f) (h' : Matrix.Represents b A' f') : (A * A').Represents b (f * f') := by delta Matrix.Represents PiToModule.fromMatrix rw [LinearMap.comp_apply, AlgEquiv.toLinearMap_apply, _root_.map_mul] ext dsimp [PiToModule.fromEnd] rw [← h'.congr_fun, ← h.congr_fun] rfl #align matrix.represents.mul Matrix.Represents.mul theorem Matrix.Represents.one : (1 : Matrix ΞΉ ΞΉ R).Represents b 1 := by delta Matrix.Represents PiToModule.fromMatrix rw [LinearMap.comp_apply, AlgEquiv.toLinearMap_apply, _root_.map_one] ext rfl #align matrix.represents.one Matrix.Represents.one theorem Matrix.Represents.add {A A' : Matrix ΞΉ ΞΉ R} {f f' : Module.End R M} (h : A.Represents b f) (h' : Matrix.Represents b A' f') : (A + A').Represents b (f + f') := by delta Matrix.Represents at h h' ⊒; rw [map_add, map_add, h, h'] #align matrix.represents.add Matrix.Represents.add theorem Matrix.Represents.zero : (0 : Matrix ΞΉ ΞΉ R).Represents b 0 := by delta Matrix.Represents rw [map_zero, map_zero] #align matrix.represents.zero Matrix.Represents.zero
Mathlib/LinearAlgebra/Matrix/Charpoly/LinearMap.lean
141
144
theorem Matrix.Represents.smul {A : Matrix ΞΉ ΞΉ R} {f : Module.End R M} (h : A.Represents b f) (r : R) : (r β€’ A).Represents b (r β€’ f) := by
delta Matrix.Represents at h ⊒ rw [_root_.map_smul, _root_.map_smul, h]
2
7.389056
1
1.444444
9
1,527
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order #align_import measure_theory.constructions.borel_space.basic from "leanprover-community/mathlib"@"9f55d0d4363ae59948c33864cbc52e0b12e0e8ce" open Set Filter MeasureTheory MeasurableSpace open scoped Classical Topology NNReal ENNReal MeasureTheory universe u v w x y variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*} {ΞΉ : Sort y} {s t u : Set Ξ±} namespace Real theorem borel_eq_generateFrom_Ioo_rat : borel ℝ = .generateFrom (⋃ (a : β„š) (b : β„š) (_ : a < b), {Ioo (a : ℝ) (b : ℝ)}) := isTopologicalBasis_Ioo_rat.borel_eq_generateFrom #align real.borel_eq_generate_from_Ioo_rat Real.borel_eq_generateFrom_Ioo_rat
Mathlib/MeasureTheory/Constructions/BorelSpace/Real.lean
44
54
theorem borel_eq_generateFrom_Iio_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Iio (a : ℝ)}) := by
rw [borel_eq_generateFrom_Iio] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsLUB (range ((↑) : β„š β†’ ℝ) ∩ Iio a) a := by simp [isLUB_iff_le_iff, mem_upperBounds, ← le_iff_forall_rat_lt_imp_le] rw [← this.biUnion_Iio_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Iio (b : ℝ)) (by simp)
10
22,026.465795
2
1.444444
9
1,528
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order #align_import measure_theory.constructions.borel_space.basic from "leanprover-community/mathlib"@"9f55d0d4363ae59948c33864cbc52e0b12e0e8ce" open Set Filter MeasureTheory MeasurableSpace open scoped Classical Topology NNReal ENNReal MeasureTheory universe u v w x y variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*} {ΞΉ : Sort y} {s t u : Set Ξ±} namespace Real theorem borel_eq_generateFrom_Ioo_rat : borel ℝ = .generateFrom (⋃ (a : β„š) (b : β„š) (_ : a < b), {Ioo (a : ℝ) (b : ℝ)}) := isTopologicalBasis_Ioo_rat.borel_eq_generateFrom #align real.borel_eq_generate_from_Ioo_rat Real.borel_eq_generateFrom_Ioo_rat theorem borel_eq_generateFrom_Iio_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Iio (a : ℝ)}) := by rw [borel_eq_generateFrom_Iio] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsLUB (range ((↑) : β„š β†’ ℝ) ∩ Iio a) a := by simp [isLUB_iff_le_iff, mem_upperBounds, ← le_iff_forall_rat_lt_imp_le] rw [← this.biUnion_Iio_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Iio (b : ℝ)) (by simp)
Mathlib/MeasureTheory/Constructions/BorelSpace/Real.lean
56
66
theorem borel_eq_generateFrom_Ioi_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Ioi (a : ℝ)}) := by
rw [borel_eq_generateFrom_Ioi] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsGLB (range ((↑) : β„š β†’ ℝ) ∩ Ioi a) a := by simp [isGLB_iff_le_iff, mem_lowerBounds, ← le_iff_forall_lt_rat_imp_le] rw [← this.biUnion_Ioi_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Ioi (b : ℝ)) (by simp)
10
22,026.465795
2
1.444444
9
1,528
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order #align_import measure_theory.constructions.borel_space.basic from "leanprover-community/mathlib"@"9f55d0d4363ae59948c33864cbc52e0b12e0e8ce" open Set Filter MeasureTheory MeasurableSpace open scoped Classical Topology NNReal ENNReal MeasureTheory universe u v w x y variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*} {ΞΉ : Sort y} {s t u : Set Ξ±} namespace Real theorem borel_eq_generateFrom_Ioo_rat : borel ℝ = .generateFrom (⋃ (a : β„š) (b : β„š) (_ : a < b), {Ioo (a : ℝ) (b : ℝ)}) := isTopologicalBasis_Ioo_rat.borel_eq_generateFrom #align real.borel_eq_generate_from_Ioo_rat Real.borel_eq_generateFrom_Ioo_rat theorem borel_eq_generateFrom_Iio_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Iio (a : ℝ)}) := by rw [borel_eq_generateFrom_Iio] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsLUB (range ((↑) : β„š β†’ ℝ) ∩ Iio a) a := by simp [isLUB_iff_le_iff, mem_upperBounds, ← le_iff_forall_rat_lt_imp_le] rw [← this.biUnion_Iio_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Iio (b : ℝ)) (by simp) theorem borel_eq_generateFrom_Ioi_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Ioi (a : ℝ)}) := by rw [borel_eq_generateFrom_Ioi] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsGLB (range ((↑) : β„š β†’ ℝ) ∩ Ioi a) a := by simp [isGLB_iff_le_iff, mem_lowerBounds, ← le_iff_forall_lt_rat_imp_le] rw [← this.biUnion_Ioi_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Ioi (b : ℝ)) (by simp)
Mathlib/MeasureTheory/Constructions/BorelSpace/Real.lean
68
74
theorem borel_eq_generateFrom_Iic_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Iic (a : ℝ)}) := by
rw [borel_eq_generateFrom_Ioi_rat, iUnion_singleton_eq_range, iUnion_singleton_eq_range] refine le_antisymm (generateFrom_le ?_) (generateFrom_le ?_) <;> rintro _ ⟨q, rfl⟩ <;> dsimp only <;> [rw [← compl_Iic]; rw [← compl_Ioi]] <;> exact MeasurableSet.compl (GenerateMeasurable.basic _ (mem_range_self q))
6
403.428793
2
1.444444
9
1,528
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order #align_import measure_theory.constructions.borel_space.basic from "leanprover-community/mathlib"@"9f55d0d4363ae59948c33864cbc52e0b12e0e8ce" open Set Filter MeasureTheory MeasurableSpace open scoped Classical Topology NNReal ENNReal MeasureTheory universe u v w x y variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*} {ΞΉ : Sort y} {s t u : Set Ξ±} namespace Real theorem borel_eq_generateFrom_Ioo_rat : borel ℝ = .generateFrom (⋃ (a : β„š) (b : β„š) (_ : a < b), {Ioo (a : ℝ) (b : ℝ)}) := isTopologicalBasis_Ioo_rat.borel_eq_generateFrom #align real.borel_eq_generate_from_Ioo_rat Real.borel_eq_generateFrom_Ioo_rat theorem borel_eq_generateFrom_Iio_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Iio (a : ℝ)}) := by rw [borel_eq_generateFrom_Iio] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsLUB (range ((↑) : β„š β†’ ℝ) ∩ Iio a) a := by simp [isLUB_iff_le_iff, mem_upperBounds, ← le_iff_forall_rat_lt_imp_le] rw [← this.biUnion_Iio_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Iio (b : ℝ)) (by simp) theorem borel_eq_generateFrom_Ioi_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Ioi (a : ℝ)}) := by rw [borel_eq_generateFrom_Ioi] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsGLB (range ((↑) : β„š β†’ ℝ) ∩ Ioi a) a := by simp [isGLB_iff_le_iff, mem_lowerBounds, ← le_iff_forall_lt_rat_imp_le] rw [← this.biUnion_Ioi_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Ioi (b : ℝ)) (by simp) theorem borel_eq_generateFrom_Iic_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Iic (a : ℝ)}) := by rw [borel_eq_generateFrom_Ioi_rat, iUnion_singleton_eq_range, iUnion_singleton_eq_range] refine le_antisymm (generateFrom_le ?_) (generateFrom_le ?_) <;> rintro _ ⟨q, rfl⟩ <;> dsimp only <;> [rw [← compl_Iic]; rw [← compl_Ioi]] <;> exact MeasurableSet.compl (GenerateMeasurable.basic _ (mem_range_self q))
Mathlib/MeasureTheory/Constructions/BorelSpace/Real.lean
76
82
theorem borel_eq_generateFrom_Ici_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Ici (a : ℝ)}) := by
rw [borel_eq_generateFrom_Iio_rat, iUnion_singleton_eq_range, iUnion_singleton_eq_range] refine le_antisymm (generateFrom_le ?_) (generateFrom_le ?_) <;> rintro _ ⟨q, rfl⟩ <;> dsimp only <;> [rw [← compl_Ici]; rw [← compl_Iio]] <;> exact MeasurableSet.compl (GenerateMeasurable.basic _ (mem_range_self q))
6
403.428793
2
1.444444
9
1,528
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order #align_import measure_theory.constructions.borel_space.basic from "leanprover-community/mathlib"@"9f55d0d4363ae59948c33864cbc52e0b12e0e8ce" open Set Filter MeasureTheory MeasurableSpace open scoped Classical Topology NNReal ENNReal MeasureTheory universe u v w x y variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*} {ΞΉ : Sort y} {s t u : Set Ξ±} namespace Real theorem borel_eq_generateFrom_Ioo_rat : borel ℝ = .generateFrom (⋃ (a : β„š) (b : β„š) (_ : a < b), {Ioo (a : ℝ) (b : ℝ)}) := isTopologicalBasis_Ioo_rat.borel_eq_generateFrom #align real.borel_eq_generate_from_Ioo_rat Real.borel_eq_generateFrom_Ioo_rat theorem borel_eq_generateFrom_Iio_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Iio (a : ℝ)}) := by rw [borel_eq_generateFrom_Iio] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsLUB (range ((↑) : β„š β†’ ℝ) ∩ Iio a) a := by simp [isLUB_iff_le_iff, mem_upperBounds, ← le_iff_forall_rat_lt_imp_le] rw [← this.biUnion_Iio_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Iio (b : ℝ)) (by simp) theorem borel_eq_generateFrom_Ioi_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Ioi (a : ℝ)}) := by rw [borel_eq_generateFrom_Ioi] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsGLB (range ((↑) : β„š β†’ ℝ) ∩ Ioi a) a := by simp [isGLB_iff_le_iff, mem_lowerBounds, ← le_iff_forall_lt_rat_imp_le] rw [← this.biUnion_Ioi_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Ioi (b : ℝ)) (by simp) theorem borel_eq_generateFrom_Iic_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Iic (a : ℝ)}) := by rw [borel_eq_generateFrom_Ioi_rat, iUnion_singleton_eq_range, iUnion_singleton_eq_range] refine le_antisymm (generateFrom_le ?_) (generateFrom_le ?_) <;> rintro _ ⟨q, rfl⟩ <;> dsimp only <;> [rw [← compl_Iic]; rw [← compl_Ioi]] <;> exact MeasurableSet.compl (GenerateMeasurable.basic _ (mem_range_self q)) theorem borel_eq_generateFrom_Ici_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Ici (a : ℝ)}) := by rw [borel_eq_generateFrom_Iio_rat, iUnion_singleton_eq_range, iUnion_singleton_eq_range] refine le_antisymm (generateFrom_le ?_) (generateFrom_le ?_) <;> rintro _ ⟨q, rfl⟩ <;> dsimp only <;> [rw [← compl_Ici]; rw [← compl_Iio]] <;> exact MeasurableSet.compl (GenerateMeasurable.basic _ (mem_range_self q))
Mathlib/MeasureTheory/Constructions/BorelSpace/Real.lean
84
88
theorem isPiSystem_Ioo_rat : IsPiSystem (⋃ (a : β„š) (b : β„š) (_ : a < b), {Ioo (a : ℝ) (b : ℝ)}) := by
convert isPiSystem_Ioo ((↑) : β„š β†’ ℝ) ((↑) : β„š β†’ ℝ) ext x simp [eq_comm]
3
20.085537
1
1.444444
9
1,528
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order #align_import measure_theory.constructions.borel_space.basic from "leanprover-community/mathlib"@"9f55d0d4363ae59948c33864cbc52e0b12e0e8ce" open Set Filter MeasureTheory MeasurableSpace open scoped Classical Topology NNReal ENNReal MeasureTheory universe u v w x y variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*} {ΞΉ : Sort y} {s t u : Set Ξ±} namespace Real theorem borel_eq_generateFrom_Ioo_rat : borel ℝ = .generateFrom (⋃ (a : β„š) (b : β„š) (_ : a < b), {Ioo (a : ℝ) (b : ℝ)}) := isTopologicalBasis_Ioo_rat.borel_eq_generateFrom #align real.borel_eq_generate_from_Ioo_rat Real.borel_eq_generateFrom_Ioo_rat theorem borel_eq_generateFrom_Iio_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Iio (a : ℝ)}) := by rw [borel_eq_generateFrom_Iio] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsLUB (range ((↑) : β„š β†’ ℝ) ∩ Iio a) a := by simp [isLUB_iff_le_iff, mem_upperBounds, ← le_iff_forall_rat_lt_imp_le] rw [← this.biUnion_Iio_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Iio (b : ℝ)) (by simp) theorem borel_eq_generateFrom_Ioi_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Ioi (a : ℝ)}) := by rw [borel_eq_generateFrom_Ioi] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsGLB (range ((↑) : β„š β†’ ℝ) ∩ Ioi a) a := by simp [isGLB_iff_le_iff, mem_lowerBounds, ← le_iff_forall_lt_rat_imp_le] rw [← this.biUnion_Ioi_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Ioi (b : ℝ)) (by simp) theorem borel_eq_generateFrom_Iic_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Iic (a : ℝ)}) := by rw [borel_eq_generateFrom_Ioi_rat, iUnion_singleton_eq_range, iUnion_singleton_eq_range] refine le_antisymm (generateFrom_le ?_) (generateFrom_le ?_) <;> rintro _ ⟨q, rfl⟩ <;> dsimp only <;> [rw [← compl_Iic]; rw [← compl_Ioi]] <;> exact MeasurableSet.compl (GenerateMeasurable.basic _ (mem_range_self q)) theorem borel_eq_generateFrom_Ici_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Ici (a : ℝ)}) := by rw [borel_eq_generateFrom_Iio_rat, iUnion_singleton_eq_range, iUnion_singleton_eq_range] refine le_antisymm (generateFrom_le ?_) (generateFrom_le ?_) <;> rintro _ ⟨q, rfl⟩ <;> dsimp only <;> [rw [← compl_Ici]; rw [← compl_Iio]] <;> exact MeasurableSet.compl (GenerateMeasurable.basic _ (mem_range_self q)) theorem isPiSystem_Ioo_rat : IsPiSystem (⋃ (a : β„š) (b : β„š) (_ : a < b), {Ioo (a : ℝ) (b : ℝ)}) := by convert isPiSystem_Ioo ((↑) : β„š β†’ ℝ) ((↑) : β„š β†’ ℝ) ext x simp [eq_comm] #align real.is_pi_system_Ioo_rat Real.isPiSystem_Ioo_rat
Mathlib/MeasureTheory/Constructions/BorelSpace/Real.lean
91
94
theorem isPiSystem_Iio_rat : IsPiSystem (⋃ a : β„š, {Iio (a : ℝ)}) := by
convert isPiSystem_image_Iio (((↑) : β„š β†’ ℝ) '' univ) ext x simp only [iUnion_singleton_eq_range, mem_range, image_univ, mem_image, exists_exists_eq_and]
3
20.085537
1
1.444444
9
1,528
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order #align_import measure_theory.constructions.borel_space.basic from "leanprover-community/mathlib"@"9f55d0d4363ae59948c33864cbc52e0b12e0e8ce" open Set Filter MeasureTheory MeasurableSpace open scoped Classical Topology NNReal ENNReal MeasureTheory universe u v w x y variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*} {ΞΉ : Sort y} {s t u : Set Ξ±} namespace Real theorem borel_eq_generateFrom_Ioo_rat : borel ℝ = .generateFrom (⋃ (a : β„š) (b : β„š) (_ : a < b), {Ioo (a : ℝ) (b : ℝ)}) := isTopologicalBasis_Ioo_rat.borel_eq_generateFrom #align real.borel_eq_generate_from_Ioo_rat Real.borel_eq_generateFrom_Ioo_rat theorem borel_eq_generateFrom_Iio_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Iio (a : ℝ)}) := by rw [borel_eq_generateFrom_Iio] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsLUB (range ((↑) : β„š β†’ ℝ) ∩ Iio a) a := by simp [isLUB_iff_le_iff, mem_upperBounds, ← le_iff_forall_rat_lt_imp_le] rw [← this.biUnion_Iio_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Iio (b : ℝ)) (by simp) theorem borel_eq_generateFrom_Ioi_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Ioi (a : ℝ)}) := by rw [borel_eq_generateFrom_Ioi] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsGLB (range ((↑) : β„š β†’ ℝ) ∩ Ioi a) a := by simp [isGLB_iff_le_iff, mem_lowerBounds, ← le_iff_forall_lt_rat_imp_le] rw [← this.biUnion_Ioi_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Ioi (b : ℝ)) (by simp) theorem borel_eq_generateFrom_Iic_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Iic (a : ℝ)}) := by rw [borel_eq_generateFrom_Ioi_rat, iUnion_singleton_eq_range, iUnion_singleton_eq_range] refine le_antisymm (generateFrom_le ?_) (generateFrom_le ?_) <;> rintro _ ⟨q, rfl⟩ <;> dsimp only <;> [rw [← compl_Iic]; rw [← compl_Ioi]] <;> exact MeasurableSet.compl (GenerateMeasurable.basic _ (mem_range_self q)) theorem borel_eq_generateFrom_Ici_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Ici (a : ℝ)}) := by rw [borel_eq_generateFrom_Iio_rat, iUnion_singleton_eq_range, iUnion_singleton_eq_range] refine le_antisymm (generateFrom_le ?_) (generateFrom_le ?_) <;> rintro _ ⟨q, rfl⟩ <;> dsimp only <;> [rw [← compl_Ici]; rw [← compl_Iio]] <;> exact MeasurableSet.compl (GenerateMeasurable.basic _ (mem_range_self q)) theorem isPiSystem_Ioo_rat : IsPiSystem (⋃ (a : β„š) (b : β„š) (_ : a < b), {Ioo (a : ℝ) (b : ℝ)}) := by convert isPiSystem_Ioo ((↑) : β„š β†’ ℝ) ((↑) : β„š β†’ ℝ) ext x simp [eq_comm] #align real.is_pi_system_Ioo_rat Real.isPiSystem_Ioo_rat theorem isPiSystem_Iio_rat : IsPiSystem (⋃ a : β„š, {Iio (a : ℝ)}) := by convert isPiSystem_image_Iio (((↑) : β„š β†’ ℝ) '' univ) ext x simp only [iUnion_singleton_eq_range, mem_range, image_univ, mem_image, exists_exists_eq_and]
Mathlib/MeasureTheory/Constructions/BorelSpace/Real.lean
96
99
theorem isPiSystem_Ioi_rat : IsPiSystem (⋃ a : β„š, {Ioi (a : ℝ)}) := by
convert isPiSystem_image_Ioi (((↑) : β„š β†’ ℝ) '' univ) ext x simp only [iUnion_singleton_eq_range, mem_range, image_univ, mem_image, exists_exists_eq_and]
3
20.085537
1
1.444444
9
1,528
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order #align_import measure_theory.constructions.borel_space.basic from "leanprover-community/mathlib"@"9f55d0d4363ae59948c33864cbc52e0b12e0e8ce" open Set Filter MeasureTheory MeasurableSpace open scoped Classical Topology NNReal ENNReal MeasureTheory universe u v w x y variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*} {ΞΉ : Sort y} {s t u : Set Ξ±} namespace Real theorem borel_eq_generateFrom_Ioo_rat : borel ℝ = .generateFrom (⋃ (a : β„š) (b : β„š) (_ : a < b), {Ioo (a : ℝ) (b : ℝ)}) := isTopologicalBasis_Ioo_rat.borel_eq_generateFrom #align real.borel_eq_generate_from_Ioo_rat Real.borel_eq_generateFrom_Ioo_rat theorem borel_eq_generateFrom_Iio_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Iio (a : ℝ)}) := by rw [borel_eq_generateFrom_Iio] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsLUB (range ((↑) : β„š β†’ ℝ) ∩ Iio a) a := by simp [isLUB_iff_le_iff, mem_upperBounds, ← le_iff_forall_rat_lt_imp_le] rw [← this.biUnion_Iio_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Iio (b : ℝ)) (by simp) theorem borel_eq_generateFrom_Ioi_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Ioi (a : ℝ)}) := by rw [borel_eq_generateFrom_Ioi] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsGLB (range ((↑) : β„š β†’ ℝ) ∩ Ioi a) a := by simp [isGLB_iff_le_iff, mem_lowerBounds, ← le_iff_forall_lt_rat_imp_le] rw [← this.biUnion_Ioi_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Ioi (b : ℝ)) (by simp) theorem borel_eq_generateFrom_Iic_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Iic (a : ℝ)}) := by rw [borel_eq_generateFrom_Ioi_rat, iUnion_singleton_eq_range, iUnion_singleton_eq_range] refine le_antisymm (generateFrom_le ?_) (generateFrom_le ?_) <;> rintro _ ⟨q, rfl⟩ <;> dsimp only <;> [rw [← compl_Iic]; rw [← compl_Ioi]] <;> exact MeasurableSet.compl (GenerateMeasurable.basic _ (mem_range_self q)) theorem borel_eq_generateFrom_Ici_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Ici (a : ℝ)}) := by rw [borel_eq_generateFrom_Iio_rat, iUnion_singleton_eq_range, iUnion_singleton_eq_range] refine le_antisymm (generateFrom_le ?_) (generateFrom_le ?_) <;> rintro _ ⟨q, rfl⟩ <;> dsimp only <;> [rw [← compl_Ici]; rw [← compl_Iio]] <;> exact MeasurableSet.compl (GenerateMeasurable.basic _ (mem_range_self q)) theorem isPiSystem_Ioo_rat : IsPiSystem (⋃ (a : β„š) (b : β„š) (_ : a < b), {Ioo (a : ℝ) (b : ℝ)}) := by convert isPiSystem_Ioo ((↑) : β„š β†’ ℝ) ((↑) : β„š β†’ ℝ) ext x simp [eq_comm] #align real.is_pi_system_Ioo_rat Real.isPiSystem_Ioo_rat theorem isPiSystem_Iio_rat : IsPiSystem (⋃ a : β„š, {Iio (a : ℝ)}) := by convert isPiSystem_image_Iio (((↑) : β„š β†’ ℝ) '' univ) ext x simp only [iUnion_singleton_eq_range, mem_range, image_univ, mem_image, exists_exists_eq_and] theorem isPiSystem_Ioi_rat : IsPiSystem (⋃ a : β„š, {Ioi (a : ℝ)}) := by convert isPiSystem_image_Ioi (((↑) : β„š β†’ ℝ) '' univ) ext x simp only [iUnion_singleton_eq_range, mem_range, image_univ, mem_image, exists_exists_eq_and]
Mathlib/MeasureTheory/Constructions/BorelSpace/Real.lean
101
104
theorem isPiSystem_Iic_rat : IsPiSystem (⋃ a : β„š, {Iic (a : ℝ)}) := by
convert isPiSystem_image_Iic (((↑) : β„š β†’ ℝ) '' univ) ext x simp only [iUnion_singleton_eq_range, mem_range, image_univ, mem_image, exists_exists_eq_and]
3
20.085537
1
1.444444
9
1,528
import Mathlib.MeasureTheory.Constructions.BorelSpace.Order #align_import measure_theory.constructions.borel_space.basic from "leanprover-community/mathlib"@"9f55d0d4363ae59948c33864cbc52e0b12e0e8ce" open Set Filter MeasureTheory MeasurableSpace open scoped Classical Topology NNReal ENNReal MeasureTheory universe u v w x y variable {Ξ± Ξ² Ξ³ Ξ΄ : Type*} {ΞΉ : Sort y} {s t u : Set Ξ±} namespace Real theorem borel_eq_generateFrom_Ioo_rat : borel ℝ = .generateFrom (⋃ (a : β„š) (b : β„š) (_ : a < b), {Ioo (a : ℝ) (b : ℝ)}) := isTopologicalBasis_Ioo_rat.borel_eq_generateFrom #align real.borel_eq_generate_from_Ioo_rat Real.borel_eq_generateFrom_Ioo_rat theorem borel_eq_generateFrom_Iio_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Iio (a : ℝ)}) := by rw [borel_eq_generateFrom_Iio] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsLUB (range ((↑) : β„š β†’ ℝ) ∩ Iio a) a := by simp [isLUB_iff_le_iff, mem_upperBounds, ← le_iff_forall_rat_lt_imp_le] rw [← this.biUnion_Iio_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Iio (b : ℝ)) (by simp) theorem borel_eq_generateFrom_Ioi_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Ioi (a : ℝ)}) := by rw [borel_eq_generateFrom_Ioi] refine le_antisymm (generateFrom_le ?_) (generateFrom_mono <| iUnion_subset fun q ↦ singleton_subset_iff.mpr <| mem_range_self _) rintro _ ⟨a, rfl⟩ have : IsGLB (range ((↑) : β„š β†’ ℝ) ∩ Ioi a) a := by simp [isGLB_iff_le_iff, mem_lowerBounds, ← le_iff_forall_lt_rat_imp_le] rw [← this.biUnion_Ioi_eq, ← image_univ, ← image_inter_preimage, univ_inter, biUnion_image] exact MeasurableSet.biUnion (to_countable _) fun b _ => GenerateMeasurable.basic (Ioi (b : ℝ)) (by simp) theorem borel_eq_generateFrom_Iic_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Iic (a : ℝ)}) := by rw [borel_eq_generateFrom_Ioi_rat, iUnion_singleton_eq_range, iUnion_singleton_eq_range] refine le_antisymm (generateFrom_le ?_) (generateFrom_le ?_) <;> rintro _ ⟨q, rfl⟩ <;> dsimp only <;> [rw [← compl_Iic]; rw [← compl_Ioi]] <;> exact MeasurableSet.compl (GenerateMeasurable.basic _ (mem_range_self q)) theorem borel_eq_generateFrom_Ici_rat : borel ℝ = .generateFrom (⋃ a : β„š, {Ici (a : ℝ)}) := by rw [borel_eq_generateFrom_Iio_rat, iUnion_singleton_eq_range, iUnion_singleton_eq_range] refine le_antisymm (generateFrom_le ?_) (generateFrom_le ?_) <;> rintro _ ⟨q, rfl⟩ <;> dsimp only <;> [rw [← compl_Ici]; rw [← compl_Iio]] <;> exact MeasurableSet.compl (GenerateMeasurable.basic _ (mem_range_self q)) theorem isPiSystem_Ioo_rat : IsPiSystem (⋃ (a : β„š) (b : β„š) (_ : a < b), {Ioo (a : ℝ) (b : ℝ)}) := by convert isPiSystem_Ioo ((↑) : β„š β†’ ℝ) ((↑) : β„š β†’ ℝ) ext x simp [eq_comm] #align real.is_pi_system_Ioo_rat Real.isPiSystem_Ioo_rat theorem isPiSystem_Iio_rat : IsPiSystem (⋃ a : β„š, {Iio (a : ℝ)}) := by convert isPiSystem_image_Iio (((↑) : β„š β†’ ℝ) '' univ) ext x simp only [iUnion_singleton_eq_range, mem_range, image_univ, mem_image, exists_exists_eq_and] theorem isPiSystem_Ioi_rat : IsPiSystem (⋃ a : β„š, {Ioi (a : ℝ)}) := by convert isPiSystem_image_Ioi (((↑) : β„š β†’ ℝ) '' univ) ext x simp only [iUnion_singleton_eq_range, mem_range, image_univ, mem_image, exists_exists_eq_and] theorem isPiSystem_Iic_rat : IsPiSystem (⋃ a : β„š, {Iic (a : ℝ)}) := by convert isPiSystem_image_Iic (((↑) : β„š β†’ ℝ) '' univ) ext x simp only [iUnion_singleton_eq_range, mem_range, image_univ, mem_image, exists_exists_eq_and]
Mathlib/MeasureTheory/Constructions/BorelSpace/Real.lean
106
109
theorem isPiSystem_Ici_rat : IsPiSystem (⋃ a : β„š, {Ici (a : ℝ)}) := by
convert isPiSystem_image_Ici (((↑) : β„š β†’ ℝ) '' univ) ext x simp only [iUnion_singleton_eq_range, mem_range, image_univ, mem_image, exists_exists_eq_and]
3
20.085537
1
1.444444
9
1,528
import Mathlib.Data.Nat.Choose.Basic import Mathlib.Data.Sym.Sym2 namespace List variable {Ξ± : Type*} section Sym2 protected def sym2 : List Ξ± β†’ List (Sym2 Ξ±) | [] => [] | x :: xs => (x :: xs).map (fun y => s(x, y)) ++ xs.sym2
Mathlib/Data/List/Sym.lean
40
43
theorem mem_sym2_cons_iff {x : Ξ±} {xs : List Ξ±} {z : Sym2 Ξ±} : z ∈ (x :: xs).sym2 ↔ z = s(x, x) ∨ (βˆƒ y, y ∈ xs ∧ z = s(x, y)) ∨ z ∈ xs.sym2 := by
simp only [List.sym2, map_cons, cons_append, mem_cons, mem_append, mem_map] simp only [eq_comm]
2
7.389056
1
1.444444
9
1,529
import Mathlib.Data.Nat.Choose.Basic import Mathlib.Data.Sym.Sym2 namespace List variable {Ξ± : Type*} section Sym2 protected def sym2 : List Ξ± β†’ List (Sym2 Ξ±) | [] => [] | x :: xs => (x :: xs).map (fun y => s(x, y)) ++ xs.sym2 theorem mem_sym2_cons_iff {x : Ξ±} {xs : List Ξ±} {z : Sym2 Ξ±} : z ∈ (x :: xs).sym2 ↔ z = s(x, x) ∨ (βˆƒ y, y ∈ xs ∧ z = s(x, y)) ∨ z ∈ xs.sym2 := by simp only [List.sym2, map_cons, cons_append, mem_cons, mem_append, mem_map] simp only [eq_comm] @[simp]
Mathlib/Data/List/Sym.lean
46
47
theorem sym2_eq_nil_iff {xs : List Ξ±} : xs.sym2 = [] ↔ xs = [] := by
cases xs <;> simp [List.sym2]
1
2.718282
0
1.444444
9
1,529
import Mathlib.Data.Nat.Choose.Basic import Mathlib.Data.Sym.Sym2 namespace List variable {Ξ± : Type*} section Sym2 protected def sym2 : List Ξ± β†’ List (Sym2 Ξ±) | [] => [] | x :: xs => (x :: xs).map (fun y => s(x, y)) ++ xs.sym2 theorem mem_sym2_cons_iff {x : Ξ±} {xs : List Ξ±} {z : Sym2 Ξ±} : z ∈ (x :: xs).sym2 ↔ z = s(x, x) ∨ (βˆƒ y, y ∈ xs ∧ z = s(x, y)) ∨ z ∈ xs.sym2 := by simp only [List.sym2, map_cons, cons_append, mem_cons, mem_append, mem_map] simp only [eq_comm] @[simp] theorem sym2_eq_nil_iff {xs : List Ξ±} : xs.sym2 = [] ↔ xs = [] := by cases xs <;> simp [List.sym2]
Mathlib/Data/List/Sym.lean
49
61
theorem left_mem_of_mk_mem_sym2 {xs : List α} {a b : α} (h : s(a, b) ∈ xs.sym2) : a ∈ xs := by
induction xs with | nil => exact (not_mem_nil _ h).elim | cons x xs ih => rw [mem_cons] rw [mem_sym2_cons_iff] at h obtain (h | ⟨c, hc, h⟩ | h) := h Β· rw [Sym2.eq_iff, ← and_or_left] at h exact .inl h.1 Β· rw [Sym2.eq_iff] at h obtain (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩) := h <;> simp [hc] Β· exact .inr <| ih h
11
59,874.141715
2
1.444444
9
1,529
import Mathlib.Data.Nat.Choose.Basic import Mathlib.Data.Sym.Sym2 namespace List variable {Ξ± : Type*} section Sym2 protected def sym2 : List Ξ± β†’ List (Sym2 Ξ±) | [] => [] | x :: xs => (x :: xs).map (fun y => s(x, y)) ++ xs.sym2 theorem mem_sym2_cons_iff {x : Ξ±} {xs : List Ξ±} {z : Sym2 Ξ±} : z ∈ (x :: xs).sym2 ↔ z = s(x, x) ∨ (βˆƒ y, y ∈ xs ∧ z = s(x, y)) ∨ z ∈ xs.sym2 := by simp only [List.sym2, map_cons, cons_append, mem_cons, mem_append, mem_map] simp only [eq_comm] @[simp] theorem sym2_eq_nil_iff {xs : List Ξ±} : xs.sym2 = [] ↔ xs = [] := by cases xs <;> simp [List.sym2] theorem left_mem_of_mk_mem_sym2 {xs : List Ξ±} {a b : Ξ±} (h : s(a, b) ∈ xs.sym2) : a ∈ xs := by induction xs with | nil => exact (not_mem_nil _ h).elim | cons x xs ih => rw [mem_cons] rw [mem_sym2_cons_iff] at h obtain (h | ⟨c, hc, h⟩ | h) := h Β· rw [Sym2.eq_iff, ← and_or_left] at h exact .inl h.1 Β· rw [Sym2.eq_iff] at h obtain (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩) := h <;> simp [hc] Β· exact .inr <| ih h
Mathlib/Data/List/Sym.lean
63
66
theorem right_mem_of_mk_mem_sym2 {xs : List α} {a b : α} (h : s(a, b) ∈ xs.sym2) : b ∈ xs := by
rw [Sym2.eq_swap] at h exact left_mem_of_mk_mem_sym2 h
2
7.389056
1
1.444444
9
1,529
import Mathlib.Data.Nat.Choose.Basic import Mathlib.Data.Sym.Sym2 namespace List variable {Ξ± : Type*} section Sym2 protected def sym2 : List Ξ± β†’ List (Sym2 Ξ±) | [] => [] | x :: xs => (x :: xs).map (fun y => s(x, y)) ++ xs.sym2 theorem mem_sym2_cons_iff {x : Ξ±} {xs : List Ξ±} {z : Sym2 Ξ±} : z ∈ (x :: xs).sym2 ↔ z = s(x, x) ∨ (βˆƒ y, y ∈ xs ∧ z = s(x, y)) ∨ z ∈ xs.sym2 := by simp only [List.sym2, map_cons, cons_append, mem_cons, mem_append, mem_map] simp only [eq_comm] @[simp] theorem sym2_eq_nil_iff {xs : List Ξ±} : xs.sym2 = [] ↔ xs = [] := by cases xs <;> simp [List.sym2] theorem left_mem_of_mk_mem_sym2 {xs : List Ξ±} {a b : Ξ±} (h : s(a, b) ∈ xs.sym2) : a ∈ xs := by induction xs with | nil => exact (not_mem_nil _ h).elim | cons x xs ih => rw [mem_cons] rw [mem_sym2_cons_iff] at h obtain (h | ⟨c, hc, h⟩ | h) := h Β· rw [Sym2.eq_iff, ← and_or_left] at h exact .inl h.1 Β· rw [Sym2.eq_iff] at h obtain (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩) := h <;> simp [hc] Β· exact .inr <| ih h theorem right_mem_of_mk_mem_sym2 {xs : List Ξ±} {a b : Ξ±} (h : s(a, b) ∈ xs.sym2) : b ∈ xs := by rw [Sym2.eq_swap] at h exact left_mem_of_mk_mem_sym2 h
Mathlib/Data/List/Sym.lean
68
79
theorem mk_mem_sym2 {xs : List α} {a b : α} (ha : a ∈ xs) (hb : b ∈ xs) : s(a, b) ∈ xs.sym2 := by
induction xs with | nil => simp at ha | cons x xs ih => rw [mem_sym2_cons_iff] rw [mem_cons] at ha hb obtain (rfl | ha) := ha <;> obtain (rfl | hb) := hb Β· left; rfl Β· right; left; use b Β· right; left; rw [Sym2.eq_swap]; use a Β· right; right; exact ih ha hb
10
22,026.465795
2
1.444444
9
1,529
import Mathlib.Data.Nat.Choose.Basic import Mathlib.Data.Sym.Sym2 namespace List variable {Ξ± : Type*} section Sym2 protected def sym2 : List Ξ± β†’ List (Sym2 Ξ±) | [] => [] | x :: xs => (x :: xs).map (fun y => s(x, y)) ++ xs.sym2 theorem mem_sym2_cons_iff {x : Ξ±} {xs : List Ξ±} {z : Sym2 Ξ±} : z ∈ (x :: xs).sym2 ↔ z = s(x, x) ∨ (βˆƒ y, y ∈ xs ∧ z = s(x, y)) ∨ z ∈ xs.sym2 := by simp only [List.sym2, map_cons, cons_append, mem_cons, mem_append, mem_map] simp only [eq_comm] @[simp] theorem sym2_eq_nil_iff {xs : List Ξ±} : xs.sym2 = [] ↔ xs = [] := by cases xs <;> simp [List.sym2] theorem left_mem_of_mk_mem_sym2 {xs : List Ξ±} {a b : Ξ±} (h : s(a, b) ∈ xs.sym2) : a ∈ xs := by induction xs with | nil => exact (not_mem_nil _ h).elim | cons x xs ih => rw [mem_cons] rw [mem_sym2_cons_iff] at h obtain (h | ⟨c, hc, h⟩ | h) := h Β· rw [Sym2.eq_iff, ← and_or_left] at h exact .inl h.1 Β· rw [Sym2.eq_iff] at h obtain (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩) := h <;> simp [hc] Β· exact .inr <| ih h theorem right_mem_of_mk_mem_sym2 {xs : List Ξ±} {a b : Ξ±} (h : s(a, b) ∈ xs.sym2) : b ∈ xs := by rw [Sym2.eq_swap] at h exact left_mem_of_mk_mem_sym2 h theorem mk_mem_sym2 {xs : List Ξ±} {a b : Ξ±} (ha : a ∈ xs) (hb : b ∈ xs) : s(a, b) ∈ xs.sym2 := by induction xs with | nil => simp at ha | cons x xs ih => rw [mem_sym2_cons_iff] rw [mem_cons] at ha hb obtain (rfl | ha) := ha <;> obtain (rfl | hb) := hb Β· left; rfl Β· right; left; use b Β· right; left; rw [Sym2.eq_swap]; use a Β· right; right; exact ih ha hb
Mathlib/Data/List/Sym.lean
81
87
theorem mk_mem_sym2_iff {xs : List Ξ±} {a b : Ξ±} : s(a, b) ∈ xs.sym2 ↔ a ∈ xs ∧ b ∈ xs := by
constructor · intro h exact ⟨left_mem_of_mk_mem_sym2 h, right_mem_of_mk_mem_sym2 h⟩ · rintro ⟨ha, hb⟩ exact mk_mem_sym2 ha hb
5
148.413159
2
1.444444
9
1,529
import Mathlib.Data.Nat.Choose.Basic import Mathlib.Data.Sym.Sym2 namespace List variable {Ξ± : Type*} section Sym2 protected def sym2 : List Ξ± β†’ List (Sym2 Ξ±) | [] => [] | x :: xs => (x :: xs).map (fun y => s(x, y)) ++ xs.sym2 theorem mem_sym2_cons_iff {x : Ξ±} {xs : List Ξ±} {z : Sym2 Ξ±} : z ∈ (x :: xs).sym2 ↔ z = s(x, x) ∨ (βˆƒ y, y ∈ xs ∧ z = s(x, y)) ∨ z ∈ xs.sym2 := by simp only [List.sym2, map_cons, cons_append, mem_cons, mem_append, mem_map] simp only [eq_comm] @[simp] theorem sym2_eq_nil_iff {xs : List Ξ±} : xs.sym2 = [] ↔ xs = [] := by cases xs <;> simp [List.sym2] theorem left_mem_of_mk_mem_sym2 {xs : List Ξ±} {a b : Ξ±} (h : s(a, b) ∈ xs.sym2) : a ∈ xs := by induction xs with | nil => exact (not_mem_nil _ h).elim | cons x xs ih => rw [mem_cons] rw [mem_sym2_cons_iff] at h obtain (h | ⟨c, hc, h⟩ | h) := h Β· rw [Sym2.eq_iff, ← and_or_left] at h exact .inl h.1 Β· rw [Sym2.eq_iff] at h obtain (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩) := h <;> simp [hc] Β· exact .inr <| ih h theorem right_mem_of_mk_mem_sym2 {xs : List Ξ±} {a b : Ξ±} (h : s(a, b) ∈ xs.sym2) : b ∈ xs := by rw [Sym2.eq_swap] at h exact left_mem_of_mk_mem_sym2 h theorem mk_mem_sym2 {xs : List Ξ±} {a b : Ξ±} (ha : a ∈ xs) (hb : b ∈ xs) : s(a, b) ∈ xs.sym2 := by induction xs with | nil => simp at ha | cons x xs ih => rw [mem_sym2_cons_iff] rw [mem_cons] at ha hb obtain (rfl | ha) := ha <;> obtain (rfl | hb) := hb Β· left; rfl Β· right; left; use b Β· right; left; rw [Sym2.eq_swap]; use a Β· right; right; exact ih ha hb theorem mk_mem_sym2_iff {xs : List Ξ±} {a b : Ξ±} : s(a, b) ∈ xs.sym2 ↔ a ∈ xs ∧ b ∈ xs := by constructor Β· intro h exact ⟨left_mem_of_mk_mem_sym2 h, right_mem_of_mk_mem_sym2 h⟩ Β· rintro ⟨ha, hb⟩ exact mk_mem_sym2 ha hb
Mathlib/Data/List/Sym.lean
89
92
theorem mem_sym2_iff {xs : List Ξ±} {z : Sym2 Ξ±} : z ∈ xs.sym2 ↔ βˆ€ y ∈ z, y ∈ xs := by
refine z.ind (fun a b => ?_) simp [mk_mem_sym2_iff]
2
7.389056
1
1.444444
9
1,529
import Mathlib.Data.Nat.Choose.Basic import Mathlib.Data.Sym.Sym2 namespace List variable {Ξ± : Type*} section Sym2 protected def sym2 : List Ξ± β†’ List (Sym2 Ξ±) | [] => [] | x :: xs => (x :: xs).map (fun y => s(x, y)) ++ xs.sym2 theorem mem_sym2_cons_iff {x : Ξ±} {xs : List Ξ±} {z : Sym2 Ξ±} : z ∈ (x :: xs).sym2 ↔ z = s(x, x) ∨ (βˆƒ y, y ∈ xs ∧ z = s(x, y)) ∨ z ∈ xs.sym2 := by simp only [List.sym2, map_cons, cons_append, mem_cons, mem_append, mem_map] simp only [eq_comm] @[simp] theorem sym2_eq_nil_iff {xs : List Ξ±} : xs.sym2 = [] ↔ xs = [] := by cases xs <;> simp [List.sym2] theorem left_mem_of_mk_mem_sym2 {xs : List Ξ±} {a b : Ξ±} (h : s(a, b) ∈ xs.sym2) : a ∈ xs := by induction xs with | nil => exact (not_mem_nil _ h).elim | cons x xs ih => rw [mem_cons] rw [mem_sym2_cons_iff] at h obtain (h | ⟨c, hc, h⟩ | h) := h Β· rw [Sym2.eq_iff, ← and_or_left] at h exact .inl h.1 Β· rw [Sym2.eq_iff] at h obtain (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩) := h <;> simp [hc] Β· exact .inr <| ih h theorem right_mem_of_mk_mem_sym2 {xs : List Ξ±} {a b : Ξ±} (h : s(a, b) ∈ xs.sym2) : b ∈ xs := by rw [Sym2.eq_swap] at h exact left_mem_of_mk_mem_sym2 h theorem mk_mem_sym2 {xs : List Ξ±} {a b : Ξ±} (ha : a ∈ xs) (hb : b ∈ xs) : s(a, b) ∈ xs.sym2 := by induction xs with | nil => simp at ha | cons x xs ih => rw [mem_sym2_cons_iff] rw [mem_cons] at ha hb obtain (rfl | ha) := ha <;> obtain (rfl | hb) := hb Β· left; rfl Β· right; left; use b Β· right; left; rw [Sym2.eq_swap]; use a Β· right; right; exact ih ha hb theorem mk_mem_sym2_iff {xs : List Ξ±} {a b : Ξ±} : s(a, b) ∈ xs.sym2 ↔ a ∈ xs ∧ b ∈ xs := by constructor Β· intro h exact ⟨left_mem_of_mk_mem_sym2 h, right_mem_of_mk_mem_sym2 h⟩ Β· rintro ⟨ha, hb⟩ exact mk_mem_sym2 ha hb theorem mem_sym2_iff {xs : List Ξ±} {z : Sym2 Ξ±} : z ∈ xs.sym2 ↔ βˆ€ y ∈ z, y ∈ xs := by refine z.ind (fun a b => ?_) simp [mk_mem_sym2_iff] protected theorem Nodup.sym2 {xs : List Ξ±} (h : xs.Nodup) : xs.sym2.Nodup := by induction xs with | nil => simp only [List.sym2, nodup_nil] | cons x xs ih => rw [List.sym2] specialize ih h.of_cons rw [nodup_cons] at h refine Nodup.append (Nodup.cons ?notmem (h.2.map ?inj)) ih ?disj case disj => intro z hz hz' simp only [mem_cons, mem_map] at hz obtain ⟨_, (rfl | _), rfl⟩ := hz <;> simp [left_mem_of_mk_mem_sym2 hz'] at h case notmem => intro h' simp only [h.1, mem_map, Sym2.eq_iff, true_and, or_self, exists_eq_right] at h' case inj => intro a b simp only [Sym2.eq_iff, true_and] rintro (rfl | ⟨rfl, rfl⟩) <;> rfl protected theorem Perm.sym2 {xs ys : List Ξ±} (h : xs ~ ys) : xs.sym2 ~ ys.sym2 := by induction h with | nil => rfl | cons x h ih => simp only [List.sym2, map_cons, cons_append, perm_cons] exact (h.map _).append ih | swap x y xs => simp only [List.sym2, map_cons, cons_append] conv => enter [1,2,1]; rw [Sym2.eq_swap] -- Explicit permutation to speed up simps that follow. refine Perm.trans (Perm.swap ..) (Perm.trans (Perm.cons _ ?_) (Perm.swap ..)) simp only [← Multiset.coe_eq_coe, ← Multiset.cons_coe, ← Multiset.coe_add, ← Multiset.singleton_add] simp only [add_assoc, add_left_comm] | trans _ _ ih1 ih2 => exact ih1.trans ih2 protected theorem Sublist.sym2 {xs ys : List Ξ±} (h : xs <+ ys) : xs.sym2 <+ ys.sym2 := by induction h with | slnil => apply slnil | cons a h ih => simp only [List.sym2] exact Sublist.append (nil_sublist _) ih | consβ‚‚ a h ih => simp only [List.sym2, map_cons, cons_append] exact consβ‚‚ _ (append (Sublist.map _ h) ih) protected theorem Subperm.sym2 {xs ys : List Ξ±} (h : xs <+~ ys) : xs.sym2 <+~ ys.sym2 := by obtain ⟨xs', hx, h⟩ := h exact hx.sym2.symm.subperm.trans h.sym2.subperm
Mathlib/Data/List/Sym.lean
146
151
theorem length_sym2 {xs : List Ξ±} : xs.sym2.length = Nat.choose (xs.length + 1) 2 := by
induction xs with | nil => rfl | cons x xs ih => rw [List.sym2, length_append, length_map, length_cons, Nat.choose_succ_succ, ← ih, Nat.choose_one_right]
5
148.413159
2
1.444444
9
1,529
import Mathlib.Data.Nat.Choose.Basic import Mathlib.Data.Sym.Sym2 namespace List variable {Ξ± : Type*} section Sym protected def sym : (n : β„•) β†’ List Ξ± β†’ List (Sym Ξ± n) | 0, _ => [.nil] | _, [] => [] | n + 1, x :: xs => ((x :: xs).sym n |>.map fun p => x ::β‚› p) ++ xs.sym (n + 1) variable {xs ys : List Ξ±} {n : β„•}
Mathlib/Data/List/Sym.lean
165
169
theorem sym_one_eq : xs.sym 1 = xs.map (Β· ::β‚› .nil) := by
induction xs with | nil => simp only [List.sym, Nat.succ_eq_add_one, Nat.reduceAdd, map_nil] | cons x xs ih => rw [map_cons, ← ih, List.sym, List.sym, map_singleton, singleton_append]
4
54.59815
2
1.444444
9
1,529
import Mathlib.Topology.MetricSpace.HausdorffDistance import Mathlib.MeasureTheory.Constructions.BorelSpace.Order #align_import measure_theory.measure.regular from "leanprover-community/mathlib"@"bf6a01357ff5684b1ebcd0f1a13be314fc82c0bf" open Set Filter ENNReal Topology NNReal TopologicalSpace namespace MeasureTheory namespace Measure def InnerRegularWRT {Ξ±} {_ : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (p q : Set Ξ± β†’ Prop) := βˆ€ ⦃U⦄, q U β†’ βˆ€ r < ΞΌ U, βˆƒ K, K βŠ† U ∧ p K ∧ r < ΞΌ K #align measure_theory.measure.inner_regular MeasureTheory.Measure.InnerRegularWRT namespace InnerRegularWRT variable {Ξ± : Type*} {m : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} {p q : Set Ξ± β†’ Prop} {U : Set Ξ±} {Ξ΅ : ℝβ‰₯0∞}
Mathlib/MeasureTheory/Measure/Regular.lean
215
219
theorem measure_eq_iSup (H : InnerRegularWRT ΞΌ p q) (hU : q U) : ΞΌ U = ⨆ (K) (_ : K βŠ† U) (_ : p K), ΞΌ K := by
refine le_antisymm (le_of_forall_lt fun r hr => ?_) (iSupβ‚‚_le fun K hK => iSup_le fun _ => ΞΌ.mono hK) simpa only [lt_iSup_iff, exists_prop] using H hU r hr
3
20.085537
1
1.444444
9
1,530
import Mathlib.Topology.MetricSpace.HausdorffDistance import Mathlib.MeasureTheory.Constructions.BorelSpace.Order #align_import measure_theory.measure.regular from "leanprover-community/mathlib"@"bf6a01357ff5684b1ebcd0f1a13be314fc82c0bf" open Set Filter ENNReal Topology NNReal TopologicalSpace namespace MeasureTheory namespace Measure def InnerRegularWRT {Ξ±} {_ : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (p q : Set Ξ± β†’ Prop) := βˆ€ ⦃U⦄, q U β†’ βˆ€ r < ΞΌ U, βˆƒ K, K βŠ† U ∧ p K ∧ r < ΞΌ K #align measure_theory.measure.inner_regular MeasureTheory.Measure.InnerRegularWRT namespace InnerRegularWRT variable {Ξ± : Type*} {m : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} {p q : Set Ξ± β†’ Prop} {U : Set Ξ±} {Ξ΅ : ℝβ‰₯0∞} theorem measure_eq_iSup (H : InnerRegularWRT ΞΌ p q) (hU : q U) : ΞΌ U = ⨆ (K) (_ : K βŠ† U) (_ : p K), ΞΌ K := by refine le_antisymm (le_of_forall_lt fun r hr => ?_) (iSupβ‚‚_le fun K hK => iSup_le fun _ => ΞΌ.mono hK) simpa only [lt_iSup_iff, exists_prop] using H hU r hr #align measure_theory.measure.inner_regular.measure_eq_supr MeasureTheory.Measure.InnerRegularWRT.measure_eq_iSup
Mathlib/MeasureTheory/Measure/Regular.lean
222
228
theorem exists_subset_lt_add (H : InnerRegularWRT ΞΌ p q) (h0 : p βˆ…) (hU : q U) (hΞΌU : ΞΌ U β‰  ∞) (hΞ΅ : Ξ΅ β‰  0) : βˆƒ K, K βŠ† U ∧ p K ∧ ΞΌ U < ΞΌ K + Ξ΅ := by
rcases eq_or_ne (ΞΌ U) 0 with hβ‚€ | hβ‚€ Β· refine βŸ¨βˆ…, empty_subset _, h0, ?_⟩ rwa [measure_empty, hβ‚€, zero_add, pos_iff_ne_zero] Β· rcases H hU _ (ENNReal.sub_lt_self hΞΌU hβ‚€ hΞ΅) with ⟨K, hKU, hKc, hrK⟩ exact ⟨K, hKU, hKc, ENNReal.lt_add_of_sub_lt_right (Or.inl hΞΌU) hrK⟩
5
148.413159
2
1.444444
9
1,530
import Mathlib.Topology.MetricSpace.HausdorffDistance import Mathlib.MeasureTheory.Constructions.BorelSpace.Order #align_import measure_theory.measure.regular from "leanprover-community/mathlib"@"bf6a01357ff5684b1ebcd0f1a13be314fc82c0bf" open Set Filter ENNReal Topology NNReal TopologicalSpace namespace MeasureTheory namespace Measure def InnerRegularWRT {Ξ±} {_ : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (p q : Set Ξ± β†’ Prop) := βˆ€ ⦃U⦄, q U β†’ βˆ€ r < ΞΌ U, βˆƒ K, K βŠ† U ∧ p K ∧ r < ΞΌ K #align measure_theory.measure.inner_regular MeasureTheory.Measure.InnerRegularWRT namespace InnerRegularWRT variable {Ξ± : Type*} {m : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} {p q : Set Ξ± β†’ Prop} {U : Set Ξ±} {Ξ΅ : ℝβ‰₯0∞} theorem measure_eq_iSup (H : InnerRegularWRT ΞΌ p q) (hU : q U) : ΞΌ U = ⨆ (K) (_ : K βŠ† U) (_ : p K), ΞΌ K := by refine le_antisymm (le_of_forall_lt fun r hr => ?_) (iSupβ‚‚_le fun K hK => iSup_le fun _ => ΞΌ.mono hK) simpa only [lt_iSup_iff, exists_prop] using H hU r hr #align measure_theory.measure.inner_regular.measure_eq_supr MeasureTheory.Measure.InnerRegularWRT.measure_eq_iSup theorem exists_subset_lt_add (H : InnerRegularWRT ΞΌ p q) (h0 : p βˆ…) (hU : q U) (hΞΌU : ΞΌ U β‰  ∞) (hΞ΅ : Ξ΅ β‰  0) : βˆƒ K, K βŠ† U ∧ p K ∧ ΞΌ U < ΞΌ K + Ξ΅ := by rcases eq_or_ne (ΞΌ U) 0 with hβ‚€ | hβ‚€ Β· refine βŸ¨βˆ…, empty_subset _, h0, ?_⟩ rwa [measure_empty, hβ‚€, zero_add, pos_iff_ne_zero] Β· rcases H hU _ (ENNReal.sub_lt_self hΞΌU hβ‚€ hΞ΅) with ⟨K, hKU, hKc, hrK⟩ exact ⟨K, hKU, hKc, ENNReal.lt_add_of_sub_lt_right (Or.inl hΞΌU) hrK⟩ #align measure_theory.measure.inner_regular.exists_subset_lt_add MeasureTheory.Measure.InnerRegularWRT.exists_subset_lt_add protected theorem map {Ξ± Ξ²} [MeasurableSpace Ξ±] [MeasurableSpace Ξ²] {ΞΌ : Measure Ξ±} {pa qa : Set Ξ± β†’ Prop} (H : InnerRegularWRT ΞΌ pa qa) {f : Ξ± β†’ Ξ²} (hf : AEMeasurable f ΞΌ) {pb qb : Set Ξ² β†’ Prop} (hAB : βˆ€ U, qb U β†’ qa (f ⁻¹' U)) (hAB' : βˆ€ K, pa K β†’ pb (f '' K)) (hBβ‚‚ : βˆ€ U, qb U β†’ MeasurableSet U) : InnerRegularWRT (map f ΞΌ) pb qb := by intro U hU r hr rw [map_apply_of_aemeasurable hf (hBβ‚‚ _ hU)] at hr rcases H (hAB U hU) r hr with ⟨K, hKU, hKc, hK⟩ refine ⟨f '' K, image_subset_iff.2 hKU, hAB' _ hKc, ?_⟩ exact hK.trans_le (le_map_apply_image hf _) #align measure_theory.measure.inner_regular.map MeasureTheory.Measure.InnerRegularWRT.map
Mathlib/MeasureTheory/Measure/Regular.lean
244
252
theorem map' {Ξ± Ξ²} [MeasurableSpace Ξ±] [MeasurableSpace Ξ²] {ΞΌ : Measure Ξ±} {pa qa : Set Ξ± β†’ Prop} (H : InnerRegularWRT ΞΌ pa qa) (f : Ξ± ≃ᡐ Ξ²) {pb qb : Set Ξ² β†’ Prop} (hAB : βˆ€ U, qb U β†’ qa (f ⁻¹' U)) (hAB' : βˆ€ K, pa K β†’ pb (f '' K)) : InnerRegularWRT (map f ΞΌ) pb qb := by
intro U hU r hr rw [f.map_apply U] at hr rcases H (hAB U hU) r hr with ⟨K, hKU, hKc, hK⟩ refine ⟨f '' K, image_subset_iff.2 hKU, hAB' _ hKc, ?_⟩ rwa [f.map_apply, f.preimage_image]
5
148.413159
2
1.444444
9
1,530
import Mathlib.Topology.MetricSpace.HausdorffDistance import Mathlib.MeasureTheory.Constructions.BorelSpace.Order #align_import measure_theory.measure.regular from "leanprover-community/mathlib"@"bf6a01357ff5684b1ebcd0f1a13be314fc82c0bf" open Set Filter ENNReal Topology NNReal TopologicalSpace namespace MeasureTheory namespace Measure def InnerRegularWRT {Ξ±} {_ : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (p q : Set Ξ± β†’ Prop) := βˆ€ ⦃U⦄, q U β†’ βˆ€ r < ΞΌ U, βˆƒ K, K βŠ† U ∧ p K ∧ r < ΞΌ K #align measure_theory.measure.inner_regular MeasureTheory.Measure.InnerRegularWRT namespace InnerRegularWRT variable {Ξ± : Type*} {m : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} {p q : Set Ξ± β†’ Prop} {U : Set Ξ±} {Ξ΅ : ℝβ‰₯0∞} theorem measure_eq_iSup (H : InnerRegularWRT ΞΌ p q) (hU : q U) : ΞΌ U = ⨆ (K) (_ : K βŠ† U) (_ : p K), ΞΌ K := by refine le_antisymm (le_of_forall_lt fun r hr => ?_) (iSupβ‚‚_le fun K hK => iSup_le fun _ => ΞΌ.mono hK) simpa only [lt_iSup_iff, exists_prop] using H hU r hr #align measure_theory.measure.inner_regular.measure_eq_supr MeasureTheory.Measure.InnerRegularWRT.measure_eq_iSup theorem exists_subset_lt_add (H : InnerRegularWRT ΞΌ p q) (h0 : p βˆ…) (hU : q U) (hΞΌU : ΞΌ U β‰  ∞) (hΞ΅ : Ξ΅ β‰  0) : βˆƒ K, K βŠ† U ∧ p K ∧ ΞΌ U < ΞΌ K + Ξ΅ := by rcases eq_or_ne (ΞΌ U) 0 with hβ‚€ | hβ‚€ Β· refine βŸ¨βˆ…, empty_subset _, h0, ?_⟩ rwa [measure_empty, hβ‚€, zero_add, pos_iff_ne_zero] Β· rcases H hU _ (ENNReal.sub_lt_self hΞΌU hβ‚€ hΞ΅) with ⟨K, hKU, hKc, hrK⟩ exact ⟨K, hKU, hKc, ENNReal.lt_add_of_sub_lt_right (Or.inl hΞΌU) hrK⟩ #align measure_theory.measure.inner_regular.exists_subset_lt_add MeasureTheory.Measure.InnerRegularWRT.exists_subset_lt_add protected theorem map {Ξ± Ξ²} [MeasurableSpace Ξ±] [MeasurableSpace Ξ²] {ΞΌ : Measure Ξ±} {pa qa : Set Ξ± β†’ Prop} (H : InnerRegularWRT ΞΌ pa qa) {f : Ξ± β†’ Ξ²} (hf : AEMeasurable f ΞΌ) {pb qb : Set Ξ² β†’ Prop} (hAB : βˆ€ U, qb U β†’ qa (f ⁻¹' U)) (hAB' : βˆ€ K, pa K β†’ pb (f '' K)) (hBβ‚‚ : βˆ€ U, qb U β†’ MeasurableSet U) : InnerRegularWRT (map f ΞΌ) pb qb := by intro U hU r hr rw [map_apply_of_aemeasurable hf (hBβ‚‚ _ hU)] at hr rcases H (hAB U hU) r hr with ⟨K, hKU, hKc, hK⟩ refine ⟨f '' K, image_subset_iff.2 hKU, hAB' _ hKc, ?_⟩ exact hK.trans_le (le_map_apply_image hf _) #align measure_theory.measure.inner_regular.map MeasureTheory.Measure.InnerRegularWRT.map theorem map' {Ξ± Ξ²} [MeasurableSpace Ξ±] [MeasurableSpace Ξ²] {ΞΌ : Measure Ξ±} {pa qa : Set Ξ± β†’ Prop} (H : InnerRegularWRT ΞΌ pa qa) (f : Ξ± ≃ᡐ Ξ²) {pb qb : Set Ξ² β†’ Prop} (hAB : βˆ€ U, qb U β†’ qa (f ⁻¹' U)) (hAB' : βˆ€ K, pa K β†’ pb (f '' K)) : InnerRegularWRT (map f ΞΌ) pb qb := by intro U hU r hr rw [f.map_apply U] at hr rcases H (hAB U hU) r hr with ⟨K, hKU, hKc, hK⟩ refine ⟨f '' K, image_subset_iff.2 hKU, hAB' _ hKc, ?_⟩ rwa [f.map_apply, f.preimage_image]
Mathlib/MeasureTheory/Measure/Regular.lean
254
257
theorem smul (H : InnerRegularWRT ΞΌ p q) (c : ℝβ‰₯0∞) : InnerRegularWRT (c β€’ ΞΌ) p q := by
intro U hU r hr rw [smul_apply, H.measure_eq_iSup hU, smul_eq_mul] at hr simpa only [ENNReal.mul_iSup, lt_iSup_iff, exists_prop] using hr
3
20.085537
1
1.444444
9
1,530
import Mathlib.Topology.MetricSpace.HausdorffDistance import Mathlib.MeasureTheory.Constructions.BorelSpace.Order #align_import measure_theory.measure.regular from "leanprover-community/mathlib"@"bf6a01357ff5684b1ebcd0f1a13be314fc82c0bf" open Set Filter ENNReal Topology NNReal TopologicalSpace namespace MeasureTheory namespace Measure def InnerRegularWRT {Ξ±} {_ : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (p q : Set Ξ± β†’ Prop) := βˆ€ ⦃U⦄, q U β†’ βˆ€ r < ΞΌ U, βˆƒ K, K βŠ† U ∧ p K ∧ r < ΞΌ K #align measure_theory.measure.inner_regular MeasureTheory.Measure.InnerRegularWRT namespace InnerRegularWRT variable {Ξ± : Type*} {m : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} {p q : Set Ξ± β†’ Prop} {U : Set Ξ±} {Ξ΅ : ℝβ‰₯0∞} theorem measure_eq_iSup (H : InnerRegularWRT ΞΌ p q) (hU : q U) : ΞΌ U = ⨆ (K) (_ : K βŠ† U) (_ : p K), ΞΌ K := by refine le_antisymm (le_of_forall_lt fun r hr => ?_) (iSupβ‚‚_le fun K hK => iSup_le fun _ => ΞΌ.mono hK) simpa only [lt_iSup_iff, exists_prop] using H hU r hr #align measure_theory.measure.inner_regular.measure_eq_supr MeasureTheory.Measure.InnerRegularWRT.measure_eq_iSup theorem exists_subset_lt_add (H : InnerRegularWRT ΞΌ p q) (h0 : p βˆ…) (hU : q U) (hΞΌU : ΞΌ U β‰  ∞) (hΞ΅ : Ξ΅ β‰  0) : βˆƒ K, K βŠ† U ∧ p K ∧ ΞΌ U < ΞΌ K + Ξ΅ := by rcases eq_or_ne (ΞΌ U) 0 with hβ‚€ | hβ‚€ Β· refine βŸ¨βˆ…, empty_subset _, h0, ?_⟩ rwa [measure_empty, hβ‚€, zero_add, pos_iff_ne_zero] Β· rcases H hU _ (ENNReal.sub_lt_self hΞΌU hβ‚€ hΞ΅) with ⟨K, hKU, hKc, hrK⟩ exact ⟨K, hKU, hKc, ENNReal.lt_add_of_sub_lt_right (Or.inl hΞΌU) hrK⟩ #align measure_theory.measure.inner_regular.exists_subset_lt_add MeasureTheory.Measure.InnerRegularWRT.exists_subset_lt_add protected theorem map {Ξ± Ξ²} [MeasurableSpace Ξ±] [MeasurableSpace Ξ²] {ΞΌ : Measure Ξ±} {pa qa : Set Ξ± β†’ Prop} (H : InnerRegularWRT ΞΌ pa qa) {f : Ξ± β†’ Ξ²} (hf : AEMeasurable f ΞΌ) {pb qb : Set Ξ² β†’ Prop} (hAB : βˆ€ U, qb U β†’ qa (f ⁻¹' U)) (hAB' : βˆ€ K, pa K β†’ pb (f '' K)) (hBβ‚‚ : βˆ€ U, qb U β†’ MeasurableSet U) : InnerRegularWRT (map f ΞΌ) pb qb := by intro U hU r hr rw [map_apply_of_aemeasurable hf (hBβ‚‚ _ hU)] at hr rcases H (hAB U hU) r hr with ⟨K, hKU, hKc, hK⟩ refine ⟨f '' K, image_subset_iff.2 hKU, hAB' _ hKc, ?_⟩ exact hK.trans_le (le_map_apply_image hf _) #align measure_theory.measure.inner_regular.map MeasureTheory.Measure.InnerRegularWRT.map theorem map' {Ξ± Ξ²} [MeasurableSpace Ξ±] [MeasurableSpace Ξ²] {ΞΌ : Measure Ξ±} {pa qa : Set Ξ± β†’ Prop} (H : InnerRegularWRT ΞΌ pa qa) (f : Ξ± ≃ᡐ Ξ²) {pb qb : Set Ξ² β†’ Prop} (hAB : βˆ€ U, qb U β†’ qa (f ⁻¹' U)) (hAB' : βˆ€ K, pa K β†’ pb (f '' K)) : InnerRegularWRT (map f ΞΌ) pb qb := by intro U hU r hr rw [f.map_apply U] at hr rcases H (hAB U hU) r hr with ⟨K, hKU, hKc, hK⟩ refine ⟨f '' K, image_subset_iff.2 hKU, hAB' _ hKc, ?_⟩ rwa [f.map_apply, f.preimage_image] theorem smul (H : InnerRegularWRT ΞΌ p q) (c : ℝβ‰₯0∞) : InnerRegularWRT (c β€’ ΞΌ) p q := by intro U hU r hr rw [smul_apply, H.measure_eq_iSup hU, smul_eq_mul] at hr simpa only [ENNReal.mul_iSup, lt_iSup_iff, exists_prop] using hr #align measure_theory.measure.inner_regular.smul MeasureTheory.Measure.InnerRegularWRT.smul
Mathlib/MeasureTheory/Measure/Regular.lean
260
264
theorem trans {q' : Set Ξ± β†’ Prop} (H : InnerRegularWRT ΞΌ p q) (H' : InnerRegularWRT ΞΌ q q') : InnerRegularWRT ΞΌ p q' := by
intro U hU r hr rcases H' hU r hr with ⟨F, hFU, hqF, hF⟩; rcases H hqF _ hF with ⟨K, hKF, hpK, hrK⟩ exact ⟨K, hKF.trans hFU, hpK, hrK⟩
3
20.085537
1
1.444444
9
1,530
import Mathlib.Topology.MetricSpace.HausdorffDistance import Mathlib.MeasureTheory.Constructions.BorelSpace.Order #align_import measure_theory.measure.regular from "leanprover-community/mathlib"@"bf6a01357ff5684b1ebcd0f1a13be314fc82c0bf" open Set Filter ENNReal Topology NNReal TopologicalSpace namespace MeasureTheory namespace Measure def InnerRegularWRT {Ξ±} {_ : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (p q : Set Ξ± β†’ Prop) := βˆ€ ⦃U⦄, q U β†’ βˆ€ r < ΞΌ U, βˆƒ K, K βŠ† U ∧ p K ∧ r < ΞΌ K #align measure_theory.measure.inner_regular MeasureTheory.Measure.InnerRegularWRT variable {Ξ± Ξ² : Type*} [MeasurableSpace Ξ±] [TopologicalSpace Ξ±] {ΞΌ : Measure Ξ±} class OuterRegular (ΞΌ : Measure Ξ±) : Prop where protected outerRegular : βˆ€ ⦃A : Set α⦄, MeasurableSet A β†’ βˆ€ r > ΞΌ A, βˆƒ U, U βŠ‡ A ∧ IsOpen U ∧ ΞΌ U < r #align measure_theory.measure.outer_regular MeasureTheory.Measure.OuterRegular #align measure_theory.measure.outer_regular.outer_regular MeasureTheory.Measure.OuterRegular.outerRegular class Regular (ΞΌ : Measure Ξ±) extends IsFiniteMeasureOnCompacts ΞΌ, OuterRegular ΞΌ : Prop where innerRegular : InnerRegularWRT ΞΌ IsCompact IsOpen #align measure_theory.measure.regular MeasureTheory.Measure.Regular class WeaklyRegular (ΞΌ : Measure Ξ±) extends OuterRegular ΞΌ : Prop where protected innerRegular : InnerRegularWRT ΞΌ IsClosed IsOpen #align measure_theory.measure.weakly_regular MeasureTheory.Measure.WeaklyRegular #align measure_theory.measure.weakly_regular.inner_regular MeasureTheory.Measure.WeaklyRegular.innerRegular class InnerRegular (ΞΌ : Measure Ξ±) : Prop where protected innerRegular : InnerRegularWRT ΞΌ IsCompact (fun s ↦ MeasurableSet s) class InnerRegularCompactLTTop (ΞΌ : Measure Ξ±) : Prop where protected innerRegular : InnerRegularWRT ΞΌ IsCompact (fun s ↦ MeasurableSet s ∧ ΞΌ s β‰  ∞) -- see Note [lower instance priority] instance (priority := 100) Regular.weaklyRegular [R1Space Ξ±] [Regular ΞΌ] : WeaklyRegular ΞΌ where innerRegular := fun _U hU r hr ↦ let ⟨K, KU, K_comp, hK⟩ := Regular.innerRegular hU r hr ⟨closure K, K_comp.closure_subset_of_isOpen hU KU, isClosed_closure, hK.trans_le (measure_mono subset_closure)⟩ #align measure_theory.measure.regular.weakly_regular MeasureTheory.Measure.Regular.weaklyRegular namespace OuterRegular instance zero : OuterRegular (0 : Measure Ξ±) := ⟨fun A _ _r hr => ⟨univ, subset_univ A, isOpen_univ, hr⟩⟩ #align measure_theory.measure.outer_regular.zero MeasureTheory.Measure.OuterRegular.zero
Mathlib/MeasureTheory/Measure/Regular.lean
339
344
theorem _root_.Set.exists_isOpen_lt_of_lt [OuterRegular ΞΌ] (A : Set Ξ±) (r : ℝβ‰₯0∞) (hr : ΞΌ A < r) : βˆƒ U, U βŠ‡ A ∧ IsOpen U ∧ ΞΌ U < r := by
rcases OuterRegular.outerRegular (measurableSet_toMeasurable μ A) r (by rwa [measure_toMeasurable]) with ⟨U, hAU, hUo, hU⟩ exact ⟨U, (subset_toMeasurable _ _).trans hAU, hUo, hU⟩
4
54.59815
2
1.444444
9
1,530
import Mathlib.Topology.MetricSpace.HausdorffDistance import Mathlib.MeasureTheory.Constructions.BorelSpace.Order #align_import measure_theory.measure.regular from "leanprover-community/mathlib"@"bf6a01357ff5684b1ebcd0f1a13be314fc82c0bf" open Set Filter ENNReal Topology NNReal TopologicalSpace namespace MeasureTheory namespace Measure def InnerRegularWRT {Ξ±} {_ : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (p q : Set Ξ± β†’ Prop) := βˆ€ ⦃U⦄, q U β†’ βˆ€ r < ΞΌ U, βˆƒ K, K βŠ† U ∧ p K ∧ r < ΞΌ K #align measure_theory.measure.inner_regular MeasureTheory.Measure.InnerRegularWRT variable {Ξ± Ξ² : Type*} [MeasurableSpace Ξ±] [TopologicalSpace Ξ±] {ΞΌ : Measure Ξ±} class OuterRegular (ΞΌ : Measure Ξ±) : Prop where protected outerRegular : βˆ€ ⦃A : Set α⦄, MeasurableSet A β†’ βˆ€ r > ΞΌ A, βˆƒ U, U βŠ‡ A ∧ IsOpen U ∧ ΞΌ U < r #align measure_theory.measure.outer_regular MeasureTheory.Measure.OuterRegular #align measure_theory.measure.outer_regular.outer_regular MeasureTheory.Measure.OuterRegular.outerRegular class Regular (ΞΌ : Measure Ξ±) extends IsFiniteMeasureOnCompacts ΞΌ, OuterRegular ΞΌ : Prop where innerRegular : InnerRegularWRT ΞΌ IsCompact IsOpen #align measure_theory.measure.regular MeasureTheory.Measure.Regular class WeaklyRegular (ΞΌ : Measure Ξ±) extends OuterRegular ΞΌ : Prop where protected innerRegular : InnerRegularWRT ΞΌ IsClosed IsOpen #align measure_theory.measure.weakly_regular MeasureTheory.Measure.WeaklyRegular #align measure_theory.measure.weakly_regular.inner_regular MeasureTheory.Measure.WeaklyRegular.innerRegular class InnerRegular (ΞΌ : Measure Ξ±) : Prop where protected innerRegular : InnerRegularWRT ΞΌ IsCompact (fun s ↦ MeasurableSet s) class InnerRegularCompactLTTop (ΞΌ : Measure Ξ±) : Prop where protected innerRegular : InnerRegularWRT ΞΌ IsCompact (fun s ↦ MeasurableSet s ∧ ΞΌ s β‰  ∞) -- see Note [lower instance priority] instance (priority := 100) Regular.weaklyRegular [R1Space Ξ±] [Regular ΞΌ] : WeaklyRegular ΞΌ where innerRegular := fun _U hU r hr ↦ let ⟨K, KU, K_comp, hK⟩ := Regular.innerRegular hU r hr ⟨closure K, K_comp.closure_subset_of_isOpen hU KU, isClosed_closure, hK.trans_le (measure_mono subset_closure)⟩ #align measure_theory.measure.regular.weakly_regular MeasureTheory.Measure.Regular.weaklyRegular namespace OuterRegular instance zero : OuterRegular (0 : Measure Ξ±) := ⟨fun A _ _r hr => ⟨univ, subset_univ A, isOpen_univ, hr⟩⟩ #align measure_theory.measure.outer_regular.zero MeasureTheory.Measure.OuterRegular.zero theorem _root_.Set.exists_isOpen_lt_of_lt [OuterRegular ΞΌ] (A : Set Ξ±) (r : ℝβ‰₯0∞) (hr : ΞΌ A < r) : βˆƒ U, U βŠ‡ A ∧ IsOpen U ∧ ΞΌ U < r := by rcases OuterRegular.outerRegular (measurableSet_toMeasurable ΞΌ A) r (by rwa [measure_toMeasurable]) with ⟨U, hAU, hUo, hU⟩ exact ⟨U, (subset_toMeasurable _ _).trans hAU, hUo, hU⟩ #align set.exists_is_open_lt_of_lt Set.exists_isOpen_lt_of_lt
Mathlib/MeasureTheory/Measure/Regular.lean
349
353
theorem _root_.Set.measure_eq_iInf_isOpen (A : Set Ξ±) (ΞΌ : Measure Ξ±) [OuterRegular ΞΌ] : ΞΌ A = β¨… (U : Set Ξ±) (_ : A βŠ† U) (_ : IsOpen U), ΞΌ U := by
refine le_antisymm (le_iInfβ‚‚ fun s hs => le_iInf fun _ => ΞΌ.mono hs) ?_ refine le_of_forall_lt' fun r hr => ?_ simpa only [iInf_lt_iff, exists_prop] using A.exists_isOpen_lt_of_lt r hr
3
20.085537
1
1.444444
9
1,530
import Mathlib.Topology.MetricSpace.HausdorffDistance import Mathlib.MeasureTheory.Constructions.BorelSpace.Order #align_import measure_theory.measure.regular from "leanprover-community/mathlib"@"bf6a01357ff5684b1ebcd0f1a13be314fc82c0bf" open Set Filter ENNReal Topology NNReal TopologicalSpace namespace MeasureTheory namespace Measure def InnerRegularWRT {Ξ±} {_ : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (p q : Set Ξ± β†’ Prop) := βˆ€ ⦃U⦄, q U β†’ βˆ€ r < ΞΌ U, βˆƒ K, K βŠ† U ∧ p K ∧ r < ΞΌ K #align measure_theory.measure.inner_regular MeasureTheory.Measure.InnerRegularWRT variable {Ξ± Ξ² : Type*} [MeasurableSpace Ξ±] [TopologicalSpace Ξ±] {ΞΌ : Measure Ξ±} class OuterRegular (ΞΌ : Measure Ξ±) : Prop where protected outerRegular : βˆ€ ⦃A : Set α⦄, MeasurableSet A β†’ βˆ€ r > ΞΌ A, βˆƒ U, U βŠ‡ A ∧ IsOpen U ∧ ΞΌ U < r #align measure_theory.measure.outer_regular MeasureTheory.Measure.OuterRegular #align measure_theory.measure.outer_regular.outer_regular MeasureTheory.Measure.OuterRegular.outerRegular class Regular (ΞΌ : Measure Ξ±) extends IsFiniteMeasureOnCompacts ΞΌ, OuterRegular ΞΌ : Prop where innerRegular : InnerRegularWRT ΞΌ IsCompact IsOpen #align measure_theory.measure.regular MeasureTheory.Measure.Regular class WeaklyRegular (ΞΌ : Measure Ξ±) extends OuterRegular ΞΌ : Prop where protected innerRegular : InnerRegularWRT ΞΌ IsClosed IsOpen #align measure_theory.measure.weakly_regular MeasureTheory.Measure.WeaklyRegular #align measure_theory.measure.weakly_regular.inner_regular MeasureTheory.Measure.WeaklyRegular.innerRegular class InnerRegular (ΞΌ : Measure Ξ±) : Prop where protected innerRegular : InnerRegularWRT ΞΌ IsCompact (fun s ↦ MeasurableSet s) class InnerRegularCompactLTTop (ΞΌ : Measure Ξ±) : Prop where protected innerRegular : InnerRegularWRT ΞΌ IsCompact (fun s ↦ MeasurableSet s ∧ ΞΌ s β‰  ∞) -- see Note [lower instance priority] instance (priority := 100) Regular.weaklyRegular [R1Space Ξ±] [Regular ΞΌ] : WeaklyRegular ΞΌ where innerRegular := fun _U hU r hr ↦ let ⟨K, KU, K_comp, hK⟩ := Regular.innerRegular hU r hr ⟨closure K, K_comp.closure_subset_of_isOpen hU KU, isClosed_closure, hK.trans_le (measure_mono subset_closure)⟩ #align measure_theory.measure.regular.weakly_regular MeasureTheory.Measure.Regular.weaklyRegular namespace OuterRegular instance zero : OuterRegular (0 : Measure Ξ±) := ⟨fun A _ _r hr => ⟨univ, subset_univ A, isOpen_univ, hr⟩⟩ #align measure_theory.measure.outer_regular.zero MeasureTheory.Measure.OuterRegular.zero theorem _root_.Set.exists_isOpen_lt_of_lt [OuterRegular ΞΌ] (A : Set Ξ±) (r : ℝβ‰₯0∞) (hr : ΞΌ A < r) : βˆƒ U, U βŠ‡ A ∧ IsOpen U ∧ ΞΌ U < r := by rcases OuterRegular.outerRegular (measurableSet_toMeasurable ΞΌ A) r (by rwa [measure_toMeasurable]) with ⟨U, hAU, hUo, hU⟩ exact ⟨U, (subset_toMeasurable _ _).trans hAU, hUo, hU⟩ #align set.exists_is_open_lt_of_lt Set.exists_isOpen_lt_of_lt theorem _root_.Set.measure_eq_iInf_isOpen (A : Set Ξ±) (ΞΌ : Measure Ξ±) [OuterRegular ΞΌ] : ΞΌ A = β¨… (U : Set Ξ±) (_ : A βŠ† U) (_ : IsOpen U), ΞΌ U := by refine le_antisymm (le_iInfβ‚‚ fun s hs => le_iInf fun _ => ΞΌ.mono hs) ?_ refine le_of_forall_lt' fun r hr => ?_ simpa only [iInf_lt_iff, exists_prop] using A.exists_isOpen_lt_of_lt r hr #align set.measure_eq_infi_is_open Set.measure_eq_iInf_isOpen theorem _root_.Set.exists_isOpen_lt_add [OuterRegular ΞΌ] (A : Set Ξ±) (hA : ΞΌ A β‰  ∞) {Ξ΅ : ℝβ‰₯0∞} (hΞ΅ : Ξ΅ β‰  0) : βˆƒ U, U βŠ‡ A ∧ IsOpen U ∧ ΞΌ U < ΞΌ A + Ξ΅ := A.exists_isOpen_lt_of_lt _ (ENNReal.lt_add_right hA hΞ΅) #align set.exists_is_open_lt_add Set.exists_isOpen_lt_add
Mathlib/MeasureTheory/Measure/Regular.lean
361
366
theorem _root_.Set.exists_isOpen_le_add (A : Set Ξ±) (ΞΌ : Measure Ξ±) [OuterRegular ΞΌ] {Ξ΅ : ℝβ‰₯0∞} (hΞ΅ : Ξ΅ β‰  0) : βˆƒ U, U βŠ‡ A ∧ IsOpen U ∧ ΞΌ U ≀ ΞΌ A + Ξ΅ := by
rcases eq_or_ne (μ A) ∞ with (H | H) · exact ⟨univ, subset_univ _, isOpen_univ, by simp only [H, _root_.top_add, le_top]⟩ · rcases A.exists_isOpen_lt_add H hΡ with ⟨U, AU, U_open, hU⟩ exact ⟨U, AU, U_open, hU.le⟩
4
54.59815
2
1.444444
9
1,530
import Mathlib.Topology.MetricSpace.HausdorffDistance import Mathlib.MeasureTheory.Constructions.BorelSpace.Order #align_import measure_theory.measure.regular from "leanprover-community/mathlib"@"bf6a01357ff5684b1ebcd0f1a13be314fc82c0bf" open Set Filter ENNReal Topology NNReal TopologicalSpace namespace MeasureTheory namespace Measure def InnerRegularWRT {Ξ±} {_ : MeasurableSpace Ξ±} (ΞΌ : Measure Ξ±) (p q : Set Ξ± β†’ Prop) := βˆ€ ⦃U⦄, q U β†’ βˆ€ r < ΞΌ U, βˆƒ K, K βŠ† U ∧ p K ∧ r < ΞΌ K #align measure_theory.measure.inner_regular MeasureTheory.Measure.InnerRegularWRT variable {Ξ± Ξ² : Type*} [MeasurableSpace Ξ±] [TopologicalSpace Ξ±] {ΞΌ : Measure Ξ±} class OuterRegular (ΞΌ : Measure Ξ±) : Prop where protected outerRegular : βˆ€ ⦃A : Set α⦄, MeasurableSet A β†’ βˆ€ r > ΞΌ A, βˆƒ U, U βŠ‡ A ∧ IsOpen U ∧ ΞΌ U < r #align measure_theory.measure.outer_regular MeasureTheory.Measure.OuterRegular #align measure_theory.measure.outer_regular.outer_regular MeasureTheory.Measure.OuterRegular.outerRegular class Regular (ΞΌ : Measure Ξ±) extends IsFiniteMeasureOnCompacts ΞΌ, OuterRegular ΞΌ : Prop where innerRegular : InnerRegularWRT ΞΌ IsCompact IsOpen #align measure_theory.measure.regular MeasureTheory.Measure.Regular class WeaklyRegular (ΞΌ : Measure Ξ±) extends OuterRegular ΞΌ : Prop where protected innerRegular : InnerRegularWRT ΞΌ IsClosed IsOpen #align measure_theory.measure.weakly_regular MeasureTheory.Measure.WeaklyRegular #align measure_theory.measure.weakly_regular.inner_regular MeasureTheory.Measure.WeaklyRegular.innerRegular class InnerRegular (ΞΌ : Measure Ξ±) : Prop where protected innerRegular : InnerRegularWRT ΞΌ IsCompact (fun s ↦ MeasurableSet s) class InnerRegularCompactLTTop (ΞΌ : Measure Ξ±) : Prop where protected innerRegular : InnerRegularWRT ΞΌ IsCompact (fun s ↦ MeasurableSet s ∧ ΞΌ s β‰  ∞) -- see Note [lower instance priority] instance (priority := 100) Regular.weaklyRegular [R1Space Ξ±] [Regular ΞΌ] : WeaklyRegular ΞΌ where innerRegular := fun _U hU r hr ↦ let ⟨K, KU, K_comp, hK⟩ := Regular.innerRegular hU r hr ⟨closure K, K_comp.closure_subset_of_isOpen hU KU, isClosed_closure, hK.trans_le (measure_mono subset_closure)⟩ #align measure_theory.measure.regular.weakly_regular MeasureTheory.Measure.Regular.weaklyRegular namespace OuterRegular instance zero : OuterRegular (0 : Measure Ξ±) := ⟨fun A _ _r hr => ⟨univ, subset_univ A, isOpen_univ, hr⟩⟩ #align measure_theory.measure.outer_regular.zero MeasureTheory.Measure.OuterRegular.zero theorem _root_.Set.exists_isOpen_lt_of_lt [OuterRegular ΞΌ] (A : Set Ξ±) (r : ℝβ‰₯0∞) (hr : ΞΌ A < r) : βˆƒ U, U βŠ‡ A ∧ IsOpen U ∧ ΞΌ U < r := by rcases OuterRegular.outerRegular (measurableSet_toMeasurable ΞΌ A) r (by rwa [measure_toMeasurable]) with ⟨U, hAU, hUo, hU⟩ exact ⟨U, (subset_toMeasurable _ _).trans hAU, hUo, hU⟩ #align set.exists_is_open_lt_of_lt Set.exists_isOpen_lt_of_lt theorem _root_.Set.measure_eq_iInf_isOpen (A : Set Ξ±) (ΞΌ : Measure Ξ±) [OuterRegular ΞΌ] : ΞΌ A = β¨… (U : Set Ξ±) (_ : A βŠ† U) (_ : IsOpen U), ΞΌ U := by refine le_antisymm (le_iInfβ‚‚ fun s hs => le_iInf fun _ => ΞΌ.mono hs) ?_ refine le_of_forall_lt' fun r hr => ?_ simpa only [iInf_lt_iff, exists_prop] using A.exists_isOpen_lt_of_lt r hr #align set.measure_eq_infi_is_open Set.measure_eq_iInf_isOpen theorem _root_.Set.exists_isOpen_lt_add [OuterRegular ΞΌ] (A : Set Ξ±) (hA : ΞΌ A β‰  ∞) {Ξ΅ : ℝβ‰₯0∞} (hΞ΅ : Ξ΅ β‰  0) : βˆƒ U, U βŠ‡ A ∧ IsOpen U ∧ ΞΌ U < ΞΌ A + Ξ΅ := A.exists_isOpen_lt_of_lt _ (ENNReal.lt_add_right hA hΞ΅) #align set.exists_is_open_lt_add Set.exists_isOpen_lt_add theorem _root_.Set.exists_isOpen_le_add (A : Set Ξ±) (ΞΌ : Measure Ξ±) [OuterRegular ΞΌ] {Ξ΅ : ℝβ‰₯0∞} (hΞ΅ : Ξ΅ β‰  0) : βˆƒ U, U βŠ‡ A ∧ IsOpen U ∧ ΞΌ U ≀ ΞΌ A + Ξ΅ := by rcases eq_or_ne (ΞΌ A) ∞ with (H | H) Β· exact ⟨univ, subset_univ _, isOpen_univ, by simp only [H, _root_.top_add, le_top]⟩ Β· rcases A.exists_isOpen_lt_add H hΞ΅ with ⟨U, AU, U_open, hU⟩ exact ⟨U, AU, U_open, hU.le⟩ #align set.exists_is_open_le_add Set.exists_isOpen_le_add
Mathlib/MeasureTheory/Measure/Regular.lean
369
374
theorem _root_.MeasurableSet.exists_isOpen_diff_lt [OuterRegular ΞΌ] {A : Set Ξ±} (hA : MeasurableSet A) (hA' : ΞΌ A β‰  ∞) {Ξ΅ : ℝβ‰₯0∞} (hΞ΅ : Ξ΅ β‰  0) : βˆƒ U, U βŠ‡ A ∧ IsOpen U ∧ ΞΌ U < ∞ ∧ ΞΌ (U \ A) < Ξ΅ := by
rcases A.exists_isOpen_lt_add hA' hΡ with ⟨U, hAU, hUo, hU⟩ use U, hAU, hUo, hU.trans_le le_top exact measure_diff_lt_of_lt_add hA hAU hA' hU
3
20.085537
1
1.444444
9
1,530
import Mathlib.Probability.IdentDistrib import Mathlib.MeasureTheory.Integral.DominatedConvergence import Mathlib.Analysis.SpecificLimits.FloorPow import Mathlib.Analysis.PSeries import Mathlib.Analysis.Asymptotics.SpecificAsymptotics #align_import probability.strong_law from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section open MeasureTheory Filter Finset Asymptotics open Set (indicator) open scoped Topology MeasureTheory ProbabilityTheory ENNReal NNReal namespace ProbabilityTheory section Truncation variable {Ξ± : Type*} def truncation (f : Ξ± β†’ ℝ) (A : ℝ) := indicator (Set.Ioc (-A) A) id ∘ f #align probability_theory.truncation ProbabilityTheory.truncation variable {m : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} {f : Ξ± β†’ ℝ}
Mathlib/Probability/StrongLaw.lean
82
85
theorem _root_.MeasureTheory.AEStronglyMeasurable.truncation (hf : AEStronglyMeasurable f ΞΌ) {A : ℝ} : AEStronglyMeasurable (truncation f A) ΞΌ := by
apply AEStronglyMeasurable.comp_aemeasurable _ hf.aemeasurable exact (stronglyMeasurable_id.indicator measurableSet_Ioc).aestronglyMeasurable
2
7.389056
1
1.444444
9
1,531
import Mathlib.Probability.IdentDistrib import Mathlib.MeasureTheory.Integral.DominatedConvergence import Mathlib.Analysis.SpecificLimits.FloorPow import Mathlib.Analysis.PSeries import Mathlib.Analysis.Asymptotics.SpecificAsymptotics #align_import probability.strong_law from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section open MeasureTheory Filter Finset Asymptotics open Set (indicator) open scoped Topology MeasureTheory ProbabilityTheory ENNReal NNReal namespace ProbabilityTheory section Truncation variable {Ξ± : Type*} def truncation (f : Ξ± β†’ ℝ) (A : ℝ) := indicator (Set.Ioc (-A) A) id ∘ f #align probability_theory.truncation ProbabilityTheory.truncation variable {m : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} {f : Ξ± β†’ ℝ} theorem _root_.MeasureTheory.AEStronglyMeasurable.truncation (hf : AEStronglyMeasurable f ΞΌ) {A : ℝ} : AEStronglyMeasurable (truncation f A) ΞΌ := by apply AEStronglyMeasurable.comp_aemeasurable _ hf.aemeasurable exact (stronglyMeasurable_id.indicator measurableSet_Ioc).aestronglyMeasurable #align measure_theory.ae_strongly_measurable.truncation MeasureTheory.AEStronglyMeasurable.truncation
Mathlib/Probability/StrongLaw.lean
88
92
theorem abs_truncation_le_bound (f : Ξ± β†’ ℝ) (A : ℝ) (x : Ξ±) : |truncation f A x| ≀ |A| := by
simp only [truncation, Set.indicator, Set.mem_Icc, id, Function.comp_apply] split_ifs with h Β· exact abs_le_abs h.2 (neg_le.2 h.1.le) Β· simp [abs_nonneg]
4
54.59815
2
1.444444
9
1,531
import Mathlib.Probability.IdentDistrib import Mathlib.MeasureTheory.Integral.DominatedConvergence import Mathlib.Analysis.SpecificLimits.FloorPow import Mathlib.Analysis.PSeries import Mathlib.Analysis.Asymptotics.SpecificAsymptotics #align_import probability.strong_law from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section open MeasureTheory Filter Finset Asymptotics open Set (indicator) open scoped Topology MeasureTheory ProbabilityTheory ENNReal NNReal namespace ProbabilityTheory section Truncation variable {Ξ± : Type*} def truncation (f : Ξ± β†’ ℝ) (A : ℝ) := indicator (Set.Ioc (-A) A) id ∘ f #align probability_theory.truncation ProbabilityTheory.truncation variable {m : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} {f : Ξ± β†’ ℝ} theorem _root_.MeasureTheory.AEStronglyMeasurable.truncation (hf : AEStronglyMeasurable f ΞΌ) {A : ℝ} : AEStronglyMeasurable (truncation f A) ΞΌ := by apply AEStronglyMeasurable.comp_aemeasurable _ hf.aemeasurable exact (stronglyMeasurable_id.indicator measurableSet_Ioc).aestronglyMeasurable #align measure_theory.ae_strongly_measurable.truncation MeasureTheory.AEStronglyMeasurable.truncation theorem abs_truncation_le_bound (f : Ξ± β†’ ℝ) (A : ℝ) (x : Ξ±) : |truncation f A x| ≀ |A| := by simp only [truncation, Set.indicator, Set.mem_Icc, id, Function.comp_apply] split_ifs with h Β· exact abs_le_abs h.2 (neg_le.2 h.1.le) Β· simp [abs_nonneg] #align probability_theory.abs_truncation_le_bound ProbabilityTheory.abs_truncation_le_bound @[simp]
Mathlib/Probability/StrongLaw.lean
96
96
theorem truncation_zero (f : Ξ± β†’ ℝ) : truncation f 0 = 0 := by
simp [truncation]; rfl
1
2.718282
0
1.444444
9
1,531
import Mathlib.Probability.IdentDistrib import Mathlib.MeasureTheory.Integral.DominatedConvergence import Mathlib.Analysis.SpecificLimits.FloorPow import Mathlib.Analysis.PSeries import Mathlib.Analysis.Asymptotics.SpecificAsymptotics #align_import probability.strong_law from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section open MeasureTheory Filter Finset Asymptotics open Set (indicator) open scoped Topology MeasureTheory ProbabilityTheory ENNReal NNReal namespace ProbabilityTheory section Truncation variable {Ξ± : Type*} def truncation (f : Ξ± β†’ ℝ) (A : ℝ) := indicator (Set.Ioc (-A) A) id ∘ f #align probability_theory.truncation ProbabilityTheory.truncation variable {m : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} {f : Ξ± β†’ ℝ} theorem _root_.MeasureTheory.AEStronglyMeasurable.truncation (hf : AEStronglyMeasurable f ΞΌ) {A : ℝ} : AEStronglyMeasurable (truncation f A) ΞΌ := by apply AEStronglyMeasurable.comp_aemeasurable _ hf.aemeasurable exact (stronglyMeasurable_id.indicator measurableSet_Ioc).aestronglyMeasurable #align measure_theory.ae_strongly_measurable.truncation MeasureTheory.AEStronglyMeasurable.truncation theorem abs_truncation_le_bound (f : Ξ± β†’ ℝ) (A : ℝ) (x : Ξ±) : |truncation f A x| ≀ |A| := by simp only [truncation, Set.indicator, Set.mem_Icc, id, Function.comp_apply] split_ifs with h Β· exact abs_le_abs h.2 (neg_le.2 h.1.le) Β· simp [abs_nonneg] #align probability_theory.abs_truncation_le_bound ProbabilityTheory.abs_truncation_le_bound @[simp] theorem truncation_zero (f : Ξ± β†’ ℝ) : truncation f 0 = 0 := by simp [truncation]; rfl #align probability_theory.truncation_zero ProbabilityTheory.truncation_zero
Mathlib/Probability/StrongLaw.lean
99
103
theorem abs_truncation_le_abs_self (f : Ξ± β†’ ℝ) (A : ℝ) (x : Ξ±) : |truncation f A x| ≀ |f x| := by
simp only [truncation, indicator, Set.mem_Icc, id, Function.comp_apply] split_ifs Β· exact le_rfl Β· simp [abs_nonneg]
4
54.59815
2
1.444444
9
1,531
import Mathlib.Probability.IdentDistrib import Mathlib.MeasureTheory.Integral.DominatedConvergence import Mathlib.Analysis.SpecificLimits.FloorPow import Mathlib.Analysis.PSeries import Mathlib.Analysis.Asymptotics.SpecificAsymptotics #align_import probability.strong_law from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section open MeasureTheory Filter Finset Asymptotics open Set (indicator) open scoped Topology MeasureTheory ProbabilityTheory ENNReal NNReal namespace ProbabilityTheory section Truncation variable {Ξ± : Type*} def truncation (f : Ξ± β†’ ℝ) (A : ℝ) := indicator (Set.Ioc (-A) A) id ∘ f #align probability_theory.truncation ProbabilityTheory.truncation variable {m : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} {f : Ξ± β†’ ℝ} theorem _root_.MeasureTheory.AEStronglyMeasurable.truncation (hf : AEStronglyMeasurable f ΞΌ) {A : ℝ} : AEStronglyMeasurable (truncation f A) ΞΌ := by apply AEStronglyMeasurable.comp_aemeasurable _ hf.aemeasurable exact (stronglyMeasurable_id.indicator measurableSet_Ioc).aestronglyMeasurable #align measure_theory.ae_strongly_measurable.truncation MeasureTheory.AEStronglyMeasurable.truncation theorem abs_truncation_le_bound (f : Ξ± β†’ ℝ) (A : ℝ) (x : Ξ±) : |truncation f A x| ≀ |A| := by simp only [truncation, Set.indicator, Set.mem_Icc, id, Function.comp_apply] split_ifs with h Β· exact abs_le_abs h.2 (neg_le.2 h.1.le) Β· simp [abs_nonneg] #align probability_theory.abs_truncation_le_bound ProbabilityTheory.abs_truncation_le_bound @[simp] theorem truncation_zero (f : Ξ± β†’ ℝ) : truncation f 0 = 0 := by simp [truncation]; rfl #align probability_theory.truncation_zero ProbabilityTheory.truncation_zero theorem abs_truncation_le_abs_self (f : Ξ± β†’ ℝ) (A : ℝ) (x : Ξ±) : |truncation f A x| ≀ |f x| := by simp only [truncation, indicator, Set.mem_Icc, id, Function.comp_apply] split_ifs Β· exact le_rfl Β· simp [abs_nonneg] #align probability_theory.abs_truncation_le_abs_self ProbabilityTheory.abs_truncation_le_abs_self
Mathlib/Probability/StrongLaw.lean
106
111
theorem truncation_eq_self {f : Ξ± β†’ ℝ} {A : ℝ} {x : Ξ±} (h : |f x| < A) : truncation f A x = f x := by
simp only [truncation, indicator, Set.mem_Icc, id, Function.comp_apply, ite_eq_left_iff] intro H apply H.elim simp [(abs_lt.1 h).1, (abs_lt.1 h).2.le]
4
54.59815
2
1.444444
9
1,531
import Mathlib.Probability.IdentDistrib import Mathlib.MeasureTheory.Integral.DominatedConvergence import Mathlib.Analysis.SpecificLimits.FloorPow import Mathlib.Analysis.PSeries import Mathlib.Analysis.Asymptotics.SpecificAsymptotics #align_import probability.strong_law from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section open MeasureTheory Filter Finset Asymptotics open Set (indicator) open scoped Topology MeasureTheory ProbabilityTheory ENNReal NNReal namespace ProbabilityTheory section Truncation variable {Ξ± : Type*} def truncation (f : Ξ± β†’ ℝ) (A : ℝ) := indicator (Set.Ioc (-A) A) id ∘ f #align probability_theory.truncation ProbabilityTheory.truncation variable {m : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} {f : Ξ± β†’ ℝ} theorem _root_.MeasureTheory.AEStronglyMeasurable.truncation (hf : AEStronglyMeasurable f ΞΌ) {A : ℝ} : AEStronglyMeasurable (truncation f A) ΞΌ := by apply AEStronglyMeasurable.comp_aemeasurable _ hf.aemeasurable exact (stronglyMeasurable_id.indicator measurableSet_Ioc).aestronglyMeasurable #align measure_theory.ae_strongly_measurable.truncation MeasureTheory.AEStronglyMeasurable.truncation theorem abs_truncation_le_bound (f : Ξ± β†’ ℝ) (A : ℝ) (x : Ξ±) : |truncation f A x| ≀ |A| := by simp only [truncation, Set.indicator, Set.mem_Icc, id, Function.comp_apply] split_ifs with h Β· exact abs_le_abs h.2 (neg_le.2 h.1.le) Β· simp [abs_nonneg] #align probability_theory.abs_truncation_le_bound ProbabilityTheory.abs_truncation_le_bound @[simp] theorem truncation_zero (f : Ξ± β†’ ℝ) : truncation f 0 = 0 := by simp [truncation]; rfl #align probability_theory.truncation_zero ProbabilityTheory.truncation_zero theorem abs_truncation_le_abs_self (f : Ξ± β†’ ℝ) (A : ℝ) (x : Ξ±) : |truncation f A x| ≀ |f x| := by simp only [truncation, indicator, Set.mem_Icc, id, Function.comp_apply] split_ifs Β· exact le_rfl Β· simp [abs_nonneg] #align probability_theory.abs_truncation_le_abs_self ProbabilityTheory.abs_truncation_le_abs_self theorem truncation_eq_self {f : Ξ± β†’ ℝ} {A : ℝ} {x : Ξ±} (h : |f x| < A) : truncation f A x = f x := by simp only [truncation, indicator, Set.mem_Icc, id, Function.comp_apply, ite_eq_left_iff] intro H apply H.elim simp [(abs_lt.1 h).1, (abs_lt.1 h).2.le] #align probability_theory.truncation_eq_self ProbabilityTheory.truncation_eq_self
Mathlib/Probability/StrongLaw.lean
114
123
theorem truncation_eq_of_nonneg {f : Ξ± β†’ ℝ} {A : ℝ} (h : βˆ€ x, 0 ≀ f x) : truncation f A = indicator (Set.Ioc 0 A) id ∘ f := by
ext x rcases (h x).lt_or_eq with (hx | hx) Β· simp only [truncation, indicator, hx, Set.mem_Ioc, id, Function.comp_apply, true_and_iff] by_cases h'x : f x ≀ A Β· have : -A < f x := by linarith [h x] simp only [this, true_and_iff] Β· simp only [h'x, and_false_iff] Β· simp only [truncation, indicator, hx, id, Function.comp_apply, ite_self]
8
2,980.957987
2
1.444444
9
1,531
import Mathlib.Probability.IdentDistrib import Mathlib.MeasureTheory.Integral.DominatedConvergence import Mathlib.Analysis.SpecificLimits.FloorPow import Mathlib.Analysis.PSeries import Mathlib.Analysis.Asymptotics.SpecificAsymptotics #align_import probability.strong_law from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section open MeasureTheory Filter Finset Asymptotics open Set (indicator) open scoped Topology MeasureTheory ProbabilityTheory ENNReal NNReal namespace ProbabilityTheory section Truncation variable {Ξ± : Type*} def truncation (f : Ξ± β†’ ℝ) (A : ℝ) := indicator (Set.Ioc (-A) A) id ∘ f #align probability_theory.truncation ProbabilityTheory.truncation variable {m : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} {f : Ξ± β†’ ℝ} theorem _root_.MeasureTheory.AEStronglyMeasurable.truncation (hf : AEStronglyMeasurable f ΞΌ) {A : ℝ} : AEStronglyMeasurable (truncation f A) ΞΌ := by apply AEStronglyMeasurable.comp_aemeasurable _ hf.aemeasurable exact (stronglyMeasurable_id.indicator measurableSet_Ioc).aestronglyMeasurable #align measure_theory.ae_strongly_measurable.truncation MeasureTheory.AEStronglyMeasurable.truncation theorem abs_truncation_le_bound (f : Ξ± β†’ ℝ) (A : ℝ) (x : Ξ±) : |truncation f A x| ≀ |A| := by simp only [truncation, Set.indicator, Set.mem_Icc, id, Function.comp_apply] split_ifs with h Β· exact abs_le_abs h.2 (neg_le.2 h.1.le) Β· simp [abs_nonneg] #align probability_theory.abs_truncation_le_bound ProbabilityTheory.abs_truncation_le_bound @[simp] theorem truncation_zero (f : Ξ± β†’ ℝ) : truncation f 0 = 0 := by simp [truncation]; rfl #align probability_theory.truncation_zero ProbabilityTheory.truncation_zero theorem abs_truncation_le_abs_self (f : Ξ± β†’ ℝ) (A : ℝ) (x : Ξ±) : |truncation f A x| ≀ |f x| := by simp only [truncation, indicator, Set.mem_Icc, id, Function.comp_apply] split_ifs Β· exact le_rfl Β· simp [abs_nonneg] #align probability_theory.abs_truncation_le_abs_self ProbabilityTheory.abs_truncation_le_abs_self theorem truncation_eq_self {f : Ξ± β†’ ℝ} {A : ℝ} {x : Ξ±} (h : |f x| < A) : truncation f A x = f x := by simp only [truncation, indicator, Set.mem_Icc, id, Function.comp_apply, ite_eq_left_iff] intro H apply H.elim simp [(abs_lt.1 h).1, (abs_lt.1 h).2.le] #align probability_theory.truncation_eq_self ProbabilityTheory.truncation_eq_self theorem truncation_eq_of_nonneg {f : Ξ± β†’ ℝ} {A : ℝ} (h : βˆ€ x, 0 ≀ f x) : truncation f A = indicator (Set.Ioc 0 A) id ∘ f := by ext x rcases (h x).lt_or_eq with (hx | hx) Β· simp only [truncation, indicator, hx, Set.mem_Ioc, id, Function.comp_apply, true_and_iff] by_cases h'x : f x ≀ A Β· have : -A < f x := by linarith [h x] simp only [this, true_and_iff] Β· simp only [h'x, and_false_iff] Β· simp only [truncation, indicator, hx, id, Function.comp_apply, ite_self] #align probability_theory.truncation_eq_of_nonneg ProbabilityTheory.truncation_eq_of_nonneg theorem truncation_nonneg {f : Ξ± β†’ ℝ} (A : ℝ) {x : Ξ±} (h : 0 ≀ f x) : 0 ≀ truncation f A x := Set.indicator_apply_nonneg fun _ => h #align probability_theory.truncation_nonneg ProbabilityTheory.truncation_nonneg theorem _root_.MeasureTheory.AEStronglyMeasurable.memβ„’p_truncation [IsFiniteMeasure ΞΌ] (hf : AEStronglyMeasurable f ΞΌ) {A : ℝ} {p : ℝβ‰₯0∞} : Memβ„’p (truncation f A) p ΞΌ := Memβ„’p.of_bound hf.truncation |A| (eventually_of_forall fun _ => abs_truncation_le_bound _ _ _) #align measure_theory.ae_strongly_measurable.mem_β„’p_truncation MeasureTheory.AEStronglyMeasurable.memβ„’p_truncation
Mathlib/Probability/StrongLaw.lean
135
137
theorem _root_.MeasureTheory.AEStronglyMeasurable.integrable_truncation [IsFiniteMeasure ΞΌ] (hf : AEStronglyMeasurable f ΞΌ) {A : ℝ} : Integrable (truncation f A) ΞΌ := by
rw [← memβ„’p_one_iff_integrable]; exact hf.memβ„’p_truncation
1
2.718282
0
1.444444
9
1,531
import Mathlib.Probability.IdentDistrib import Mathlib.MeasureTheory.Integral.DominatedConvergence import Mathlib.Analysis.SpecificLimits.FloorPow import Mathlib.Analysis.PSeries import Mathlib.Analysis.Asymptotics.SpecificAsymptotics #align_import probability.strong_law from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section open MeasureTheory Filter Finset Asymptotics open Set (indicator) open scoped Topology MeasureTheory ProbabilityTheory ENNReal NNReal namespace ProbabilityTheory section Truncation variable {Ξ± : Type*} def truncation (f : Ξ± β†’ ℝ) (A : ℝ) := indicator (Set.Ioc (-A) A) id ∘ f #align probability_theory.truncation ProbabilityTheory.truncation variable {m : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} {f : Ξ± β†’ ℝ} theorem _root_.MeasureTheory.AEStronglyMeasurable.truncation (hf : AEStronglyMeasurable f ΞΌ) {A : ℝ} : AEStronglyMeasurable (truncation f A) ΞΌ := by apply AEStronglyMeasurable.comp_aemeasurable _ hf.aemeasurable exact (stronglyMeasurable_id.indicator measurableSet_Ioc).aestronglyMeasurable #align measure_theory.ae_strongly_measurable.truncation MeasureTheory.AEStronglyMeasurable.truncation theorem abs_truncation_le_bound (f : Ξ± β†’ ℝ) (A : ℝ) (x : Ξ±) : |truncation f A x| ≀ |A| := by simp only [truncation, Set.indicator, Set.mem_Icc, id, Function.comp_apply] split_ifs with h Β· exact abs_le_abs h.2 (neg_le.2 h.1.le) Β· simp [abs_nonneg] #align probability_theory.abs_truncation_le_bound ProbabilityTheory.abs_truncation_le_bound @[simp] theorem truncation_zero (f : Ξ± β†’ ℝ) : truncation f 0 = 0 := by simp [truncation]; rfl #align probability_theory.truncation_zero ProbabilityTheory.truncation_zero theorem abs_truncation_le_abs_self (f : Ξ± β†’ ℝ) (A : ℝ) (x : Ξ±) : |truncation f A x| ≀ |f x| := by simp only [truncation, indicator, Set.mem_Icc, id, Function.comp_apply] split_ifs Β· exact le_rfl Β· simp [abs_nonneg] #align probability_theory.abs_truncation_le_abs_self ProbabilityTheory.abs_truncation_le_abs_self theorem truncation_eq_self {f : Ξ± β†’ ℝ} {A : ℝ} {x : Ξ±} (h : |f x| < A) : truncation f A x = f x := by simp only [truncation, indicator, Set.mem_Icc, id, Function.comp_apply, ite_eq_left_iff] intro H apply H.elim simp [(abs_lt.1 h).1, (abs_lt.1 h).2.le] #align probability_theory.truncation_eq_self ProbabilityTheory.truncation_eq_self theorem truncation_eq_of_nonneg {f : Ξ± β†’ ℝ} {A : ℝ} (h : βˆ€ x, 0 ≀ f x) : truncation f A = indicator (Set.Ioc 0 A) id ∘ f := by ext x rcases (h x).lt_or_eq with (hx | hx) Β· simp only [truncation, indicator, hx, Set.mem_Ioc, id, Function.comp_apply, true_and_iff] by_cases h'x : f x ≀ A Β· have : -A < f x := by linarith [h x] simp only [this, true_and_iff] Β· simp only [h'x, and_false_iff] Β· simp only [truncation, indicator, hx, id, Function.comp_apply, ite_self] #align probability_theory.truncation_eq_of_nonneg ProbabilityTheory.truncation_eq_of_nonneg theorem truncation_nonneg {f : Ξ± β†’ ℝ} (A : ℝ) {x : Ξ±} (h : 0 ≀ f x) : 0 ≀ truncation f A x := Set.indicator_apply_nonneg fun _ => h #align probability_theory.truncation_nonneg ProbabilityTheory.truncation_nonneg theorem _root_.MeasureTheory.AEStronglyMeasurable.memβ„’p_truncation [IsFiniteMeasure ΞΌ] (hf : AEStronglyMeasurable f ΞΌ) {A : ℝ} {p : ℝβ‰₯0∞} : Memβ„’p (truncation f A) p ΞΌ := Memβ„’p.of_bound hf.truncation |A| (eventually_of_forall fun _ => abs_truncation_le_bound _ _ _) #align measure_theory.ae_strongly_measurable.mem_β„’p_truncation MeasureTheory.AEStronglyMeasurable.memβ„’p_truncation theorem _root_.MeasureTheory.AEStronglyMeasurable.integrable_truncation [IsFiniteMeasure ΞΌ] (hf : AEStronglyMeasurable f ΞΌ) {A : ℝ} : Integrable (truncation f A) ΞΌ := by rw [← memβ„’p_one_iff_integrable]; exact hf.memβ„’p_truncation #align measure_theory.ae_strongly_measurable.integrable_truncation MeasureTheory.AEStronglyMeasurable.integrable_truncation
Mathlib/Probability/StrongLaw.lean
140
148
theorem moment_truncation_eq_intervalIntegral (hf : AEStronglyMeasurable f ΞΌ) {A : ℝ} (hA : 0 ≀ A) {n : β„•} (hn : n β‰  0) : ∫ x, truncation f A x ^ n βˆ‚ΞΌ = ∫ y in -A..A, y ^ n βˆ‚Measure.map f ΞΌ := by
have M : MeasurableSet (Set.Ioc (-A) A) := measurableSet_Ioc change ∫ x, (fun z => indicator (Set.Ioc (-A) A) id z ^ n) (f x) βˆ‚ΞΌ = _ rw [← integral_map (f := fun z => _ ^ n) hf.aemeasurable, intervalIntegral.integral_of_le, ← integral_indicator M] Β· simp only [indicator, zero_pow hn, id, ite_pow] Β· linarith Β· exact ((measurable_id.indicator M).pow_const n).aestronglyMeasurable
7
1,096.633158
2
1.444444
9
1,531
import Mathlib.Probability.IdentDistrib import Mathlib.MeasureTheory.Integral.DominatedConvergence import Mathlib.Analysis.SpecificLimits.FloorPow import Mathlib.Analysis.PSeries import Mathlib.Analysis.Asymptotics.SpecificAsymptotics #align_import probability.strong_law from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section open MeasureTheory Filter Finset Asymptotics open Set (indicator) open scoped Topology MeasureTheory ProbabilityTheory ENNReal NNReal namespace ProbabilityTheory section Truncation variable {Ξ± : Type*} def truncation (f : Ξ± β†’ ℝ) (A : ℝ) := indicator (Set.Ioc (-A) A) id ∘ f #align probability_theory.truncation ProbabilityTheory.truncation variable {m : MeasurableSpace Ξ±} {ΞΌ : Measure Ξ±} {f : Ξ± β†’ ℝ} theorem _root_.MeasureTheory.AEStronglyMeasurable.truncation (hf : AEStronglyMeasurable f ΞΌ) {A : ℝ} : AEStronglyMeasurable (truncation f A) ΞΌ := by apply AEStronglyMeasurable.comp_aemeasurable _ hf.aemeasurable exact (stronglyMeasurable_id.indicator measurableSet_Ioc).aestronglyMeasurable #align measure_theory.ae_strongly_measurable.truncation MeasureTheory.AEStronglyMeasurable.truncation theorem abs_truncation_le_bound (f : Ξ± β†’ ℝ) (A : ℝ) (x : Ξ±) : |truncation f A x| ≀ |A| := by simp only [truncation, Set.indicator, Set.mem_Icc, id, Function.comp_apply] split_ifs with h Β· exact abs_le_abs h.2 (neg_le.2 h.1.le) Β· simp [abs_nonneg] #align probability_theory.abs_truncation_le_bound ProbabilityTheory.abs_truncation_le_bound @[simp] theorem truncation_zero (f : Ξ± β†’ ℝ) : truncation f 0 = 0 := by simp [truncation]; rfl #align probability_theory.truncation_zero ProbabilityTheory.truncation_zero theorem abs_truncation_le_abs_self (f : Ξ± β†’ ℝ) (A : ℝ) (x : Ξ±) : |truncation f A x| ≀ |f x| := by simp only [truncation, indicator, Set.mem_Icc, id, Function.comp_apply] split_ifs Β· exact le_rfl Β· simp [abs_nonneg] #align probability_theory.abs_truncation_le_abs_self ProbabilityTheory.abs_truncation_le_abs_self theorem truncation_eq_self {f : Ξ± β†’ ℝ} {A : ℝ} {x : Ξ±} (h : |f x| < A) : truncation f A x = f x := by simp only [truncation, indicator, Set.mem_Icc, id, Function.comp_apply, ite_eq_left_iff] intro H apply H.elim simp [(abs_lt.1 h).1, (abs_lt.1 h).2.le] #align probability_theory.truncation_eq_self ProbabilityTheory.truncation_eq_self theorem truncation_eq_of_nonneg {f : Ξ± β†’ ℝ} {A : ℝ} (h : βˆ€ x, 0 ≀ f x) : truncation f A = indicator (Set.Ioc 0 A) id ∘ f := by ext x rcases (h x).lt_or_eq with (hx | hx) Β· simp only [truncation, indicator, hx, Set.mem_Ioc, id, Function.comp_apply, true_and_iff] by_cases h'x : f x ≀ A Β· have : -A < f x := by linarith [h x] simp only [this, true_and_iff] Β· simp only [h'x, and_false_iff] Β· simp only [truncation, indicator, hx, id, Function.comp_apply, ite_self] #align probability_theory.truncation_eq_of_nonneg ProbabilityTheory.truncation_eq_of_nonneg theorem truncation_nonneg {f : Ξ± β†’ ℝ} (A : ℝ) {x : Ξ±} (h : 0 ≀ f x) : 0 ≀ truncation f A x := Set.indicator_apply_nonneg fun _ => h #align probability_theory.truncation_nonneg ProbabilityTheory.truncation_nonneg theorem _root_.MeasureTheory.AEStronglyMeasurable.memβ„’p_truncation [IsFiniteMeasure ΞΌ] (hf : AEStronglyMeasurable f ΞΌ) {A : ℝ} {p : ℝβ‰₯0∞} : Memβ„’p (truncation f A) p ΞΌ := Memβ„’p.of_bound hf.truncation |A| (eventually_of_forall fun _ => abs_truncation_le_bound _ _ _) #align measure_theory.ae_strongly_measurable.mem_β„’p_truncation MeasureTheory.AEStronglyMeasurable.memβ„’p_truncation theorem _root_.MeasureTheory.AEStronglyMeasurable.integrable_truncation [IsFiniteMeasure ΞΌ] (hf : AEStronglyMeasurable f ΞΌ) {A : ℝ} : Integrable (truncation f A) ΞΌ := by rw [← memβ„’p_one_iff_integrable]; exact hf.memβ„’p_truncation #align measure_theory.ae_strongly_measurable.integrable_truncation MeasureTheory.AEStronglyMeasurable.integrable_truncation theorem moment_truncation_eq_intervalIntegral (hf : AEStronglyMeasurable f ΞΌ) {A : ℝ} (hA : 0 ≀ A) {n : β„•} (hn : n β‰  0) : ∫ x, truncation f A x ^ n βˆ‚ΞΌ = ∫ y in -A..A, y ^ n βˆ‚Measure.map f ΞΌ := by have M : MeasurableSet (Set.Ioc (-A) A) := measurableSet_Ioc change ∫ x, (fun z => indicator (Set.Ioc (-A) A) id z ^ n) (f x) βˆ‚ΞΌ = _ rw [← integral_map (f := fun z => _ ^ n) hf.aemeasurable, intervalIntegral.integral_of_le, ← integral_indicator M] Β· simp only [indicator, zero_pow hn, id, ite_pow] Β· linarith Β· exact ((measurable_id.indicator M).pow_const n).aestronglyMeasurable #align probability_theory.moment_truncation_eq_interval_integral ProbabilityTheory.moment_truncation_eq_intervalIntegral
Mathlib/Probability/StrongLaw.lean
151
175
theorem moment_truncation_eq_intervalIntegral_of_nonneg (hf : AEStronglyMeasurable f ΞΌ) {A : ℝ} {n : β„•} (hn : n β‰  0) (h'f : 0 ≀ f) : ∫ x, truncation f A x ^ n βˆ‚ΞΌ = ∫ y in (0)..A, y ^ n βˆ‚Measure.map f ΞΌ := by
have M : MeasurableSet (Set.Ioc 0 A) := measurableSet_Ioc have M' : MeasurableSet (Set.Ioc A 0) := measurableSet_Ioc rw [truncation_eq_of_nonneg h'f] change ∫ x, (fun z => indicator (Set.Ioc 0 A) id z ^ n) (f x) βˆ‚ΞΌ = _ rcases le_or_lt 0 A with (hA | hA) Β· rw [← integral_map (f := fun z => _ ^ n) hf.aemeasurable, intervalIntegral.integral_of_le hA, ← integral_indicator M] Β· simp only [indicator, zero_pow hn, id, ite_pow] Β· exact ((measurable_id.indicator M).pow_const n).aestronglyMeasurable Β· rw [← integral_map (f := fun z => _ ^ n) hf.aemeasurable, intervalIntegral.integral_of_ge hA.le, ← integral_indicator M'] Β· simp only [Set.Ioc_eq_empty_of_le hA.le, zero_pow hn, Set.indicator_empty, integral_zero, zero_eq_neg] apply integral_eq_zero_of_ae have : βˆ€α΅ x βˆ‚Measure.map f ΞΌ, (0 : ℝ) ≀ x := (ae_map_iff hf.aemeasurable measurableSet_Ici).2 (eventually_of_forall h'f) filter_upwards [this] with x hx simp only [indicator, Set.mem_Ioc, Pi.zero_apply, ite_eq_right_iff, and_imp] intro _ h''x have : x = 0 := by linarith simp [this, zero_pow hn] Β· exact ((measurable_id.indicator M).pow_const n).aestronglyMeasurable
22
3,584,912,846.131591
2
1.444444
9
1,531
import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Tactic.Ring #align_import data.nat.hyperoperation from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" def hyperoperation : β„• β†’ β„• β†’ β„• β†’ β„• | 0, _, k => k + 1 | 1, m, 0 => m | 2, _, 0 => 0 | _ + 3, _, 0 => 1 | n + 1, m, k + 1 => hyperoperation n m (hyperoperation (n + 1) m k) #align hyperoperation hyperoperation -- Basic hyperoperation lemmas @[simp] theorem hyperoperation_zero (m : β„•) : hyperoperation 0 m = Nat.succ := funext fun k => by rw [hyperoperation, Nat.succ_eq_add_one] #align hyperoperation_zero hyperoperation_zero
Mathlib/Data/Nat/Hyperoperation.lean
49
50
theorem hyperoperation_ge_three_eq_one (n m : β„•) : hyperoperation (n + 3) m 0 = 1 := by
rw [hyperoperation]
1
2.718282
0
1.444444
9
1,532
import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Tactic.Ring #align_import data.nat.hyperoperation from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" def hyperoperation : β„• β†’ β„• β†’ β„• β†’ β„• | 0, _, k => k + 1 | 1, m, 0 => m | 2, _, 0 => 0 | _ + 3, _, 0 => 1 | n + 1, m, k + 1 => hyperoperation n m (hyperoperation (n + 1) m k) #align hyperoperation hyperoperation -- Basic hyperoperation lemmas @[simp] theorem hyperoperation_zero (m : β„•) : hyperoperation 0 m = Nat.succ := funext fun k => by rw [hyperoperation, Nat.succ_eq_add_one] #align hyperoperation_zero hyperoperation_zero theorem hyperoperation_ge_three_eq_one (n m : β„•) : hyperoperation (n + 3) m 0 = 1 := by rw [hyperoperation] #align hyperoperation_ge_three_eq_one hyperoperation_ge_three_eq_one
Mathlib/Data/Nat/Hyperoperation.lean
53
55
theorem hyperoperation_recursion (n m k : β„•) : hyperoperation (n + 1) m (k + 1) = hyperoperation n m (hyperoperation (n + 1) m k) := by
rw [hyperoperation]
1
2.718282
0
1.444444
9
1,532
import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Tactic.Ring #align_import data.nat.hyperoperation from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" def hyperoperation : β„• β†’ β„• β†’ β„• β†’ β„• | 0, _, k => k + 1 | 1, m, 0 => m | 2, _, 0 => 0 | _ + 3, _, 0 => 1 | n + 1, m, k + 1 => hyperoperation n m (hyperoperation (n + 1) m k) #align hyperoperation hyperoperation -- Basic hyperoperation lemmas @[simp] theorem hyperoperation_zero (m : β„•) : hyperoperation 0 m = Nat.succ := funext fun k => by rw [hyperoperation, Nat.succ_eq_add_one] #align hyperoperation_zero hyperoperation_zero theorem hyperoperation_ge_three_eq_one (n m : β„•) : hyperoperation (n + 3) m 0 = 1 := by rw [hyperoperation] #align hyperoperation_ge_three_eq_one hyperoperation_ge_three_eq_one theorem hyperoperation_recursion (n m k : β„•) : hyperoperation (n + 1) m (k + 1) = hyperoperation n m (hyperoperation (n + 1) m k) := by rw [hyperoperation] #align hyperoperation_recursion hyperoperation_recursion -- Interesting hyperoperation lemmas @[simp]
Mathlib/Data/Nat/Hyperoperation.lean
60
65
theorem hyperoperation_one : hyperoperation 1 = (Β· + Β·) := by
ext m k induction' k with bn bih Β· rw [Nat.add_zero m, hyperoperation] Β· rw [hyperoperation_recursion, bih, hyperoperation_zero] exact Nat.add_assoc m bn 1
5
148.413159
2
1.444444
9
1,532
import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Tactic.Ring #align_import data.nat.hyperoperation from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" def hyperoperation : β„• β†’ β„• β†’ β„• β†’ β„• | 0, _, k => k + 1 | 1, m, 0 => m | 2, _, 0 => 0 | _ + 3, _, 0 => 1 | n + 1, m, k + 1 => hyperoperation n m (hyperoperation (n + 1) m k) #align hyperoperation hyperoperation -- Basic hyperoperation lemmas @[simp] theorem hyperoperation_zero (m : β„•) : hyperoperation 0 m = Nat.succ := funext fun k => by rw [hyperoperation, Nat.succ_eq_add_one] #align hyperoperation_zero hyperoperation_zero theorem hyperoperation_ge_three_eq_one (n m : β„•) : hyperoperation (n + 3) m 0 = 1 := by rw [hyperoperation] #align hyperoperation_ge_three_eq_one hyperoperation_ge_three_eq_one theorem hyperoperation_recursion (n m k : β„•) : hyperoperation (n + 1) m (k + 1) = hyperoperation n m (hyperoperation (n + 1) m k) := by rw [hyperoperation] #align hyperoperation_recursion hyperoperation_recursion -- Interesting hyperoperation lemmas @[simp] theorem hyperoperation_one : hyperoperation 1 = (Β· + Β·) := by ext m k induction' k with bn bih Β· rw [Nat.add_zero m, hyperoperation] Β· rw [hyperoperation_recursion, bih, hyperoperation_zero] exact Nat.add_assoc m bn 1 #align hyperoperation_one hyperoperation_one @[simp]
Mathlib/Data/Nat/Hyperoperation.lean
69
78
theorem hyperoperation_two : hyperoperation 2 = (Β· * Β·) := by
ext m k induction' k with bn bih Β· rw [hyperoperation] exact (Nat.mul_zero m).symm Β· rw [hyperoperation_recursion, hyperoperation_one, bih] -- Porting note: was `ring` dsimp only nth_rewrite 1 [← mul_one m] rw [← mul_add, add_comm]
9
8,103.083928
2
1.444444
9
1,532
import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Tactic.Ring #align_import data.nat.hyperoperation from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" def hyperoperation : β„• β†’ β„• β†’ β„• β†’ β„• | 0, _, k => k + 1 | 1, m, 0 => m | 2, _, 0 => 0 | _ + 3, _, 0 => 1 | n + 1, m, k + 1 => hyperoperation n m (hyperoperation (n + 1) m k) #align hyperoperation hyperoperation -- Basic hyperoperation lemmas @[simp] theorem hyperoperation_zero (m : β„•) : hyperoperation 0 m = Nat.succ := funext fun k => by rw [hyperoperation, Nat.succ_eq_add_one] #align hyperoperation_zero hyperoperation_zero theorem hyperoperation_ge_three_eq_one (n m : β„•) : hyperoperation (n + 3) m 0 = 1 := by rw [hyperoperation] #align hyperoperation_ge_three_eq_one hyperoperation_ge_three_eq_one theorem hyperoperation_recursion (n m k : β„•) : hyperoperation (n + 1) m (k + 1) = hyperoperation n m (hyperoperation (n + 1) m k) := by rw [hyperoperation] #align hyperoperation_recursion hyperoperation_recursion -- Interesting hyperoperation lemmas @[simp] theorem hyperoperation_one : hyperoperation 1 = (Β· + Β·) := by ext m k induction' k with bn bih Β· rw [Nat.add_zero m, hyperoperation] Β· rw [hyperoperation_recursion, bih, hyperoperation_zero] exact Nat.add_assoc m bn 1 #align hyperoperation_one hyperoperation_one @[simp] theorem hyperoperation_two : hyperoperation 2 = (Β· * Β·) := by ext m k induction' k with bn bih Β· rw [hyperoperation] exact (Nat.mul_zero m).symm Β· rw [hyperoperation_recursion, hyperoperation_one, bih] -- Porting note: was `ring` dsimp only nth_rewrite 1 [← mul_one m] rw [← mul_add, add_comm] #align hyperoperation_two hyperoperation_two @[simp]
Mathlib/Data/Nat/Hyperoperation.lean
82
88
theorem hyperoperation_three : hyperoperation 3 = (Β· ^ Β·) := by
ext m k induction' k with bn bih Β· rw [hyperoperation_ge_three_eq_one] exact (pow_zero m).symm Β· rw [hyperoperation_recursion, hyperoperation_two, bih] exact (pow_succ' m bn).symm
6
403.428793
2
1.444444
9
1,532
import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Tactic.Ring #align_import data.nat.hyperoperation from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" def hyperoperation : β„• β†’ β„• β†’ β„• β†’ β„• | 0, _, k => k + 1 | 1, m, 0 => m | 2, _, 0 => 0 | _ + 3, _, 0 => 1 | n + 1, m, k + 1 => hyperoperation n m (hyperoperation (n + 1) m k) #align hyperoperation hyperoperation -- Basic hyperoperation lemmas @[simp] theorem hyperoperation_zero (m : β„•) : hyperoperation 0 m = Nat.succ := funext fun k => by rw [hyperoperation, Nat.succ_eq_add_one] #align hyperoperation_zero hyperoperation_zero theorem hyperoperation_ge_three_eq_one (n m : β„•) : hyperoperation (n + 3) m 0 = 1 := by rw [hyperoperation] #align hyperoperation_ge_three_eq_one hyperoperation_ge_three_eq_one theorem hyperoperation_recursion (n m k : β„•) : hyperoperation (n + 1) m (k + 1) = hyperoperation n m (hyperoperation (n + 1) m k) := by rw [hyperoperation] #align hyperoperation_recursion hyperoperation_recursion -- Interesting hyperoperation lemmas @[simp] theorem hyperoperation_one : hyperoperation 1 = (Β· + Β·) := by ext m k induction' k with bn bih Β· rw [Nat.add_zero m, hyperoperation] Β· rw [hyperoperation_recursion, bih, hyperoperation_zero] exact Nat.add_assoc m bn 1 #align hyperoperation_one hyperoperation_one @[simp] theorem hyperoperation_two : hyperoperation 2 = (Β· * Β·) := by ext m k induction' k with bn bih Β· rw [hyperoperation] exact (Nat.mul_zero m).symm Β· rw [hyperoperation_recursion, hyperoperation_one, bih] -- Porting note: was `ring` dsimp only nth_rewrite 1 [← mul_one m] rw [← mul_add, add_comm] #align hyperoperation_two hyperoperation_two @[simp] theorem hyperoperation_three : hyperoperation 3 = (Β· ^ Β·) := by ext m k induction' k with bn bih Β· rw [hyperoperation_ge_three_eq_one] exact (pow_zero m).symm Β· rw [hyperoperation_recursion, hyperoperation_two, bih] exact (pow_succ' m bn).symm #align hyperoperation_three hyperoperation_three
Mathlib/Data/Nat/Hyperoperation.lean
91
95
theorem hyperoperation_ge_two_eq_self (n m : β„•) : hyperoperation (n + 2) m 1 = m := by
induction' n with nn nih Β· rw [hyperoperation_two] ring Β· rw [hyperoperation_recursion, hyperoperation_ge_three_eq_one, nih]
4
54.59815
2
1.444444
9
1,532
import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Tactic.Ring #align_import data.nat.hyperoperation from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" def hyperoperation : β„• β†’ β„• β†’ β„• β†’ β„• | 0, _, k => k + 1 | 1, m, 0 => m | 2, _, 0 => 0 | _ + 3, _, 0 => 1 | n + 1, m, k + 1 => hyperoperation n m (hyperoperation (n + 1) m k) #align hyperoperation hyperoperation -- Basic hyperoperation lemmas @[simp] theorem hyperoperation_zero (m : β„•) : hyperoperation 0 m = Nat.succ := funext fun k => by rw [hyperoperation, Nat.succ_eq_add_one] #align hyperoperation_zero hyperoperation_zero theorem hyperoperation_ge_three_eq_one (n m : β„•) : hyperoperation (n + 3) m 0 = 1 := by rw [hyperoperation] #align hyperoperation_ge_three_eq_one hyperoperation_ge_three_eq_one theorem hyperoperation_recursion (n m k : β„•) : hyperoperation (n + 1) m (k + 1) = hyperoperation n m (hyperoperation (n + 1) m k) := by rw [hyperoperation] #align hyperoperation_recursion hyperoperation_recursion -- Interesting hyperoperation lemmas @[simp] theorem hyperoperation_one : hyperoperation 1 = (Β· + Β·) := by ext m k induction' k with bn bih Β· rw [Nat.add_zero m, hyperoperation] Β· rw [hyperoperation_recursion, bih, hyperoperation_zero] exact Nat.add_assoc m bn 1 #align hyperoperation_one hyperoperation_one @[simp] theorem hyperoperation_two : hyperoperation 2 = (Β· * Β·) := by ext m k induction' k with bn bih Β· rw [hyperoperation] exact (Nat.mul_zero m).symm Β· rw [hyperoperation_recursion, hyperoperation_one, bih] -- Porting note: was `ring` dsimp only nth_rewrite 1 [← mul_one m] rw [← mul_add, add_comm] #align hyperoperation_two hyperoperation_two @[simp] theorem hyperoperation_three : hyperoperation 3 = (Β· ^ Β·) := by ext m k induction' k with bn bih Β· rw [hyperoperation_ge_three_eq_one] exact (pow_zero m).symm Β· rw [hyperoperation_recursion, hyperoperation_two, bih] exact (pow_succ' m bn).symm #align hyperoperation_three hyperoperation_three theorem hyperoperation_ge_two_eq_self (n m : β„•) : hyperoperation (n + 2) m 1 = m := by induction' n with nn nih Β· rw [hyperoperation_two] ring Β· rw [hyperoperation_recursion, hyperoperation_ge_three_eq_one, nih] #align hyperoperation_ge_two_eq_self hyperoperation_ge_two_eq_self
Mathlib/Data/Nat/Hyperoperation.lean
98
101
theorem hyperoperation_two_two_eq_four (n : β„•) : hyperoperation (n + 1) 2 2 = 4 := by
induction' n with nn nih Β· rw [hyperoperation_one] Β· rw [hyperoperation_recursion, hyperoperation_ge_two_eq_self, nih]
3
20.085537
1
1.444444
9
1,532
import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Tactic.Ring #align_import data.nat.hyperoperation from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" def hyperoperation : β„• β†’ β„• β†’ β„• β†’ β„• | 0, _, k => k + 1 | 1, m, 0 => m | 2, _, 0 => 0 | _ + 3, _, 0 => 1 | n + 1, m, k + 1 => hyperoperation n m (hyperoperation (n + 1) m k) #align hyperoperation hyperoperation -- Basic hyperoperation lemmas @[simp] theorem hyperoperation_zero (m : β„•) : hyperoperation 0 m = Nat.succ := funext fun k => by rw [hyperoperation, Nat.succ_eq_add_one] #align hyperoperation_zero hyperoperation_zero theorem hyperoperation_ge_three_eq_one (n m : β„•) : hyperoperation (n + 3) m 0 = 1 := by rw [hyperoperation] #align hyperoperation_ge_three_eq_one hyperoperation_ge_three_eq_one theorem hyperoperation_recursion (n m k : β„•) : hyperoperation (n + 1) m (k + 1) = hyperoperation n m (hyperoperation (n + 1) m k) := by rw [hyperoperation] #align hyperoperation_recursion hyperoperation_recursion -- Interesting hyperoperation lemmas @[simp] theorem hyperoperation_one : hyperoperation 1 = (Β· + Β·) := by ext m k induction' k with bn bih Β· rw [Nat.add_zero m, hyperoperation] Β· rw [hyperoperation_recursion, bih, hyperoperation_zero] exact Nat.add_assoc m bn 1 #align hyperoperation_one hyperoperation_one @[simp] theorem hyperoperation_two : hyperoperation 2 = (Β· * Β·) := by ext m k induction' k with bn bih Β· rw [hyperoperation] exact (Nat.mul_zero m).symm Β· rw [hyperoperation_recursion, hyperoperation_one, bih] -- Porting note: was `ring` dsimp only nth_rewrite 1 [← mul_one m] rw [← mul_add, add_comm] #align hyperoperation_two hyperoperation_two @[simp] theorem hyperoperation_three : hyperoperation 3 = (Β· ^ Β·) := by ext m k induction' k with bn bih Β· rw [hyperoperation_ge_three_eq_one] exact (pow_zero m).symm Β· rw [hyperoperation_recursion, hyperoperation_two, bih] exact (pow_succ' m bn).symm #align hyperoperation_three hyperoperation_three theorem hyperoperation_ge_two_eq_self (n m : β„•) : hyperoperation (n + 2) m 1 = m := by induction' n with nn nih Β· rw [hyperoperation_two] ring Β· rw [hyperoperation_recursion, hyperoperation_ge_three_eq_one, nih] #align hyperoperation_ge_two_eq_self hyperoperation_ge_two_eq_self theorem hyperoperation_two_two_eq_four (n : β„•) : hyperoperation (n + 1) 2 2 = 4 := by induction' n with nn nih Β· rw [hyperoperation_one] Β· rw [hyperoperation_recursion, hyperoperation_ge_two_eq_self, nih] #align hyperoperation_two_two_eq_four hyperoperation_two_two_eq_four
Mathlib/Data/Nat/Hyperoperation.lean
104
113
theorem hyperoperation_ge_three_one (n : β„•) : βˆ€ k : β„•, hyperoperation (n + 3) 1 k = 1 := by
induction' n with nn nih Β· intro k rw [hyperoperation_three] dsimp rw [one_pow] Β· intro k cases k Β· rw [hyperoperation_ge_three_eq_one] Β· rw [hyperoperation_recursion, nih]
9
8,103.083928
2
1.444444
9
1,532
import Mathlib.Algebra.Order.Ring.Abs import Mathlib.Tactic.Ring #align_import data.nat.hyperoperation from "leanprover-community/mathlib"@"f7fc89d5d5ff1db2d1242c7bb0e9062ce47ef47c" def hyperoperation : β„• β†’ β„• β†’ β„• β†’ β„• | 0, _, k => k + 1 | 1, m, 0 => m | 2, _, 0 => 0 | _ + 3, _, 0 => 1 | n + 1, m, k + 1 => hyperoperation n m (hyperoperation (n + 1) m k) #align hyperoperation hyperoperation -- Basic hyperoperation lemmas @[simp] theorem hyperoperation_zero (m : β„•) : hyperoperation 0 m = Nat.succ := funext fun k => by rw [hyperoperation, Nat.succ_eq_add_one] #align hyperoperation_zero hyperoperation_zero theorem hyperoperation_ge_three_eq_one (n m : β„•) : hyperoperation (n + 3) m 0 = 1 := by rw [hyperoperation] #align hyperoperation_ge_three_eq_one hyperoperation_ge_three_eq_one theorem hyperoperation_recursion (n m k : β„•) : hyperoperation (n + 1) m (k + 1) = hyperoperation n m (hyperoperation (n + 1) m k) := by rw [hyperoperation] #align hyperoperation_recursion hyperoperation_recursion -- Interesting hyperoperation lemmas @[simp] theorem hyperoperation_one : hyperoperation 1 = (Β· + Β·) := by ext m k induction' k with bn bih Β· rw [Nat.add_zero m, hyperoperation] Β· rw [hyperoperation_recursion, bih, hyperoperation_zero] exact Nat.add_assoc m bn 1 #align hyperoperation_one hyperoperation_one @[simp] theorem hyperoperation_two : hyperoperation 2 = (Β· * Β·) := by ext m k induction' k with bn bih Β· rw [hyperoperation] exact (Nat.mul_zero m).symm Β· rw [hyperoperation_recursion, hyperoperation_one, bih] -- Porting note: was `ring` dsimp only nth_rewrite 1 [← mul_one m] rw [← mul_add, add_comm] #align hyperoperation_two hyperoperation_two @[simp] theorem hyperoperation_three : hyperoperation 3 = (Β· ^ Β·) := by ext m k induction' k with bn bih Β· rw [hyperoperation_ge_three_eq_one] exact (pow_zero m).symm Β· rw [hyperoperation_recursion, hyperoperation_two, bih] exact (pow_succ' m bn).symm #align hyperoperation_three hyperoperation_three theorem hyperoperation_ge_two_eq_self (n m : β„•) : hyperoperation (n + 2) m 1 = m := by induction' n with nn nih Β· rw [hyperoperation_two] ring Β· rw [hyperoperation_recursion, hyperoperation_ge_three_eq_one, nih] #align hyperoperation_ge_two_eq_self hyperoperation_ge_two_eq_self theorem hyperoperation_two_two_eq_four (n : β„•) : hyperoperation (n + 1) 2 2 = 4 := by induction' n with nn nih Β· rw [hyperoperation_one] Β· rw [hyperoperation_recursion, hyperoperation_ge_two_eq_self, nih] #align hyperoperation_two_two_eq_four hyperoperation_two_two_eq_four theorem hyperoperation_ge_three_one (n : β„•) : βˆ€ k : β„•, hyperoperation (n + 3) 1 k = 1 := by induction' n with nn nih Β· intro k rw [hyperoperation_three] dsimp rw [one_pow] Β· intro k cases k Β· rw [hyperoperation_ge_three_eq_one] Β· rw [hyperoperation_recursion, nih] #align hyperoperation_ge_three_one hyperoperation_ge_three_one
Mathlib/Data/Nat/Hyperoperation.lean
116
126
theorem hyperoperation_ge_four_zero (n k : β„•) : hyperoperation (n + 4) 0 k = if Even k then 1 else 0 := by
induction' k with kk kih Β· rw [hyperoperation_ge_three_eq_one] simp only [Nat.zero_eq, even_zero, if_true] Β· rw [hyperoperation_recursion] rw [kih] simp_rw [Nat.even_add_one] split_ifs Β· exact hyperoperation_ge_two_eq_self (n + 1) 0 Β· exact hyperoperation_ge_three_eq_one n 0
9
8,103.083928
2
1.444444
9
1,532