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.Algebra.Lie.Semisimple.Defs import Mathlib.Order.BooleanGenerators #align_import algebra.lie.semisimple from "leanprover-community/mathlib"@"356447fe00e75e54777321045cdff7c9ea212e60" namespace LieAlgebra variable (R L : Type*) [CommRing R] [LieRing L] [LieAlgebra R L] variable {R L} in theorem HasTrivialRadical.eq_bot_of_isSolvable [HasTrivialRadical R L] (I : LieIdeal R L) [hI : IsSolvable R I] : I = ⊥ := sSup_eq_bot.mp radical_eq_bot _ hI @[simp] theorem HasTrivialRadical.center_eq_bot [HasTrivialRadical R L] : center R L = ⊥ := HasTrivialRadical.eq_bot_of_isSolvable _ #align lie_algebra.center_eq_bot_of_semisimple LieAlgebra.HasTrivialRadical.center_eq_bot variable {R L} in theorem hasTrivialRadical_of_no_solvable_ideals (h : ∀ I : LieIdeal R L, IsSolvable R I → I = ⊥) : HasTrivialRadical R L := ⟨sSup_eq_bot.mpr h⟩ theorem hasTrivialRadical_iff_no_solvable_ideals : HasTrivialRadical R L ↔ ∀ I : LieIdeal R L, IsSolvable R I → I = ⊥ := ⟨@HasTrivialRadical.eq_bot_of_isSolvable _ _ _ _ _, hasTrivialRadical_of_no_solvable_ideals⟩ #align lie_algebra.is_semisimple_iff_no_solvable_ideals LieAlgebra.hasTrivialRadical_iff_no_solvable_ideals
Mathlib/Algebra/Lie/Semisimple/Basic.lean
71
77
theorem hasTrivialRadical_iff_no_abelian_ideals : HasTrivialRadical R L ↔ ∀ I : LieIdeal R L, IsLieAbelian I → I = ⊥ := by
rw [hasTrivialRadical_iff_no_solvable_ideals] constructor <;> intro h₁ I h₂ · exact h₁ _ <| LieAlgebra.ofAbelianIsSolvable R I · rw [← abelian_of_solvable_ideal_eq_bot_iff] exact h₁ _ <| abelian_derivedAbelianOfIdeal I
5
148.413159
2
2
1
2,360
import Mathlib.Topology.Bases import Mathlib.Topology.DenseEmbedding #align_import topology.stone_cech from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977" noncomputable section open Filter Set open Topology universe u v section Ultrafilter def ultrafilterBasis (α : Type u) : Set (Set (Ultrafilter α)) := range fun s : Set α => { u | s ∈ u } #align ultrafilter_basis ultrafilterBasis variable {α : Type u} instance Ultrafilter.topologicalSpace : TopologicalSpace (Ultrafilter α) := TopologicalSpace.generateFrom (ultrafilterBasis α) #align ultrafilter.topological_space Ultrafilter.topologicalSpace theorem ultrafilterBasis_is_basis : TopologicalSpace.IsTopologicalBasis (ultrafilterBasis α) := ⟨by rintro _ ⟨a, rfl⟩ _ ⟨b, rfl⟩ u ⟨ua, ub⟩ refine ⟨_, ⟨a ∩ b, rfl⟩, inter_mem ua ub, fun v hv => ⟨?_, ?_⟩⟩ <;> apply mem_of_superset hv <;> simp [inter_subset_right], eq_univ_of_univ_subset <| subset_sUnion_of_mem <| ⟨univ, eq_univ_of_forall fun u => univ_mem⟩, rfl⟩ #align ultrafilter_basis_is_basis ultrafilterBasis_is_basis theorem ultrafilter_isOpen_basic (s : Set α) : IsOpen { u : Ultrafilter α | s ∈ u } := ultrafilterBasis_is_basis.isOpen ⟨s, rfl⟩ #align ultrafilter_is_open_basic ultrafilter_isOpen_basic
Mathlib/Topology/StoneCech.lean
58
62
theorem ultrafilter_isClosed_basic (s : Set α) : IsClosed { u : Ultrafilter α | s ∈ u } := by
rw [← isOpen_compl_iff] convert ultrafilter_isOpen_basic sᶜ using 1 ext u exact Ultrafilter.compl_mem_iff_not_mem.symm
4
54.59815
2
2
5
2,361
import Mathlib.Topology.Bases import Mathlib.Topology.DenseEmbedding #align_import topology.stone_cech from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977" noncomputable section open Filter Set open Topology universe u v section Ultrafilter def ultrafilterBasis (α : Type u) : Set (Set (Ultrafilter α)) := range fun s : Set α => { u | s ∈ u } #align ultrafilter_basis ultrafilterBasis variable {α : Type u} instance Ultrafilter.topologicalSpace : TopologicalSpace (Ultrafilter α) := TopologicalSpace.generateFrom (ultrafilterBasis α) #align ultrafilter.topological_space Ultrafilter.topologicalSpace theorem ultrafilterBasis_is_basis : TopologicalSpace.IsTopologicalBasis (ultrafilterBasis α) := ⟨by rintro _ ⟨a, rfl⟩ _ ⟨b, rfl⟩ u ⟨ua, ub⟩ refine ⟨_, ⟨a ∩ b, rfl⟩, inter_mem ua ub, fun v hv => ⟨?_, ?_⟩⟩ <;> apply mem_of_superset hv <;> simp [inter_subset_right], eq_univ_of_univ_subset <| subset_sUnion_of_mem <| ⟨univ, eq_univ_of_forall fun u => univ_mem⟩, rfl⟩ #align ultrafilter_basis_is_basis ultrafilterBasis_is_basis theorem ultrafilter_isOpen_basic (s : Set α) : IsOpen { u : Ultrafilter α | s ∈ u } := ultrafilterBasis_is_basis.isOpen ⟨s, rfl⟩ #align ultrafilter_is_open_basic ultrafilter_isOpen_basic theorem ultrafilter_isClosed_basic (s : Set α) : IsClosed { u : Ultrafilter α | s ∈ u } := by rw [← isOpen_compl_iff] convert ultrafilter_isOpen_basic sᶜ using 1 ext u exact Ultrafilter.compl_mem_iff_not_mem.symm #align ultrafilter_is_closed_basic ultrafilter_isClosed_basic
Mathlib/Topology/StoneCech.lean
67
77
theorem ultrafilter_converges_iff {u : Ultrafilter (Ultrafilter α)} {x : Ultrafilter α} : ↑u ≤ 𝓝 x ↔ x = joinM u := by
rw [eq_comm, ← Ultrafilter.coe_le_coe] change ↑u ≤ 𝓝 x ↔ ∀ s ∈ x, { v : Ultrafilter α | s ∈ v } ∈ u simp only [TopologicalSpace.nhds_generateFrom, le_iInf_iff, ultrafilterBasis, le_principal_iff, mem_setOf_eq] constructor · intro h a ha exact h _ ⟨ha, a, rfl⟩ · rintro h a ⟨xi, a, rfl⟩ exact h _ xi
9
8,103.083928
2
2
5
2,361
import Mathlib.Topology.Bases import Mathlib.Topology.DenseEmbedding #align_import topology.stone_cech from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977" noncomputable section open Filter Set open Topology universe u v section Ultrafilter def ultrafilterBasis (α : Type u) : Set (Set (Ultrafilter α)) := range fun s : Set α => { u | s ∈ u } #align ultrafilter_basis ultrafilterBasis variable {α : Type u} instance Ultrafilter.topologicalSpace : TopologicalSpace (Ultrafilter α) := TopologicalSpace.generateFrom (ultrafilterBasis α) #align ultrafilter.topological_space Ultrafilter.topologicalSpace theorem ultrafilterBasis_is_basis : TopologicalSpace.IsTopologicalBasis (ultrafilterBasis α) := ⟨by rintro _ ⟨a, rfl⟩ _ ⟨b, rfl⟩ u ⟨ua, ub⟩ refine ⟨_, ⟨a ∩ b, rfl⟩, inter_mem ua ub, fun v hv => ⟨?_, ?_⟩⟩ <;> apply mem_of_superset hv <;> simp [inter_subset_right], eq_univ_of_univ_subset <| subset_sUnion_of_mem <| ⟨univ, eq_univ_of_forall fun u => univ_mem⟩, rfl⟩ #align ultrafilter_basis_is_basis ultrafilterBasis_is_basis theorem ultrafilter_isOpen_basic (s : Set α) : IsOpen { u : Ultrafilter α | s ∈ u } := ultrafilterBasis_is_basis.isOpen ⟨s, rfl⟩ #align ultrafilter_is_open_basic ultrafilter_isOpen_basic theorem ultrafilter_isClosed_basic (s : Set α) : IsClosed { u : Ultrafilter α | s ∈ u } := by rw [← isOpen_compl_iff] convert ultrafilter_isOpen_basic sᶜ using 1 ext u exact Ultrafilter.compl_mem_iff_not_mem.symm #align ultrafilter_is_closed_basic ultrafilter_isClosed_basic theorem ultrafilter_converges_iff {u : Ultrafilter (Ultrafilter α)} {x : Ultrafilter α} : ↑u ≤ 𝓝 x ↔ x = joinM u := by rw [eq_comm, ← Ultrafilter.coe_le_coe] change ↑u ≤ 𝓝 x ↔ ∀ s ∈ x, { v : Ultrafilter α | s ∈ v } ∈ u simp only [TopologicalSpace.nhds_generateFrom, le_iInf_iff, ultrafilterBasis, le_principal_iff, mem_setOf_eq] constructor · intro h a ha exact h _ ⟨ha, a, rfl⟩ · rintro h a ⟨xi, a, rfl⟩ exact h _ xi #align ultrafilter_converges_iff ultrafilter_converges_iff instance ultrafilter_compact : CompactSpace (Ultrafilter α) := ⟨isCompact_iff_ultrafilter_le_nhds.mpr fun f _ => ⟨joinM f, trivial, ultrafilter_converges_iff.mpr rfl⟩⟩ #align ultrafilter_compact ultrafilter_compact instance Ultrafilter.t2Space : T2Space (Ultrafilter α) := t2_iff_ultrafilter.mpr @fun x y f fx fy => have hx : x = joinM f := ultrafilter_converges_iff.mp fx have hy : y = joinM f := ultrafilter_converges_iff.mp fy hx.trans hy.symm #align ultrafilter.t2_space Ultrafilter.t2Space instance : TotallyDisconnectedSpace (Ultrafilter α) := by rw [totallyDisconnectedSpace_iff_connectedComponent_singleton] intro A simp only [Set.eq_singleton_iff_unique_mem, mem_connectedComponent, true_and_iff] intro B hB rw [← Ultrafilter.coe_le_coe] intro s hs rw [connectedComponent_eq_iInter_isClopen, Set.mem_iInter] at hB let Z := { F : Ultrafilter α | s ∈ F } have hZ : IsClopen Z := ⟨ultrafilter_isClosed_basic s, ultrafilter_isOpen_basic s⟩ exact hB ⟨Z, hZ, hs⟩ @[simp] theorem Ultrafilter.tendsto_pure_self (b : Ultrafilter α) : Tendsto pure b (𝓝 b) := by rw [Tendsto, ← coe_map, ultrafilter_converges_iff] ext s change s ∈ b ↔ {t | s ∈ t} ∈ map pure b simp_rw [mem_map, preimage_setOf_eq, mem_pure, setOf_mem_eq]
Mathlib/Topology/StoneCech.lean
110
117
theorem ultrafilter_comap_pure_nhds (b : Ultrafilter α) : comap pure (𝓝 b) ≤ b := by
rw [TopologicalSpace.nhds_generateFrom] simp only [comap_iInf, comap_principal] intro s hs rw [← le_principal_iff] refine iInf_le_of_le { u | s ∈ u } ?_ refine iInf_le_of_le ⟨hs, ⟨s, rfl⟩⟩ ?_ exact principal_mono.2 fun a => id
7
1,096.633158
2
2
5
2,361
import Mathlib.Topology.Bases import Mathlib.Topology.DenseEmbedding #align_import topology.stone_cech from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977" noncomputable section open Filter Set open Topology universe u v section Ultrafilter def ultrafilterBasis (α : Type u) : Set (Set (Ultrafilter α)) := range fun s : Set α => { u | s ∈ u } #align ultrafilter_basis ultrafilterBasis variable {α : Type u} instance Ultrafilter.topologicalSpace : TopologicalSpace (Ultrafilter α) := TopologicalSpace.generateFrom (ultrafilterBasis α) #align ultrafilter.topological_space Ultrafilter.topologicalSpace theorem ultrafilterBasis_is_basis : TopologicalSpace.IsTopologicalBasis (ultrafilterBasis α) := ⟨by rintro _ ⟨a, rfl⟩ _ ⟨b, rfl⟩ u ⟨ua, ub⟩ refine ⟨_, ⟨a ∩ b, rfl⟩, inter_mem ua ub, fun v hv => ⟨?_, ?_⟩⟩ <;> apply mem_of_superset hv <;> simp [inter_subset_right], eq_univ_of_univ_subset <| subset_sUnion_of_mem <| ⟨univ, eq_univ_of_forall fun u => univ_mem⟩, rfl⟩ #align ultrafilter_basis_is_basis ultrafilterBasis_is_basis theorem ultrafilter_isOpen_basic (s : Set α) : IsOpen { u : Ultrafilter α | s ∈ u } := ultrafilterBasis_is_basis.isOpen ⟨s, rfl⟩ #align ultrafilter_is_open_basic ultrafilter_isOpen_basic theorem ultrafilter_isClosed_basic (s : Set α) : IsClosed { u : Ultrafilter α | s ∈ u } := by rw [← isOpen_compl_iff] convert ultrafilter_isOpen_basic sᶜ using 1 ext u exact Ultrafilter.compl_mem_iff_not_mem.symm #align ultrafilter_is_closed_basic ultrafilter_isClosed_basic theorem ultrafilter_converges_iff {u : Ultrafilter (Ultrafilter α)} {x : Ultrafilter α} : ↑u ≤ 𝓝 x ↔ x = joinM u := by rw [eq_comm, ← Ultrafilter.coe_le_coe] change ↑u ≤ 𝓝 x ↔ ∀ s ∈ x, { v : Ultrafilter α | s ∈ v } ∈ u simp only [TopologicalSpace.nhds_generateFrom, le_iInf_iff, ultrafilterBasis, le_principal_iff, mem_setOf_eq] constructor · intro h a ha exact h _ ⟨ha, a, rfl⟩ · rintro h a ⟨xi, a, rfl⟩ exact h _ xi #align ultrafilter_converges_iff ultrafilter_converges_iff instance ultrafilter_compact : CompactSpace (Ultrafilter α) := ⟨isCompact_iff_ultrafilter_le_nhds.mpr fun f _ => ⟨joinM f, trivial, ultrafilter_converges_iff.mpr rfl⟩⟩ #align ultrafilter_compact ultrafilter_compact instance Ultrafilter.t2Space : T2Space (Ultrafilter α) := t2_iff_ultrafilter.mpr @fun x y f fx fy => have hx : x = joinM f := ultrafilter_converges_iff.mp fx have hy : y = joinM f := ultrafilter_converges_iff.mp fy hx.trans hy.symm #align ultrafilter.t2_space Ultrafilter.t2Space instance : TotallyDisconnectedSpace (Ultrafilter α) := by rw [totallyDisconnectedSpace_iff_connectedComponent_singleton] intro A simp only [Set.eq_singleton_iff_unique_mem, mem_connectedComponent, true_and_iff] intro B hB rw [← Ultrafilter.coe_le_coe] intro s hs rw [connectedComponent_eq_iInter_isClopen, Set.mem_iInter] at hB let Z := { F : Ultrafilter α | s ∈ F } have hZ : IsClopen Z := ⟨ultrafilter_isClosed_basic s, ultrafilter_isOpen_basic s⟩ exact hB ⟨Z, hZ, hs⟩ @[simp] theorem Ultrafilter.tendsto_pure_self (b : Ultrafilter α) : Tendsto pure b (𝓝 b) := by rw [Tendsto, ← coe_map, ultrafilter_converges_iff] ext s change s ∈ b ↔ {t | s ∈ t} ∈ map pure b simp_rw [mem_map, preimage_setOf_eq, mem_pure, setOf_mem_eq] theorem ultrafilter_comap_pure_nhds (b : Ultrafilter α) : comap pure (𝓝 b) ≤ b := by rw [TopologicalSpace.nhds_generateFrom] simp only [comap_iInf, comap_principal] intro s hs rw [← le_principal_iff] refine iInf_le_of_le { u | s ∈ u } ?_ refine iInf_le_of_le ⟨hs, ⟨s, rfl⟩⟩ ?_ exact principal_mono.2 fun a => id #align ultrafilter_comap_pure_nhds ultrafilter_comap_pure_nhds section Embedding
Mathlib/Topology/StoneCech.lean
122
126
theorem ultrafilter_pure_injective : Function.Injective (pure : α → Ultrafilter α) := by
intro x y h have : {x} ∈ (pure x : Ultrafilter α) := singleton_mem_pure rw [h] at this exact (mem_singleton_iff.mp (mem_pure.mp this)).symm
4
54.59815
2
2
5
2,361
import Mathlib.Topology.Bases import Mathlib.Topology.DenseEmbedding #align_import topology.stone_cech from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977" noncomputable section open Filter Set open Topology universe u v section Ultrafilter def ultrafilterBasis (α : Type u) : Set (Set (Ultrafilter α)) := range fun s : Set α => { u | s ∈ u } #align ultrafilter_basis ultrafilterBasis variable {α : Type u} instance Ultrafilter.topologicalSpace : TopologicalSpace (Ultrafilter α) := TopologicalSpace.generateFrom (ultrafilterBasis α) #align ultrafilter.topological_space Ultrafilter.topologicalSpace theorem ultrafilterBasis_is_basis : TopologicalSpace.IsTopologicalBasis (ultrafilterBasis α) := ⟨by rintro _ ⟨a, rfl⟩ _ ⟨b, rfl⟩ u ⟨ua, ub⟩ refine ⟨_, ⟨a ∩ b, rfl⟩, inter_mem ua ub, fun v hv => ⟨?_, ?_⟩⟩ <;> apply mem_of_superset hv <;> simp [inter_subset_right], eq_univ_of_univ_subset <| subset_sUnion_of_mem <| ⟨univ, eq_univ_of_forall fun u => univ_mem⟩, rfl⟩ #align ultrafilter_basis_is_basis ultrafilterBasis_is_basis theorem ultrafilter_isOpen_basic (s : Set α) : IsOpen { u : Ultrafilter α | s ∈ u } := ultrafilterBasis_is_basis.isOpen ⟨s, rfl⟩ #align ultrafilter_is_open_basic ultrafilter_isOpen_basic theorem ultrafilter_isClosed_basic (s : Set α) : IsClosed { u : Ultrafilter α | s ∈ u } := by rw [← isOpen_compl_iff] convert ultrafilter_isOpen_basic sᶜ using 1 ext u exact Ultrafilter.compl_mem_iff_not_mem.symm #align ultrafilter_is_closed_basic ultrafilter_isClosed_basic theorem ultrafilter_converges_iff {u : Ultrafilter (Ultrafilter α)} {x : Ultrafilter α} : ↑u ≤ 𝓝 x ↔ x = joinM u := by rw [eq_comm, ← Ultrafilter.coe_le_coe] change ↑u ≤ 𝓝 x ↔ ∀ s ∈ x, { v : Ultrafilter α | s ∈ v } ∈ u simp only [TopologicalSpace.nhds_generateFrom, le_iInf_iff, ultrafilterBasis, le_principal_iff, mem_setOf_eq] constructor · intro h a ha exact h _ ⟨ha, a, rfl⟩ · rintro h a ⟨xi, a, rfl⟩ exact h _ xi #align ultrafilter_converges_iff ultrafilter_converges_iff instance ultrafilter_compact : CompactSpace (Ultrafilter α) := ⟨isCompact_iff_ultrafilter_le_nhds.mpr fun f _ => ⟨joinM f, trivial, ultrafilter_converges_iff.mpr rfl⟩⟩ #align ultrafilter_compact ultrafilter_compact instance Ultrafilter.t2Space : T2Space (Ultrafilter α) := t2_iff_ultrafilter.mpr @fun x y f fx fy => have hx : x = joinM f := ultrafilter_converges_iff.mp fx have hy : y = joinM f := ultrafilter_converges_iff.mp fy hx.trans hy.symm #align ultrafilter.t2_space Ultrafilter.t2Space instance : TotallyDisconnectedSpace (Ultrafilter α) := by rw [totallyDisconnectedSpace_iff_connectedComponent_singleton] intro A simp only [Set.eq_singleton_iff_unique_mem, mem_connectedComponent, true_and_iff] intro B hB rw [← Ultrafilter.coe_le_coe] intro s hs rw [connectedComponent_eq_iInter_isClopen, Set.mem_iInter] at hB let Z := { F : Ultrafilter α | s ∈ F } have hZ : IsClopen Z := ⟨ultrafilter_isClosed_basic s, ultrafilter_isOpen_basic s⟩ exact hB ⟨Z, hZ, hs⟩ @[simp] theorem Ultrafilter.tendsto_pure_self (b : Ultrafilter α) : Tendsto pure b (𝓝 b) := by rw [Tendsto, ← coe_map, ultrafilter_converges_iff] ext s change s ∈ b ↔ {t | s ∈ t} ∈ map pure b simp_rw [mem_map, preimage_setOf_eq, mem_pure, setOf_mem_eq] theorem ultrafilter_comap_pure_nhds (b : Ultrafilter α) : comap pure (𝓝 b) ≤ b := by rw [TopologicalSpace.nhds_generateFrom] simp only [comap_iInf, comap_principal] intro s hs rw [← le_principal_iff] refine iInf_le_of_le { u | s ∈ u } ?_ refine iInf_le_of_le ⟨hs, ⟨s, rfl⟩⟩ ?_ exact principal_mono.2 fun a => id #align ultrafilter_comap_pure_nhds ultrafilter_comap_pure_nhds section Embedding theorem ultrafilter_pure_injective : Function.Injective (pure : α → Ultrafilter α) := by intro x y h have : {x} ∈ (pure x : Ultrafilter α) := singleton_mem_pure rw [h] at this exact (mem_singleton_iff.mp (mem_pure.mp this)).symm #align ultrafilter_pure_injective ultrafilter_pure_injective open TopologicalSpace theorem denseRange_pure : DenseRange (pure : α → Ultrafilter α) := fun x => mem_closure_iff_ultrafilter.mpr ⟨x.map pure, range_mem_map, ultrafilter_converges_iff.mpr (bind_pure x).symm⟩ #align dense_range_pure denseRange_pure
Mathlib/Topology/StoneCech.lean
138
143
theorem induced_topology_pure : TopologicalSpace.induced (pure : α → Ultrafilter α) Ultrafilter.topologicalSpace = ⊥ := by
apply eq_bot_of_singletons_open intro x use { u : Ultrafilter α | {x} ∈ u }, ultrafilter_isOpen_basic _ simp
4
54.59815
2
2
5
2,361
import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions noncomputable section open scoped Manifold open Bundle Set Topology variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {H : Type*} [TopologicalSpace H] (I : ModelWithCorners 𝕜 E H) {M : Type*} [TopologicalSpace M] [ChartedSpace H M] {E' : Type*} [NormedAddCommGroup E'] [NormedSpace 𝕜 E'] {H' : Type*} [TopologicalSpace H'] (I' : ModelWithCorners 𝕜 E' H') {M' : Type*} [TopologicalSpace M'] [ChartedSpace H' M'] {E'' : Type*} [NormedAddCommGroup E''] [NormedSpace 𝕜 E''] {H'' : Type*} [TopologicalSpace H''] (I'' : ModelWithCorners 𝕜 E'' H'') {M'' : Type*} [TopologicalSpace M''] [ChartedSpace H'' M''] section Charts variable [SmoothManifoldWithCorners I M] [SmoothManifoldWithCorners I' M'] [SmoothManifoldWithCorners I'' M''] {e : PartialHomeomorph M H}
Mathlib/Geometry/Manifold/MFDeriv/Atlas.lean
89
106
theorem mdifferentiableAt_atlas (h : e ∈ atlas H M) {x : M} (hx : x ∈ e.source) : MDifferentiableAt I I e x := by
rw [mdifferentiableAt_iff] refine ⟨(e.continuousOn x hx).continuousAt (e.open_source.mem_nhds hx), ?_⟩ have mem : I ((chartAt H x : M → H) x) ∈ I.symm ⁻¹' ((chartAt H x).symm ≫ₕ e).source ∩ range I := by simp only [hx, mfld_simps] have : (chartAt H x).symm.trans e ∈ contDiffGroupoid ∞ I := HasGroupoid.compatible (chart_mem_atlas H x) h have A : ContDiffOn 𝕜 ∞ (I ∘ (chartAt H x).symm.trans e ∘ I.symm) (I.symm ⁻¹' ((chartAt H x).symm.trans e).source ∩ range I) := this.1 have B := A.differentiableOn le_top (I ((chartAt H x : M → H) x)) mem simp only [mfld_simps] at B rw [inter_comm, differentiableWithinAt_inter] at B · simpa only [mfld_simps] · apply IsOpen.mem_nhds ((PartialHomeomorph.open_source _).preimage I.continuous_symm) mem.1
16
8,886,110.520508
2
2
6
2,362
import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions noncomputable section open scoped Manifold open Bundle Set Topology variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {H : Type*} [TopologicalSpace H] (I : ModelWithCorners 𝕜 E H) {M : Type*} [TopologicalSpace M] [ChartedSpace H M] {E' : Type*} [NormedAddCommGroup E'] [NormedSpace 𝕜 E'] {H' : Type*} [TopologicalSpace H'] (I' : ModelWithCorners 𝕜 E' H') {M' : Type*} [TopologicalSpace M'] [ChartedSpace H' M'] {E'' : Type*} [NormedAddCommGroup E''] [NormedSpace 𝕜 E''] {H'' : Type*} [TopologicalSpace H''] (I'' : ModelWithCorners 𝕜 E'' H'') {M'' : Type*} [TopologicalSpace M''] [ChartedSpace H'' M''] section Charts variable [SmoothManifoldWithCorners I M] [SmoothManifoldWithCorners I' M'] [SmoothManifoldWithCorners I'' M''] {e : PartialHomeomorph M H} theorem mdifferentiableAt_atlas (h : e ∈ atlas H M) {x : M} (hx : x ∈ e.source) : MDifferentiableAt I I e x := by rw [mdifferentiableAt_iff] refine ⟨(e.continuousOn x hx).continuousAt (e.open_source.mem_nhds hx), ?_⟩ have mem : I ((chartAt H x : M → H) x) ∈ I.symm ⁻¹' ((chartAt H x).symm ≫ₕ e).source ∩ range I := by simp only [hx, mfld_simps] have : (chartAt H x).symm.trans e ∈ contDiffGroupoid ∞ I := HasGroupoid.compatible (chart_mem_atlas H x) h have A : ContDiffOn 𝕜 ∞ (I ∘ (chartAt H x).symm.trans e ∘ I.symm) (I.symm ⁻¹' ((chartAt H x).symm.trans e).source ∩ range I) := this.1 have B := A.differentiableOn le_top (I ((chartAt H x : M → H) x)) mem simp only [mfld_simps] at B rw [inter_comm, differentiableWithinAt_inter] at B · simpa only [mfld_simps] · apply IsOpen.mem_nhds ((PartialHomeomorph.open_source _).preimage I.continuous_symm) mem.1 #align mdifferentiable_at_atlas mdifferentiableAt_atlas theorem mdifferentiableOn_atlas (h : e ∈ atlas H M) : MDifferentiableOn I I e e.source := fun _x hx => (mdifferentiableAt_atlas I h hx).mdifferentiableWithinAt #align mdifferentiable_on_atlas mdifferentiableOn_atlas
Mathlib/Geometry/Manifold/MFDeriv/Atlas.lean
113
129
theorem mdifferentiableAt_atlas_symm (h : e ∈ atlas H M) {x : H} (hx : x ∈ e.target) : MDifferentiableAt I I e.symm x := by
rw [mdifferentiableAt_iff] refine ⟨(e.continuousOn_symm x hx).continuousAt (e.open_target.mem_nhds hx), ?_⟩ have mem : I x ∈ I.symm ⁻¹' (e.symm ≫ₕ chartAt H (e.symm x)).source ∩ range I := by simp only [hx, mfld_simps] have : e.symm.trans (chartAt H (e.symm x)) ∈ contDiffGroupoid ∞ I := HasGroupoid.compatible h (chart_mem_atlas H _) have A : ContDiffOn 𝕜 ∞ (I ∘ e.symm.trans (chartAt H (e.symm x)) ∘ I.symm) (I.symm ⁻¹' (e.symm.trans (chartAt H (e.symm x))).source ∩ range I) := this.1 have B := A.differentiableOn le_top (I x) mem simp only [mfld_simps] at B rw [inter_comm, differentiableWithinAt_inter] at B · simpa only [mfld_simps] · apply IsOpen.mem_nhds ((PartialHomeomorph.open_source _).preimage I.continuous_symm) mem.1
15
3,269,017.372472
2
2
6
2,362
import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions noncomputable section open scoped Manifold open Bundle Set Topology variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {H : Type*} [TopologicalSpace H] (I : ModelWithCorners 𝕜 E H) {M : Type*} [TopologicalSpace M] [ChartedSpace H M] {E' : Type*} [NormedAddCommGroup E'] [NormedSpace 𝕜 E'] {H' : Type*} [TopologicalSpace H'] (I' : ModelWithCorners 𝕜 E' H') {M' : Type*} [TopologicalSpace M'] [ChartedSpace H' M'] {E'' : Type*} [NormedAddCommGroup E''] [NormedSpace 𝕜 E''] {H'' : Type*} [TopologicalSpace H''] (I'' : ModelWithCorners 𝕜 E'' H'') {M'' : Type*} [TopologicalSpace M''] [ChartedSpace H'' M''] section Charts variable [SmoothManifoldWithCorners I M] [SmoothManifoldWithCorners I' M'] [SmoothManifoldWithCorners I'' M''] {e : PartialHomeomorph M H} theorem mdifferentiableAt_atlas (h : e ∈ atlas H M) {x : M} (hx : x ∈ e.source) : MDifferentiableAt I I e x := by rw [mdifferentiableAt_iff] refine ⟨(e.continuousOn x hx).continuousAt (e.open_source.mem_nhds hx), ?_⟩ have mem : I ((chartAt H x : M → H) x) ∈ I.symm ⁻¹' ((chartAt H x).symm ≫ₕ e).source ∩ range I := by simp only [hx, mfld_simps] have : (chartAt H x).symm.trans e ∈ contDiffGroupoid ∞ I := HasGroupoid.compatible (chart_mem_atlas H x) h have A : ContDiffOn 𝕜 ∞ (I ∘ (chartAt H x).symm.trans e ∘ I.symm) (I.symm ⁻¹' ((chartAt H x).symm.trans e).source ∩ range I) := this.1 have B := A.differentiableOn le_top (I ((chartAt H x : M → H) x)) mem simp only [mfld_simps] at B rw [inter_comm, differentiableWithinAt_inter] at B · simpa only [mfld_simps] · apply IsOpen.mem_nhds ((PartialHomeomorph.open_source _).preimage I.continuous_symm) mem.1 #align mdifferentiable_at_atlas mdifferentiableAt_atlas theorem mdifferentiableOn_atlas (h : e ∈ atlas H M) : MDifferentiableOn I I e e.source := fun _x hx => (mdifferentiableAt_atlas I h hx).mdifferentiableWithinAt #align mdifferentiable_on_atlas mdifferentiableOn_atlas theorem mdifferentiableAt_atlas_symm (h : e ∈ atlas H M) {x : H} (hx : x ∈ e.target) : MDifferentiableAt I I e.symm x := by rw [mdifferentiableAt_iff] refine ⟨(e.continuousOn_symm x hx).continuousAt (e.open_target.mem_nhds hx), ?_⟩ have mem : I x ∈ I.symm ⁻¹' (e.symm ≫ₕ chartAt H (e.symm x)).source ∩ range I := by simp only [hx, mfld_simps] have : e.symm.trans (chartAt H (e.symm x)) ∈ contDiffGroupoid ∞ I := HasGroupoid.compatible h (chart_mem_atlas H _) have A : ContDiffOn 𝕜 ∞ (I ∘ e.symm.trans (chartAt H (e.symm x)) ∘ I.symm) (I.symm ⁻¹' (e.symm.trans (chartAt H (e.symm x))).source ∩ range I) := this.1 have B := A.differentiableOn le_top (I x) mem simp only [mfld_simps] at B rw [inter_comm, differentiableWithinAt_inter] at B · simpa only [mfld_simps] · apply IsOpen.mem_nhds ((PartialHomeomorph.open_source _).preimage I.continuous_symm) mem.1 #align mdifferentiable_at_atlas_symm mdifferentiableAt_atlas_symm theorem mdifferentiableOn_atlas_symm (h : e ∈ atlas H M) : MDifferentiableOn I I e.symm e.target := fun _x hx => (mdifferentiableAt_atlas_symm I h hx).mdifferentiableWithinAt #align mdifferentiable_on_atlas_symm mdifferentiableOn_atlas_symm theorem mdifferentiable_of_mem_atlas (h : e ∈ atlas H M) : e.MDifferentiable I I := ⟨mdifferentiableOn_atlas I h, mdifferentiableOn_atlas_symm I h⟩ #align mdifferentiable_of_mem_atlas mdifferentiable_of_mem_atlas theorem mdifferentiable_chart (x : M) : (chartAt H x).MDifferentiable I I := mdifferentiable_of_mem_atlas _ (chart_mem_atlas _ _) #align mdifferentiable_chart mdifferentiable_chart
Mathlib/Geometry/Manifold/MFDeriv/Atlas.lean
146
153
theorem tangentMap_chart {p q : TangentBundle I M} (h : q.1 ∈ (chartAt H p.1).source) : tangentMap I I (chartAt H p.1) q = (TotalSpace.toProd _ _).symm ((chartAt (ModelProd H E) p : TangentBundle I M → ModelProd H E) q) := by
dsimp [tangentMap] rw [MDifferentiableAt.mfderiv] · rfl · exact mdifferentiableAt_atlas _ (chart_mem_atlas _ _) h
4
54.59815
2
2
6
2,362
import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions noncomputable section open scoped Manifold open Bundle Set Topology variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {H : Type*} [TopologicalSpace H] (I : ModelWithCorners 𝕜 E H) {M : Type*} [TopologicalSpace M] [ChartedSpace H M] {E' : Type*} [NormedAddCommGroup E'] [NormedSpace 𝕜 E'] {H' : Type*} [TopologicalSpace H'] (I' : ModelWithCorners 𝕜 E' H') {M' : Type*} [TopologicalSpace M'] [ChartedSpace H' M'] {E'' : Type*} [NormedAddCommGroup E''] [NormedSpace 𝕜 E''] {H'' : Type*} [TopologicalSpace H''] (I'' : ModelWithCorners 𝕜 E'' H'') {M'' : Type*} [TopologicalSpace M''] [ChartedSpace H'' M''] section Charts variable [SmoothManifoldWithCorners I M] [SmoothManifoldWithCorners I' M'] [SmoothManifoldWithCorners I'' M''] {e : PartialHomeomorph M H} theorem mdifferentiableAt_atlas (h : e ∈ atlas H M) {x : M} (hx : x ∈ e.source) : MDifferentiableAt I I e x := by rw [mdifferentiableAt_iff] refine ⟨(e.continuousOn x hx).continuousAt (e.open_source.mem_nhds hx), ?_⟩ have mem : I ((chartAt H x : M → H) x) ∈ I.symm ⁻¹' ((chartAt H x).symm ≫ₕ e).source ∩ range I := by simp only [hx, mfld_simps] have : (chartAt H x).symm.trans e ∈ contDiffGroupoid ∞ I := HasGroupoid.compatible (chart_mem_atlas H x) h have A : ContDiffOn 𝕜 ∞ (I ∘ (chartAt H x).symm.trans e ∘ I.symm) (I.symm ⁻¹' ((chartAt H x).symm.trans e).source ∩ range I) := this.1 have B := A.differentiableOn le_top (I ((chartAt H x : M → H) x)) mem simp only [mfld_simps] at B rw [inter_comm, differentiableWithinAt_inter] at B · simpa only [mfld_simps] · apply IsOpen.mem_nhds ((PartialHomeomorph.open_source _).preimage I.continuous_symm) mem.1 #align mdifferentiable_at_atlas mdifferentiableAt_atlas theorem mdifferentiableOn_atlas (h : e ∈ atlas H M) : MDifferentiableOn I I e e.source := fun _x hx => (mdifferentiableAt_atlas I h hx).mdifferentiableWithinAt #align mdifferentiable_on_atlas mdifferentiableOn_atlas theorem mdifferentiableAt_atlas_symm (h : e ∈ atlas H M) {x : H} (hx : x ∈ e.target) : MDifferentiableAt I I e.symm x := by rw [mdifferentiableAt_iff] refine ⟨(e.continuousOn_symm x hx).continuousAt (e.open_target.mem_nhds hx), ?_⟩ have mem : I x ∈ I.symm ⁻¹' (e.symm ≫ₕ chartAt H (e.symm x)).source ∩ range I := by simp only [hx, mfld_simps] have : e.symm.trans (chartAt H (e.symm x)) ∈ contDiffGroupoid ∞ I := HasGroupoid.compatible h (chart_mem_atlas H _) have A : ContDiffOn 𝕜 ∞ (I ∘ e.symm.trans (chartAt H (e.symm x)) ∘ I.symm) (I.symm ⁻¹' (e.symm.trans (chartAt H (e.symm x))).source ∩ range I) := this.1 have B := A.differentiableOn le_top (I x) mem simp only [mfld_simps] at B rw [inter_comm, differentiableWithinAt_inter] at B · simpa only [mfld_simps] · apply IsOpen.mem_nhds ((PartialHomeomorph.open_source _).preimage I.continuous_symm) mem.1 #align mdifferentiable_at_atlas_symm mdifferentiableAt_atlas_symm theorem mdifferentiableOn_atlas_symm (h : e ∈ atlas H M) : MDifferentiableOn I I e.symm e.target := fun _x hx => (mdifferentiableAt_atlas_symm I h hx).mdifferentiableWithinAt #align mdifferentiable_on_atlas_symm mdifferentiableOn_atlas_symm theorem mdifferentiable_of_mem_atlas (h : e ∈ atlas H M) : e.MDifferentiable I I := ⟨mdifferentiableOn_atlas I h, mdifferentiableOn_atlas_symm I h⟩ #align mdifferentiable_of_mem_atlas mdifferentiable_of_mem_atlas theorem mdifferentiable_chart (x : M) : (chartAt H x).MDifferentiable I I := mdifferentiable_of_mem_atlas _ (chart_mem_atlas _ _) #align mdifferentiable_chart mdifferentiable_chart theorem tangentMap_chart {p q : TangentBundle I M} (h : q.1 ∈ (chartAt H p.1).source) : tangentMap I I (chartAt H p.1) q = (TotalSpace.toProd _ _).symm ((chartAt (ModelProd H E) p : TangentBundle I M → ModelProd H E) q) := by dsimp [tangentMap] rw [MDifferentiableAt.mfderiv] · rfl · exact mdifferentiableAt_atlas _ (chart_mem_atlas _ _) h #align tangent_map_chart tangentMap_chart
Mathlib/Geometry/Manifold/MFDeriv/Atlas.lean
159
169
theorem tangentMap_chart_symm {p : TangentBundle I M} {q : TangentBundle I H} (h : q.1 ∈ (chartAt H p.1).target) : tangentMap I I (chartAt H p.1).symm q = (chartAt (ModelProd H E) p).symm (TotalSpace.toProd H E q) := by
dsimp only [tangentMap] rw [MDifferentiableAt.mfderiv (mdifferentiableAt_atlas_symm _ (chart_mem_atlas _ _) h)] simp only [ContinuousLinearMap.coe_coe, TangentBundle.chartAt, h, tangentBundleCore, mfld_simps, (· ∘ ·)] -- `simp` fails to apply `PartialEquiv.prod_symm` with `ModelProd` congr exact ((chartAt H (TotalSpace.proj p)).right_inv h).symm
7
1,096.633158
2
2
6
2,362
import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions noncomputable section open scoped Manifold open Bundle Set Topology variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {H : Type*} [TopologicalSpace H] (I : ModelWithCorners 𝕜 E H) {M : Type*} [TopologicalSpace M] [ChartedSpace H M] {E' : Type*} [NormedAddCommGroup E'] [NormedSpace 𝕜 E'] {H' : Type*} [TopologicalSpace H'] (I' : ModelWithCorners 𝕜 E' H') {M' : Type*} [TopologicalSpace M'] [ChartedSpace H' M'] {E'' : Type*} [NormedAddCommGroup E''] [NormedSpace 𝕜 E''] {H'' : Type*} [TopologicalSpace H''] (I'' : ModelWithCorners 𝕜 E'' H'') {M'' : Type*} [TopologicalSpace M''] [ChartedSpace H'' M''] namespace PartialHomeomorph.MDifferentiable variable {I I' I''} variable {e : PartialHomeomorph M M'} (he : e.MDifferentiable I I') {e' : PartialHomeomorph M' M''} nonrec theorem symm : e.symm.MDifferentiable I' I := he.symm #align local_homeomorph.mdifferentiable.symm PartialHomeomorph.MDifferentiable.symm protected theorem mdifferentiableAt {x : M} (hx : x ∈ e.source) : MDifferentiableAt I I' e x := (he.1 x hx).mdifferentiableAt (e.open_source.mem_nhds hx) #align local_homeomorph.mdifferentiable.mdifferentiable_at PartialHomeomorph.MDifferentiable.mdifferentiableAt theorem mdifferentiableAt_symm {x : M'} (hx : x ∈ e.target) : MDifferentiableAt I' I e.symm x := (he.2 x hx).mdifferentiableAt (e.open_target.mem_nhds hx) #align local_homeomorph.mdifferentiable.mdifferentiable_at_symm PartialHomeomorph.MDifferentiable.mdifferentiableAt_symm variable [SmoothManifoldWithCorners I M] [SmoothManifoldWithCorners I' M'] [SmoothManifoldWithCorners I'' M'']
Mathlib/Geometry/Manifold/MFDeriv/Atlas.lean
200
210
theorem symm_comp_deriv {x : M} (hx : x ∈ e.source) : (mfderiv I' I e.symm (e x)).comp (mfderiv I I' e x) = ContinuousLinearMap.id 𝕜 (TangentSpace I x) := by
have : mfderiv I I (e.symm ∘ e) x = (mfderiv I' I e.symm (e x)).comp (mfderiv I I' e x) := mfderiv_comp x (he.mdifferentiableAt_symm (e.map_source hx)) (he.mdifferentiableAt hx) rw [← this] have : mfderiv I I (_root_.id : M → M) x = ContinuousLinearMap.id _ _ := mfderiv_id I rw [← this] apply Filter.EventuallyEq.mfderiv_eq have : e.source ∈ 𝓝 x := e.open_source.mem_nhds hx exact Filter.mem_of_superset this (by mfld_set_tac)
8
2,980.957987
2
2
6
2,362
import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions noncomputable section open scoped Manifold open Bundle Set Topology variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {H : Type*} [TopologicalSpace H] (I : ModelWithCorners 𝕜 E H) {M : Type*} [TopologicalSpace M] [ChartedSpace H M] {E' : Type*} [NormedAddCommGroup E'] [NormedSpace 𝕜 E'] {H' : Type*} [TopologicalSpace H'] (I' : ModelWithCorners 𝕜 E' H') {M' : Type*} [TopologicalSpace M'] [ChartedSpace H' M'] {E'' : Type*} [NormedAddCommGroup E''] [NormedSpace 𝕜 E''] {H'' : Type*} [TopologicalSpace H''] (I'' : ModelWithCorners 𝕜 E'' H'') {M'' : Type*} [TopologicalSpace M''] [ChartedSpace H'' M''] namespace PartialHomeomorph.MDifferentiable variable {I I' I''} variable {e : PartialHomeomorph M M'} (he : e.MDifferentiable I I') {e' : PartialHomeomorph M' M''} nonrec theorem symm : e.symm.MDifferentiable I' I := he.symm #align local_homeomorph.mdifferentiable.symm PartialHomeomorph.MDifferentiable.symm protected theorem mdifferentiableAt {x : M} (hx : x ∈ e.source) : MDifferentiableAt I I' e x := (he.1 x hx).mdifferentiableAt (e.open_source.mem_nhds hx) #align local_homeomorph.mdifferentiable.mdifferentiable_at PartialHomeomorph.MDifferentiable.mdifferentiableAt theorem mdifferentiableAt_symm {x : M'} (hx : x ∈ e.target) : MDifferentiableAt I' I e.symm x := (he.2 x hx).mdifferentiableAt (e.open_target.mem_nhds hx) #align local_homeomorph.mdifferentiable.mdifferentiable_at_symm PartialHomeomorph.MDifferentiable.mdifferentiableAt_symm variable [SmoothManifoldWithCorners I M] [SmoothManifoldWithCorners I' M'] [SmoothManifoldWithCorners I'' M''] theorem symm_comp_deriv {x : M} (hx : x ∈ e.source) : (mfderiv I' I e.symm (e x)).comp (mfderiv I I' e x) = ContinuousLinearMap.id 𝕜 (TangentSpace I x) := by have : mfderiv I I (e.symm ∘ e) x = (mfderiv I' I e.symm (e x)).comp (mfderiv I I' e x) := mfderiv_comp x (he.mdifferentiableAt_symm (e.map_source hx)) (he.mdifferentiableAt hx) rw [← this] have : mfderiv I I (_root_.id : M → M) x = ContinuousLinearMap.id _ _ := mfderiv_id I rw [← this] apply Filter.EventuallyEq.mfderiv_eq have : e.source ∈ 𝓝 x := e.open_source.mem_nhds hx exact Filter.mem_of_superset this (by mfld_set_tac) #align local_homeomorph.mdifferentiable.symm_comp_deriv PartialHomeomorph.MDifferentiable.symm_comp_deriv theorem comp_symm_deriv {x : M'} (hx : x ∈ e.target) : (mfderiv I I' e (e.symm x)).comp (mfderiv I' I e.symm x) = ContinuousLinearMap.id 𝕜 (TangentSpace I' x) := he.symm.symm_comp_deriv hx #align local_homeomorph.mdifferentiable.comp_symm_deriv PartialHomeomorph.MDifferentiable.comp_symm_deriv protected def mfderiv {x : M} (hx : x ∈ e.source) : TangentSpace I x ≃L[𝕜] TangentSpace I' (e x) := { mfderiv I I' e x with invFun := mfderiv I' I e.symm (e x) continuous_toFun := (mfderiv I I' e x).cont continuous_invFun := (mfderiv I' I e.symm (e x)).cont left_inv := fun y => by have : (ContinuousLinearMap.id _ _ : TangentSpace I x →L[𝕜] TangentSpace I x) y = y := rfl conv_rhs => rw [← this, ← he.symm_comp_deriv hx] rfl right_inv := fun y => by have : (ContinuousLinearMap.id 𝕜 _ : TangentSpace I' (e x) →L[𝕜] TangentSpace I' (e x)) y = y := rfl conv_rhs => rw [← this, ← he.comp_symm_deriv (e.map_source hx)] rw [e.left_inv hx] rfl } #align local_homeomorph.mdifferentiable.mfderiv PartialHomeomorph.MDifferentiable.mfderiv theorem mfderiv_bijective {x : M} (hx : x ∈ e.source) : Function.Bijective (mfderiv I I' e x) := (he.mfderiv hx).bijective #align local_homeomorph.mdifferentiable.mfderiv_bijective PartialHomeomorph.MDifferentiable.mfderiv_bijective theorem mfderiv_injective {x : M} (hx : x ∈ e.source) : Function.Injective (mfderiv I I' e x) := (he.mfderiv hx).injective #align local_homeomorph.mdifferentiable.mfderiv_injective PartialHomeomorph.MDifferentiable.mfderiv_injective theorem mfderiv_surjective {x : M} (hx : x ∈ e.source) : Function.Surjective (mfderiv I I' e x) := (he.mfderiv hx).surjective #align local_homeomorph.mdifferentiable.mfderiv_surjective PartialHomeomorph.MDifferentiable.mfderiv_surjective theorem ker_mfderiv_eq_bot {x : M} (hx : x ∈ e.source) : LinearMap.ker (mfderiv I I' e x) = ⊥ := (he.mfderiv hx).toLinearEquiv.ker #align local_homeomorph.mdifferentiable.ker_mfderiv_eq_bot PartialHomeomorph.MDifferentiable.ker_mfderiv_eq_bot theorem range_mfderiv_eq_top {x : M} (hx : x ∈ e.source) : LinearMap.range (mfderiv I I' e x) = ⊤ := (he.mfderiv hx).toLinearEquiv.range #align local_homeomorph.mdifferentiable.range_mfderiv_eq_top PartialHomeomorph.MDifferentiable.range_mfderiv_eq_top theorem range_mfderiv_eq_univ {x : M} (hx : x ∈ e.source) : range (mfderiv I I' e x) = univ := (he.mfderiv_surjective hx).range_eq #align local_homeomorph.mdifferentiable.range_mfderiv_eq_univ PartialHomeomorph.MDifferentiable.range_mfderiv_eq_univ
Mathlib/Geometry/Manifold/MFDeriv/Atlas.lean
263
273
theorem trans (he' : e'.MDifferentiable I' I'') : (e.trans e').MDifferentiable I I'' := by
constructor · intro x hx simp only [mfld_simps] at hx exact ((he'.mdifferentiableAt hx.2).comp _ (he.mdifferentiableAt hx.1)).mdifferentiableWithinAt · intro x hx simp only [mfld_simps] at hx exact ((he.symm.mdifferentiableAt hx.2).comp _ (he'.symm.mdifferentiableAt hx.1)).mdifferentiableWithinAt
10
22,026.465795
2
2
6
2,362
import Mathlib.Data.List.GetD import Mathlib.Data.Nat.Bits import Mathlib.Algebra.Ring.Nat import Mathlib.Order.Basic import Mathlib.Tactic.AdaptationNote import Mathlib.Tactic.Common #align_import data.nat.bitwise from "leanprover-community/mathlib"@"6afc9b06856ad973f6a2619e3e8a0a8d537a58f2" open Function namespace Nat set_option linter.deprecated false section variable {f : Bool → Bool → Bool} @[simp] lemma bitwise_zero_left (m : Nat) : bitwise f 0 m = if f false true then m else 0 := by simp [bitwise] #align nat.bitwise_zero_left Nat.bitwise_zero_left @[simp] lemma bitwise_zero_right (n : Nat) : bitwise f n 0 = if f true false then n else 0 := by unfold bitwise simp only [ite_self, decide_False, Nat.zero_div, ite_true, ite_eq_right_iff] rintro ⟨⟩ split_ifs <;> rfl #align nat.bitwise_zero_right Nat.bitwise_zero_right lemma bitwise_zero : bitwise f 0 0 = 0 := by simp only [bitwise_zero_right, ite_self] #align nat.bitwise_zero Nat.bitwise_zero lemma bitwise_of_ne_zero {n m : Nat} (hn : n ≠ 0) (hm : m ≠ 0) : bitwise f n m = bit (f (bodd n) (bodd m)) (bitwise f (n / 2) (m / 2)) := by conv_lhs => unfold bitwise have mod_two_iff_bod x : (x % 2 = 1 : Bool) = bodd x := by simp only [mod_two_of_bodd, cond]; cases bodd x <;> rfl simp only [hn, hm, mod_two_iff_bod, ite_false, bit, bit1, bit0, Bool.cond_eq_ite] split_ifs <;> rfl
Mathlib/Data/Nat/Bitwise.lean
75
81
theorem binaryRec_of_ne_zero {C : Nat → Sort*} (z : C 0) (f : ∀ b n, C n → C (bit b n)) {n} (h : n ≠ 0) : binaryRec z f n = bit_decomp n ▸ f (bodd n) (div2 n) (binaryRec z f (div2 n)) := by
rw [Eq.rec_eq_cast] rw [binaryRec] dsimp only rw [dif_neg h, eq_mpr_eq_cast]
4
54.59815
2
2
1
2,363
import Mathlib.ModelTheory.Ultraproducts import Mathlib.ModelTheory.Bundled import Mathlib.ModelTheory.Skolem #align_import model_theory.satisfiability from "leanprover-community/mathlib"@"d565b3df44619c1498326936be16f1a935df0728" set_option linter.uppercaseLean3 false universe u v w w' open Cardinal CategoryTheory open Cardinal FirstOrder namespace FirstOrder namespace Language variable {L : Language.{u, v}} {T : L.Theory} {α : Type w} {n : ℕ} namespace Theory variable (T) def IsSatisfiable : Prop := Nonempty (ModelType.{u, v, max u v} T) #align first_order.language.Theory.is_satisfiable FirstOrder.Language.Theory.IsSatisfiable def IsFinitelySatisfiable : Prop := ∀ T0 : Finset L.Sentence, (T0 : L.Theory) ⊆ T → IsSatisfiable (T0 : L.Theory) #align first_order.language.Theory.is_finitely_satisfiable FirstOrder.Language.Theory.IsFinitelySatisfiable variable {T} {T' : L.Theory} theorem Model.isSatisfiable (M : Type w) [Nonempty M] [L.Structure M] [M ⊨ T] : T.IsSatisfiable := ⟨((⊥ : Substructure _ (ModelType.of T M)).elementarySkolem₁Reduct.toModel T).shrink⟩ #align first_order.language.Theory.model.is_satisfiable FirstOrder.Language.Theory.Model.isSatisfiable theorem IsSatisfiable.mono (h : T'.IsSatisfiable) (hs : T ⊆ T') : T.IsSatisfiable := ⟨(Theory.Model.mono (ModelType.is_model h.some) hs).bundled⟩ #align first_order.language.Theory.is_satisfiable.mono FirstOrder.Language.Theory.IsSatisfiable.mono theorem isSatisfiable_empty (L : Language.{u, v}) : IsSatisfiable (∅ : L.Theory) := ⟨default⟩ #align first_order.language.Theory.is_satisfiable_empty FirstOrder.Language.Theory.isSatisfiable_empty theorem isSatisfiable_of_isSatisfiable_onTheory {L' : Language.{w, w'}} (φ : L →ᴸ L') (h : (φ.onTheory T).IsSatisfiable) : T.IsSatisfiable := Model.isSatisfiable (h.some.reduct φ) #align first_order.language.Theory.is_satisfiable_of_is_satisfiable_on_Theory FirstOrder.Language.Theory.isSatisfiable_of_isSatisfiable_onTheory
Mathlib/ModelTheory/Satisfiability.lean
93
98
theorem isSatisfiable_onTheory_iff {L' : Language.{w, w'}} {φ : L →ᴸ L'} (h : φ.Injective) : (φ.onTheory T).IsSatisfiable ↔ T.IsSatisfiable := by
classical refine ⟨isSatisfiable_of_isSatisfiable_onTheory φ, fun h' => ?_⟩ haveI : Inhabited h'.some := Classical.inhabited_of_nonempty' exact Model.isSatisfiable (h'.some.defaultExpansion h)
4
54.59815
2
2
5
2,364
import Mathlib.ModelTheory.Ultraproducts import Mathlib.ModelTheory.Bundled import Mathlib.ModelTheory.Skolem #align_import model_theory.satisfiability from "leanprover-community/mathlib"@"d565b3df44619c1498326936be16f1a935df0728" set_option linter.uppercaseLean3 false universe u v w w' open Cardinal CategoryTheory open Cardinal FirstOrder namespace FirstOrder namespace Language variable {L : Language.{u, v}} {T : L.Theory} {α : Type w} {n : ℕ} namespace Theory variable (T) def IsSatisfiable : Prop := Nonempty (ModelType.{u, v, max u v} T) #align first_order.language.Theory.is_satisfiable FirstOrder.Language.Theory.IsSatisfiable def IsFinitelySatisfiable : Prop := ∀ T0 : Finset L.Sentence, (T0 : L.Theory) ⊆ T → IsSatisfiable (T0 : L.Theory) #align first_order.language.Theory.is_finitely_satisfiable FirstOrder.Language.Theory.IsFinitelySatisfiable variable {T} {T' : L.Theory} theorem Model.isSatisfiable (M : Type w) [Nonempty M] [L.Structure M] [M ⊨ T] : T.IsSatisfiable := ⟨((⊥ : Substructure _ (ModelType.of T M)).elementarySkolem₁Reduct.toModel T).shrink⟩ #align first_order.language.Theory.model.is_satisfiable FirstOrder.Language.Theory.Model.isSatisfiable theorem IsSatisfiable.mono (h : T'.IsSatisfiable) (hs : T ⊆ T') : T.IsSatisfiable := ⟨(Theory.Model.mono (ModelType.is_model h.some) hs).bundled⟩ #align first_order.language.Theory.is_satisfiable.mono FirstOrder.Language.Theory.IsSatisfiable.mono theorem isSatisfiable_empty (L : Language.{u, v}) : IsSatisfiable (∅ : L.Theory) := ⟨default⟩ #align first_order.language.Theory.is_satisfiable_empty FirstOrder.Language.Theory.isSatisfiable_empty theorem isSatisfiable_of_isSatisfiable_onTheory {L' : Language.{w, w'}} (φ : L →ᴸ L') (h : (φ.onTheory T).IsSatisfiable) : T.IsSatisfiable := Model.isSatisfiable (h.some.reduct φ) #align first_order.language.Theory.is_satisfiable_of_is_satisfiable_on_Theory FirstOrder.Language.Theory.isSatisfiable_of_isSatisfiable_onTheory theorem isSatisfiable_onTheory_iff {L' : Language.{w, w'}} {φ : L →ᴸ L'} (h : φ.Injective) : (φ.onTheory T).IsSatisfiable ↔ T.IsSatisfiable := by classical refine ⟨isSatisfiable_of_isSatisfiable_onTheory φ, fun h' => ?_⟩ haveI : Inhabited h'.some := Classical.inhabited_of_nonempty' exact Model.isSatisfiable (h'.some.defaultExpansion h) #align first_order.language.Theory.is_satisfiable_on_Theory_iff FirstOrder.Language.Theory.isSatisfiable_onTheory_iff theorem IsSatisfiable.isFinitelySatisfiable (h : T.IsSatisfiable) : T.IsFinitelySatisfiable := fun _ => h.mono #align first_order.language.Theory.is_satisfiable.is_finitely_satisfiable FirstOrder.Language.Theory.IsSatisfiable.isFinitelySatisfiable
Mathlib/ModelTheory/Satisfiability.lean
107
126
theorem isSatisfiable_iff_isFinitelySatisfiable {T : L.Theory} : T.IsSatisfiable ↔ T.IsFinitelySatisfiable := ⟨Theory.IsSatisfiable.isFinitelySatisfiable, fun h => by classical set M : Finset T → Type max u v := fun T0 : Finset T => (h (T0.map (Function.Embedding.subtype fun x => x ∈ T)) T0.map_subtype_subset).some.Carrier let M' := Filter.Product (Ultrafilter.of (Filter.atTop : Filter (Finset T))) M have h' : M' ⊨ T := by
refine ⟨fun φ hφ => ?_⟩ rw [Ultraproduct.sentence_realize] refine Filter.Eventually.filter_mono (Ultrafilter.of_le _) (Filter.eventually_atTop.2 ⟨{⟨φ, hφ⟩}, fun s h' => Theory.realize_sentence_of_mem (s.map (Function.Embedding.subtype fun x => x ∈ T)) ?_⟩) simp only [Finset.coe_map, Function.Embedding.coe_subtype, Set.mem_image, Finset.mem_coe, Subtype.exists, Subtype.coe_mk, exists_and_right, exists_eq_right] exact ⟨hφ, h' (Finset.mem_singleton_self _)⟩ exact ⟨ModelType.of T M'⟩⟩
12
162,754.791419
2
2
5
2,364
import Mathlib.ModelTheory.Ultraproducts import Mathlib.ModelTheory.Bundled import Mathlib.ModelTheory.Skolem #align_import model_theory.satisfiability from "leanprover-community/mathlib"@"d565b3df44619c1498326936be16f1a935df0728" set_option linter.uppercaseLean3 false universe u v w w' open Cardinal CategoryTheory open Cardinal FirstOrder namespace FirstOrder namespace Language variable {L : Language.{u, v}} {T : L.Theory} {α : Type w} {n : ℕ} namespace Theory variable (T) def IsSatisfiable : Prop := Nonempty (ModelType.{u, v, max u v} T) #align first_order.language.Theory.is_satisfiable FirstOrder.Language.Theory.IsSatisfiable def IsFinitelySatisfiable : Prop := ∀ T0 : Finset L.Sentence, (T0 : L.Theory) ⊆ T → IsSatisfiable (T0 : L.Theory) #align first_order.language.Theory.is_finitely_satisfiable FirstOrder.Language.Theory.IsFinitelySatisfiable variable {T} {T' : L.Theory} theorem Model.isSatisfiable (M : Type w) [Nonempty M] [L.Structure M] [M ⊨ T] : T.IsSatisfiable := ⟨((⊥ : Substructure _ (ModelType.of T M)).elementarySkolem₁Reduct.toModel T).shrink⟩ #align first_order.language.Theory.model.is_satisfiable FirstOrder.Language.Theory.Model.isSatisfiable theorem IsSatisfiable.mono (h : T'.IsSatisfiable) (hs : T ⊆ T') : T.IsSatisfiable := ⟨(Theory.Model.mono (ModelType.is_model h.some) hs).bundled⟩ #align first_order.language.Theory.is_satisfiable.mono FirstOrder.Language.Theory.IsSatisfiable.mono theorem isSatisfiable_empty (L : Language.{u, v}) : IsSatisfiable (∅ : L.Theory) := ⟨default⟩ #align first_order.language.Theory.is_satisfiable_empty FirstOrder.Language.Theory.isSatisfiable_empty theorem isSatisfiable_of_isSatisfiable_onTheory {L' : Language.{w, w'}} (φ : L →ᴸ L') (h : (φ.onTheory T).IsSatisfiable) : T.IsSatisfiable := Model.isSatisfiable (h.some.reduct φ) #align first_order.language.Theory.is_satisfiable_of_is_satisfiable_on_Theory FirstOrder.Language.Theory.isSatisfiable_of_isSatisfiable_onTheory theorem isSatisfiable_onTheory_iff {L' : Language.{w, w'}} {φ : L →ᴸ L'} (h : φ.Injective) : (φ.onTheory T).IsSatisfiable ↔ T.IsSatisfiable := by classical refine ⟨isSatisfiable_of_isSatisfiable_onTheory φ, fun h' => ?_⟩ haveI : Inhabited h'.some := Classical.inhabited_of_nonempty' exact Model.isSatisfiable (h'.some.defaultExpansion h) #align first_order.language.Theory.is_satisfiable_on_Theory_iff FirstOrder.Language.Theory.isSatisfiable_onTheory_iff theorem IsSatisfiable.isFinitelySatisfiable (h : T.IsSatisfiable) : T.IsFinitelySatisfiable := fun _ => h.mono #align first_order.language.Theory.is_satisfiable.is_finitely_satisfiable FirstOrder.Language.Theory.IsSatisfiable.isFinitelySatisfiable theorem isSatisfiable_iff_isFinitelySatisfiable {T : L.Theory} : T.IsSatisfiable ↔ T.IsFinitelySatisfiable := ⟨Theory.IsSatisfiable.isFinitelySatisfiable, fun h => by classical set M : Finset T → Type max u v := fun T0 : Finset T => (h (T0.map (Function.Embedding.subtype fun x => x ∈ T)) T0.map_subtype_subset).some.Carrier let M' := Filter.Product (Ultrafilter.of (Filter.atTop : Filter (Finset T))) M have h' : M' ⊨ T := by refine ⟨fun φ hφ => ?_⟩ rw [Ultraproduct.sentence_realize] refine Filter.Eventually.filter_mono (Ultrafilter.of_le _) (Filter.eventually_atTop.2 ⟨{⟨φ, hφ⟩}, fun s h' => Theory.realize_sentence_of_mem (s.map (Function.Embedding.subtype fun x => x ∈ T)) ?_⟩) simp only [Finset.coe_map, Function.Embedding.coe_subtype, Set.mem_image, Finset.mem_coe, Subtype.exists, Subtype.coe_mk, exists_and_right, exists_eq_right] exact ⟨hφ, h' (Finset.mem_singleton_self _)⟩ exact ⟨ModelType.of T M'⟩⟩ #align first_order.language.Theory.is_satisfiable_iff_is_finitely_satisfiable FirstOrder.Language.Theory.isSatisfiable_iff_isFinitelySatisfiable
Mathlib/ModelTheory/Satisfiability.lean
129
135
theorem isSatisfiable_directed_union_iff {ι : Type*} [Nonempty ι] {T : ι → L.Theory} (h : Directed (· ⊆ ·) T) : Theory.IsSatisfiable (⋃ i, T i) ↔ ∀ i, (T i).IsSatisfiable := by
refine ⟨fun h' i => h'.mono (Set.subset_iUnion _ _), fun h' => ?_⟩ rw [isSatisfiable_iff_isFinitelySatisfiable, IsFinitelySatisfiable] intro T0 hT0 obtain ⟨i, hi⟩ := h.exists_mem_subset_of_finset_subset_biUnion hT0 exact (h' i).mono hi
5
148.413159
2
2
5
2,364
import Mathlib.ModelTheory.Ultraproducts import Mathlib.ModelTheory.Bundled import Mathlib.ModelTheory.Skolem #align_import model_theory.satisfiability from "leanprover-community/mathlib"@"d565b3df44619c1498326936be16f1a935df0728" set_option linter.uppercaseLean3 false universe u v w w' open Cardinal CategoryTheory open Cardinal FirstOrder namespace FirstOrder namespace Language variable {L : Language.{u, v}} {T : L.Theory} {α : Type w} {n : ℕ} namespace Theory variable (T) def IsSatisfiable : Prop := Nonempty (ModelType.{u, v, max u v} T) #align first_order.language.Theory.is_satisfiable FirstOrder.Language.Theory.IsSatisfiable def IsFinitelySatisfiable : Prop := ∀ T0 : Finset L.Sentence, (T0 : L.Theory) ⊆ T → IsSatisfiable (T0 : L.Theory) #align first_order.language.Theory.is_finitely_satisfiable FirstOrder.Language.Theory.IsFinitelySatisfiable variable {T} {T' : L.Theory} theorem Model.isSatisfiable (M : Type w) [Nonempty M] [L.Structure M] [M ⊨ T] : T.IsSatisfiable := ⟨((⊥ : Substructure _ (ModelType.of T M)).elementarySkolem₁Reduct.toModel T).shrink⟩ #align first_order.language.Theory.model.is_satisfiable FirstOrder.Language.Theory.Model.isSatisfiable theorem IsSatisfiable.mono (h : T'.IsSatisfiable) (hs : T ⊆ T') : T.IsSatisfiable := ⟨(Theory.Model.mono (ModelType.is_model h.some) hs).bundled⟩ #align first_order.language.Theory.is_satisfiable.mono FirstOrder.Language.Theory.IsSatisfiable.mono theorem isSatisfiable_empty (L : Language.{u, v}) : IsSatisfiable (∅ : L.Theory) := ⟨default⟩ #align first_order.language.Theory.is_satisfiable_empty FirstOrder.Language.Theory.isSatisfiable_empty theorem isSatisfiable_of_isSatisfiable_onTheory {L' : Language.{w, w'}} (φ : L →ᴸ L') (h : (φ.onTheory T).IsSatisfiable) : T.IsSatisfiable := Model.isSatisfiable (h.some.reduct φ) #align first_order.language.Theory.is_satisfiable_of_is_satisfiable_on_Theory FirstOrder.Language.Theory.isSatisfiable_of_isSatisfiable_onTheory theorem isSatisfiable_onTheory_iff {L' : Language.{w, w'}} {φ : L →ᴸ L'} (h : φ.Injective) : (φ.onTheory T).IsSatisfiable ↔ T.IsSatisfiable := by classical refine ⟨isSatisfiable_of_isSatisfiable_onTheory φ, fun h' => ?_⟩ haveI : Inhabited h'.some := Classical.inhabited_of_nonempty' exact Model.isSatisfiable (h'.some.defaultExpansion h) #align first_order.language.Theory.is_satisfiable_on_Theory_iff FirstOrder.Language.Theory.isSatisfiable_onTheory_iff theorem IsSatisfiable.isFinitelySatisfiable (h : T.IsSatisfiable) : T.IsFinitelySatisfiable := fun _ => h.mono #align first_order.language.Theory.is_satisfiable.is_finitely_satisfiable FirstOrder.Language.Theory.IsSatisfiable.isFinitelySatisfiable theorem isSatisfiable_iff_isFinitelySatisfiable {T : L.Theory} : T.IsSatisfiable ↔ T.IsFinitelySatisfiable := ⟨Theory.IsSatisfiable.isFinitelySatisfiable, fun h => by classical set M : Finset T → Type max u v := fun T0 : Finset T => (h (T0.map (Function.Embedding.subtype fun x => x ∈ T)) T0.map_subtype_subset).some.Carrier let M' := Filter.Product (Ultrafilter.of (Filter.atTop : Filter (Finset T))) M have h' : M' ⊨ T := by refine ⟨fun φ hφ => ?_⟩ rw [Ultraproduct.sentence_realize] refine Filter.Eventually.filter_mono (Ultrafilter.of_le _) (Filter.eventually_atTop.2 ⟨{⟨φ, hφ⟩}, fun s h' => Theory.realize_sentence_of_mem (s.map (Function.Embedding.subtype fun x => x ∈ T)) ?_⟩) simp only [Finset.coe_map, Function.Embedding.coe_subtype, Set.mem_image, Finset.mem_coe, Subtype.exists, Subtype.coe_mk, exists_and_right, exists_eq_right] exact ⟨hφ, h' (Finset.mem_singleton_self _)⟩ exact ⟨ModelType.of T M'⟩⟩ #align first_order.language.Theory.is_satisfiable_iff_is_finitely_satisfiable FirstOrder.Language.Theory.isSatisfiable_iff_isFinitelySatisfiable theorem isSatisfiable_directed_union_iff {ι : Type*} [Nonempty ι] {T : ι → L.Theory} (h : Directed (· ⊆ ·) T) : Theory.IsSatisfiable (⋃ i, T i) ↔ ∀ i, (T i).IsSatisfiable := by refine ⟨fun h' i => h'.mono (Set.subset_iUnion _ _), fun h' => ?_⟩ rw [isSatisfiable_iff_isFinitelySatisfiable, IsFinitelySatisfiable] intro T0 hT0 obtain ⟨i, hi⟩ := h.exists_mem_subset_of_finset_subset_biUnion hT0 exact (h' i).mono hi #align first_order.language.Theory.is_satisfiable_directed_union_iff FirstOrder.Language.Theory.isSatisfiable_directed_union_iff
Mathlib/ModelTheory/Satisfiability.lean
138
154
theorem isSatisfiable_union_distinctConstantsTheory_of_card_le (T : L.Theory) (s : Set α) (M : Type w') [Nonempty M] [L.Structure M] [M ⊨ T] (h : Cardinal.lift.{w'} #s ≤ Cardinal.lift.{w} #M) : ((L.lhomWithConstants α).onTheory T ∪ L.distinctConstantsTheory s).IsSatisfiable := by
haveI : Inhabited M := Classical.inhabited_of_nonempty inferInstance rw [Cardinal.lift_mk_le'] at h letI : (constantsOn α).Structure M := constantsOn.structure (Function.extend (↑) h.some default) have : M ⊨ (L.lhomWithConstants α).onTheory T ∪ L.distinctConstantsTheory s := by refine ((LHom.onTheory_model _ _).2 inferInstance).union ?_ rw [model_distinctConstantsTheory] refine fun a as b bs ab => ?_ rw [← Subtype.coe_mk a as, ← Subtype.coe_mk b bs, ← Subtype.ext_iff] exact h.some.injective ((Subtype.coe_injective.extend_apply h.some default ⟨a, as⟩).symm.trans (ab.trans (Subtype.coe_injective.extend_apply h.some default ⟨b, bs⟩))) exact Model.isSatisfiable M
13
442,413.392009
2
2
5
2,364
import Mathlib.ModelTheory.Ultraproducts import Mathlib.ModelTheory.Bundled import Mathlib.ModelTheory.Skolem #align_import model_theory.satisfiability from "leanprover-community/mathlib"@"d565b3df44619c1498326936be16f1a935df0728" set_option linter.uppercaseLean3 false universe u v w w' open Cardinal CategoryTheory open Cardinal FirstOrder namespace FirstOrder namespace Language variable {L : Language.{u, v}} {T : L.Theory} {α : Type w} {n : ℕ} variable (L)
Mathlib/ModelTheory/Satisfiability.lean
212
224
theorem exists_elementaryEmbedding_card_eq_of_le (M : Type w') [L.Structure M] [Nonempty M] (κ : Cardinal.{w}) (h1 : ℵ₀ ≤ κ) (h2 : lift.{w} L.card ≤ Cardinal.lift.{max u v} κ) (h3 : lift.{w'} κ ≤ Cardinal.lift.{w} #M) : ∃ N : Bundled L.Structure, Nonempty (N ↪ₑ[L] M) ∧ #N = κ := by
obtain ⟨S, _, hS⟩ := exists_elementarySubstructure_card_eq L ∅ κ h1 (by simp) h2 h3 have : Small.{w} S := by rw [← lift_inj.{_, w + 1}, lift_lift, lift_lift] at hS exact small_iff_lift_mk_lt_univ.2 (lt_of_eq_of_lt hS κ.lift_lt_univ') refine ⟨(equivShrink S).bundledInduced L, ⟨S.subtype.comp (Equiv.bundledInducedEquiv L _).symm.toElementaryEmbedding⟩, lift_inj.1 (_root_.trans ?_ hS)⟩ simp only [Equiv.bundledInduced_α, lift_mk_shrink']
9
8,103.083928
2
2
5
2,364
import Mathlib.Data.ZMod.Quotient #align_import group_theory.complement from "leanprover-community/mathlib"@"6ca1a09bc9aa75824bf97388c9e3b441fc4ccf3f" open Set open scoped Pointwise namespace Subgroup variable {G : Type*} [Group G] (H K : Subgroup G) (S T : Set G) @[to_additive "`S` and `T` are complements if `(+) : S × T → G` is a bijection"] def IsComplement : Prop := Function.Bijective fun x : S × T => x.1.1 * x.2.1 #align subgroup.is_complement Subgroup.IsComplement #align add_subgroup.is_complement AddSubgroup.IsComplement @[to_additive "`H` and `K` are complements if `(+) : H × K → G` is a bijection"] abbrev IsComplement' := IsComplement (H : Set G) (K : Set G) #align subgroup.is_complement' Subgroup.IsComplement' #align add_subgroup.is_complement' AddSubgroup.IsComplement' @[to_additive "The set of left-complements of `T : Set G`"] def leftTransversals : Set (Set G) := { S : Set G | IsComplement S T } #align subgroup.left_transversals Subgroup.leftTransversals #align add_subgroup.left_transversals AddSubgroup.leftTransversals @[to_additive "The set of right-complements of `S : Set G`"] def rightTransversals : Set (Set G) := { T : Set G | IsComplement S T } #align subgroup.right_transversals Subgroup.rightTransversals #align add_subgroup.right_transversals AddSubgroup.rightTransversals variable {H K S T} @[to_additive] theorem isComplement'_def : IsComplement' H K ↔ IsComplement (H : Set G) (K : Set G) := Iff.rfl #align subgroup.is_complement'_def Subgroup.isComplement'_def #align add_subgroup.is_complement'_def AddSubgroup.isComplement'_def @[to_additive] theorem isComplement_iff_existsUnique : IsComplement S T ↔ ∀ g : G, ∃! x : S × T, x.1.1 * x.2.1 = g := Function.bijective_iff_existsUnique _ #align subgroup.is_complement_iff_exists_unique Subgroup.isComplement_iff_existsUnique #align add_subgroup.is_complement_iff_exists_unique AddSubgroup.isComplement_iff_existsUnique @[to_additive] theorem IsComplement.existsUnique (h : IsComplement S T) (g : G) : ∃! x : S × T, x.1.1 * x.2.1 = g := isComplement_iff_existsUnique.mp h g #align subgroup.is_complement.exists_unique Subgroup.IsComplement.existsUnique #align add_subgroup.is_complement.exists_unique AddSubgroup.IsComplement.existsUnique @[to_additive]
Mathlib/GroupTheory/Complement.lean
90
99
theorem IsComplement'.symm (h : IsComplement' H K) : IsComplement' K H := by
let ϕ : H × K ≃ K × H := Equiv.mk (fun x => ⟨x.2⁻¹, x.1⁻¹⟩) (fun x => ⟨x.2⁻¹, x.1⁻¹⟩) (fun x => Prod.ext (inv_inv _) (inv_inv _)) fun x => Prod.ext (inv_inv _) (inv_inv _) let ψ : G ≃ G := Equiv.mk (fun g : G => g⁻¹) (fun g : G => g⁻¹) inv_inv inv_inv suffices hf : (ψ ∘ fun x : H × K => x.1.1 * x.2.1) = (fun x : K × H => x.1.1 * x.2.1) ∘ ϕ by rw [isComplement'_def, IsComplement, ← Equiv.bijective_comp ϕ] apply (congr_arg Function.Bijective hf).mp -- Porting note: This was a `rw` in mathlib3 rwa [ψ.comp_bijective] exact funext fun x => mul_inv_rev _ _
9
8,103.083928
2
2
3
2,365
import Mathlib.Data.ZMod.Quotient #align_import group_theory.complement from "leanprover-community/mathlib"@"6ca1a09bc9aa75824bf97388c9e3b441fc4ccf3f" open Set open scoped Pointwise namespace Subgroup variable {G : Type*} [Group G] (H K : Subgroup G) (S T : Set G) @[to_additive "`S` and `T` are complements if `(+) : S × T → G` is a bijection"] def IsComplement : Prop := Function.Bijective fun x : S × T => x.1.1 * x.2.1 #align subgroup.is_complement Subgroup.IsComplement #align add_subgroup.is_complement AddSubgroup.IsComplement @[to_additive "`H` and `K` are complements if `(+) : H × K → G` is a bijection"] abbrev IsComplement' := IsComplement (H : Set G) (K : Set G) #align subgroup.is_complement' Subgroup.IsComplement' #align add_subgroup.is_complement' AddSubgroup.IsComplement' @[to_additive "The set of left-complements of `T : Set G`"] def leftTransversals : Set (Set G) := { S : Set G | IsComplement S T } #align subgroup.left_transversals Subgroup.leftTransversals #align add_subgroup.left_transversals AddSubgroup.leftTransversals @[to_additive "The set of right-complements of `S : Set G`"] def rightTransversals : Set (Set G) := { T : Set G | IsComplement S T } #align subgroup.right_transversals Subgroup.rightTransversals #align add_subgroup.right_transversals AddSubgroup.rightTransversals variable {H K S T} @[to_additive] theorem isComplement'_def : IsComplement' H K ↔ IsComplement (H : Set G) (K : Set G) := Iff.rfl #align subgroup.is_complement'_def Subgroup.isComplement'_def #align add_subgroup.is_complement'_def AddSubgroup.isComplement'_def @[to_additive] theorem isComplement_iff_existsUnique : IsComplement S T ↔ ∀ g : G, ∃! x : S × T, x.1.1 * x.2.1 = g := Function.bijective_iff_existsUnique _ #align subgroup.is_complement_iff_exists_unique Subgroup.isComplement_iff_existsUnique #align add_subgroup.is_complement_iff_exists_unique AddSubgroup.isComplement_iff_existsUnique @[to_additive] theorem IsComplement.existsUnique (h : IsComplement S T) (g : G) : ∃! x : S × T, x.1.1 * x.2.1 = g := isComplement_iff_existsUnique.mp h g #align subgroup.is_complement.exists_unique Subgroup.IsComplement.existsUnique #align add_subgroup.is_complement.exists_unique AddSubgroup.IsComplement.existsUnique @[to_additive] theorem IsComplement'.symm (h : IsComplement' H K) : IsComplement' K H := by let ϕ : H × K ≃ K × H := Equiv.mk (fun x => ⟨x.2⁻¹, x.1⁻¹⟩) (fun x => ⟨x.2⁻¹, x.1⁻¹⟩) (fun x => Prod.ext (inv_inv _) (inv_inv _)) fun x => Prod.ext (inv_inv _) (inv_inv _) let ψ : G ≃ G := Equiv.mk (fun g : G => g⁻¹) (fun g : G => g⁻¹) inv_inv inv_inv suffices hf : (ψ ∘ fun x : H × K => x.1.1 * x.2.1) = (fun x : K × H => x.1.1 * x.2.1) ∘ ϕ by rw [isComplement'_def, IsComplement, ← Equiv.bijective_comp ϕ] apply (congr_arg Function.Bijective hf).mp -- Porting note: This was a `rw` in mathlib3 rwa [ψ.comp_bijective] exact funext fun x => mul_inv_rev _ _ #align subgroup.is_complement'.symm Subgroup.IsComplement'.symm #align add_subgroup.is_complement'.symm AddSubgroup.IsComplement'.symm @[to_additive] theorem isComplement'_comm : IsComplement' H K ↔ IsComplement' K H := ⟨IsComplement'.symm, IsComplement'.symm⟩ #align subgroup.is_complement'_comm Subgroup.isComplement'_comm #align add_subgroup.is_complement'_comm AddSubgroup.isComplement'_comm @[to_additive] theorem isComplement_univ_singleton {g : G} : IsComplement (univ : Set G) {g} := ⟨fun ⟨_, _, rfl⟩ ⟨_, _, rfl⟩ h => Prod.ext (Subtype.ext (mul_right_cancel h)) rfl, fun x => ⟨⟨⟨x * g⁻¹, ⟨⟩⟩, g, rfl⟩, inv_mul_cancel_right x g⟩⟩ #align subgroup.is_complement_top_singleton Subgroup.isComplement_univ_singleton #align add_subgroup.is_complement_top_singleton AddSubgroup.isComplement_univ_singleton @[to_additive] theorem isComplement_singleton_univ {g : G} : IsComplement ({g} : Set G) univ := ⟨fun ⟨⟨_, rfl⟩, _⟩ ⟨⟨_, rfl⟩, _⟩ h => Prod.ext rfl (Subtype.ext (mul_left_cancel h)), fun x => ⟨⟨⟨g, rfl⟩, g⁻¹ * x, ⟨⟩⟩, mul_inv_cancel_left g x⟩⟩ #align subgroup.is_complement_singleton_top Subgroup.isComplement_singleton_univ #align add_subgroup.is_complement_singleton_top AddSubgroup.isComplement_singleton_univ @[to_additive]
Mathlib/GroupTheory/Complement.lean
124
128
theorem isComplement_singleton_left {g : G} : IsComplement {g} S ↔ S = univ := by
refine ⟨fun h => top_le_iff.mp fun x _ => ?_, fun h => (congr_arg _ h).mpr isComplement_singleton_univ⟩ obtain ⟨⟨⟨z, rfl : z = g⟩, y, _⟩, hy⟩ := h.2 (g * x) rwa [← mul_left_cancel hy]
4
54.59815
2
2
3
2,365
import Mathlib.Data.ZMod.Quotient #align_import group_theory.complement from "leanprover-community/mathlib"@"6ca1a09bc9aa75824bf97388c9e3b441fc4ccf3f" open Set open scoped Pointwise namespace Subgroup variable {G : Type*} [Group G] (H K : Subgroup G) (S T : Set G) @[to_additive "`S` and `T` are complements if `(+) : S × T → G` is a bijection"] def IsComplement : Prop := Function.Bijective fun x : S × T => x.1.1 * x.2.1 #align subgroup.is_complement Subgroup.IsComplement #align add_subgroup.is_complement AddSubgroup.IsComplement @[to_additive "`H` and `K` are complements if `(+) : H × K → G` is a bijection"] abbrev IsComplement' := IsComplement (H : Set G) (K : Set G) #align subgroup.is_complement' Subgroup.IsComplement' #align add_subgroup.is_complement' AddSubgroup.IsComplement' @[to_additive "The set of left-complements of `T : Set G`"] def leftTransversals : Set (Set G) := { S : Set G | IsComplement S T } #align subgroup.left_transversals Subgroup.leftTransversals #align add_subgroup.left_transversals AddSubgroup.leftTransversals @[to_additive "The set of right-complements of `S : Set G`"] def rightTransversals : Set (Set G) := { T : Set G | IsComplement S T } #align subgroup.right_transversals Subgroup.rightTransversals #align add_subgroup.right_transversals AddSubgroup.rightTransversals variable {H K S T} @[to_additive] theorem isComplement'_def : IsComplement' H K ↔ IsComplement (H : Set G) (K : Set G) := Iff.rfl #align subgroup.is_complement'_def Subgroup.isComplement'_def #align add_subgroup.is_complement'_def AddSubgroup.isComplement'_def @[to_additive] theorem isComplement_iff_existsUnique : IsComplement S T ↔ ∀ g : G, ∃! x : S × T, x.1.1 * x.2.1 = g := Function.bijective_iff_existsUnique _ #align subgroup.is_complement_iff_exists_unique Subgroup.isComplement_iff_existsUnique #align add_subgroup.is_complement_iff_exists_unique AddSubgroup.isComplement_iff_existsUnique @[to_additive] theorem IsComplement.existsUnique (h : IsComplement S T) (g : G) : ∃! x : S × T, x.1.1 * x.2.1 = g := isComplement_iff_existsUnique.mp h g #align subgroup.is_complement.exists_unique Subgroup.IsComplement.existsUnique #align add_subgroup.is_complement.exists_unique AddSubgroup.IsComplement.existsUnique @[to_additive] theorem IsComplement'.symm (h : IsComplement' H K) : IsComplement' K H := by let ϕ : H × K ≃ K × H := Equiv.mk (fun x => ⟨x.2⁻¹, x.1⁻¹⟩) (fun x => ⟨x.2⁻¹, x.1⁻¹⟩) (fun x => Prod.ext (inv_inv _) (inv_inv _)) fun x => Prod.ext (inv_inv _) (inv_inv _) let ψ : G ≃ G := Equiv.mk (fun g : G => g⁻¹) (fun g : G => g⁻¹) inv_inv inv_inv suffices hf : (ψ ∘ fun x : H × K => x.1.1 * x.2.1) = (fun x : K × H => x.1.1 * x.2.1) ∘ ϕ by rw [isComplement'_def, IsComplement, ← Equiv.bijective_comp ϕ] apply (congr_arg Function.Bijective hf).mp -- Porting note: This was a `rw` in mathlib3 rwa [ψ.comp_bijective] exact funext fun x => mul_inv_rev _ _ #align subgroup.is_complement'.symm Subgroup.IsComplement'.symm #align add_subgroup.is_complement'.symm AddSubgroup.IsComplement'.symm @[to_additive] theorem isComplement'_comm : IsComplement' H K ↔ IsComplement' K H := ⟨IsComplement'.symm, IsComplement'.symm⟩ #align subgroup.is_complement'_comm Subgroup.isComplement'_comm #align add_subgroup.is_complement'_comm AddSubgroup.isComplement'_comm @[to_additive] theorem isComplement_univ_singleton {g : G} : IsComplement (univ : Set G) {g} := ⟨fun ⟨_, _, rfl⟩ ⟨_, _, rfl⟩ h => Prod.ext (Subtype.ext (mul_right_cancel h)) rfl, fun x => ⟨⟨⟨x * g⁻¹, ⟨⟩⟩, g, rfl⟩, inv_mul_cancel_right x g⟩⟩ #align subgroup.is_complement_top_singleton Subgroup.isComplement_univ_singleton #align add_subgroup.is_complement_top_singleton AddSubgroup.isComplement_univ_singleton @[to_additive] theorem isComplement_singleton_univ {g : G} : IsComplement ({g} : Set G) univ := ⟨fun ⟨⟨_, rfl⟩, _⟩ ⟨⟨_, rfl⟩, _⟩ h => Prod.ext rfl (Subtype.ext (mul_left_cancel h)), fun x => ⟨⟨⟨g, rfl⟩, g⁻¹ * x, ⟨⟩⟩, mul_inv_cancel_left g x⟩⟩ #align subgroup.is_complement_singleton_top Subgroup.isComplement_singleton_univ #align add_subgroup.is_complement_singleton_top AddSubgroup.isComplement_singleton_univ @[to_additive] theorem isComplement_singleton_left {g : G} : IsComplement {g} S ↔ S = univ := by refine ⟨fun h => top_le_iff.mp fun x _ => ?_, fun h => (congr_arg _ h).mpr isComplement_singleton_univ⟩ obtain ⟨⟨⟨z, rfl : z = g⟩, y, _⟩, hy⟩ := h.2 (g * x) rwa [← mul_left_cancel hy] #align subgroup.is_complement_singleton_left Subgroup.isComplement_singleton_left #align add_subgroup.is_complement_singleton_left AddSubgroup.isComplement_singleton_left @[to_additive]
Mathlib/GroupTheory/Complement.lean
133
139
theorem isComplement_singleton_right {g : G} : IsComplement S {g} ↔ S = univ := by
refine ⟨fun h => top_le_iff.mp fun x _ => ?_, fun h => h ▸ isComplement_univ_singleton⟩ obtain ⟨y, hy⟩ := h.2 (x * g) conv_rhs at hy => rw [← show y.2.1 = g from y.2.2] rw [← mul_right_cancel hy] exact y.1.2
6
403.428793
2
2
3
2,365
import Mathlib.Analysis.Complex.RealDeriv import Mathlib.Analysis.Calculus.ContDiff.RCLike import Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas #align_import analysis.special_functions.exp_deriv from "leanprover-community/mathlib"@"6a5c85000ab93fe5dcfdf620676f614ba8e18c26" noncomputable section open Filter Asymptotics Set Function open scoped Classical Topology namespace Complex variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] [NormedAlgebra 𝕜 ℂ]
Mathlib/Analysis/SpecialFunctions/ExpDeriv.lean
36
42
theorem hasDerivAt_exp (x : ℂ) : HasDerivAt exp (exp x) x := by
rw [hasDerivAt_iff_isLittleO_nhds_zero] have : (1 : ℕ) < 2 := by norm_num refine (IsBigO.of_bound ‖exp x‖ ?_).trans_isLittleO (isLittleO_pow_id this) filter_upwards [Metric.ball_mem_nhds (0 : ℂ) zero_lt_one] simp only [Metric.mem_ball, dist_zero_right, norm_pow] exact fun z hz => exp_bound_sq x z hz.le
6
403.428793
2
2
2
2,366
import Mathlib.Analysis.Complex.RealDeriv import Mathlib.Analysis.Calculus.ContDiff.RCLike import Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas #align_import analysis.special_functions.exp_deriv from "leanprover-community/mathlib"@"6a5c85000ab93fe5dcfdf620676f614ba8e18c26" noncomputable section open Filter Asymptotics Set Function open scoped Classical Topology namespace Complex variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] [NormedAlgebra 𝕜 ℂ] theorem hasDerivAt_exp (x : ℂ) : HasDerivAt exp (exp x) x := by rw [hasDerivAt_iff_isLittleO_nhds_zero] have : (1 : ℕ) < 2 := by norm_num refine (IsBigO.of_bound ‖exp x‖ ?_).trans_isLittleO (isLittleO_pow_id this) filter_upwards [Metric.ball_mem_nhds (0 : ℂ) zero_lt_one] simp only [Metric.mem_ball, dist_zero_right, norm_pow] exact fun z hz => exp_bound_sq x z hz.le #align complex.has_deriv_at_exp Complex.hasDerivAt_exp theorem differentiable_exp : Differentiable 𝕜 exp := fun x => (hasDerivAt_exp x).differentiableAt.restrictScalars 𝕜 #align complex.differentiable_exp Complex.differentiable_exp theorem differentiableAt_exp {x : ℂ} : DifferentiableAt 𝕜 exp x := differentiable_exp x #align complex.differentiable_at_exp Complex.differentiableAt_exp @[simp] theorem deriv_exp : deriv exp = exp := funext fun x => (hasDerivAt_exp x).deriv #align complex.deriv_exp Complex.deriv_exp @[simp] theorem iter_deriv_exp : ∀ n : ℕ, deriv^[n] exp = exp | 0 => rfl | n + 1 => by rw [iterate_succ_apply, deriv_exp, iter_deriv_exp n] #align complex.iter_deriv_exp Complex.iter_deriv_exp
Mathlib/Analysis/SpecialFunctions/ExpDeriv.lean
64
73
theorem contDiff_exp : ∀ {n}, ContDiff 𝕜 n exp := by
-- Porting note: added `@` due to `∀ {n}` weirdness above refine @(contDiff_all_iff_nat.2 fun n => ?_) have : ContDiff ℂ (↑n) exp := by induction' n with n ihn · exact contDiff_zero.2 continuous_exp · rw [contDiff_succ_iff_deriv] use differentiable_exp rwa [deriv_exp] exact this.restrict_scalars 𝕜
9
8,103.083928
2
2
2
2,366
import Mathlib.Algebra.Group.Ext import Mathlib.CategoryTheory.Simple import Mathlib.CategoryTheory.Linear.Basic import Mathlib.CategoryTheory.Endomorphism import Mathlib.FieldTheory.IsAlgClosed.Spectrum #align_import category_theory.preadditive.schur from "leanprover-community/mathlib"@"58a272265b5e05f258161260dd2c5d247213cbd3" namespace CategoryTheory open CategoryTheory.Limits variable {C : Type*} [Category C] variable [Preadditive C] -- See also `epi_of_nonzero_to_simple`, which does not require `Preadditive C`. theorem mono_of_nonzero_from_simple [HasKernels C] {X Y : C} [Simple X] {f : X ⟶ Y} (w : f ≠ 0) : Mono f := Preadditive.mono_of_kernel_zero (kernel_zero_of_nonzero_from_simple w) #align category_theory.mono_of_nonzero_from_simple CategoryTheory.mono_of_nonzero_from_simple theorem isIso_of_hom_simple [HasKernels C] {X Y : C} [Simple X] [Simple Y] {f : X ⟶ Y} (w : f ≠ 0) : IsIso f := haveI := mono_of_nonzero_from_simple w isIso_of_mono_of_nonzero w #align category_theory.is_iso_of_hom_simple CategoryTheory.isIso_of_hom_simple theorem isIso_iff_nonzero [HasKernels C] {X Y : C} [Simple X] [Simple Y] (f : X ⟶ Y) : IsIso f ↔ f ≠ 0 := ⟨fun I => by intro h apply id_nonzero X simp only [← IsIso.hom_inv_id f, h, zero_comp], fun w => isIso_of_hom_simple w⟩ #align category_theory.is_iso_iff_nonzero CategoryTheory.isIso_iff_nonzero open scoped Classical in noncomputable instance [HasKernels C] {X : C} [Simple X] : DivisionRing (End X) where inv f := if h : f = 0 then 0 else haveI := isIso_of_hom_simple h; inv f exists_pair_ne := ⟨𝟙 X, 0, id_nonzero _⟩ inv_zero := dif_pos rfl mul_inv_cancel f hf := by dsimp rw [dif_neg hf] haveI := isIso_of_hom_simple hf exact IsIso.inv_hom_id f nnqsmul := _ qsmul := _ open FiniteDimensional section variable (𝕜 : Type*) [DivisionRing 𝕜] theorem finrank_hom_simple_simple_eq_zero_of_not_iso [HasKernels C] [Linear 𝕜 C] {X Y : C} [Simple X] [Simple Y] (h : (X ≅ Y) → False) : finrank 𝕜 (X ⟶ Y) = 0 := haveI := subsingleton_of_forall_eq (0 : X ⟶ Y) fun f => by have p := not_congr (isIso_iff_nonzero f) simp only [Classical.not_not, Ne] at p exact p.mp fun _ => h (asIso f) finrank_zero_of_subsingleton #align category_theory.finrank_hom_simple_simple_eq_zero_of_not_iso CategoryTheory.finrank_hom_simple_simple_eq_zero_of_not_iso end variable (𝕜 : Type*) [Field 𝕜] variable [IsAlgClosed 𝕜] [Linear 𝕜 C] -- Porting note: the defeq issue in lean3 described below is no longer a problem in Lean4. -- In the proof below we have some difficulty using `I : FiniteDimensional 𝕜 (X ⟶ X)` -- where we need a `FiniteDimensional 𝕜 (End X)`. -- These are definitionally equal, but without eta reduction Lean can't see this. -- To get around this, we use `convert I`, -- then check the various instances agree field-by-field, -- We prove this with the explicit `isIso_iff_nonzero` assumption, -- rather than just `[Simple X]`, as this form is useful for -- Müger's formulation of semisimplicity.
Mathlib/CategoryTheory/Preadditive/Schur.lean
114
125
theorem finrank_endomorphism_eq_one {X : C} (isIso_iff_nonzero : ∀ f : X ⟶ X, IsIso f ↔ f ≠ 0) [I : FiniteDimensional 𝕜 (X ⟶ X)] : finrank 𝕜 (X ⟶ X) = 1 := by
have id_nonzero := (isIso_iff_nonzero (𝟙 X)).mp (by infer_instance) refine finrank_eq_one (𝟙 X) id_nonzero ?_ intro f have : Nontrivial (End X) := nontrivial_of_ne _ _ id_nonzero have : FiniteDimensional 𝕜 (End X) := I obtain ⟨c, nu⟩ := spectrum.nonempty_of_isAlgClosed_of_finiteDimensional 𝕜 (End.of f) use c rw [spectrum.mem_iff, IsUnit.sub_iff, isUnit_iff_isIso, isIso_iff_nonzero, Ne, Classical.not_not, sub_eq_zero, Algebra.algebraMap_eq_smul_one] at nu exact nu.symm
10
22,026.465795
2
2
1
2,367
import Mathlib.Analysis.Convex.Combination import Mathlib.Tactic.Linarith open Finset Set variable {ι 𝕜 E : Type*} [LinearOrderedField 𝕜] [AddCommGroup E] [Module 𝕜 E] {f : ι → E}
Mathlib/Analysis/Convex/Radon.lean
26
50
theorem radon_partition (h : ¬ AffineIndependent 𝕜 f) : ∃ I, (convexHull 𝕜 (f '' I) ∩ convexHull 𝕜 (f '' Iᶜ)).Nonempty := by
rw [affineIndependent_iff] at h push_neg at h obtain ⟨s, w, h_wsum, h_vsum, nonzero_w_index, h1, h2⟩ := h let I : Finset ι := s.filter fun i ↦ 0 ≤ w i let J : Finset ι := s.filter fun i ↦ w i < 0 let p : E := centerMass I w f -- point of intersection have hJI : ∑ j ∈ J, w j + ∑ i ∈ I, w i = 0 := by simpa only [h_wsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) w have hI : 0 < ∑ i ∈ I, w i := by rcases exists_pos_of_sum_zero_of_exists_nonzero _ h_wsum ⟨nonzero_w_index, h1, h2⟩ with ⟨pos_w_index, h1', h2'⟩ exact sum_pos' (fun _i hi ↦ (mem_filter.1 hi).2) ⟨pos_w_index, by simp only [I, mem_filter, h1', h2'.le, and_self, h2']⟩ have hp : centerMass J w f = p := Finset.centerMass_of_sum_add_sum_eq_zero hJI <| by simpa only [← h_vsum, not_lt] using sum_filter_add_sum_filter_not s (fun i ↦ w i < 0) _ refine ⟨I, p, ?_, ?_⟩ · exact centerMass_mem_convexHull _ (fun _i hi ↦ (mem_filter.mp hi).2) hI (fun _i hi ↦ Set.mem_image_of_mem _ hi) rw [← hp] refine centerMass_mem_convexHull_of_nonpos _ (fun _ hi ↦ (mem_filter.mp hi).2.le) ?_ (fun _i hi ↦ Set.mem_image_of_mem _ fun hi' ↦ ?_) · linarith only [hI, hJI] · exact (mem_filter.mp hi').2.not_lt (mem_filter.mp hi).2
23
9,744,803,446.248903
2
2
1
2,368
import Mathlib.Algebra.CharP.Algebra import Mathlib.Data.ZMod.Algebra import Mathlib.FieldTheory.Finite.Basic import Mathlib.FieldTheory.Galois import Mathlib.FieldTheory.SplittingField.IsSplittingField #align_import field_theory.finite.galois_field from "leanprover-community/mathlib"@"0723536a0522d24fc2f159a096fb3304bef77472" noncomputable section open Polynomial Finset open scoped Polynomial instance FiniteField.isSplittingField_sub (K F : Type*) [Field K] [Fintype K] [Field F] [Algebra F K] : IsSplittingField F K (X ^ Fintype.card K - X) where splits' := by have h : (X ^ Fintype.card K - X : K[X]).natDegree = Fintype.card K := FiniteField.X_pow_card_sub_X_natDegree_eq K Fintype.one_lt_card rw [← splits_id_iff_splits, splits_iff_card_roots, Polynomial.map_sub, Polynomial.map_pow, map_X, h, FiniteField.roots_X_pow_card_sub_X K, ← Finset.card_def, Finset.card_univ] adjoin_rootSet' := by classical trans Algebra.adjoin F ((roots (X ^ Fintype.card K - X : K[X])).toFinset : Set K) · simp only [rootSet, aroots, Polynomial.map_pow, map_X, Polynomial.map_sub] · rw [FiniteField.roots_X_pow_card_sub_X, val_toFinset, coe_univ, Algebra.adjoin_univ] #align finite_field.has_sub.sub.polynomial.is_splitting_field FiniteField.isSplittingField_sub
Mathlib/FieldTheory/Finite/GaloisField.lean
55
60
theorem galois_poly_separable {K : Type*} [Field K] (p q : ℕ) [CharP K p] (h : p ∣ q) : Separable (X ^ q - X : K[X]) := by
use 1, X ^ q - X - 1 rw [← CharP.cast_eq_zero_iff K[X] p] at h rw [derivative_sub, derivative_X_pow, derivative_X, C_eq_natCast, h] ring
4
54.59815
2
2
2
2,369
import Mathlib.Algebra.CharP.Algebra import Mathlib.Data.ZMod.Algebra import Mathlib.FieldTheory.Finite.Basic import Mathlib.FieldTheory.Galois import Mathlib.FieldTheory.SplittingField.IsSplittingField #align_import field_theory.finite.galois_field from "leanprover-community/mathlib"@"0723536a0522d24fc2f159a096fb3304bef77472" noncomputable section open Polynomial Finset open scoped Polynomial instance FiniteField.isSplittingField_sub (K F : Type*) [Field K] [Fintype K] [Field F] [Algebra F K] : IsSplittingField F K (X ^ Fintype.card K - X) where splits' := by have h : (X ^ Fintype.card K - X : K[X]).natDegree = Fintype.card K := FiniteField.X_pow_card_sub_X_natDegree_eq K Fintype.one_lt_card rw [← splits_id_iff_splits, splits_iff_card_roots, Polynomial.map_sub, Polynomial.map_pow, map_X, h, FiniteField.roots_X_pow_card_sub_X K, ← Finset.card_def, Finset.card_univ] adjoin_rootSet' := by classical trans Algebra.adjoin F ((roots (X ^ Fintype.card K - X : K[X])).toFinset : Set K) · simp only [rootSet, aroots, Polynomial.map_pow, map_X, Polynomial.map_sub] · rw [FiniteField.roots_X_pow_card_sub_X, val_toFinset, coe_univ, Algebra.adjoin_univ] #align finite_field.has_sub.sub.polynomial.is_splitting_field FiniteField.isSplittingField_sub theorem galois_poly_separable {K : Type*} [Field K] (p q : ℕ) [CharP K p] (h : p ∣ q) : Separable (X ^ q - X : K[X]) := by use 1, X ^ q - X - 1 rw [← CharP.cast_eq_zero_iff K[X] p] at h rw [derivative_sub, derivative_X_pow, derivative_X, C_eq_natCast, h] ring #align galois_poly_separable galois_poly_separable variable (p : ℕ) [Fact p.Prime] (n : ℕ) def GaloisField := SplittingField (X ^ p ^ n - X : (ZMod p)[X]) -- deriving Field -- Porting note: see https://github.com/leanprover-community/mathlib4/issues/5020 #align galois_field GaloisField instance : Field (GaloisField p n) := inferInstanceAs (Field (SplittingField _)) instance : Inhabited (@GaloisField 2 (Fact.mk Nat.prime_two) 1) := ⟨37⟩ namespace GaloisField variable (p : ℕ) [h_prime : Fact p.Prime] (n : ℕ) instance : Algebra (ZMod p) (GaloisField p n) := SplittingField.algebra _ instance : IsSplittingField (ZMod p) (GaloisField p n) (X ^ p ^ n - X) := Polynomial.IsSplittingField.splittingField _ instance : CharP (GaloisField p n) p := (Algebra.charP_iff (ZMod p) (GaloisField p n) p).mp (by infer_instance) instance : FiniteDimensional (ZMod p) (GaloisField p n) := by dsimp only [GaloisField]; infer_instance instance : Fintype (GaloisField p n) := by dsimp only [GaloisField] exact FiniteDimensional.fintypeOfFintype (ZMod p) (GaloisField p n)
Mathlib/FieldTheory/Finite/GaloisField.lean
96
143
theorem finrank {n} (h : n ≠ 0) : FiniteDimensional.finrank (ZMod p) (GaloisField p n) = n := by
set g_poly := (X ^ p ^ n - X : (ZMod p)[X]) have hp : 1 < p := h_prime.out.one_lt have aux : g_poly ≠ 0 := FiniteField.X_pow_card_pow_sub_X_ne_zero _ h hp -- Porting note: in the statment of `key`, replaced `g_poly` by its value otherwise the -- proof fails have key : Fintype.card (g_poly.rootSet (GaloisField p n)) = g_poly.natDegree := card_rootSet_eq_natDegree (galois_poly_separable p _ (dvd_pow (dvd_refl p) h)) (SplittingField.splits (X ^ p ^ n - X : (ZMod p)[X])) have nat_degree_eq : g_poly.natDegree = p ^ n := FiniteField.X_pow_card_pow_sub_X_natDegree_eq _ h hp rw [nat_degree_eq] at key suffices g_poly.rootSet (GaloisField p n) = Set.univ by simp_rw [this, ← Fintype.ofEquiv_card (Equiv.Set.univ _)] at key -- Porting note: prevents `card_eq_pow_finrank` from using a wrong instance for `Fintype` rw [@card_eq_pow_finrank (ZMod p) _ _ _ _ _ (_), ZMod.card] at key exact Nat.pow_right_injective (Nat.Prime.one_lt' p).out key rw [Set.eq_univ_iff_forall] suffices ∀ (x) (hx : x ∈ (⊤ : Subalgebra (ZMod p) (GaloisField p n))), x ∈ (X ^ p ^ n - X : (ZMod p)[X]).rootSet (GaloisField p n) by simpa rw [← SplittingField.adjoin_rootSet] simp_rw [Algebra.mem_adjoin_iff] intro x hx -- We discharge the `p = 0` separately, to avoid typeclass issues on `ZMod p`. cases p; cases hp refine Subring.closure_induction hx ?_ ?_ ?_ ?_ ?_ ?_ <;> simp_rw [mem_rootSet_of_ne aux] · rintro x (⟨r, rfl⟩ | hx) · simp only [g_poly, map_sub, map_pow, aeval_X] rw [← map_pow, ZMod.pow_card_pow, sub_self] · dsimp only [GaloisField] at hx rwa [mem_rootSet_of_ne aux] at hx · rw [← coeff_zero_eq_aeval_zero'] simp only [g_poly, coeff_X_pow, coeff_X_zero, sub_zero, _root_.map_eq_zero, ite_eq_right_iff, one_ne_zero, coeff_sub] intro hn exact Nat.not_lt_zero 1 (pow_eq_zero hn.symm ▸ hp) · simp [g_poly] · simp only [g_poly, aeval_X_pow, aeval_X, AlgHom.map_sub, add_pow_char_pow, sub_eq_zero] intro x y hx hy rw [hx, hy] · intro x hx simp only [g_poly, sub_eq_zero, aeval_X_pow, aeval_X, AlgHom.map_sub, sub_neg_eq_add] at * rw [neg_pow, hx, CharP.neg_one_pow_char_pow] simp · simp only [g_poly, aeval_X_pow, aeval_X, AlgHom.map_sub, mul_pow, sub_eq_zero] intro x y hx hy rw [hx, hy]
47
258,131,288,619,006,750,000
2
2
2
2,369
import Mathlib.Mathport.Rename import Mathlib.Tactic.Basic #align_import init.control.lawful from "leanprover-community/lean"@"9af482290ef68e8aaa5ead01aa7b09b7be7019fd" set_option autoImplicit true universe u v #align is_lawful_functor LawfulFunctor #align is_lawful_functor.map_const_eq LawfulFunctor.map_const #align is_lawful_functor.id_map LawfulFunctor.id_map #align is_lawful_functor.comp_map LawfulFunctor.comp_map #align is_lawful_applicative LawfulApplicative #align is_lawful_applicative.seq_left_eq LawfulApplicative.seqLeft_eq #align is_lawful_applicative.seq_right_eq LawfulApplicative.seqRight_eq #align is_lawful_applicative.pure_seq_eq_map LawfulApplicative.pure_seq #align is_lawful_applicative.map_pure LawfulApplicative.map_pure #align is_lawful_applicative.seq_pure LawfulApplicative.seq_pure #align is_lawful_applicative.seq_assoc LawfulApplicative.seq_assoc #align pure_id_seq pure_id_seq #align is_lawful_monad LawfulMonad #align is_lawful_monad.bind_pure_comp_eq_map LawfulMonad.bind_pure_comp #align is_lawful_monad.bind_map_eq_seq LawfulMonad.bind_map #align is_lawful_monad.pure_bind LawfulMonad.pure_bind #align is_lawful_monad.bind_assoc LawfulMonad.bind_assoc #align bind_pure bind_pure #align bind_ext_congr bind_congr #align map_ext_congr map_congr #align id.map_eq Id.map_eq #align id.bind_eq Id.bind_eq #align id.pure_eq Id.pure_eq namespace OptionT variable {α β : Type u} {m : Type u → Type v} (x : OptionT m α) @[ext] theorem ext {x x' : OptionT m α} (h : x.run = x'.run) : x = x' := h #align option_t.ext OptionTₓ.ext -- Porting note: This is proven by proj reduction in Lean 3. @[simp] theorem run_mk (x : m (Option α)) : OptionT.run (OptionT.mk x) = x := rfl variable [Monad m] @[simp] theorem run_pure (a) : (pure a : OptionT m α).run = pure (some a) := rfl #align option_t.run_pure OptionTₓ.run_pure @[simp] theorem run_bind (f : α → OptionT m β) : (x >>= f).run = x.run >>= fun | some a => OptionT.run (f a) | none => pure none := rfl #align option_t.run_bind OptionTₓ.run_bind @[simp]
Mathlib/Init/Control/Lawful.lean
213
219
theorem run_map (f : α → β) [LawfulMonad m] : (f <$> x).run = Option.map f <$> x.run := by
rw [← bind_pure_comp _ x.run] change x.run >>= (fun | some a => OptionT.run (pure (f a)) | none => pure none) = _ apply bind_congr intro a; cases a <;> simp [Option.map, Option.bind]
6
403.428793
2
2
1
2,370
import Mathlib.Analysis.LocallyConvex.Bounded import Mathlib.Analysis.RCLike.Basic #align_import analysis.locally_convex.continuous_of_bounded from "leanprover-community/mathlib"@"3f655f5297b030a87d641ad4e825af8d9679eb0b" open TopologicalSpace Bornology Filter Topology Pointwise variable {𝕜 𝕜' E F : Type*} variable [AddCommGroup E] [UniformSpace E] [UniformAddGroup E] variable [AddCommGroup F] [UniformSpace F] section RCLike open TopologicalSpace Bornology variable [FirstCountableTopology E] variable [RCLike 𝕜] [Module 𝕜 E] [ContinuousSMul 𝕜 E] variable [RCLike 𝕜'] [Module 𝕜' F] [ContinuousSMul 𝕜' F] variable {σ : 𝕜 →+* 𝕜'}
Mathlib/Analysis/LocallyConvex/ContinuousOfBounded.lean
96
166
theorem LinearMap.continuousAt_zero_of_locally_bounded (f : E →ₛₗ[σ] F) (hf : ∀ s, IsVonNBounded 𝕜 s → IsVonNBounded 𝕜' (f '' s)) : ContinuousAt f 0 := by
-- Assume that f is not continuous at 0 by_contra h -- We use a decreasing balanced basis for 0 : E and a balanced basis for 0 : F -- and reformulate non-continuity in terms of these bases rcases (nhds_basis_balanced 𝕜 E).exists_antitone_subbasis with ⟨b, bE1, bE⟩ simp only [_root_.id] at bE have bE' : (𝓝 (0 : E)).HasBasis (fun x : ℕ => x ≠ 0) fun n : ℕ => (n : 𝕜)⁻¹ • b n := by refine bE.1.to_hasBasis ?_ ?_ · intro n _ use n + 1 simp only [Ne, Nat.succ_ne_zero, not_false_iff, Nat.cast_add, Nat.cast_one, true_and_iff] -- `b (n + 1) ⊆ b n` follows from `Antitone`. have h : b (n + 1) ⊆ b n := bE.2 (by simp) refine _root_.trans ?_ h rintro y ⟨x, hx, hy⟩ -- Since `b (n + 1)` is balanced `(n+1)⁻¹ b (n + 1) ⊆ b (n + 1)` rw [← hy] refine (bE1 (n + 1)).2.smul_mem ?_ hx have h' : 0 < (n : ℝ) + 1 := n.cast_add_one_pos rw [norm_inv, ← Nat.cast_one, ← Nat.cast_add, RCLike.norm_natCast, Nat.cast_add, Nat.cast_one, inv_le h' zero_lt_one] simp intro n hn -- The converse direction follows from continuity of the scalar multiplication have hcont : ContinuousAt (fun x : E => (n : 𝕜) • x) 0 := (continuous_const_smul (n : 𝕜)).continuousAt simp only [ContinuousAt, map_zero, smul_zero] at hcont rw [bE.1.tendsto_left_iff] at hcont rcases hcont (b n) (bE1 n).1 with ⟨i, _, hi⟩ refine ⟨i, trivial, fun x hx => ⟨(n : 𝕜) • x, hi hx, ?_⟩⟩ simp [← mul_smul, hn] rw [ContinuousAt, map_zero, bE'.tendsto_iff (nhds_basis_balanced 𝕜' F)] at h push_neg at h rcases h with ⟨V, ⟨hV, -⟩, h⟩ simp only [_root_.id, forall_true_left] at h -- There exists `u : ℕ → E` such that for all `n : ℕ` we have `u n ∈ n⁻¹ • b n` and `f (u n) ∉ V` choose! u hu hu' using h -- The sequence `(fun n ↦ n • u n)` converges to `0` have h_tendsto : Tendsto (fun n : ℕ => (n : 𝕜) • u n) atTop (𝓝 (0 : E)) := by apply bE.tendsto intro n by_cases h : n = 0 · rw [h, Nat.cast_zero, zero_smul] exact mem_of_mem_nhds (bE.1.mem_of_mem <| by trivial) rcases hu n h with ⟨y, hy, hu1⟩ convert hy rw [← hu1, ← mul_smul] simp only [h, mul_inv_cancel, Ne, Nat.cast_eq_zero, not_false_iff, one_smul] -- The image `(fun n ↦ n • u n)` is von Neumann bounded: have h_bounded : IsVonNBounded 𝕜 (Set.range fun n : ℕ => (n : 𝕜) • u n) := h_tendsto.cauchySeq.totallyBounded_range.isVonNBounded 𝕜 -- Since `range u` is bounded, `V` absorbs it rcases (hf _ h_bounded hV).exists_pos with ⟨r, hr, h'⟩ cases' exists_nat_gt r with n hn -- We now find a contradiction between `f (u n) ∉ V` and the absorbing property have h1 : r ≤ ‖(n : 𝕜')‖ := by rw [RCLike.norm_natCast] exact hn.le have hn' : 0 < ‖(n : 𝕜')‖ := lt_of_lt_of_le hr h1 rw [norm_pos_iff, Ne, Nat.cast_eq_zero] at hn' have h'' : f (u n) ∈ V := by simp only [Set.image_subset_iff] at h' specialize h' (n : 𝕜') h1 (Set.mem_range_self n) simp only [Set.mem_preimage, LinearMap.map_smulₛₗ, map_natCast] at h' rcases h' with ⟨y, hy, h'⟩ apply_fun fun y : F => (n : 𝕜')⁻¹ • y at h' simp only [hn', inv_smul_smul₀, Ne, Nat.cast_eq_zero, not_false_iff] at h' rwa [← h'] exact hu' n hn' h''
69
925,378,172,558,778,900,000,000,000,000
2
2
1
2,371
import Mathlib.MeasureTheory.Measure.VectorMeasure #align_import measure_theory.measure.complex from "leanprover-community/mathlib"@"17b3357baa47f48697ca9c243e300eb8cdd16a15" noncomputable section open scoped Classical MeasureTheory ENNReal NNReal variable {α β : Type*} {m : MeasurableSpace α} namespace MeasureTheory open VectorMeasure namespace ComplexMeasure @[simps! apply] def re : ComplexMeasure α →ₗ[ℝ] SignedMeasure α := mapRangeₗ Complex.reCLM Complex.continuous_re #align measure_theory.complex_measure.re MeasureTheory.ComplexMeasure.re @[simps! apply] def im : ComplexMeasure α →ₗ[ℝ] SignedMeasure α := mapRangeₗ Complex.imCLM Complex.continuous_im #align measure_theory.complex_measure.im MeasureTheory.ComplexMeasure.im @[simps!] def _root_.MeasureTheory.SignedMeasure.toComplexMeasure (s t : SignedMeasure α) : ComplexMeasure α where measureOf' i := ⟨s i, t i⟩ empty' := by dsimp only; rw [s.empty, t.empty]; rfl not_measurable' i hi := by dsimp only; rw [s.not_measurable hi, t.not_measurable hi]; rfl m_iUnion' f hf hfdisj := (Complex.hasSum_iff _ _).2 ⟨s.m_iUnion hf hfdisj, t.m_iUnion hf hfdisj⟩ #align measure_theory.signed_measure.to_complex_measure MeasureTheory.SignedMeasure.toComplexMeasure theorem _root_.MeasureTheory.SignedMeasure.toComplexMeasure_apply {s t : SignedMeasure α} {i : Set α} : s.toComplexMeasure t i = ⟨s i, t i⟩ := rfl #align measure_theory.signed_measure.to_complex_measure_apply MeasureTheory.SignedMeasure.toComplexMeasure_apply theorem toComplexMeasure_to_signedMeasure (c : ComplexMeasure α) : SignedMeasure.toComplexMeasure (ComplexMeasure.re c) (ComplexMeasure.im c) = c := rfl #align measure_theory.complex_measure.to_complex_measure_to_signed_measure MeasureTheory.ComplexMeasure.toComplexMeasure_to_signedMeasure theorem _root_.MeasureTheory.SignedMeasure.re_toComplexMeasure (s t : SignedMeasure α) : ComplexMeasure.re (SignedMeasure.toComplexMeasure s t) = s := rfl #align measure_theory.signed_measure.re_to_complex_measure MeasureTheory.SignedMeasure.re_toComplexMeasure theorem _root_.MeasureTheory.SignedMeasure.im_toComplexMeasure (s t : SignedMeasure α) : ComplexMeasure.im (SignedMeasure.toComplexMeasure s t) = t := rfl #align measure_theory.signed_measure.im_to_complex_measure MeasureTheory.SignedMeasure.im_toComplexMeasure @[simps] def equivSignedMeasure : ComplexMeasure α ≃ SignedMeasure α × SignedMeasure α where toFun c := ⟨ComplexMeasure.re c, ComplexMeasure.im c⟩ invFun := fun ⟨s, t⟩ => s.toComplexMeasure t left_inv c := c.toComplexMeasure_to_signedMeasure right_inv := fun ⟨s, t⟩ => Prod.mk.inj_iff.2 ⟨s.re_toComplexMeasure t, s.im_toComplexMeasure t⟩ #align measure_theory.complex_measure.equiv_signed_measure MeasureTheory.ComplexMeasure.equivSignedMeasure section variable {R : Type*} [Semiring R] [Module R ℝ] variable [ContinuousConstSMul R ℝ] [ContinuousConstSMul R ℂ] @[simps] def equivSignedMeasureₗ : ComplexMeasure α ≃ₗ[R] SignedMeasure α × SignedMeasure α := { equivSignedMeasure with map_add' := fun c d => by rfl map_smul' := by intro r c dsimp ext · simp [Complex.smul_re] · simp [Complex.smul_im] } #align measure_theory.complex_measure.equiv_signed_measureₗ MeasureTheory.ComplexMeasure.equivSignedMeasureₗ end
Mathlib/MeasureTheory/Measure/Complex.lean
116
122
theorem absolutelyContinuous_ennreal_iff (c : ComplexMeasure α) (μ : VectorMeasure α ℝ≥0∞) : c ≪ᵥ μ ↔ ComplexMeasure.re c ≪ᵥ μ ∧ ComplexMeasure.im c ≪ᵥ μ := by
constructor <;> intro h · constructor <;> · intro i hi; simp [h hi] · intro i hi rw [← Complex.re_add_im (c i), (_ : (c i).re = 0), (_ : (c i).im = 0)] exacts [by simp, h.2 hi, h.1 hi]
5
148.413159
2
2
1
2,372
import Mathlib.Analysis.InnerProductSpace.Adjoint import Mathlib.Topology.Algebra.Module.Basic #align_import analysis.inner_product_space.linear_pmap from "leanprover-community/mathlib"@"8b981918a93bc45a8600de608cde7944a80d92b9" noncomputable section open RCLike open scoped ComplexConjugate Classical variable {𝕜 E F G : Type*} [RCLike 𝕜] variable [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] variable [NormedAddCommGroup F] [InnerProductSpace 𝕜 F] local notation "⟪" x ", " y "⟫" => @inner 𝕜 _ _ x y namespace LinearPMap def IsFormalAdjoint (T : E →ₗ.[𝕜] F) (S : F →ₗ.[𝕜] E) : Prop := ∀ (x : T.domain) (y : S.domain), ⟪T x, y⟫ = ⟪(x : E), S y⟫ #align linear_pmap.is_formal_adjoint LinearPMap.IsFormalAdjoint variable {T : E →ₗ.[𝕜] F} {S : F →ₗ.[𝕜] E} @[symm] protected theorem IsFormalAdjoint.symm (h : T.IsFormalAdjoint S) : S.IsFormalAdjoint T := fun y _ => by rw [← inner_conj_symm, ← inner_conj_symm (y : F), h] #align linear_pmap.is_formal_adjoint.symm LinearPMap.IsFormalAdjoint.symm variable (T) def adjointDomain : Submodule 𝕜 F where carrier := {y | Continuous ((innerₛₗ 𝕜 y).comp T.toFun)} zero_mem' := by rw [Set.mem_setOf_eq, LinearMap.map_zero, LinearMap.zero_comp] exact continuous_zero add_mem' hx hy := by rw [Set.mem_setOf_eq, LinearMap.map_add] at *; exact hx.add hy smul_mem' a x hx := by rw [Set.mem_setOf_eq, LinearMap.map_smulₛₗ] at * exact hx.const_smul (conj a) #align linear_pmap.adjoint_domain LinearPMap.adjointDomain def adjointDomainMkCLM (y : T.adjointDomain) : T.domain →L[𝕜] 𝕜 := ⟨(innerₛₗ 𝕜 (y : F)).comp T.toFun, y.prop⟩ #align linear_pmap.adjoint_domain_mk_clm LinearPMap.adjointDomainMkCLM theorem adjointDomainMkCLM_apply (y : T.adjointDomain) (x : T.domain) : adjointDomainMkCLM T y x = ⟪(y : F), T x⟫ := rfl #align linear_pmap.adjoint_domain_mk_clm_apply LinearPMap.adjointDomainMkCLM_apply variable {T} variable (hT : Dense (T.domain : Set E)) def adjointDomainMkCLMExtend (y : T.adjointDomain) : E →L[𝕜] 𝕜 := (T.adjointDomainMkCLM y).extend (Submodule.subtypeL T.domain) hT.denseRange_val uniformEmbedding_subtype_val.toUniformInducing #align linear_pmap.adjoint_domain_mk_clm_extend LinearPMap.adjointDomainMkCLMExtend @[simp] theorem adjointDomainMkCLMExtend_apply (y : T.adjointDomain) (x : T.domain) : adjointDomainMkCLMExtend hT y (x : E) = ⟪(y : F), T x⟫ := ContinuousLinearMap.extend_eq _ _ _ _ _ #align linear_pmap.adjoint_domain_mk_clm_extend_apply LinearPMap.adjointDomainMkCLMExtend_apply variable [CompleteSpace E] def adjointAux : T.adjointDomain →ₗ[𝕜] E where toFun y := (InnerProductSpace.toDual 𝕜 E).symm (adjointDomainMkCLMExtend hT y) map_add' x y := hT.eq_of_inner_left fun _ => by simp only [inner_add_left, Submodule.coe_add, InnerProductSpace.toDual_symm_apply, adjointDomainMkCLMExtend_apply] map_smul' _ _ := hT.eq_of_inner_left fun _ => by simp only [inner_smul_left, Submodule.coe_smul_of_tower, RingHom.id_apply, InnerProductSpace.toDual_symm_apply, adjointDomainMkCLMExtend_apply] #align linear_pmap.adjoint_aux LinearPMap.adjointAux
Mathlib/Analysis/InnerProductSpace/LinearPMap.lean
140
147
theorem adjointAux_inner (y : T.adjointDomain) (x : T.domain) : ⟪adjointAux hT y, x⟫ = ⟪(y : F), T x⟫ := by
simp only [adjointAux, LinearMap.coe_mk, InnerProductSpace.toDual_symm_apply, adjointDomainMkCLMExtend_apply] -- Porting note(https://github.com/leanprover-community/mathlib4/issues/5026): -- mathlib3 was finished here simp only [AddHom.coe_mk, InnerProductSpace.toDual_symm_apply] rw [adjointDomainMkCLMExtend_apply]
6
403.428793
2
2
2
2,373
import Mathlib.Analysis.InnerProductSpace.Adjoint import Mathlib.Topology.Algebra.Module.Basic #align_import analysis.inner_product_space.linear_pmap from "leanprover-community/mathlib"@"8b981918a93bc45a8600de608cde7944a80d92b9" noncomputable section open RCLike open scoped ComplexConjugate Classical variable {𝕜 E F G : Type*} [RCLike 𝕜] variable [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] variable [NormedAddCommGroup F] [InnerProductSpace 𝕜 F] local notation "⟪" x ", " y "⟫" => @inner 𝕜 _ _ x y namespace LinearPMap def IsFormalAdjoint (T : E →ₗ.[𝕜] F) (S : F →ₗ.[𝕜] E) : Prop := ∀ (x : T.domain) (y : S.domain), ⟪T x, y⟫ = ⟪(x : E), S y⟫ #align linear_pmap.is_formal_adjoint LinearPMap.IsFormalAdjoint variable {T : E →ₗ.[𝕜] F} {S : F →ₗ.[𝕜] E} @[symm] protected theorem IsFormalAdjoint.symm (h : T.IsFormalAdjoint S) : S.IsFormalAdjoint T := fun y _ => by rw [← inner_conj_symm, ← inner_conj_symm (y : F), h] #align linear_pmap.is_formal_adjoint.symm LinearPMap.IsFormalAdjoint.symm variable (T) def adjointDomain : Submodule 𝕜 F where carrier := {y | Continuous ((innerₛₗ 𝕜 y).comp T.toFun)} zero_mem' := by rw [Set.mem_setOf_eq, LinearMap.map_zero, LinearMap.zero_comp] exact continuous_zero add_mem' hx hy := by rw [Set.mem_setOf_eq, LinearMap.map_add] at *; exact hx.add hy smul_mem' a x hx := by rw [Set.mem_setOf_eq, LinearMap.map_smulₛₗ] at * exact hx.const_smul (conj a) #align linear_pmap.adjoint_domain LinearPMap.adjointDomain def adjointDomainMkCLM (y : T.adjointDomain) : T.domain →L[𝕜] 𝕜 := ⟨(innerₛₗ 𝕜 (y : F)).comp T.toFun, y.prop⟩ #align linear_pmap.adjoint_domain_mk_clm LinearPMap.adjointDomainMkCLM theorem adjointDomainMkCLM_apply (y : T.adjointDomain) (x : T.domain) : adjointDomainMkCLM T y x = ⟪(y : F), T x⟫ := rfl #align linear_pmap.adjoint_domain_mk_clm_apply LinearPMap.adjointDomainMkCLM_apply variable {T} variable (hT : Dense (T.domain : Set E)) def adjointDomainMkCLMExtend (y : T.adjointDomain) : E →L[𝕜] 𝕜 := (T.adjointDomainMkCLM y).extend (Submodule.subtypeL T.domain) hT.denseRange_val uniformEmbedding_subtype_val.toUniformInducing #align linear_pmap.adjoint_domain_mk_clm_extend LinearPMap.adjointDomainMkCLMExtend @[simp] theorem adjointDomainMkCLMExtend_apply (y : T.adjointDomain) (x : T.domain) : adjointDomainMkCLMExtend hT y (x : E) = ⟪(y : F), T x⟫ := ContinuousLinearMap.extend_eq _ _ _ _ _ #align linear_pmap.adjoint_domain_mk_clm_extend_apply LinearPMap.adjointDomainMkCLMExtend_apply variable [CompleteSpace E] def adjointAux : T.adjointDomain →ₗ[𝕜] E where toFun y := (InnerProductSpace.toDual 𝕜 E).symm (adjointDomainMkCLMExtend hT y) map_add' x y := hT.eq_of_inner_left fun _ => by simp only [inner_add_left, Submodule.coe_add, InnerProductSpace.toDual_symm_apply, adjointDomainMkCLMExtend_apply] map_smul' _ _ := hT.eq_of_inner_left fun _ => by simp only [inner_smul_left, Submodule.coe_smul_of_tower, RingHom.id_apply, InnerProductSpace.toDual_symm_apply, adjointDomainMkCLMExtend_apply] #align linear_pmap.adjoint_aux LinearPMap.adjointAux theorem adjointAux_inner (y : T.adjointDomain) (x : T.domain) : ⟪adjointAux hT y, x⟫ = ⟪(y : F), T x⟫ := by simp only [adjointAux, LinearMap.coe_mk, InnerProductSpace.toDual_symm_apply, adjointDomainMkCLMExtend_apply] -- Porting note(https://github.com/leanprover-community/mathlib4/issues/5026): -- mathlib3 was finished here simp only [AddHom.coe_mk, InnerProductSpace.toDual_symm_apply] rw [adjointDomainMkCLMExtend_apply] #align linear_pmap.adjoint_aux_inner LinearPMap.adjointAux_inner theorem adjointAux_unique (y : T.adjointDomain) {x₀ : E} (hx₀ : ∀ x : T.domain, ⟪x₀, x⟫ = ⟪(y : F), T x⟫) : adjointAux hT y = x₀ := hT.eq_of_inner_left fun v => (adjointAux_inner hT _ _).trans (hx₀ v).symm #align linear_pmap.adjoint_aux_unique LinearPMap.adjointAux_unique variable (T) def adjoint : F →ₗ.[𝕜] E where domain := T.adjointDomain toFun := if hT : Dense (T.domain : Set E) then adjointAux hT else 0 #align linear_pmap.adjoint LinearPMap.adjoint scoped postfix:1024 "†" => LinearPMap.adjoint theorem mem_adjoint_domain_iff (y : F) : y ∈ T†.domain ↔ Continuous ((innerₛₗ 𝕜 y).comp T.toFun) := Iff.rfl #align linear_pmap.mem_adjoint_domain_iff LinearPMap.mem_adjoint_domain_iff variable {T}
Mathlib/Analysis/InnerProductSpace/LinearPMap.lean
171
178
theorem mem_adjoint_domain_of_exists (y : F) (h : ∃ w : E, ∀ x : T.domain, ⟪w, x⟫ = ⟪y, T x⟫) : y ∈ T†.domain := by
cases' h with w hw rw [T.mem_adjoint_domain_iff] -- Porting note: was `by continuity` have : Continuous ((innerSL 𝕜 w).comp T.domain.subtypeL) := ContinuousLinearMap.continuous _ convert this using 1 exact funext fun x => (hw x).symm
6
403.428793
2
2
2
2,373
import Mathlib.Analysis.Convex.Jensen import Mathlib.Analysis.Convex.Mul import Mathlib.Analysis.Convex.SpecificFunctions.Basic import Mathlib.Analysis.SpecialFunctions.Pow.NNReal #align_import analysis.mean_inequalities_pow from "leanprover-community/mathlib"@"ccdbfb6e5614667af5aa3ab2d50885e0ef44a46f" universe u v open Finset open scoped Classical open NNReal ENNReal noncomputable section variable {ι : Type u} (s : Finset ι) namespace Real theorem pow_arith_mean_le_arith_mean_pow (w z : ι → ℝ) (hw : ∀ i ∈ s, 0 ≤ w i) (hw' : ∑ i ∈ s, w i = 1) (hz : ∀ i ∈ s, 0 ≤ z i) (n : ℕ) : (∑ i ∈ s, w i * z i) ^ n ≤ ∑ i ∈ s, w i * z i ^ n := (convexOn_pow n).map_sum_le hw hw' hz #align real.pow_arith_mean_le_arith_mean_pow Real.pow_arith_mean_le_arith_mean_pow theorem pow_arith_mean_le_arith_mean_pow_of_even (w z : ι → ℝ) (hw : ∀ i ∈ s, 0 ≤ w i) (hw' : ∑ i ∈ s, w i = 1) {n : ℕ} (hn : Even n) : (∑ i ∈ s, w i * z i) ^ n ≤ ∑ i ∈ s, w i * z i ^ n := hn.convexOn_pow.map_sum_le hw hw' fun _ _ => Set.mem_univ _ #align real.pow_arith_mean_le_arith_mean_pow_of_even Real.pow_arith_mean_le_arith_mean_pow_of_even
Mathlib/Analysis/MeanInequalitiesPow.lean
72
86
theorem pow_sum_div_card_le_sum_pow {f : ι → ℝ} (n : ℕ) (hf : ∀ a ∈ s, 0 ≤ f a) : (∑ x ∈ s, f x) ^ (n + 1) / (s.card : ℝ) ^ n ≤ ∑ x ∈ s, f x ^ (n + 1) := by
rcases s.eq_empty_or_nonempty with (rfl | hs) · simp_rw [Finset.sum_empty, zero_pow n.succ_ne_zero, zero_div]; rfl · have hs0 : 0 < (s.card : ℝ) := Nat.cast_pos.2 hs.card_pos suffices (∑ x ∈ s, f x / s.card) ^ (n + 1) ≤ ∑ x ∈ s, f x ^ (n + 1) / s.card by rwa [← Finset.sum_div, ← Finset.sum_div, div_pow, pow_succ (s.card : ℝ), ← div_div, div_le_iff hs0, div_mul, div_self hs0.ne', div_one] at this have := @ConvexOn.map_sum_le ℝ ℝ ℝ ι _ _ _ _ _ _ (Set.Ici 0) (fun x => x ^ (n + 1)) s (fun _ => 1 / s.card) ((↑) ∘ f) (convexOn_pow (n + 1)) ?_ ?_ fun i hi => Set.mem_Ici.2 (hf i hi) · simpa only [inv_mul_eq_div, one_div, Algebra.id.smul_eq_mul] using this · simp only [one_div, inv_nonneg, Nat.cast_nonneg, imp_true_iff] · simpa only [one_div, Finset.sum_const, nsmul_eq_mul] using mul_inv_cancel hs0.ne'
13
442,413.392009
2
2
2
2,374
import Mathlib.Analysis.Convex.Jensen import Mathlib.Analysis.Convex.Mul import Mathlib.Analysis.Convex.SpecificFunctions.Basic import Mathlib.Analysis.SpecialFunctions.Pow.NNReal #align_import analysis.mean_inequalities_pow from "leanprover-community/mathlib"@"ccdbfb6e5614667af5aa3ab2d50885e0ef44a46f" universe u v open Finset open scoped Classical open NNReal ENNReal noncomputable section variable {ι : Type u} (s : Finset ι) namespace Real theorem pow_arith_mean_le_arith_mean_pow (w z : ι → ℝ) (hw : ∀ i ∈ s, 0 ≤ w i) (hw' : ∑ i ∈ s, w i = 1) (hz : ∀ i ∈ s, 0 ≤ z i) (n : ℕ) : (∑ i ∈ s, w i * z i) ^ n ≤ ∑ i ∈ s, w i * z i ^ n := (convexOn_pow n).map_sum_le hw hw' hz #align real.pow_arith_mean_le_arith_mean_pow Real.pow_arith_mean_le_arith_mean_pow theorem pow_arith_mean_le_arith_mean_pow_of_even (w z : ι → ℝ) (hw : ∀ i ∈ s, 0 ≤ w i) (hw' : ∑ i ∈ s, w i = 1) {n : ℕ} (hn : Even n) : (∑ i ∈ s, w i * z i) ^ n ≤ ∑ i ∈ s, w i * z i ^ n := hn.convexOn_pow.map_sum_le hw hw' fun _ _ => Set.mem_univ _ #align real.pow_arith_mean_le_arith_mean_pow_of_even Real.pow_arith_mean_le_arith_mean_pow_of_even theorem pow_sum_div_card_le_sum_pow {f : ι → ℝ} (n : ℕ) (hf : ∀ a ∈ s, 0 ≤ f a) : (∑ x ∈ s, f x) ^ (n + 1) / (s.card : ℝ) ^ n ≤ ∑ x ∈ s, f x ^ (n + 1) := by rcases s.eq_empty_or_nonempty with (rfl | hs) · simp_rw [Finset.sum_empty, zero_pow n.succ_ne_zero, zero_div]; rfl · have hs0 : 0 < (s.card : ℝ) := Nat.cast_pos.2 hs.card_pos suffices (∑ x ∈ s, f x / s.card) ^ (n + 1) ≤ ∑ x ∈ s, f x ^ (n + 1) / s.card by rwa [← Finset.sum_div, ← Finset.sum_div, div_pow, pow_succ (s.card : ℝ), ← div_div, div_le_iff hs0, div_mul, div_self hs0.ne', div_one] at this have := @ConvexOn.map_sum_le ℝ ℝ ℝ ι _ _ _ _ _ _ (Set.Ici 0) (fun x => x ^ (n + 1)) s (fun _ => 1 / s.card) ((↑) ∘ f) (convexOn_pow (n + 1)) ?_ ?_ fun i hi => Set.mem_Ici.2 (hf i hi) · simpa only [inv_mul_eq_div, one_div, Algebra.id.smul_eq_mul] using this · simp only [one_div, inv_nonneg, Nat.cast_nonneg, imp_true_iff] · simpa only [one_div, Finset.sum_const, nsmul_eq_mul] using mul_inv_cancel hs0.ne' #align real.pow_sum_div_card_le_sum_pow Real.pow_sum_div_card_le_sum_pow theorem zpow_arith_mean_le_arith_mean_zpow (w z : ι → ℝ) (hw : ∀ i ∈ s, 0 ≤ w i) (hw' : ∑ i ∈ s, w i = 1) (hz : ∀ i ∈ s, 0 < z i) (m : ℤ) : (∑ i ∈ s, w i * z i) ^ m ≤ ∑ i ∈ s, w i * z i ^ m := (convexOn_zpow m).map_sum_le hw hw' hz #align real.zpow_arith_mean_le_arith_mean_zpow Real.zpow_arith_mean_le_arith_mean_zpow theorem rpow_arith_mean_le_arith_mean_rpow (w z : ι → ℝ) (hw : ∀ i ∈ s, 0 ≤ w i) (hw' : ∑ i ∈ s, w i = 1) (hz : ∀ i ∈ s, 0 ≤ z i) {p : ℝ} (hp : 1 ≤ p) : (∑ i ∈ s, w i * z i) ^ p ≤ ∑ i ∈ s, w i * z i ^ p := (convexOn_rpow hp).map_sum_le hw hw' hz #align real.rpow_arith_mean_le_arith_mean_rpow Real.rpow_arith_mean_le_arith_mean_rpow
Mathlib/Analysis/MeanInequalitiesPow.lean
101
110
theorem arith_mean_le_rpow_mean (w z : ι → ℝ) (hw : ∀ i ∈ s, 0 ≤ w i) (hw' : ∑ i ∈ s, w i = 1) (hz : ∀ i ∈ s, 0 ≤ z i) {p : ℝ} (hp : 1 ≤ p) : ∑ i ∈ s, w i * z i ≤ (∑ i ∈ s, w i * z i ^ p) ^ (1 / p) := by
have : 0 < p := by positivity rw [← rpow_le_rpow_iff _ _ this, ← rpow_mul, one_div_mul_cancel (ne_of_gt this), rpow_one] · exact rpow_arith_mean_le_arith_mean_rpow s w z hw hw' hz hp all_goals apply_rules [sum_nonneg, rpow_nonneg] intro i hi apply_rules [mul_nonneg, rpow_nonneg, hw i hi, hz i hi]
7
1,096.633158
2
2
2
2,374
import Mathlib.Analysis.Normed.Group.Quotient import Mathlib.Topology.Instances.AddCircle #align_import analysis.normed.group.add_circle from "leanprover-community/mathlib"@"084f76e20c88eae536222583331abd9468b08e1c" noncomputable section open Set open Int hiding mem_zmultiples_iff open AddSubgroup namespace AddCircle variable (p : ℝ) instance : NormedAddCommGroup (AddCircle p) := AddSubgroup.normedAddCommGroupQuotient _ @[simp]
Mathlib/Analysis/Normed/Group/AddCircle.lean
44
68
theorem norm_coe_mul (x : ℝ) (t : ℝ) : ‖(↑(t * x) : AddCircle (t * p))‖ = |t| * ‖(x : AddCircle p)‖ := by
have aux : ∀ {a b c : ℝ}, a ∈ zmultiples b → c * a ∈ zmultiples (c * b) := fun {a b c} h => by simp only [mem_zmultiples_iff] at h ⊢ obtain ⟨n, rfl⟩ := h exact ⟨n, (mul_smul_comm n c b).symm⟩ rcases eq_or_ne t 0 with (rfl | ht); · simp have ht' : |t| ≠ 0 := (not_congr abs_eq_zero).mpr ht simp only [quotient_norm_eq, Real.norm_eq_abs] conv_rhs => rw [← smul_eq_mul, ← Real.sInf_smul_of_nonneg (abs_nonneg t)] simp only [QuotientAddGroup.mk'_apply, QuotientAddGroup.eq_iff_sub_mem] congr 1 ext z rw [mem_smul_set_iff_inv_smul_mem₀ ht'] show (∃ y, y - t * x ∈ zmultiples (t * p) ∧ |y| = z) ↔ ∃ w, w - x ∈ zmultiples p ∧ |w| = |t|⁻¹ * z constructor · rintro ⟨y, hy, rfl⟩ refine ⟨t⁻¹ * y, ?_, by rw [abs_mul, abs_inv]⟩ rw [← inv_mul_cancel_left₀ ht x, ← inv_mul_cancel_left₀ ht p, ← mul_sub] exact aux hy · rintro ⟨w, hw, hw'⟩ refine ⟨t * w, ?_, by rw [← (eq_inv_mul_iff_mul_eq₀ ht').mp hw', abs_mul]⟩ rw [← mul_sub] exact aux hw
23
9,744,803,446.248903
2
2
5
2,375
import Mathlib.Analysis.Normed.Group.Quotient import Mathlib.Topology.Instances.AddCircle #align_import analysis.normed.group.add_circle from "leanprover-community/mathlib"@"084f76e20c88eae536222583331abd9468b08e1c" noncomputable section open Set open Int hiding mem_zmultiples_iff open AddSubgroup namespace AddCircle variable (p : ℝ) instance : NormedAddCommGroup (AddCircle p) := AddSubgroup.normedAddCommGroupQuotient _ @[simp] theorem norm_coe_mul (x : ℝ) (t : ℝ) : ‖(↑(t * x) : AddCircle (t * p))‖ = |t| * ‖(x : AddCircle p)‖ := by have aux : ∀ {a b c : ℝ}, a ∈ zmultiples b → c * a ∈ zmultiples (c * b) := fun {a b c} h => by simp only [mem_zmultiples_iff] at h ⊢ obtain ⟨n, rfl⟩ := h exact ⟨n, (mul_smul_comm n c b).symm⟩ rcases eq_or_ne t 0 with (rfl | ht); · simp have ht' : |t| ≠ 0 := (not_congr abs_eq_zero).mpr ht simp only [quotient_norm_eq, Real.norm_eq_abs] conv_rhs => rw [← smul_eq_mul, ← Real.sInf_smul_of_nonneg (abs_nonneg t)] simp only [QuotientAddGroup.mk'_apply, QuotientAddGroup.eq_iff_sub_mem] congr 1 ext z rw [mem_smul_set_iff_inv_smul_mem₀ ht'] show (∃ y, y - t * x ∈ zmultiples (t * p) ∧ |y| = z) ↔ ∃ w, w - x ∈ zmultiples p ∧ |w| = |t|⁻¹ * z constructor · rintro ⟨y, hy, rfl⟩ refine ⟨t⁻¹ * y, ?_, by rw [abs_mul, abs_inv]⟩ rw [← inv_mul_cancel_left₀ ht x, ← inv_mul_cancel_left₀ ht p, ← mul_sub] exact aux hy · rintro ⟨w, hw, hw'⟩ refine ⟨t * w, ?_, by rw [← (eq_inv_mul_iff_mul_eq₀ ht').mp hw', abs_mul]⟩ rw [← mul_sub] exact aux hw #align add_circle.norm_coe_mul AddCircle.norm_coe_mul
Mathlib/Analysis/Normed/Group/AddCircle.lean
71
75
theorem norm_neg_period (x : ℝ) : ‖(x : AddCircle (-p))‖ = ‖(x : AddCircle p)‖ := by
suffices ‖(↑(-1 * x) : AddCircle (-1 * p))‖ = ‖(x : AddCircle p)‖ by rw [← this, neg_one_mul] simp simp only [norm_coe_mul, abs_neg, abs_one, one_mul]
4
54.59815
2
2
5
2,375
import Mathlib.Analysis.Normed.Group.Quotient import Mathlib.Topology.Instances.AddCircle #align_import analysis.normed.group.add_circle from "leanprover-community/mathlib"@"084f76e20c88eae536222583331abd9468b08e1c" noncomputable section open Set open Int hiding mem_zmultiples_iff open AddSubgroup namespace AddCircle variable (p : ℝ) instance : NormedAddCommGroup (AddCircle p) := AddSubgroup.normedAddCommGroupQuotient _ @[simp] theorem norm_coe_mul (x : ℝ) (t : ℝ) : ‖(↑(t * x) : AddCircle (t * p))‖ = |t| * ‖(x : AddCircle p)‖ := by have aux : ∀ {a b c : ℝ}, a ∈ zmultiples b → c * a ∈ zmultiples (c * b) := fun {a b c} h => by simp only [mem_zmultiples_iff] at h ⊢ obtain ⟨n, rfl⟩ := h exact ⟨n, (mul_smul_comm n c b).symm⟩ rcases eq_or_ne t 0 with (rfl | ht); · simp have ht' : |t| ≠ 0 := (not_congr abs_eq_zero).mpr ht simp only [quotient_norm_eq, Real.norm_eq_abs] conv_rhs => rw [← smul_eq_mul, ← Real.sInf_smul_of_nonneg (abs_nonneg t)] simp only [QuotientAddGroup.mk'_apply, QuotientAddGroup.eq_iff_sub_mem] congr 1 ext z rw [mem_smul_set_iff_inv_smul_mem₀ ht'] show (∃ y, y - t * x ∈ zmultiples (t * p) ∧ |y| = z) ↔ ∃ w, w - x ∈ zmultiples p ∧ |w| = |t|⁻¹ * z constructor · rintro ⟨y, hy, rfl⟩ refine ⟨t⁻¹ * y, ?_, by rw [abs_mul, abs_inv]⟩ rw [← inv_mul_cancel_left₀ ht x, ← inv_mul_cancel_left₀ ht p, ← mul_sub] exact aux hy · rintro ⟨w, hw, hw'⟩ refine ⟨t * w, ?_, by rw [← (eq_inv_mul_iff_mul_eq₀ ht').mp hw', abs_mul]⟩ rw [← mul_sub] exact aux hw #align add_circle.norm_coe_mul AddCircle.norm_coe_mul theorem norm_neg_period (x : ℝ) : ‖(x : AddCircle (-p))‖ = ‖(x : AddCircle p)‖ := by suffices ‖(↑(-1 * x) : AddCircle (-1 * p))‖ = ‖(x : AddCircle p)‖ by rw [← this, neg_one_mul] simp simp only [norm_coe_mul, abs_neg, abs_one, one_mul] #align add_circle.norm_neg_period AddCircle.norm_neg_period @[simp]
Mathlib/Analysis/Normed/Group/AddCircle.lean
79
83
theorem norm_eq_of_zero {x : ℝ} : ‖(x : AddCircle (0 : ℝ))‖ = |x| := by
suffices { y : ℝ | (y : AddCircle (0 : ℝ)) = (x : AddCircle (0 : ℝ)) } = {x} by rw [quotient_norm_eq, this, image_singleton, Real.norm_eq_abs, csInf_singleton] ext y simp [QuotientAddGroup.eq_iff_sub_mem, mem_zmultiples_iff, sub_eq_zero]
4
54.59815
2
2
5
2,375
import Mathlib.Analysis.Normed.Group.Quotient import Mathlib.Topology.Instances.AddCircle #align_import analysis.normed.group.add_circle from "leanprover-community/mathlib"@"084f76e20c88eae536222583331abd9468b08e1c" noncomputable section open Set open Int hiding mem_zmultiples_iff open AddSubgroup namespace AddCircle variable (p : ℝ) instance : NormedAddCommGroup (AddCircle p) := AddSubgroup.normedAddCommGroupQuotient _ @[simp] theorem norm_coe_mul (x : ℝ) (t : ℝ) : ‖(↑(t * x) : AddCircle (t * p))‖ = |t| * ‖(x : AddCircle p)‖ := by have aux : ∀ {a b c : ℝ}, a ∈ zmultiples b → c * a ∈ zmultiples (c * b) := fun {a b c} h => by simp only [mem_zmultiples_iff] at h ⊢ obtain ⟨n, rfl⟩ := h exact ⟨n, (mul_smul_comm n c b).symm⟩ rcases eq_or_ne t 0 with (rfl | ht); · simp have ht' : |t| ≠ 0 := (not_congr abs_eq_zero).mpr ht simp only [quotient_norm_eq, Real.norm_eq_abs] conv_rhs => rw [← smul_eq_mul, ← Real.sInf_smul_of_nonneg (abs_nonneg t)] simp only [QuotientAddGroup.mk'_apply, QuotientAddGroup.eq_iff_sub_mem] congr 1 ext z rw [mem_smul_set_iff_inv_smul_mem₀ ht'] show (∃ y, y - t * x ∈ zmultiples (t * p) ∧ |y| = z) ↔ ∃ w, w - x ∈ zmultiples p ∧ |w| = |t|⁻¹ * z constructor · rintro ⟨y, hy, rfl⟩ refine ⟨t⁻¹ * y, ?_, by rw [abs_mul, abs_inv]⟩ rw [← inv_mul_cancel_left₀ ht x, ← inv_mul_cancel_left₀ ht p, ← mul_sub] exact aux hy · rintro ⟨w, hw, hw'⟩ refine ⟨t * w, ?_, by rw [← (eq_inv_mul_iff_mul_eq₀ ht').mp hw', abs_mul]⟩ rw [← mul_sub] exact aux hw #align add_circle.norm_coe_mul AddCircle.norm_coe_mul theorem norm_neg_period (x : ℝ) : ‖(x : AddCircle (-p))‖ = ‖(x : AddCircle p)‖ := by suffices ‖(↑(-1 * x) : AddCircle (-1 * p))‖ = ‖(x : AddCircle p)‖ by rw [← this, neg_one_mul] simp simp only [norm_coe_mul, abs_neg, abs_one, one_mul] #align add_circle.norm_neg_period AddCircle.norm_neg_period @[simp] theorem norm_eq_of_zero {x : ℝ} : ‖(x : AddCircle (0 : ℝ))‖ = |x| := by suffices { y : ℝ | (y : AddCircle (0 : ℝ)) = (x : AddCircle (0 : ℝ)) } = {x} by rw [quotient_norm_eq, this, image_singleton, Real.norm_eq_abs, csInf_singleton] ext y simp [QuotientAddGroup.eq_iff_sub_mem, mem_zmultiples_iff, sub_eq_zero] #align add_circle.norm_eq_of_zero AddCircle.norm_eq_of_zero
Mathlib/Analysis/Normed/Group/AddCircle.lean
86
117
theorem norm_eq {x : ℝ} : ‖(x : AddCircle p)‖ = |x - round (p⁻¹ * x) * p| := by
suffices ∀ x : ℝ, ‖(x : AddCircle (1 : ℝ))‖ = |x - round x| by rcases eq_or_ne p 0 with (rfl | hp) · simp have hx := norm_coe_mul p x p⁻¹ rw [abs_inv, eq_inv_mul_iff_mul_eq₀ ((not_congr abs_eq_zero).mpr hp)] at hx rw [← hx, inv_mul_cancel hp, this, ← abs_mul, mul_sub, mul_inv_cancel_left₀ hp, mul_comm p] clear! x p intros x rw [quotient_norm_eq, abs_sub_round_eq_min] have h₁ : BddBelow (abs '' { m : ℝ | (m : AddCircle (1 : ℝ)) = x }) := ⟨0, by simp [mem_lowerBounds]⟩ have h₂ : (abs '' { m : ℝ | (m : AddCircle (1 : ℝ)) = x }).Nonempty := ⟨|x|, ⟨x, rfl, rfl⟩⟩ apply le_antisymm · simp_rw [Real.norm_eq_abs, csInf_le_iff h₁ h₂, le_min_iff] intro b h refine ⟨mem_lowerBounds.1 h _ ⟨fract x, ?_, abs_fract⟩, mem_lowerBounds.1 h _ ⟨fract x - 1, ?_, by rw [abs_sub_comm, abs_one_sub_fract]⟩⟩ · simp only [mem_setOf, fract, sub_eq_self, QuotientAddGroup.mk_sub, QuotientAddGroup.eq_zero_iff, intCast_mem_zmultiples_one] · simp only [mem_setOf, fract, sub_eq_self, QuotientAddGroup.mk_sub, QuotientAddGroup.eq_zero_iff, intCast_mem_zmultiples_one, sub_sub, (by norm_cast : (⌊x⌋ : ℝ) + 1 = (↑(⌊x⌋ + 1) : ℝ))] · simp only [QuotientAddGroup.mk'_apply, Real.norm_eq_abs, le_csInf_iff h₁ h₂] rintro b' ⟨b, hb, rfl⟩ simp only [mem_setOf, QuotientAddGroup.eq_iff_sub_mem, mem_zmultiples_iff, smul_one_eq_cast] at hb obtain ⟨z, hz⟩ := hb rw [(by rw [hz]; abel : x = b - z), fract_sub_int, ← abs_sub_round_eq_min] convert round_le b 0 simp
31
29,048,849,665,247.426
2
2
5
2,375
import Mathlib.Analysis.Normed.Group.Quotient import Mathlib.Topology.Instances.AddCircle #align_import analysis.normed.group.add_circle from "leanprover-community/mathlib"@"084f76e20c88eae536222583331abd9468b08e1c" noncomputable section open Set open Int hiding mem_zmultiples_iff open AddSubgroup namespace AddCircle variable (p : ℝ) instance : NormedAddCommGroup (AddCircle p) := AddSubgroup.normedAddCommGroupQuotient _ @[simp] theorem norm_coe_mul (x : ℝ) (t : ℝ) : ‖(↑(t * x) : AddCircle (t * p))‖ = |t| * ‖(x : AddCircle p)‖ := by have aux : ∀ {a b c : ℝ}, a ∈ zmultiples b → c * a ∈ zmultiples (c * b) := fun {a b c} h => by simp only [mem_zmultiples_iff] at h ⊢ obtain ⟨n, rfl⟩ := h exact ⟨n, (mul_smul_comm n c b).symm⟩ rcases eq_or_ne t 0 with (rfl | ht); · simp have ht' : |t| ≠ 0 := (not_congr abs_eq_zero).mpr ht simp only [quotient_norm_eq, Real.norm_eq_abs] conv_rhs => rw [← smul_eq_mul, ← Real.sInf_smul_of_nonneg (abs_nonneg t)] simp only [QuotientAddGroup.mk'_apply, QuotientAddGroup.eq_iff_sub_mem] congr 1 ext z rw [mem_smul_set_iff_inv_smul_mem₀ ht'] show (∃ y, y - t * x ∈ zmultiples (t * p) ∧ |y| = z) ↔ ∃ w, w - x ∈ zmultiples p ∧ |w| = |t|⁻¹ * z constructor · rintro ⟨y, hy, rfl⟩ refine ⟨t⁻¹ * y, ?_, by rw [abs_mul, abs_inv]⟩ rw [← inv_mul_cancel_left₀ ht x, ← inv_mul_cancel_left₀ ht p, ← mul_sub] exact aux hy · rintro ⟨w, hw, hw'⟩ refine ⟨t * w, ?_, by rw [← (eq_inv_mul_iff_mul_eq₀ ht').mp hw', abs_mul]⟩ rw [← mul_sub] exact aux hw #align add_circle.norm_coe_mul AddCircle.norm_coe_mul theorem norm_neg_period (x : ℝ) : ‖(x : AddCircle (-p))‖ = ‖(x : AddCircle p)‖ := by suffices ‖(↑(-1 * x) : AddCircle (-1 * p))‖ = ‖(x : AddCircle p)‖ by rw [← this, neg_one_mul] simp simp only [norm_coe_mul, abs_neg, abs_one, one_mul] #align add_circle.norm_neg_period AddCircle.norm_neg_period @[simp] theorem norm_eq_of_zero {x : ℝ} : ‖(x : AddCircle (0 : ℝ))‖ = |x| := by suffices { y : ℝ | (y : AddCircle (0 : ℝ)) = (x : AddCircle (0 : ℝ)) } = {x} by rw [quotient_norm_eq, this, image_singleton, Real.norm_eq_abs, csInf_singleton] ext y simp [QuotientAddGroup.eq_iff_sub_mem, mem_zmultiples_iff, sub_eq_zero] #align add_circle.norm_eq_of_zero AddCircle.norm_eq_of_zero theorem norm_eq {x : ℝ} : ‖(x : AddCircle p)‖ = |x - round (p⁻¹ * x) * p| := by suffices ∀ x : ℝ, ‖(x : AddCircle (1 : ℝ))‖ = |x - round x| by rcases eq_or_ne p 0 with (rfl | hp) · simp have hx := norm_coe_mul p x p⁻¹ rw [abs_inv, eq_inv_mul_iff_mul_eq₀ ((not_congr abs_eq_zero).mpr hp)] at hx rw [← hx, inv_mul_cancel hp, this, ← abs_mul, mul_sub, mul_inv_cancel_left₀ hp, mul_comm p] clear! x p intros x rw [quotient_norm_eq, abs_sub_round_eq_min] have h₁ : BddBelow (abs '' { m : ℝ | (m : AddCircle (1 : ℝ)) = x }) := ⟨0, by simp [mem_lowerBounds]⟩ have h₂ : (abs '' { m : ℝ | (m : AddCircle (1 : ℝ)) = x }).Nonempty := ⟨|x|, ⟨x, rfl, rfl⟩⟩ apply le_antisymm · simp_rw [Real.norm_eq_abs, csInf_le_iff h₁ h₂, le_min_iff] intro b h refine ⟨mem_lowerBounds.1 h _ ⟨fract x, ?_, abs_fract⟩, mem_lowerBounds.1 h _ ⟨fract x - 1, ?_, by rw [abs_sub_comm, abs_one_sub_fract]⟩⟩ · simp only [mem_setOf, fract, sub_eq_self, QuotientAddGroup.mk_sub, QuotientAddGroup.eq_zero_iff, intCast_mem_zmultiples_one] · simp only [mem_setOf, fract, sub_eq_self, QuotientAddGroup.mk_sub, QuotientAddGroup.eq_zero_iff, intCast_mem_zmultiples_one, sub_sub, (by norm_cast : (⌊x⌋ : ℝ) + 1 = (↑(⌊x⌋ + 1) : ℝ))] · simp only [QuotientAddGroup.mk'_apply, Real.norm_eq_abs, le_csInf_iff h₁ h₂] rintro b' ⟨b, hb, rfl⟩ simp only [mem_setOf, QuotientAddGroup.eq_iff_sub_mem, mem_zmultiples_iff, smul_one_eq_cast] at hb obtain ⟨z, hz⟩ := hb rw [(by rw [hz]; abel : x = b - z), fract_sub_int, ← abs_sub_round_eq_min] convert round_le b 0 simp #align add_circle.norm_eq AddCircle.norm_eq
Mathlib/Analysis/Normed/Group/AddCircle.lean
120
124
theorem norm_eq' (hp : 0 < p) {x : ℝ} : ‖(x : AddCircle p)‖ = p * |p⁻¹ * x - round (p⁻¹ * x)| := by
conv_rhs => congr rw [← abs_eq_self.mpr hp.le] rw [← abs_mul, mul_sub, mul_inv_cancel_left₀ hp.ne.symm, norm_eq, mul_comm p]
4
54.59815
2
2
5
2,375
import Mathlib.MeasureTheory.Integral.IntervalIntegral #align_import measure_theory.integral.layercake from "leanprover-community/mathlib"@"08a4542bec7242a5c60f179e4e49de8c0d677b1b" noncomputable section open scoped ENNReal MeasureTheory Topology open Set MeasureTheory Filter Measure namespace MeasureTheory section variable {α R : Type*} [MeasurableSpace α] (μ : Measure α) [LinearOrder R]
Mathlib/MeasureTheory/Integral/Layercake.lean
73
82
theorem countable_meas_le_ne_meas_lt (g : α → R) : {t : R | μ {a : α | t ≤ g a} ≠ μ {a : α | t < g a}}.Countable := by
-- the target set is contained in the set of points where the function `t ↦ μ {a : α | t ≤ g a}` -- jumps down on the right of `t`. This jump set is countable for any function. let F : R → ℝ≥0∞ := fun t ↦ μ {a : α | t ≤ g a} apply (countable_image_gt_image_Ioi F).mono intro t ht have : μ {a | t < g a} < μ {a | t ≤ g a} := lt_of_le_of_ne (measure_mono (fun a ha ↦ le_of_lt ha)) (Ne.symm ht) exact ⟨μ {a | t < g a}, this, fun s hs ↦ measure_mono (fun a ha ↦ hs.trans_le ha)⟩
8
2,980.957987
2
2
2
2,376
import Mathlib.MeasureTheory.Integral.IntervalIntegral #align_import measure_theory.integral.layercake from "leanprover-community/mathlib"@"08a4542bec7242a5c60f179e4e49de8c0d677b1b" noncomputable section open scoped ENNReal MeasureTheory Topology open Set MeasureTheory Filter Measure namespace MeasureTheory section variable {α R : Type*} [MeasurableSpace α] (μ : Measure α) [LinearOrder R] theorem countable_meas_le_ne_meas_lt (g : α → R) : {t : R | μ {a : α | t ≤ g a} ≠ μ {a : α | t < g a}}.Countable := by -- the target set is contained in the set of points where the function `t ↦ μ {a : α | t ≤ g a}` -- jumps down on the right of `t`. This jump set is countable for any function. let F : R → ℝ≥0∞ := fun t ↦ μ {a : α | t ≤ g a} apply (countable_image_gt_image_Ioi F).mono intro t ht have : μ {a | t < g a} < μ {a | t ≤ g a} := lt_of_le_of_ne (measure_mono (fun a ha ↦ le_of_lt ha)) (Ne.symm ht) exact ⟨μ {a | t < g a}, this, fun s hs ↦ measure_mono (fun a ha ↦ hs.trans_le ha)⟩ theorem meas_le_ae_eq_meas_lt {R : Type*} [LinearOrder R] [MeasurableSpace R] (ν : Measure R) [NoAtoms ν] (g : α → R) : (fun t => μ {a : α | t ≤ g a}) =ᵐ[ν] fun t => μ {a : α | t < g a} := Set.Countable.measure_zero (countable_meas_le_ne_meas_lt μ g) _ end section Layercake variable {α : Type*} [MeasurableSpace α] {f : α → ℝ} {g : ℝ → ℝ} {s : Set α}
Mathlib/MeasureTheory/Integral/Layercake.lean
105
183
theorem lintegral_comp_eq_lintegral_meas_le_mul_of_measurable_of_sigmaFinite (μ : Measure α) [SigmaFinite μ] (f_nn : 0 ≤ f) (f_mble : Measurable f) (g_intble : ∀ t > 0, IntervalIntegrable g volume 0 t) (g_mble : Measurable g) (g_nn : ∀ t > 0, 0 ≤ g t) : ∫⁻ ω, ENNReal.ofReal (∫ t in (0)..f ω, g t) ∂μ = ∫⁻ t in Ioi 0, μ {a : α | t ≤ f a} * ENNReal.ofReal (g t) := by
have g_intble' : ∀ t : ℝ, 0 ≤ t → IntervalIntegrable g volume 0 t := by intro t ht cases' eq_or_lt_of_le ht with h h · simp [← h] · exact g_intble t h have integrand_eq : ∀ ω, ENNReal.ofReal (∫ t in (0)..f ω, g t) = ∫⁻ t in Ioc 0 (f ω), ENNReal.ofReal (g t) := by intro ω have g_ae_nn : 0 ≤ᵐ[volume.restrict (Ioc 0 (f ω))] g := by filter_upwards [self_mem_ae_restrict (measurableSet_Ioc : MeasurableSet (Ioc 0 (f ω)))] with x hx using g_nn x hx.1 rw [← ofReal_integral_eq_lintegral_ofReal (g_intble' (f ω) (f_nn ω)).1 g_ae_nn] congr exact intervalIntegral.integral_of_le (f_nn ω) rw [lintegral_congr integrand_eq] simp_rw [← lintegral_indicator (fun t => ENNReal.ofReal (g t)) measurableSet_Ioc] -- Porting note: was part of `simp_rw` on the previous line, but didn't trigger. rw [← lintegral_indicator _ measurableSet_Ioi, lintegral_lintegral_swap] · apply congr_arg funext s have aux₁ : (fun x => (Ioc 0 (f x)).indicator (fun t : ℝ => ENNReal.ofReal (g t)) s) = fun x => ENNReal.ofReal (g s) * (Ioi (0 : ℝ)).indicator (fun _ => 1) s * (Ici s).indicator (fun _ : ℝ => (1 : ℝ≥0∞)) (f x) := by funext a by_cases h : s ∈ Ioc (0 : ℝ) (f a) · simp only [h, show s ∈ Ioi (0 : ℝ) from h.1, show f a ∈ Ici s from h.2, indicator_of_mem, mul_one] · have h_copy := h simp only [mem_Ioc, not_and, not_le] at h by_cases h' : 0 < s · simp only [h_copy, h h', indicator_of_not_mem, not_false_iff, mem_Ici, not_le, mul_zero] · have : s ∉ Ioi (0 : ℝ) := h' simp only [this, h', indicator_of_not_mem, not_false_iff, mul_zero, zero_mul, mem_Ioc, false_and_iff] simp_rw [aux₁] rw [lintegral_const_mul'] swap; · apply ENNReal.mul_ne_top ENNReal.ofReal_ne_top by_cases h : (0 : ℝ) < s <;> · simp [h] simp_rw [show (fun a => (Ici s).indicator (fun _ : ℝ => (1 : ℝ≥0∞)) (f a)) = fun a => {a : α | s ≤ f a}.indicator (fun _ => 1) a by funext a; by_cases h : s ≤ f a <;> simp [h]] rw [lintegral_indicator₀] swap; · exact f_mble.nullMeasurable measurableSet_Ici rw [lintegral_one, Measure.restrict_apply MeasurableSet.univ, univ_inter, indicator_mul_left, mul_assoc, show (Ioi 0).indicator (fun _x : ℝ => (1 : ℝ≥0∞)) s * μ {a : α | s ≤ f a} = (Ioi 0).indicator (fun _x : ℝ => 1 * μ {a : α | s ≤ f a}) s by by_cases h : 0 < s <;> simp [h]] simp_rw [mul_comm _ (ENNReal.ofReal _), one_mul] rfl have aux₂ : (Function.uncurry fun (x : α) (y : ℝ) => (Ioc 0 (f x)).indicator (fun t : ℝ => ENNReal.ofReal (g t)) y) = {p : α × ℝ | p.2 ∈ Ioc 0 (f p.1)}.indicator fun p => ENNReal.ofReal (g p.2) := by funext p cases p with | mk p_fst p_snd => ?_ rw [Function.uncurry_apply_pair] by_cases h : p_snd ∈ Ioc 0 (f p_fst) · have h' : (p_fst, p_snd) ∈ {p : α × ℝ | p.snd ∈ Ioc 0 (f p.fst)} := h rw [Set.indicator_of_mem h', Set.indicator_of_mem h] · have h' : (p_fst, p_snd) ∉ {p : α × ℝ | p.snd ∈ Ioc 0 (f p.fst)} := h rw [Set.indicator_of_not_mem h', Set.indicator_of_not_mem h] rw [aux₂] have mble₀ : MeasurableSet {p : α × ℝ | p.snd ∈ Ioc 0 (f p.fst)} := by simpa only [mem_univ, Pi.zero_apply, gt_iff_lt, not_lt, ge_iff_le, true_and] using measurableSet_region_between_oc measurable_zero f_mble MeasurableSet.univ exact (ENNReal.measurable_ofReal.comp (g_mble.comp measurable_snd)).aemeasurable.indicator₀ mble₀.nullMeasurableSet
72
18,586,717,452,841,279,000,000,000,000,000
2
2
2
2,376
import Mathlib.Combinatorics.SimpleGraph.Clique import Mathlib.Data.ENat.Lattice import Mathlib.Data.Nat.Lattice import Mathlib.Data.Setoid.Partition import Mathlib.Order.Antichain #align_import combinatorics.simple_graph.coloring from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" open Fintype Function universe u v namespace SimpleGraph variable {V : Type u} (G : SimpleGraph V) {n : ℕ} abbrev Coloring (α : Type v) := G →g (⊤ : SimpleGraph α) #align simple_graph.coloring SimpleGraph.Coloring variable {G} {α β : Type*} (C : G.Coloring α) theorem Coloring.valid {v w : V} (h : G.Adj v w) : C v ≠ C w := C.map_rel h #align simple_graph.coloring.valid SimpleGraph.Coloring.valid @[match_pattern] def Coloring.mk (color : V → α) (valid : ∀ {v w : V}, G.Adj v w → color v ≠ color w) : G.Coloring α := ⟨color, @valid⟩ #align simple_graph.coloring.mk SimpleGraph.Coloring.mk def Coloring.colorClass (c : α) : Set V := { v : V | C v = c } #align simple_graph.coloring.color_class SimpleGraph.Coloring.colorClass def Coloring.colorClasses : Set (Set V) := (Setoid.ker C).classes #align simple_graph.coloring.color_classes SimpleGraph.Coloring.colorClasses theorem Coloring.mem_colorClass (v : V) : v ∈ C.colorClass (C v) := rfl #align simple_graph.coloring.mem_color_class SimpleGraph.Coloring.mem_colorClass theorem Coloring.colorClasses_isPartition : Setoid.IsPartition C.colorClasses := Setoid.isPartition_classes (Setoid.ker C) #align simple_graph.coloring.color_classes_is_partition SimpleGraph.Coloring.colorClasses_isPartition theorem Coloring.mem_colorClasses {v : V} : C.colorClass (C v) ∈ C.colorClasses := ⟨v, rfl⟩ #align simple_graph.coloring.mem_color_classes SimpleGraph.Coloring.mem_colorClasses theorem Coloring.colorClasses_finite [Finite α] : C.colorClasses.Finite := Setoid.finite_classes_ker _ #align simple_graph.coloring.color_classes_finite SimpleGraph.Coloring.colorClasses_finite
Mathlib/Combinatorics/SimpleGraph/Coloring.lean
114
119
theorem Coloring.card_colorClasses_le [Fintype α] [Fintype C.colorClasses] : Fintype.card C.colorClasses ≤ Fintype.card α := by
simp [colorClasses] -- Porting note: brute force instance declaration `[Fintype (Setoid.classes (Setoid.ker C))]` haveI : Fintype (Setoid.classes (Setoid.ker C)) := by assumption convert Setoid.card_classes_ker_le C
4
54.59815
2
2
2
2,377
import Mathlib.Combinatorics.SimpleGraph.Clique import Mathlib.Data.ENat.Lattice import Mathlib.Data.Nat.Lattice import Mathlib.Data.Setoid.Partition import Mathlib.Order.Antichain #align_import combinatorics.simple_graph.coloring from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" open Fintype Function universe u v namespace SimpleGraph variable {V : Type u} (G : SimpleGraph V) {n : ℕ} abbrev Coloring (α : Type v) := G →g (⊤ : SimpleGraph α) #align simple_graph.coloring SimpleGraph.Coloring variable {G} {α β : Type*} (C : G.Coloring α) theorem Coloring.valid {v w : V} (h : G.Adj v w) : C v ≠ C w := C.map_rel h #align simple_graph.coloring.valid SimpleGraph.Coloring.valid @[match_pattern] def Coloring.mk (color : V → α) (valid : ∀ {v w : V}, G.Adj v w → color v ≠ color w) : G.Coloring α := ⟨color, @valid⟩ #align simple_graph.coloring.mk SimpleGraph.Coloring.mk def Coloring.colorClass (c : α) : Set V := { v : V | C v = c } #align simple_graph.coloring.color_class SimpleGraph.Coloring.colorClass def Coloring.colorClasses : Set (Set V) := (Setoid.ker C).classes #align simple_graph.coloring.color_classes SimpleGraph.Coloring.colorClasses theorem Coloring.mem_colorClass (v : V) : v ∈ C.colorClass (C v) := rfl #align simple_graph.coloring.mem_color_class SimpleGraph.Coloring.mem_colorClass theorem Coloring.colorClasses_isPartition : Setoid.IsPartition C.colorClasses := Setoid.isPartition_classes (Setoid.ker C) #align simple_graph.coloring.color_classes_is_partition SimpleGraph.Coloring.colorClasses_isPartition theorem Coloring.mem_colorClasses {v : V} : C.colorClass (C v) ∈ C.colorClasses := ⟨v, rfl⟩ #align simple_graph.coloring.mem_color_classes SimpleGraph.Coloring.mem_colorClasses theorem Coloring.colorClasses_finite [Finite α] : C.colorClasses.Finite := Setoid.finite_classes_ker _ #align simple_graph.coloring.color_classes_finite SimpleGraph.Coloring.colorClasses_finite theorem Coloring.card_colorClasses_le [Fintype α] [Fintype C.colorClasses] : Fintype.card C.colorClasses ≤ Fintype.card α := by simp [colorClasses] -- Porting note: brute force instance declaration `[Fintype (Setoid.classes (Setoid.ker C))]` haveI : Fintype (Setoid.classes (Setoid.ker C)) := by assumption convert Setoid.card_classes_ker_le C #align simple_graph.coloring.card_color_classes_le SimpleGraph.Coloring.card_colorClasses_le theorem Coloring.not_adj_of_mem_colorClass {c : α} {v w : V} (hv : v ∈ C.colorClass c) (hw : w ∈ C.colorClass c) : ¬G.Adj v w := fun h => C.valid h (Eq.trans hv (Eq.symm hw)) #align simple_graph.coloring.not_adj_of_mem_color_class SimpleGraph.Coloring.not_adj_of_mem_colorClass theorem Coloring.color_classes_independent (c : α) : IsAntichain G.Adj (C.colorClass c) := fun _ hv _ hw _ => C.not_adj_of_mem_colorClass hv hw #align simple_graph.coloring.color_classes_independent SimpleGraph.Coloring.color_classes_independent -- TODO make this computable noncomputable instance [Fintype V] [Fintype α] : Fintype (Coloring G α) := by classical change Fintype (RelHom G.Adj (⊤ : SimpleGraph α).Adj) apply Fintype.ofInjective _ RelHom.coe_fn_injective variable (G) def Colorable (n : ℕ) : Prop := Nonempty (G.Coloring (Fin n)) #align simple_graph.colorable SimpleGraph.Colorable def coloringOfIsEmpty [IsEmpty V] : G.Coloring α := Coloring.mk isEmptyElim fun {v} => isEmptyElim v #align simple_graph.coloring_of_is_empty SimpleGraph.coloringOfIsEmpty theorem colorable_of_isEmpty [IsEmpty V] (n : ℕ) : G.Colorable n := ⟨G.coloringOfIsEmpty⟩ #align simple_graph.colorable_of_is_empty SimpleGraph.colorable_of_isEmpty
Mathlib/Combinatorics/SimpleGraph/Coloring.lean
151
155
theorem isEmpty_of_colorable_zero (h : G.Colorable 0) : IsEmpty V := by
constructor intro v obtain ⟨i, hi⟩ := h.some v exact Nat.not_lt_zero _ hi
4
54.59815
2
2
2
2,377
import Mathlib.CategoryTheory.Limits.Preserves.Finite import Mathlib.CategoryTheory.Sites.Canonical import Mathlib.CategoryTheory.Sites.Coherent.Basic import Mathlib.CategoryTheory.Sites.Preserves universe v u w namespace CategoryTheory open Limits variable {C : Type u} [Category.{v} C] variable [FinitaryPreExtensive C] class Presieve.Extensive {X : C} (R : Presieve X) : Prop where arrows_nonempty_isColimit : ∃ (α : Type) (_ : Finite α) (Z : α → C) (π : (a : α) → (Z a ⟶ X)), R = Presieve.ofArrows Z π ∧ Nonempty (IsColimit (Cofan.mk X π)) instance {X : C} (S : Presieve X) [S.Extensive] : S.hasPullbacks where has_pullbacks := by obtain ⟨_, _, _, _, rfl, ⟨hc⟩⟩ := Presieve.Extensive.arrows_nonempty_isColimit (R := S) intro _ _ _ _ _ hg cases hg apply FinitaryPreExtensive.hasPullbacks_of_is_coproduct hc open Presieve Opposite
Mathlib/CategoryTheory/Sites/Coherent/ExtensiveSheaves.lean
52
58
theorem isSheafFor_extensive_of_preservesFiniteProducts {X : C} (S : Presieve X) [S.Extensive] (F : Cᵒᵖ ⥤ Type w) [PreservesFiniteProducts F] : S.IsSheafFor F := by
obtain ⟨α, _, Z, π, rfl, ⟨hc⟩⟩ := Extensive.arrows_nonempty_isColimit (R := S) have : (ofArrows Z (Cofan.mk X π).inj).hasPullbacks := (inferInstance : (ofArrows Z π).hasPullbacks) cases nonempty_fintype α exact isSheafFor_of_preservesProduct _ _ hc
5
148.413159
2
2
4
2,378
import Mathlib.CategoryTheory.Limits.Preserves.Finite import Mathlib.CategoryTheory.Sites.Canonical import Mathlib.CategoryTheory.Sites.Coherent.Basic import Mathlib.CategoryTheory.Sites.Preserves universe v u w namespace CategoryTheory open Limits variable {C : Type u} [Category.{v} C] variable [FinitaryPreExtensive C] class Presieve.Extensive {X : C} (R : Presieve X) : Prop where arrows_nonempty_isColimit : ∃ (α : Type) (_ : Finite α) (Z : α → C) (π : (a : α) → (Z a ⟶ X)), R = Presieve.ofArrows Z π ∧ Nonempty (IsColimit (Cofan.mk X π)) instance {X : C} (S : Presieve X) [S.Extensive] : S.hasPullbacks where has_pullbacks := by obtain ⟨_, _, _, _, rfl, ⟨hc⟩⟩ := Presieve.Extensive.arrows_nonempty_isColimit (R := S) intro _ _ _ _ _ hg cases hg apply FinitaryPreExtensive.hasPullbacks_of_is_coproduct hc open Presieve Opposite theorem isSheafFor_extensive_of_preservesFiniteProducts {X : C} (S : Presieve X) [S.Extensive] (F : Cᵒᵖ ⥤ Type w) [PreservesFiniteProducts F] : S.IsSheafFor F := by obtain ⟨α, _, Z, π, rfl, ⟨hc⟩⟩ := Extensive.arrows_nonempty_isColimit (R := S) have : (ofArrows Z (Cofan.mk X π).inj).hasPullbacks := (inferInstance : (ofArrows Z π).hasPullbacks) cases nonempty_fintype α exact isSheafFor_of_preservesProduct _ _ hc instance {α : Type} [Finite α] (Z : α → C) : (ofArrows Z (fun i ↦ Sigma.ι Z i)).Extensive := ⟨⟨α, inferInstance, Z, (fun i ↦ Sigma.ι Z i), rfl, ⟨coproductIsCoproduct _⟩⟩⟩
Mathlib/CategoryTheory/Sites/Coherent/ExtensiveSheaves.lean
64
70
theorem extensiveTopology.isSheaf_yoneda_obj (W : C) : Presieve.IsSheaf (extensiveTopology C) (yoneda.obj W) := by
erw [isSheaf_coverage] intro X R ⟨Y, α, Z, π, hR, hi⟩ have : IsIso (Sigma.desc (Cofan.inj (Cofan.mk X π))) := hi have : R.Extensive := ⟨Y, α, Z, π, hR, ⟨Cofan.isColimitOfIsIsoSigmaDesc (Cofan.mk X π)⟩⟩ exact isSheafFor_extensive_of_preservesFiniteProducts _ _
5
148.413159
2
2
4
2,378
import Mathlib.CategoryTheory.Limits.Preserves.Finite import Mathlib.CategoryTheory.Sites.Canonical import Mathlib.CategoryTheory.Sites.Coherent.Basic import Mathlib.CategoryTheory.Sites.Preserves universe v u w namespace CategoryTheory open Limits variable {C : Type u} [Category.{v} C] variable [FinitaryPreExtensive C] class Presieve.Extensive {X : C} (R : Presieve X) : Prop where arrows_nonempty_isColimit : ∃ (α : Type) (_ : Finite α) (Z : α → C) (π : (a : α) → (Z a ⟶ X)), R = Presieve.ofArrows Z π ∧ Nonempty (IsColimit (Cofan.mk X π)) instance {X : C} (S : Presieve X) [S.Extensive] : S.hasPullbacks where has_pullbacks := by obtain ⟨_, _, _, _, rfl, ⟨hc⟩⟩ := Presieve.Extensive.arrows_nonempty_isColimit (R := S) intro _ _ _ _ _ hg cases hg apply FinitaryPreExtensive.hasPullbacks_of_is_coproduct hc open Presieve Opposite theorem isSheafFor_extensive_of_preservesFiniteProducts {X : C} (S : Presieve X) [S.Extensive] (F : Cᵒᵖ ⥤ Type w) [PreservesFiniteProducts F] : S.IsSheafFor F := by obtain ⟨α, _, Z, π, rfl, ⟨hc⟩⟩ := Extensive.arrows_nonempty_isColimit (R := S) have : (ofArrows Z (Cofan.mk X π).inj).hasPullbacks := (inferInstance : (ofArrows Z π).hasPullbacks) cases nonempty_fintype α exact isSheafFor_of_preservesProduct _ _ hc instance {α : Type} [Finite α] (Z : α → C) : (ofArrows Z (fun i ↦ Sigma.ι Z i)).Extensive := ⟨⟨α, inferInstance, Z, (fun i ↦ Sigma.ι Z i), rfl, ⟨coproductIsCoproduct _⟩⟩⟩ theorem extensiveTopology.isSheaf_yoneda_obj (W : C) : Presieve.IsSheaf (extensiveTopology C) (yoneda.obj W) := by erw [isSheaf_coverage] intro X R ⟨Y, α, Z, π, hR, hi⟩ have : IsIso (Sigma.desc (Cofan.inj (Cofan.mk X π))) := hi have : R.Extensive := ⟨Y, α, Z, π, hR, ⟨Cofan.isColimitOfIsIsoSigmaDesc (Cofan.mk X π)⟩⟩ exact isSheafFor_extensive_of_preservesFiniteProducts _ _ theorem extensiveTopology.subcanonical : Sheaf.Subcanonical (extensiveTopology C) := Sheaf.Subcanonical.of_yoneda_isSheaf _ isSheaf_yoneda_obj
Mathlib/CategoryTheory/Sites/Coherent/ExtensiveSheaves.lean
80
110
theorem Presieve.isSheaf_iff_preservesFiniteProducts [FinitaryExtensive C] (F : Cᵒᵖ ⥤ Type w) : Presieve.IsSheaf (extensiveTopology C) F ↔ Nonempty (PreservesFiniteProducts F) := by
refine ⟨fun hF ↦ ⟨⟨fun α _ ↦ ⟨fun {K} ↦ ?_⟩⟩⟩, fun hF ↦ ?_⟩ · erw [Presieve.isSheaf_coverage] at hF let Z : α → C := fun i ↦ unop (K.obj ⟨i⟩) have : (Presieve.ofArrows Z (Cofan.mk (∐ Z) (Sigma.ι Z)).inj).hasPullbacks := (inferInstance : (Presieve.ofArrows Z (Sigma.ι Z)).hasPullbacks) have : ∀ (i : α), Mono (Cofan.inj (Cofan.mk (∐ Z) (Sigma.ι Z)) i) := (inferInstance : ∀ (i : α), Mono (Sigma.ι Z i)) let i : K ≅ Discrete.functor (fun i ↦ op (Z i)) := Discrete.natIsoFunctor let _ : PreservesLimit (Discrete.functor (fun i ↦ op (Z i))) F := Presieve.preservesProductOfIsSheafFor F ?_ initialIsInitial _ (coproductIsCoproduct Z) (FinitaryExtensive.isPullback_initial_to_sigma_ι Z) (hF (Presieve.ofArrows Z (fun i ↦ Sigma.ι Z i)) ?_) · exact preservesLimitOfIsoDiagram F i.symm · apply hF refine ⟨Empty, inferInstance, Empty.elim, IsEmpty.elim inferInstance, rfl, ⟨default,?_, ?_⟩⟩ · ext b cases b · simp only [eq_iff_true_of_subsingleton] · refine ⟨α, inferInstance, Z, (fun i ↦ Sigma.ι Z i), rfl, ?_⟩ suffices Sigma.desc (fun i ↦ Sigma.ι Z i) = 𝟙 _ by rw [this]; infer_instance ext simp · let _ := hF.some erw [Presieve.isSheaf_coverage] intro X R ⟨Y, α, Z, π, hR, hi⟩ have : IsIso (Sigma.desc (Cofan.inj (Cofan.mk X π))) := hi have : R.Extensive := ⟨Y, α, Z, π, hR, ⟨Cofan.isColimitOfIsIsoSigmaDesc (Cofan.mk X π)⟩⟩ exact isSheafFor_extensive_of_preservesFiniteProducts R F
28
1,446,257,064,291.475
2
2
4
2,378
import Mathlib.CategoryTheory.Limits.Preserves.Finite import Mathlib.CategoryTheory.Sites.Canonical import Mathlib.CategoryTheory.Sites.Coherent.Basic import Mathlib.CategoryTheory.Sites.Preserves universe v u w namespace CategoryTheory open Limits variable {C : Type u} [Category.{v} C] variable [FinitaryPreExtensive C] class Presieve.Extensive {X : C} (R : Presieve X) : Prop where arrows_nonempty_isColimit : ∃ (α : Type) (_ : Finite α) (Z : α → C) (π : (a : α) → (Z a ⟶ X)), R = Presieve.ofArrows Z π ∧ Nonempty (IsColimit (Cofan.mk X π)) instance {X : C} (S : Presieve X) [S.Extensive] : S.hasPullbacks where has_pullbacks := by obtain ⟨_, _, _, _, rfl, ⟨hc⟩⟩ := Presieve.Extensive.arrows_nonempty_isColimit (R := S) intro _ _ _ _ _ hg cases hg apply FinitaryPreExtensive.hasPullbacks_of_is_coproduct hc open Presieve Opposite theorem isSheafFor_extensive_of_preservesFiniteProducts {X : C} (S : Presieve X) [S.Extensive] (F : Cᵒᵖ ⥤ Type w) [PreservesFiniteProducts F] : S.IsSheafFor F := by obtain ⟨α, _, Z, π, rfl, ⟨hc⟩⟩ := Extensive.arrows_nonempty_isColimit (R := S) have : (ofArrows Z (Cofan.mk X π).inj).hasPullbacks := (inferInstance : (ofArrows Z π).hasPullbacks) cases nonempty_fintype α exact isSheafFor_of_preservesProduct _ _ hc instance {α : Type} [Finite α] (Z : α → C) : (ofArrows Z (fun i ↦ Sigma.ι Z i)).Extensive := ⟨⟨α, inferInstance, Z, (fun i ↦ Sigma.ι Z i), rfl, ⟨coproductIsCoproduct _⟩⟩⟩ theorem extensiveTopology.isSheaf_yoneda_obj (W : C) : Presieve.IsSheaf (extensiveTopology C) (yoneda.obj W) := by erw [isSheaf_coverage] intro X R ⟨Y, α, Z, π, hR, hi⟩ have : IsIso (Sigma.desc (Cofan.inj (Cofan.mk X π))) := hi have : R.Extensive := ⟨Y, α, Z, π, hR, ⟨Cofan.isColimitOfIsIsoSigmaDesc (Cofan.mk X π)⟩⟩ exact isSheafFor_extensive_of_preservesFiniteProducts _ _ theorem extensiveTopology.subcanonical : Sheaf.Subcanonical (extensiveTopology C) := Sheaf.Subcanonical.of_yoneda_isSheaf _ isSheaf_yoneda_obj theorem Presieve.isSheaf_iff_preservesFiniteProducts [FinitaryExtensive C] (F : Cᵒᵖ ⥤ Type w) : Presieve.IsSheaf (extensiveTopology C) F ↔ Nonempty (PreservesFiniteProducts F) := by refine ⟨fun hF ↦ ⟨⟨fun α _ ↦ ⟨fun {K} ↦ ?_⟩⟩⟩, fun hF ↦ ?_⟩ · erw [Presieve.isSheaf_coverage] at hF let Z : α → C := fun i ↦ unop (K.obj ⟨i⟩) have : (Presieve.ofArrows Z (Cofan.mk (∐ Z) (Sigma.ι Z)).inj).hasPullbacks := (inferInstance : (Presieve.ofArrows Z (Sigma.ι Z)).hasPullbacks) have : ∀ (i : α), Mono (Cofan.inj (Cofan.mk (∐ Z) (Sigma.ι Z)) i) := (inferInstance : ∀ (i : α), Mono (Sigma.ι Z i)) let i : K ≅ Discrete.functor (fun i ↦ op (Z i)) := Discrete.natIsoFunctor let _ : PreservesLimit (Discrete.functor (fun i ↦ op (Z i))) F := Presieve.preservesProductOfIsSheafFor F ?_ initialIsInitial _ (coproductIsCoproduct Z) (FinitaryExtensive.isPullback_initial_to_sigma_ι Z) (hF (Presieve.ofArrows Z (fun i ↦ Sigma.ι Z i)) ?_) · exact preservesLimitOfIsoDiagram F i.symm · apply hF refine ⟨Empty, inferInstance, Empty.elim, IsEmpty.elim inferInstance, rfl, ⟨default,?_, ?_⟩⟩ · ext b cases b · simp only [eq_iff_true_of_subsingleton] · refine ⟨α, inferInstance, Z, (fun i ↦ Sigma.ι Z i), rfl, ?_⟩ suffices Sigma.desc (fun i ↦ Sigma.ι Z i) = 𝟙 _ by rw [this]; infer_instance ext simp · let _ := hF.some erw [Presieve.isSheaf_coverage] intro X R ⟨Y, α, Z, π, hR, hi⟩ have : IsIso (Sigma.desc (Cofan.inj (Cofan.mk X π))) := hi have : R.Extensive := ⟨Y, α, Z, π, hR, ⟨Cofan.isColimitOfIsIsoSigmaDesc (Cofan.mk X π)⟩⟩ exact isSheafFor_extensive_of_preservesFiniteProducts R F
Mathlib/CategoryTheory/Sites/Coherent/ExtensiveSheaves.lean
115
132
theorem Presheaf.isSheaf_iff_preservesFiniteProducts {D : Type*} [Category D] [FinitaryExtensive C] (F : Cᵒᵖ ⥤ D) : IsSheaf (extensiveTopology C) F ↔ Nonempty (PreservesFiniteProducts F) := by
constructor · intro h rw [IsSheaf] at h refine ⟨⟨fun J _ ↦ ⟨fun {K} ↦ ⟨fun {c} hc ↦ ?_⟩⟩⟩⟩ apply coyonedaJointlyReflectsLimits intro ⟨E⟩ specialize h E rw [Presieve.isSheaf_iff_preservesFiniteProducts] at h have : PreservesLimit K (F.comp (coyoneda.obj ⟨E⟩)) := (h.some.preserves J).preservesLimit change IsLimit ((F.comp (coyoneda.obj ⟨E⟩)).mapCone c) apply this.preserves exact hc · intro ⟨_⟩ E rw [Presieve.isSheaf_iff_preservesFiniteProducts] exact ⟨inferInstance⟩
15
3,269,017.372472
2
2
4
2,378
import Mathlib.Analysis.Convex.Cone.Extension import Mathlib.Analysis.NormedSpace.RCLike import Mathlib.Analysis.NormedSpace.Extend import Mathlib.Analysis.RCLike.Lemmas #align_import analysis.normed_space.hahn_banach.extension from "leanprover-community/mathlib"@"915591b2bb3ea303648db07284a161a7f2a9e3d4" universe u v namespace Real variable {E : Type*} [SeminormedAddCommGroup E] [NormedSpace ℝ E]
Mathlib/Analysis/NormedSpace/HahnBanach/Extension.lean
44
59
theorem exists_extension_norm_eq (p : Subspace ℝ E) (f : p →L[ℝ] ℝ) : ∃ g : E →L[ℝ] ℝ, (∀ x : p, g x = f x) ∧ ‖g‖ = ‖f‖ := by
rcases exists_extension_of_le_sublinear ⟨p, f⟩ (fun x => ‖f‖ * ‖x‖) (fun c hc x => by simp only [norm_smul c x, Real.norm_eq_abs, abs_of_pos hc, mul_left_comm]) (fun x y => by -- Porting note: placeholder filled here rw [← left_distrib] exact mul_le_mul_of_nonneg_left (norm_add_le x y) (@norm_nonneg _ _ f)) fun x => le_trans (le_abs_self _) (f.le_opNorm _) with ⟨g, g_eq, g_le⟩ set g' := g.mkContinuous ‖f‖ fun x => abs_le.2 ⟨neg_le.1 <| g.map_neg x ▸ norm_neg x ▸ g_le (-x), g_le x⟩ refine ⟨g', g_eq, ?_⟩ apply le_antisymm (g.mkContinuous_norm_le (norm_nonneg f) _) refine f.opNorm_le_bound (norm_nonneg _) fun x => ?_ dsimp at g_eq rw [← g_eq] apply g'.le_opNorm
14
1,202,604.284165
2
2
2
2,379
import Mathlib.Analysis.Convex.Cone.Extension import Mathlib.Analysis.NormedSpace.RCLike import Mathlib.Analysis.NormedSpace.Extend import Mathlib.Analysis.RCLike.Lemmas #align_import analysis.normed_space.hahn_banach.extension from "leanprover-community/mathlib"@"915591b2bb3ea303648db07284a161a7f2a9e3d4" universe u v section DualVector variable (𝕜 : Type v) [RCLike 𝕜] variable {E : Type u} [NormedAddCommGroup E] [NormedSpace 𝕜 E] open ContinuousLinearEquiv Submodule open scoped Classical
Mathlib/Analysis/NormedSpace/HahnBanach/Extension.lean
151
163
theorem coord_norm' {x : E} (h : x ≠ 0) : ‖(‖x‖ : 𝕜) • coord 𝕜 x h‖ = 1 := by
#adaptation_note /-- `set_option maxSynthPendingDepth 2` required after https://github.com/leanprover/lean4/pull/4119 Alternatively, we can add: ``` let X : SeminormedAddCommGroup (↥(span 𝕜 {x}) →L[𝕜] 𝕜) := inferInstance have : BoundedSMul 𝕜 (↥(span 𝕜 {x}) →L[𝕜] 𝕜) := @NormedSpace.boundedSMul 𝕜 _ _ X _ ``` -/ set_option maxSynthPendingDepth 2 in rw [norm_smul (α := 𝕜) (x := coord 𝕜 x h), RCLike.norm_coe_norm, coord_norm, mul_inv_cancel (mt norm_eq_zero.mp h)]
12
162,754.791419
2
2
2
2,379
import Mathlib.Probability.Martingale.Upcrossing import Mathlib.MeasureTheory.Function.UniformIntegrable import Mathlib.MeasureTheory.Constructions.Polish #align_import probability.martingale.convergence from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open TopologicalSpace Filter MeasureTheory.Filtration open scoped NNReal ENNReal MeasureTheory ProbabilityTheory Topology namespace MeasureTheory variable {Ω ι : Type*} {m0 : MeasurableSpace Ω} {μ : Measure Ω} {ℱ : Filtration ℕ m0} variable {a b : ℝ} {f : ℕ → Ω → ℝ} {ω : Ω} {R : ℝ≥0} section AeConvergence
Mathlib/Probability/Martingale/Convergence.lean
110
127
theorem not_frequently_of_upcrossings_lt_top (hab : a < b) (hω : upcrossings a b f ω ≠ ∞) : ¬((∃ᶠ n in atTop, f n ω < a) ∧ ∃ᶠ n in atTop, b < f n ω) := by
rw [← lt_top_iff_ne_top, upcrossings_lt_top_iff] at hω replace hω : ∃ k, ∀ N, upcrossingsBefore a b f N ω < k := by obtain ⟨k, hk⟩ := hω exact ⟨k + 1, fun N => lt_of_le_of_lt (hk N) k.lt_succ_self⟩ rintro ⟨h₁, h₂⟩ rw [frequently_atTop] at h₁ h₂ refine Classical.not_not.2 hω ?_ push_neg intro k induction' k with k ih · simp only [Nat.zero_eq, zero_le, exists_const] · obtain ⟨N, hN⟩ := ih obtain ⟨N₁, hN₁, hN₁'⟩ := h₁ N obtain ⟨N₂, hN₂, hN₂'⟩ := h₂ N₁ exact ⟨N₂ + 1, Nat.succ_le_of_lt <| lt_of_le_of_lt hN (upcrossingsBefore_lt_of_exists_upcrossing hab hN₁ hN₁' hN₂ hN₂')⟩
16
8,886,110.520508
2
2
3
2,380
import Mathlib.Probability.Martingale.Upcrossing import Mathlib.MeasureTheory.Function.UniformIntegrable import Mathlib.MeasureTheory.Constructions.Polish #align_import probability.martingale.convergence from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open TopologicalSpace Filter MeasureTheory.Filtration open scoped NNReal ENNReal MeasureTheory ProbabilityTheory Topology namespace MeasureTheory variable {Ω ι : Type*} {m0 : MeasurableSpace Ω} {μ : Measure Ω} {ℱ : Filtration ℕ m0} variable {a b : ℝ} {f : ℕ → Ω → ℝ} {ω : Ω} {R : ℝ≥0} section AeConvergence theorem not_frequently_of_upcrossings_lt_top (hab : a < b) (hω : upcrossings a b f ω ≠ ∞) : ¬((∃ᶠ n in atTop, f n ω < a) ∧ ∃ᶠ n in atTop, b < f n ω) := by rw [← lt_top_iff_ne_top, upcrossings_lt_top_iff] at hω replace hω : ∃ k, ∀ N, upcrossingsBefore a b f N ω < k := by obtain ⟨k, hk⟩ := hω exact ⟨k + 1, fun N => lt_of_le_of_lt (hk N) k.lt_succ_self⟩ rintro ⟨h₁, h₂⟩ rw [frequently_atTop] at h₁ h₂ refine Classical.not_not.2 hω ?_ push_neg intro k induction' k with k ih · simp only [Nat.zero_eq, zero_le, exists_const] · obtain ⟨N, hN⟩ := ih obtain ⟨N₁, hN₁, hN₁'⟩ := h₁ N obtain ⟨N₂, hN₂, hN₂'⟩ := h₂ N₁ exact ⟨N₂ + 1, Nat.succ_le_of_lt <| lt_of_le_of_lt hN (upcrossingsBefore_lt_of_exists_upcrossing hab hN₁ hN₁' hN₂ hN₂')⟩ #align measure_theory.not_frequently_of_upcrossings_lt_top MeasureTheory.not_frequently_of_upcrossings_lt_top theorem upcrossings_eq_top_of_frequently_lt (hab : a < b) (h₁ : ∃ᶠ n in atTop, f n ω < a) (h₂ : ∃ᶠ n in atTop, b < f n ω) : upcrossings a b f ω = ∞ := by_contradiction fun h => not_frequently_of_upcrossings_lt_top hab h ⟨h₁, h₂⟩ #align measure_theory.upcrossings_eq_top_of_frequently_lt MeasureTheory.upcrossings_eq_top_of_frequently_lt
Mathlib/Probability/Martingale/Convergence.lean
141
152
theorem tendsto_of_uncrossing_lt_top (hf₁ : liminf (fun n => (‖f n ω‖₊ : ℝ≥0∞)) atTop < ∞) (hf₂ : ∀ a b : ℚ, a < b → upcrossings a b f ω < ∞) : ∃ c, Tendsto (fun n => f n ω) atTop (𝓝 c) := by
by_cases h : IsBoundedUnder (· ≤ ·) atTop fun n => |f n ω| · rw [isBoundedUnder_le_abs] at h refine tendsto_of_no_upcrossings Rat.denseRange_cast ?_ h.1 h.2 intro a ha b hb hab obtain ⟨⟨a, rfl⟩, ⟨b, rfl⟩⟩ := ha, hb exact not_frequently_of_upcrossings_lt_top hab (hf₂ a b (Rat.cast_lt.1 hab)).ne · obtain ⟨a, b, hab, h₁, h₂⟩ := ENNReal.exists_upcrossings_of_not_bounded_under hf₁.ne h exact False.elim ((hf₂ a b hab).ne (upcrossings_eq_top_of_frequently_lt (Rat.cast_lt.2 hab) h₁ h₂))
9
8,103.083928
2
2
3
2,380
import Mathlib.Probability.Martingale.Upcrossing import Mathlib.MeasureTheory.Function.UniformIntegrable import Mathlib.MeasureTheory.Constructions.Polish #align_import probability.martingale.convergence from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open TopologicalSpace Filter MeasureTheory.Filtration open scoped NNReal ENNReal MeasureTheory ProbabilityTheory Topology namespace MeasureTheory variable {Ω ι : Type*} {m0 : MeasurableSpace Ω} {μ : Measure Ω} {ℱ : Filtration ℕ m0} variable {a b : ℝ} {f : ℕ → Ω → ℝ} {ω : Ω} {R : ℝ≥0} section AeConvergence theorem not_frequently_of_upcrossings_lt_top (hab : a < b) (hω : upcrossings a b f ω ≠ ∞) : ¬((∃ᶠ n in atTop, f n ω < a) ∧ ∃ᶠ n in atTop, b < f n ω) := by rw [← lt_top_iff_ne_top, upcrossings_lt_top_iff] at hω replace hω : ∃ k, ∀ N, upcrossingsBefore a b f N ω < k := by obtain ⟨k, hk⟩ := hω exact ⟨k + 1, fun N => lt_of_le_of_lt (hk N) k.lt_succ_self⟩ rintro ⟨h₁, h₂⟩ rw [frequently_atTop] at h₁ h₂ refine Classical.not_not.2 hω ?_ push_neg intro k induction' k with k ih · simp only [Nat.zero_eq, zero_le, exists_const] · obtain ⟨N, hN⟩ := ih obtain ⟨N₁, hN₁, hN₁'⟩ := h₁ N obtain ⟨N₂, hN₂, hN₂'⟩ := h₂ N₁ exact ⟨N₂ + 1, Nat.succ_le_of_lt <| lt_of_le_of_lt hN (upcrossingsBefore_lt_of_exists_upcrossing hab hN₁ hN₁' hN₂ hN₂')⟩ #align measure_theory.not_frequently_of_upcrossings_lt_top MeasureTheory.not_frequently_of_upcrossings_lt_top theorem upcrossings_eq_top_of_frequently_lt (hab : a < b) (h₁ : ∃ᶠ n in atTop, f n ω < a) (h₂ : ∃ᶠ n in atTop, b < f n ω) : upcrossings a b f ω = ∞ := by_contradiction fun h => not_frequently_of_upcrossings_lt_top hab h ⟨h₁, h₂⟩ #align measure_theory.upcrossings_eq_top_of_frequently_lt MeasureTheory.upcrossings_eq_top_of_frequently_lt theorem tendsto_of_uncrossing_lt_top (hf₁ : liminf (fun n => (‖f n ω‖₊ : ℝ≥0∞)) atTop < ∞) (hf₂ : ∀ a b : ℚ, a < b → upcrossings a b f ω < ∞) : ∃ c, Tendsto (fun n => f n ω) atTop (𝓝 c) := by by_cases h : IsBoundedUnder (· ≤ ·) atTop fun n => |f n ω| · rw [isBoundedUnder_le_abs] at h refine tendsto_of_no_upcrossings Rat.denseRange_cast ?_ h.1 h.2 intro a ha b hb hab obtain ⟨⟨a, rfl⟩, ⟨b, rfl⟩⟩ := ha, hb exact not_frequently_of_upcrossings_lt_top hab (hf₂ a b (Rat.cast_lt.1 hab)).ne · obtain ⟨a, b, hab, h₁, h₂⟩ := ENNReal.exists_upcrossings_of_not_bounded_under hf₁.ne h exact False.elim ((hf₂ a b hab).ne (upcrossings_eq_top_of_frequently_lt (Rat.cast_lt.2 hab) h₁ h₂)) #align measure_theory.tendsto_of_uncrossing_lt_top MeasureTheory.tendsto_of_uncrossing_lt_top
Mathlib/Probability/Martingale/Convergence.lean
156
183
theorem Submartingale.upcrossings_ae_lt_top' [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ) (hbdd : ∀ n, snorm (f n) 1 μ ≤ R) (hab : a < b) : ∀ᵐ ω ∂μ, upcrossings a b f ω < ∞ := by
refine ae_lt_top (hf.adapted.measurable_upcrossings hab) ?_ have := hf.mul_lintegral_upcrossings_le_lintegral_pos_part a b rw [mul_comm, ← ENNReal.le_div_iff_mul_le] at this · refine (lt_of_le_of_lt this (ENNReal.div_lt_top ?_ ?_)).ne · have hR' : ∀ n, ∫⁻ ω, ‖f n ω - a‖₊ ∂μ ≤ R + ‖a‖₊ * μ Set.univ := by simp_rw [snorm_one_eq_lintegral_nnnorm] at hbdd intro n refine (lintegral_mono ?_ : ∫⁻ ω, ‖f n ω - a‖₊ ∂μ ≤ ∫⁻ ω, ‖f n ω‖₊ + ‖a‖₊ ∂μ).trans ?_ · intro ω simp_rw [sub_eq_add_neg, ← nnnorm_neg a, ← ENNReal.coe_add, ENNReal.coe_le_coe] exact nnnorm_add_le _ _ · simp_rw [lintegral_add_right _ measurable_const, lintegral_const] exact add_le_add (hbdd _) le_rfl refine ne_of_lt (iSup_lt_iff.2 ⟨R + ‖a‖₊ * μ Set.univ, ENNReal.add_lt_top.2 ⟨ENNReal.coe_lt_top, ENNReal.mul_lt_top ENNReal.coe_lt_top.ne (measure_ne_top _ _)⟩, fun n => le_trans ?_ (hR' n)⟩) refine lintegral_mono fun ω => ?_ rw [ENNReal.ofReal_le_iff_le_toReal, ENNReal.coe_toReal, coe_nnnorm] · by_cases hnonneg : 0 ≤ f n ω - a · rw [posPart_eq_self.2 hnonneg, Real.norm_eq_abs, abs_of_nonneg hnonneg] · rw [posPart_eq_zero.2 (not_le.1 hnonneg).le] exact norm_nonneg _ · simp only [Ne, ENNReal.coe_ne_top, not_false_iff] · simp only [hab, Ne, ENNReal.ofReal_eq_zero, sub_nonpos, not_le] · simp only [hab, Ne, ENNReal.ofReal_eq_zero, sub_nonpos, not_le, true_or_iff] · simp only [Ne, ENNReal.ofReal_ne_top, not_false_iff, true_or_iff]
26
195,729,609,428.83878
2
2
3
2,380
import Mathlib.Algebra.Group.Subgroup.Basic import Mathlib.Data.Fintype.Card import Mathlib.GroupTheory.Nilpotent import Mathlib.Order.Radical def frattini (G : Type*) [Group G] : Subgroup G := Order.radical (Subgroup G) variable {G H : Type*} [Group G] [Group H] {φ : G →* H} (hφ : Function.Surjective φ) lemma frattini_le_coatom {K : Subgroup G} (h : IsCoatom K) : frattini G ≤ K := Order.radical_le_coatom h open Subgroup lemma frattini_le_comap_frattini_of_surjective : frattini G ≤ (frattini H).comap φ := by simp_rw [frattini, Order.radical, comap_iInf, le_iInf_iff] intro M hM apply biInf_le exact isCoatom_comap_of_surjective hφ hM instance frattini_characteristic : (frattini G).Characteristic := by rw [characteristic_iff_comap_eq] intro φ apply φ.comapSubgroup.map_radical theorem frattini_nongenerating [IsCoatomic (Subgroup G)] {K : Subgroup G} (h : K ⊔ frattini G = ⊤) : K = ⊤ := Order.radical_nongenerating h -- The Sylow files unnecessarily use `Fintype` (computable) where often `Finite` would suffice, -- so we need this: attribute [local instance] Fintype.ofFinite
Mathlib/GroupTheory/Frattini.lean
59
74
theorem frattini_nilpotent [Finite G] : Group.IsNilpotent (frattini G) := by
-- We use the characterisation of nilpotency in terms of all Sylow subgroups being normal. have q := (isNilpotent_of_finite_tfae (G := frattini G)).out 0 3 rw [q]; clear q -- Consider each prime `p` and Sylow `p`-subgroup `P` of `frattini G`. intro p p_prime P -- The Frattini argument shows that the normalizer of `P` in `G` -- together with `frattini G` generates `G`. have frattini_argument := Sylow.normalizer_sup_eq_top P -- and hence by the nongenerating property of the Frattini subgroup that -- the normalizer of `P` in `G` is `G`. have normalizer_P := frattini_nongenerating frattini_argument -- This means that `P` is normal as a subgroup of `G` have P_normal_in_G : (map (frattini G).subtype ↑P).Normal := normalizer_eq_top.mp normalizer_P -- and hence also as a subgroup of `frattini G`, which was the remaining goal. exact P_normal_in_G.of_map_subtype
15
3,269,017.372472
2
2
1
2,381
import Mathlib.Algebra.ContinuedFractions.Computation.Translations import Mathlib.Algebra.ContinuedFractions.TerminatedStable import Mathlib.Algebra.ContinuedFractions.ContinuantsRecurrence import Mathlib.Order.Filter.AtTopBot import Mathlib.Tactic.FieldSimp import Mathlib.Tactic.Ring #align_import algebra.continued_fractions.computation.correctness_terminating from "leanprover-community/mathlib"@"d6814c584384ddf2825ff038e868451a7c956f31" namespace GeneralizedContinuedFraction open GeneralizedContinuedFraction (of) variable {K : Type*} [LinearOrderedField K] {v : K} {n : ℕ} protected def compExactValue (pconts conts : Pair K) (fr : K) : K := -- if the fractional part is zero, we exactly approximated the value by the last continuants if fr = 0 then conts.a / conts.b else -- otherwise, we have to include the fractional part in a final continuants step. let exact_conts := nextContinuants 1 fr⁻¹ pconts conts exact_conts.a / exact_conts.b #align generalized_continued_fraction.comp_exact_value GeneralizedContinuedFraction.compExactValue variable [FloorRing K] protected theorem compExactValue_correctness_of_stream_eq_some_aux_comp {a : K} (b c : K) (fract_a_ne_zero : Int.fract a ≠ 0) : ((⌊a⌋ : K) * b + c) / Int.fract a + b = (b * a + c) / Int.fract a := by field_simp [fract_a_ne_zero] rw [Int.fract] ring #align generalized_continued_fraction.comp_exact_value_correctness_of_stream_eq_some_aux_comp GeneralizedContinuedFraction.compExactValue_correctness_of_stream_eq_some_aux_comp open GeneralizedContinuedFraction (compExactValue compExactValue_correctness_of_stream_eq_some_aux_comp)
Mathlib/Algebra/ContinuedFractions/Computation/CorrectnessTerminating.lean
104
212
theorem compExactValue_correctness_of_stream_eq_some : ∀ {ifp_n : IntFractPair K}, IntFractPair.stream v n = some ifp_n → v = compExactValue ((of v).continuantsAux n) ((of v).continuantsAux <| n + 1) ifp_n.fr := by
let g := of v induction' n with n IH · intro ifp_zero stream_zero_eq -- Nat.zero have : IntFractPair.of v = ifp_zero := by have : IntFractPair.stream v 0 = some (IntFractPair.of v) := rfl simpa only [Nat.zero_eq, this, Option.some.injEq] using stream_zero_eq cases this cases' Decidable.em (Int.fract v = 0) with fract_eq_zero fract_ne_zero -- Int.fract v = 0; we must then have `v = ⌊v⌋` · suffices v = ⌊v⌋ by -- Porting note: was `simpa [continuantsAux, fract_eq_zero, compExactValue]` field_simp [nextContinuants, nextNumerator, nextDenominator, compExactValue] have : (IntFractPair.of v).fr = Int.fract v := rfl rwa [this, if_pos fract_eq_zero] calc v = Int.fract v + ⌊v⌋ := by rw [Int.fract_add_floor] _ = ⌊v⌋ := by simp [fract_eq_zero] -- Int.fract v ≠ 0; the claim then easily follows by unfolding a single computation step · field_simp [continuantsAux, nextContinuants, nextNumerator, nextDenominator, of_h_eq_floor, compExactValue] -- Porting note: this and the if_neg rewrite are needed have : (IntFractPair.of v).fr = Int.fract v := rfl rw [this, if_neg fract_ne_zero, Int.floor_add_fract] · intro ifp_succ_n succ_nth_stream_eq -- Nat.succ obtain ⟨ifp_n, nth_stream_eq, nth_fract_ne_zero, -⟩ : ∃ ifp_n, IntFractPair.stream v n = some ifp_n ∧ ifp_n.fr ≠ 0 ∧ IntFractPair.of ifp_n.fr⁻¹ = ifp_succ_n := IntFractPair.succ_nth_stream_eq_some_iff.1 succ_nth_stream_eq -- introduce some notation let conts := g.continuantsAux (n + 2) set pconts := g.continuantsAux (n + 1) with pconts_eq set ppconts := g.continuantsAux n with ppconts_eq cases' Decidable.em (ifp_succ_n.fr = 0) with ifp_succ_n_fr_eq_zero ifp_succ_n_fr_ne_zero -- ifp_succ_n.fr = 0 · suffices v = conts.a / conts.b by simpa [compExactValue, ifp_succ_n_fr_eq_zero] -- use the IH and the fact that ifp_n.fr⁻¹ = ⌊ifp_n.fr⁻¹⌋ to prove this case obtain ⟨ifp_n', nth_stream_eq', ifp_n_fract_inv_eq_floor⟩ : ∃ ifp_n, IntFractPair.stream v n = some ifp_n ∧ ifp_n.fr⁻¹ = ⌊ifp_n.fr⁻¹⌋ := IntFractPair.exists_succ_nth_stream_of_fr_zero succ_nth_stream_eq ifp_succ_n_fr_eq_zero have : ifp_n' = ifp_n := by injection Eq.trans nth_stream_eq'.symm nth_stream_eq cases this have s_nth_eq : g.s.get? n = some ⟨1, ⌊ifp_n.fr⁻¹⌋⟩ := get?_of_eq_some_of_get?_intFractPair_stream_fr_ne_zero nth_stream_eq nth_fract_ne_zero rw [← ifp_n_fract_inv_eq_floor] at s_nth_eq suffices v = compExactValue ppconts pconts ifp_n.fr by simpa [conts, continuantsAux, s_nth_eq, compExactValue, nth_fract_ne_zero] using this exact IH nth_stream_eq -- ifp_succ_n.fr ≠ 0 · -- use the IH to show that the following equality suffices suffices compExactValue ppconts pconts ifp_n.fr = compExactValue pconts conts ifp_succ_n.fr by have : v = compExactValue ppconts pconts ifp_n.fr := IH nth_stream_eq conv_lhs => rw [this] assumption -- get the correspondence between ifp_n and ifp_succ_n obtain ⟨ifp_n', nth_stream_eq', ifp_n_fract_ne_zero, ⟨refl⟩⟩ : ∃ ifp_n, IntFractPair.stream v n = some ifp_n ∧ ifp_n.fr ≠ 0 ∧ IntFractPair.of ifp_n.fr⁻¹ = ifp_succ_n := IntFractPair.succ_nth_stream_eq_some_iff.1 succ_nth_stream_eq have : ifp_n' = ifp_n := by injection Eq.trans nth_stream_eq'.symm nth_stream_eq cases this -- get the correspondence between ifp_n and g.s.nth n have s_nth_eq : g.s.get? n = some ⟨1, (⌊ifp_n.fr⁻¹⌋ : K)⟩ := get?_of_eq_some_of_get?_intFractPair_stream_fr_ne_zero nth_stream_eq ifp_n_fract_ne_zero -- the claim now follows by unfolding the definitions and tedious calculations -- some shorthand notation let ppA := ppconts.a let ppB := ppconts.b let pA := pconts.a let pB := pconts.b have : compExactValue ppconts pconts ifp_n.fr = (ppA + ifp_n.fr⁻¹ * pA) / (ppB + ifp_n.fr⁻¹ * pB) := by -- unfold compExactValue and the convergent computation once field_simp [ifp_n_fract_ne_zero, compExactValue, nextContinuants, nextNumerator, nextDenominator, ppA, ppB] ac_rfl rw [this] -- two calculations needed to show the claim have tmp_calc := compExactValue_correctness_of_stream_eq_some_aux_comp pA ppA ifp_succ_n_fr_ne_zero have tmp_calc' := compExactValue_correctness_of_stream_eq_some_aux_comp pB ppB ifp_succ_n_fr_ne_zero let f := Int.fract (1 / ifp_n.fr) have f_ne_zero : f ≠ 0 := by simpa [f] using ifp_succ_n_fr_ne_zero rw [inv_eq_one_div] at tmp_calc tmp_calc' -- Porting note: the `tmp_calc`s need to be massaged, and some processing after `ac_rfl` done, -- because `field_simp` is not as powerful have hA : (↑⌊1 / ifp_n.fr⌋ * pA + ppA) + pA * f = pA * (1 / ifp_n.fr) + ppA := by have := congrFun (congrArg HMul.hMul tmp_calc) f rwa [right_distrib, div_mul_cancel₀ (h := f_ne_zero), div_mul_cancel₀ (h := f_ne_zero)] at this have hB : (↑⌊1 / ifp_n.fr⌋ * pB + ppB) + pB * f = pB * (1 / ifp_n.fr) + ppB := by have := congrFun (congrArg HMul.hMul tmp_calc') f rwa [right_distrib, div_mul_cancel₀ (h := f_ne_zero), div_mul_cancel₀ (h := f_ne_zero)] at this -- now unfold the recurrence one step and simplify both sides to arrive at the conclusion dsimp only [conts, pconts, ppconts] field_simp [compExactValue, continuantsAux_recurrence s_nth_eq ppconts_eq pconts_eq, nextContinuants, nextNumerator, nextDenominator] have hfr : (IntFractPair.of (1 / ifp_n.fr)).fr = f := rfl rw [one_div, if_neg _, ← one_div, hfr] · field_simp [hA, hB] ac_rfl · rwa [inv_eq_one_div, hfr]
106
10,844,638,552,900,231,000,000,000,000,000,000,000,000,000,000
2
2
1
2,382
import Mathlib.LinearAlgebra.Prod #align_import linear_algebra.linear_pmap from "leanprover-community/mathlib"@"8b981918a93bc45a8600de608cde7944a80d92b9" universe u v w structure LinearPMap (R : Type u) [Ring R] (E : Type v) [AddCommGroup E] [Module R E] (F : Type w) [AddCommGroup F] [Module R F] where domain : Submodule R E toFun : domain →ₗ[R] F #align linear_pmap LinearPMap @[inherit_doc] notation:25 E " →ₗ.[" R:25 "] " F:0 => LinearPMap R E F variable {R : Type*} [Ring R] {E : Type*} [AddCommGroup E] [Module R E] {F : Type*} [AddCommGroup F] [Module R F] {G : Type*} [AddCommGroup G] [Module R G] namespace LinearPMap open Submodule -- Porting note: A new definition underlying a coercion `↑`. @[coe] def toFun' (f : E →ₗ.[R] F) : f.domain → F := f.toFun instance : CoeFun (E →ₗ.[R] F) fun f : E →ₗ.[R] F => f.domain → F := ⟨toFun'⟩ @[simp] theorem toFun_eq_coe (f : E →ₗ.[R] F) (x : f.domain) : f.toFun x = f x := rfl #align linear_pmap.to_fun_eq_coe LinearPMap.toFun_eq_coe @[ext]
Mathlib/LinearAlgebra/LinearPMap.lean
64
70
theorem ext {f g : E →ₗ.[R] F} (h : f.domain = g.domain) (h' : ∀ ⦃x : f.domain⦄ ⦃y : g.domain⦄ (_h : (x : E) = y), f x = g y) : f = g := by
rcases f with ⟨f_dom, f⟩ rcases g with ⟨g_dom, g⟩ obtain rfl : f_dom = g_dom := h obtain rfl : f = g := LinearMap.ext fun x => h' rfl rfl
5
148.413159
2
2
2
2,383
import Mathlib.LinearAlgebra.Prod #align_import linear_algebra.linear_pmap from "leanprover-community/mathlib"@"8b981918a93bc45a8600de608cde7944a80d92b9" universe u v w structure LinearPMap (R : Type u) [Ring R] (E : Type v) [AddCommGroup E] [Module R E] (F : Type w) [AddCommGroup F] [Module R F] where domain : Submodule R E toFun : domain →ₗ[R] F #align linear_pmap LinearPMap @[inherit_doc] notation:25 E " →ₗ.[" R:25 "] " F:0 => LinearPMap R E F variable {R : Type*} [Ring R] {E : Type*} [AddCommGroup E] [Module R E] {F : Type*} [AddCommGroup F] [Module R F] {G : Type*} [AddCommGroup G] [Module R G] namespace LinearPMap open Submodule -- Porting note: A new definition underlying a coercion `↑`. @[coe] def toFun' (f : E →ₗ.[R] F) : f.domain → F := f.toFun instance : CoeFun (E →ₗ.[R] F) fun f : E →ₗ.[R] F => f.domain → F := ⟨toFun'⟩ @[simp] theorem toFun_eq_coe (f : E →ₗ.[R] F) (x : f.domain) : f.toFun x = f x := rfl #align linear_pmap.to_fun_eq_coe LinearPMap.toFun_eq_coe @[ext] theorem ext {f g : E →ₗ.[R] F} (h : f.domain = g.domain) (h' : ∀ ⦃x : f.domain⦄ ⦃y : g.domain⦄ (_h : (x : E) = y), f x = g y) : f = g := by rcases f with ⟨f_dom, f⟩ rcases g with ⟨g_dom, g⟩ obtain rfl : f_dom = g_dom := h obtain rfl : f = g := LinearMap.ext fun x => h' rfl rfl #align linear_pmap.ext LinearPMap.ext @[simp] theorem map_zero (f : E →ₗ.[R] F) : f 0 = 0 := f.toFun.map_zero #align linear_pmap.map_zero LinearPMap.map_zero theorem ext_iff {f g : E →ₗ.[R] F} : f = g ↔ ∃ _domain_eq : f.domain = g.domain, ∀ ⦃x : f.domain⦄ ⦃y : g.domain⦄ (_h : (x : E) = y), f x = g y := ⟨fun EQ => EQ ▸ ⟨rfl, fun x y h => by congr exact mod_cast h⟩, fun ⟨deq, feq⟩ => ext deq feq⟩ #align linear_pmap.ext_iff LinearPMap.ext_iff theorem ext' {s : Submodule R E} {f g : s →ₗ[R] F} (h : f = g) : mk s f = mk s g := h ▸ rfl #align linear_pmap.ext' LinearPMap.ext' theorem map_add (f : E →ₗ.[R] F) (x y : f.domain) : f (x + y) = f x + f y := f.toFun.map_add x y #align linear_pmap.map_add LinearPMap.map_add theorem map_neg (f : E →ₗ.[R] F) (x : f.domain) : f (-x) = -f x := f.toFun.map_neg x #align linear_pmap.map_neg LinearPMap.map_neg theorem map_sub (f : E →ₗ.[R] F) (x y : f.domain) : f (x - y) = f x - f y := f.toFun.map_sub x y #align linear_pmap.map_sub LinearPMap.map_sub theorem map_smul (f : E →ₗ.[R] F) (c : R) (x : f.domain) : f (c • x) = c • f x := f.toFun.map_smul c x #align linear_pmap.map_smul LinearPMap.map_smul @[simp] theorem mk_apply (p : Submodule R E) (f : p →ₗ[R] F) (x : p) : mk p f x = f x := rfl #align linear_pmap.mk_apply LinearPMap.mk_apply noncomputable def mkSpanSingleton' (x : E) (y : F) (H : ∀ c : R, c • x = 0 → c • y = 0) : E →ₗ.[R] F where domain := R ∙ x toFun := have H : ∀ c₁ c₂ : R, c₁ • x = c₂ • x → c₁ • y = c₂ • y := by intro c₁ c₂ h rw [← sub_eq_zero, ← sub_smul] at h ⊢ exact H _ h { toFun := fun z => Classical.choose (mem_span_singleton.1 z.prop) • y -- Porting note(#12129): additional beta reduction needed -- Porting note: Were `Classical.choose_spec (mem_span_singleton.1 _)`. map_add' := fun y z => by beta_reduce rw [← add_smul] apply H simp only [add_smul, sub_smul, fun w : R ∙ x => Classical.choose_spec (mem_span_singleton.1 w.prop)] apply coe_add map_smul' := fun c z => by beta_reduce rw [smul_smul] apply H simp only [mul_smul, fun w : R ∙ x => Classical.choose_spec (mem_span_singleton.1 w.prop)] apply coe_smul } #align linear_pmap.mk_span_singleton' LinearPMap.mkSpanSingleton' @[simp] theorem domain_mkSpanSingleton (x : E) (y : F) (H : ∀ c : R, c • x = 0 → c • y = 0) : (mkSpanSingleton' x y H).domain = R ∙ x := rfl #align linear_pmap.domain_mk_span_singleton LinearPMap.domain_mkSpanSingleton @[simp]
Mathlib/LinearAlgebra/LinearPMap.lean
151
157
theorem mkSpanSingleton'_apply (x : E) (y : F) (H : ∀ c : R, c • x = 0 → c • y = 0) (c : R) (h) : mkSpanSingleton' x y H ⟨c • x, h⟩ = c • y := by
dsimp [mkSpanSingleton'] rw [← sub_eq_zero, ← sub_smul] apply H simp only [sub_smul, one_smul, sub_eq_zero] apply Classical.choose_spec (mem_span_singleton.1 h)
5
148.413159
2
2
2
2,383
import Mathlib.NumberTheory.Cyclotomic.Embeddings import Mathlib.NumberTheory.Cyclotomic.Rat import Mathlib.NumberTheory.NumberField.Units.DirichletTheorem open NumberField Units InfinitePlace nonZeroDivisors Polynomial namespace IsCyclotomicExtension.Rat.Three variable {K : Type*} [Field K] [NumberField K] [IsCyclotomicExtension {3} ℚ K] variable {ζ : K} (hζ : IsPrimitiveRoot ζ ↑(3 : ℕ+)) (u : (𝓞 K)ˣ) local notation3 "η" => (IsPrimitiveRoot.isUnit (hζ.toInteger_isPrimitiveRoot) (by decide)).unit local notation3 "λ" => (η : 𝓞 K) - 1 -- Here `List` is more convenient than `Finset`, even if further from the informal statement. -- For example, `fin_cases` below does not work with a `Finset`.
Mathlib/NumberTheory/Cyclotomic/Three.lean
41
68
theorem Units.mem : u ∈ [1, -1, η, -η, η ^ 2, -η ^ 2] := by
have hrank : rank K = 0 := by dsimp only [rank] rw [card_eq_nrRealPlaces_add_nrComplexPlaces, nrRealPlaces_eq_zero (n := 3) K (by decide), zero_add, nrComplexPlaces_eq_totient_div_two (n := 3)] rfl obtain ⟨⟨x, e⟩, hxu, -⟩ := exist_unique_eq_mul_prod _ u replace hxu : u = x := by rw [← mul_one x.1, hxu] apply congr_arg rw [← Finset.prod_empty] congr rw [Finset.univ_eq_empty_iff, hrank] infer_instance obtain ⟨n, hnpos, hn⟩ := isOfFinOrder_iff_pow_eq_one.1 <| (CommGroup.mem_torsion _ _).1 x.2 replace hn : (↑u : K) ^ ((⟨n, hnpos⟩ : ℕ+) : ℕ) = 1 := by rw [← map_pow] convert map_one (algebraMap (𝓞 K) K) rw_mod_cast [hxu, hn] simp obtain ⟨r, hr3, hru⟩ := hζ.exists_pow_or_neg_mul_pow_of_isOfFinOrder (by decide) (isOfFinOrder_iff_pow_eq_one.2 ⟨n, hnpos, hn⟩) replace hr : r ∈ Finset.Ico 0 3 := Finset.mem_Ico.2 ⟨by simp, hr3⟩ replace hru : ↑u = η ^ r ∨ ↑u = -η ^ r := by rcases hru with (h | h) · left; ext; exact h · right; ext; exact h fin_cases hr <;> rcases hru with (h | h) <;> simp [h]
27
532,048,240,601.79865
2
2
2
2,384
import Mathlib.NumberTheory.Cyclotomic.Embeddings import Mathlib.NumberTheory.Cyclotomic.Rat import Mathlib.NumberTheory.NumberField.Units.DirichletTheorem open NumberField Units InfinitePlace nonZeroDivisors Polynomial namespace IsCyclotomicExtension.Rat.Three variable {K : Type*} [Field K] [NumberField K] [IsCyclotomicExtension {3} ℚ K] variable {ζ : K} (hζ : IsPrimitiveRoot ζ ↑(3 : ℕ+)) (u : (𝓞 K)ˣ) local notation3 "η" => (IsPrimitiveRoot.isUnit (hζ.toInteger_isPrimitiveRoot) (by decide)).unit local notation3 "λ" => (η : 𝓞 K) - 1 -- Here `List` is more convenient than `Finset`, even if further from the informal statement. -- For example, `fin_cases` below does not work with a `Finset`. theorem Units.mem : u ∈ [1, -1, η, -η, η ^ 2, -η ^ 2] := by have hrank : rank K = 0 := by dsimp only [rank] rw [card_eq_nrRealPlaces_add_nrComplexPlaces, nrRealPlaces_eq_zero (n := 3) K (by decide), zero_add, nrComplexPlaces_eq_totient_div_two (n := 3)] rfl obtain ⟨⟨x, e⟩, hxu, -⟩ := exist_unique_eq_mul_prod _ u replace hxu : u = x := by rw [← mul_one x.1, hxu] apply congr_arg rw [← Finset.prod_empty] congr rw [Finset.univ_eq_empty_iff, hrank] infer_instance obtain ⟨n, hnpos, hn⟩ := isOfFinOrder_iff_pow_eq_one.1 <| (CommGroup.mem_torsion _ _).1 x.2 replace hn : (↑u : K) ^ ((⟨n, hnpos⟩ : ℕ+) : ℕ) = 1 := by rw [← map_pow] convert map_one (algebraMap (𝓞 K) K) rw_mod_cast [hxu, hn] simp obtain ⟨r, hr3, hru⟩ := hζ.exists_pow_or_neg_mul_pow_of_isOfFinOrder (by decide) (isOfFinOrder_iff_pow_eq_one.2 ⟨n, hnpos, hn⟩) replace hr : r ∈ Finset.Ico 0 3 := Finset.mem_Ico.2 ⟨by simp, hr3⟩ replace hru : ↑u = η ^ r ∨ ↑u = -η ^ r := by rcases hru with (h | h) · left; ext; exact h · right; ext; exact h fin_cases hr <;> rcases hru with (h | h) <;> simp [h] private lemma lambda_sq : λ ^ 2 = -3 * η := by ext calc (λ ^ 2 : K) = η ^ 2 + η + 1 - 3 * η := by ring _ = 0 - 3 * η := by simpa using hζ.isRoot_cyclotomic (by decide) _ = -3 * η := by ring private lemma eta_sq : (η ^ 2 : 𝓞 K) = - η - 1 := by rw [← neg_add', ← add_eq_zero_iff_eq_neg, ← add_assoc] ext; simpa using hζ.isRoot_cyclotomic (by decide)
Mathlib/NumberTheory/Cyclotomic/Three.lean
85
111
theorem eq_one_or_neg_one_of_unit_of_congruent (hcong : ∃ n : ℤ, λ ^ 2 ∣ (u - n : 𝓞 K)) : u = 1 ∨ u = -1 := by
replace hcong : ∃ n : ℤ, (3 : 𝓞 K) ∣ (↑u - n : 𝓞 K) := by obtain ⟨n, x, hx⟩ := hcong exact ⟨n, -η * x, by rw [← mul_assoc, mul_neg, ← neg_mul, ← lambda_sq, hx]⟩ have hζ := IsCyclotomicExtension.zeta_spec 3 ℚ K have := Units.mem hζ u fin_cases this · left; rfl · right; rfl all_goals exfalso · exact hζ.not_exists_int_prime_dvd_sub_of_prime_ne_two' (by decide) hcong · apply hζ.not_exists_int_prime_dvd_sub_of_prime_ne_two' (by decide) obtain ⟨n, x, hx⟩ := hcong rw [sub_eq_iff_eq_add] at hx refine ⟨-n, -x, sub_eq_iff_eq_add.2 ?_⟩ simp only [PNat.val_ofNat, Nat.cast_ofNat, mul_neg, Int.cast_neg, ← neg_add, ← hx, Units.val_neg, IsUnit.unit_spec, RingOfIntegers.neg_mk, neg_neg] · exact (hζ.pow_of_coprime 2 (by decide)).not_exists_int_prime_dvd_sub_of_prime_ne_two' (by decide) hcong · apply (hζ.pow_of_coprime 2 (by decide)).not_exists_int_prime_dvd_sub_of_prime_ne_two' (by decide) obtain ⟨n, x, hx⟩ := hcong refine ⟨-n, -x, sub_eq_iff_eq_add.2 ?_⟩ have : (hζ.pow_of_coprime 2 (by decide)).toInteger = hζ.toInteger ^ 2 := by ext; simp simp only [this, PNat.val_ofNat, Nat.cast_ofNat, mul_neg, Int.cast_neg, ← neg_add, ← sub_eq_iff_eq_add.1 hx, Units.val_neg, val_pow_eq_pow_val, IsUnit.unit_spec, neg_neg]
25
72,004,899,337.38586
2
2
2
2,384
import Mathlib.Algebra.Associated import Mathlib.Algebra.Ring.Int #align_import data.int.associated from "leanprover-community/mathlib"@"207cfac9fcd06138865b5d04f7091e46d9320432"
Mathlib/Data/Int/Associated.lean
21
30
theorem Int.natAbs_eq_iff_associated {a b : ℤ} : a.natAbs = b.natAbs ↔ Associated a b := by
refine Int.natAbs_eq_natAbs_iff.trans ?_ constructor · rintro (rfl | rfl) · rfl · exact ⟨-1, by simp⟩ · rintro ⟨u, rfl⟩ obtain rfl | rfl := Int.units_eq_one_or u · exact Or.inl (by simp) · exact Or.inr (by simp)
9
8,103.083928
2
2
1
2,385
import Mathlib.Algebra.Group.Center import Mathlib.Data.Int.Cast.Lemmas #align_import group_theory.subsemigroup.center from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" variable {M : Type*} namespace Set variable (M) @[simp]
Mathlib/Algebra/Ring/Center.lean
24
37
theorem natCast_mem_center [NonAssocSemiring M] (n : ℕ) : (n : M) ∈ Set.center M where comm _:= by
rw [Nat.commute_cast] left_assoc _ _ := by induction n with | zero => rw [Nat.cast_zero, zero_mul, zero_mul, zero_mul] | succ n ihn => rw [Nat.cast_succ, add_mul, one_mul, ihn, add_mul, add_mul, one_mul] mid_assoc _ _ := by induction n with | zero => rw [Nat.cast_zero, zero_mul, mul_zero, zero_mul] | succ n ihn => rw [Nat.cast_succ, add_mul, mul_add, add_mul, ihn, mul_add, one_mul, mul_one] right_assoc _ _ := by induction n with | zero => rw [Nat.cast_zero, mul_zero, mul_zero, mul_zero] | succ n ihn => rw [Nat.cast_succ, mul_add, ihn, mul_add, mul_add, mul_one, mul_one]
13
442,413.392009
2
2
4
2,386
import Mathlib.Algebra.Group.Center import Mathlib.Data.Int.Cast.Lemmas #align_import group_theory.subsemigroup.center from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" variable {M : Type*} namespace Set variable (M) @[simp] theorem natCast_mem_center [NonAssocSemiring M] (n : ℕ) : (n : M) ∈ Set.center M where comm _:= by rw [Nat.commute_cast] left_assoc _ _ := by induction n with | zero => rw [Nat.cast_zero, zero_mul, zero_mul, zero_mul] | succ n ihn => rw [Nat.cast_succ, add_mul, one_mul, ihn, add_mul, add_mul, one_mul] mid_assoc _ _ := by induction n with | zero => rw [Nat.cast_zero, zero_mul, mul_zero, zero_mul] | succ n ihn => rw [Nat.cast_succ, add_mul, mul_add, add_mul, ihn, mul_add, one_mul, mul_one] right_assoc _ _ := by induction n with | zero => rw [Nat.cast_zero, mul_zero, mul_zero, mul_zero] | succ n ihn => rw [Nat.cast_succ, mul_add, ihn, mul_add, mul_add, mul_one, mul_one] -- See note [no_index around OfNat.ofNat] @[simp] theorem ofNat_mem_center [NonAssocSemiring M] (n : ℕ) [n.AtLeastTwo] : (no_index (OfNat.ofNat n)) ∈ Set.center M := natCast_mem_center M n @[simp]
Mathlib/Algebra/Ring/Center.lean
46
67
theorem intCast_mem_center [NonAssocRing M] (n : ℤ) : (n : M) ∈ Set.center M where comm _ := by
rw [Int.commute_cast] left_assoc _ _ := match n with | (n : ℕ) => by rw [Int.cast_natCast, (natCast_mem_center _ n).left_assoc _ _] | Int.negSucc n => by rw [Int.cast_negSucc, Nat.cast_add, Nat.cast_one, neg_add_rev, add_mul, add_mul, add_mul, neg_mul, one_mul, neg_mul 1, one_mul, ← neg_mul, add_right_inj, neg_mul, (natCast_mem_center _ n).left_assoc _ _, neg_mul, neg_mul] mid_assoc _ _ := match n with | (n : ℕ) => by rw [Int.cast_natCast, (natCast_mem_center _ n).mid_assoc _ _] | Int.negSucc n => by simp only [Int.cast_negSucc, Nat.cast_add, Nat.cast_one, neg_add_rev] rw [add_mul, mul_add, add_mul, mul_add, neg_mul, one_mul] rw [neg_mul, mul_neg, mul_one, mul_neg, neg_mul, neg_mul] rw [(natCast_mem_center _ n).mid_assoc _ _] simp only [mul_neg] right_assoc _ _ := match n with | (n : ℕ) => by rw [Int.cast_natCast, (natCast_mem_center _ n).right_assoc _ _] | Int.negSucc n => by simp only [Int.cast_negSucc, Nat.cast_add, Nat.cast_one, neg_add_rev] rw [mul_add, mul_add, mul_add, mul_neg, mul_one, mul_neg, mul_neg, mul_one, mul_neg, add_right_inj, (natCast_mem_center _ n).right_assoc _ _, mul_neg, mul_neg]
21
1,318,815,734.483215
2
2
4
2,386
import Mathlib.Algebra.Group.Center import Mathlib.Data.Int.Cast.Lemmas #align_import group_theory.subsemigroup.center from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" variable {M : Type*} namespace Set variable (M) @[simp] theorem natCast_mem_center [NonAssocSemiring M] (n : ℕ) : (n : M) ∈ Set.center M where comm _:= by rw [Nat.commute_cast] left_assoc _ _ := by induction n with | zero => rw [Nat.cast_zero, zero_mul, zero_mul, zero_mul] | succ n ihn => rw [Nat.cast_succ, add_mul, one_mul, ihn, add_mul, add_mul, one_mul] mid_assoc _ _ := by induction n with | zero => rw [Nat.cast_zero, zero_mul, mul_zero, zero_mul] | succ n ihn => rw [Nat.cast_succ, add_mul, mul_add, add_mul, ihn, mul_add, one_mul, mul_one] right_assoc _ _ := by induction n with | zero => rw [Nat.cast_zero, mul_zero, mul_zero, mul_zero] | succ n ihn => rw [Nat.cast_succ, mul_add, ihn, mul_add, mul_add, mul_one, mul_one] -- See note [no_index around OfNat.ofNat] @[simp] theorem ofNat_mem_center [NonAssocSemiring M] (n : ℕ) [n.AtLeastTwo] : (no_index (OfNat.ofNat n)) ∈ Set.center M := natCast_mem_center M n @[simp] theorem intCast_mem_center [NonAssocRing M] (n : ℤ) : (n : M) ∈ Set.center M where comm _ := by rw [Int.commute_cast] left_assoc _ _ := match n with | (n : ℕ) => by rw [Int.cast_natCast, (natCast_mem_center _ n).left_assoc _ _] | Int.negSucc n => by rw [Int.cast_negSucc, Nat.cast_add, Nat.cast_one, neg_add_rev, add_mul, add_mul, add_mul, neg_mul, one_mul, neg_mul 1, one_mul, ← neg_mul, add_right_inj, neg_mul, (natCast_mem_center _ n).left_assoc _ _, neg_mul, neg_mul] mid_assoc _ _ := match n with | (n : ℕ) => by rw [Int.cast_natCast, (natCast_mem_center _ n).mid_assoc _ _] | Int.negSucc n => by simp only [Int.cast_negSucc, Nat.cast_add, Nat.cast_one, neg_add_rev] rw [add_mul, mul_add, add_mul, mul_add, neg_mul, one_mul] rw [neg_mul, mul_neg, mul_one, mul_neg, neg_mul, neg_mul] rw [(natCast_mem_center _ n).mid_assoc _ _] simp only [mul_neg] right_assoc _ _ := match n with | (n : ℕ) => by rw [Int.cast_natCast, (natCast_mem_center _ n).right_assoc _ _] | Int.negSucc n => by simp only [Int.cast_negSucc, Nat.cast_add, Nat.cast_one, neg_add_rev] rw [mul_add, mul_add, mul_add, mul_neg, mul_one, mul_neg, mul_neg, mul_one, mul_neg, add_right_inj, (natCast_mem_center _ n).right_assoc _ _, mul_neg, mul_neg] variable {M} @[simp]
Mathlib/Algebra/Ring/Center.lean
72
77
theorem add_mem_center [Distrib M] {a b : M} (ha : a ∈ Set.center M) (hb : b ∈ Set.center M) : a + b ∈ Set.center M where comm _ := by
rw [add_mul, mul_add, ha.comm, hb.comm] left_assoc _ _ := by rw [add_mul, ha.left_assoc, hb.left_assoc, ← add_mul, ← add_mul] mid_assoc _ _ := by rw [mul_add, add_mul, ha.mid_assoc, hb.mid_assoc, ← mul_add, ← add_mul] right_assoc _ _ := by rw [mul_add, ha.right_assoc, hb.right_assoc, ← mul_add, ← mul_add]
4
54.59815
2
2
4
2,386
import Mathlib.Algebra.Group.Center import Mathlib.Data.Int.Cast.Lemmas #align_import group_theory.subsemigroup.center from "leanprover-community/mathlib"@"1ac8d4304efba9d03fa720d06516fac845aa5353" variable {M : Type*} namespace Set variable (M) @[simp] theorem natCast_mem_center [NonAssocSemiring M] (n : ℕ) : (n : M) ∈ Set.center M where comm _:= by rw [Nat.commute_cast] left_assoc _ _ := by induction n with | zero => rw [Nat.cast_zero, zero_mul, zero_mul, zero_mul] | succ n ihn => rw [Nat.cast_succ, add_mul, one_mul, ihn, add_mul, add_mul, one_mul] mid_assoc _ _ := by induction n with | zero => rw [Nat.cast_zero, zero_mul, mul_zero, zero_mul] | succ n ihn => rw [Nat.cast_succ, add_mul, mul_add, add_mul, ihn, mul_add, one_mul, mul_one] right_assoc _ _ := by induction n with | zero => rw [Nat.cast_zero, mul_zero, mul_zero, mul_zero] | succ n ihn => rw [Nat.cast_succ, mul_add, ihn, mul_add, mul_add, mul_one, mul_one] -- See note [no_index around OfNat.ofNat] @[simp] theorem ofNat_mem_center [NonAssocSemiring M] (n : ℕ) [n.AtLeastTwo] : (no_index (OfNat.ofNat n)) ∈ Set.center M := natCast_mem_center M n @[simp] theorem intCast_mem_center [NonAssocRing M] (n : ℤ) : (n : M) ∈ Set.center M where comm _ := by rw [Int.commute_cast] left_assoc _ _ := match n with | (n : ℕ) => by rw [Int.cast_natCast, (natCast_mem_center _ n).left_assoc _ _] | Int.negSucc n => by rw [Int.cast_negSucc, Nat.cast_add, Nat.cast_one, neg_add_rev, add_mul, add_mul, add_mul, neg_mul, one_mul, neg_mul 1, one_mul, ← neg_mul, add_right_inj, neg_mul, (natCast_mem_center _ n).left_assoc _ _, neg_mul, neg_mul] mid_assoc _ _ := match n with | (n : ℕ) => by rw [Int.cast_natCast, (natCast_mem_center _ n).mid_assoc _ _] | Int.negSucc n => by simp only [Int.cast_negSucc, Nat.cast_add, Nat.cast_one, neg_add_rev] rw [add_mul, mul_add, add_mul, mul_add, neg_mul, one_mul] rw [neg_mul, mul_neg, mul_one, mul_neg, neg_mul, neg_mul] rw [(natCast_mem_center _ n).mid_assoc _ _] simp only [mul_neg] right_assoc _ _ := match n with | (n : ℕ) => by rw [Int.cast_natCast, (natCast_mem_center _ n).right_assoc _ _] | Int.negSucc n => by simp only [Int.cast_negSucc, Nat.cast_add, Nat.cast_one, neg_add_rev] rw [mul_add, mul_add, mul_add, mul_neg, mul_one, mul_neg, mul_neg, mul_one, mul_neg, add_right_inj, (natCast_mem_center _ n).right_assoc _ _, mul_neg, mul_neg] variable {M} @[simp] theorem add_mem_center [Distrib M] {a b : M} (ha : a ∈ Set.center M) (hb : b ∈ Set.center M) : a + b ∈ Set.center M where comm _ := by rw [add_mul, mul_add, ha.comm, hb.comm] left_assoc _ _ := by rw [add_mul, ha.left_assoc, hb.left_assoc, ← add_mul, ← add_mul] mid_assoc _ _ := by rw [mul_add, add_mul, ha.mid_assoc, hb.mid_assoc, ← mul_add, ← add_mul] right_assoc _ _ := by rw [mul_add, ha.right_assoc, hb.right_assoc, ← mul_add, ← mul_add] #align set.add_mem_center Set.add_mem_center @[simp]
Mathlib/Algebra/Ring/Center.lean
81
86
theorem neg_mem_center [NonUnitalNonAssocRing M] {a : M} (ha : a ∈ Set.center M) : -a ∈ Set.center M where comm _ := by
rw [← neg_mul_comm, ← ha.comm, neg_mul_comm] left_assoc _ _ := by rw [neg_mul, ha.left_assoc, neg_mul, neg_mul] mid_assoc _ _ := by rw [← neg_mul_comm, ha.mid_assoc, neg_mul_comm, neg_mul] right_assoc _ _ := by rw [mul_neg, ha.right_assoc, mul_neg, mul_neg]
4
54.59815
2
2
4
2,386
import Mathlib.CategoryTheory.Sites.Coherent.Basic import Mathlib.CategoryTheory.EffectiveEpi.Comp import Mathlib.CategoryTheory.EffectiveEpi.Extensive namespace CategoryTheory open Limits GrothendieckTopology Sieve variable (C : Type*) [Category C] instance [Precoherent C] [HasFiniteCoproducts C] : Preregular C where exists_fac {X Y Z} f g _ := by have hp := Precoherent.pullback f PUnit (fun () ↦ Z) (fun () ↦ g) simp only [exists_const] at hp rw [← effectiveEpi_iff_effectiveEpiFamily g] at hp obtain ⟨β, _, X₂, π₂, h, ι, hι⟩ := hp inferInstance refine ⟨∐ X₂, Sigma.desc π₂, inferInstance, Sigma.desc ι, ?_⟩ ext b simpa using hι b instance [FinitaryPreExtensive C] [Preregular C] : Precoherent C where pullback {B₁ B₂} f α _ X₁ π₁ h := by refine ⟨α, inferInstance, ?_⟩ obtain ⟨Y, g, _, g', hg⟩ := Preregular.exists_fac f (Sigma.desc π₁) let X₂ := fun a ↦ pullback g' (Sigma.ι X₁ a) let π₂ := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) ≫ g let π' := fun a ↦ pullback.fst (f := g') (g := Sigma.ι X₁ a) have _ := FinitaryPreExtensive.sigma_desc_iso (fun a ↦ Sigma.ι X₁ a) g' inferInstance refine ⟨X₂, π₂, ?_, ?_⟩ · have : (Sigma.desc π' ≫ g) = Sigma.desc π₂ := by ext; simp rw [← effectiveEpi_desc_iff_effectiveEpiFamily, ← this] infer_instance · refine ⟨id, fun b ↦ pullback.snd, fun b ↦ ?_⟩ simp only [π₂, id_eq, Category.assoc, ← hg] rw [← Category.assoc, pullback.condition] simp
Mathlib/CategoryTheory/Sites/Coherent/Comparison.lean
57
94
theorem extensive_regular_generate_coherent [Preregular C] [FinitaryPreExtensive C] : ((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck = (coherentTopology C) := by
ext B S refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩ · induction h with | of Y T hT => apply Coverage.saturate.of simp only [Coverage.sup_covering, Set.mem_union] at hT exact Or.elim hT (fun ⟨α, x, X, π, ⟨h, _⟩⟩ ↦ ⟨α, x, X, π, ⟨h, inferInstance⟩⟩) (fun ⟨Z, f, ⟨h, _⟩⟩ ↦ ⟨Unit, inferInstance, fun _ ↦ Z, fun _ ↦ f, ⟨h, inferInstance⟩⟩) | top => apply Coverage.saturate.top | transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption] · induction h with | of Y T hT => obtain ⟨I, _, X, f, rfl, hT⟩ := hT apply Coverage.saturate.transitive Y (generate (Presieve.ofArrows (fun (_ : Unit) ↦ (∐ fun (i : I) => X i)) (fun (_ : Unit) ↦ Sigma.desc f))) · apply Coverage.saturate.of simp only [Coverage.sup_covering, extensiveCoverage, regularCoverage, Set.mem_union, Set.mem_setOf_eq] exact Or.inr ⟨_, Sigma.desc f, ⟨rfl, inferInstance⟩⟩ · rintro R g ⟨W, ψ, σ, ⟨⟩, rfl⟩ change _ ∈ sieves ((extensiveCoverage C) ⊔ (regularCoverage C)).toGrothendieck _ rw [Sieve.pullback_comp] apply pullback_stable' have : generate (Presieve.ofArrows X fun (i : I) ↦ Sigma.ι X i) ≤ (generate (Presieve.ofArrows X f)).pullback (Sigma.desc f) := by rintro Q q ⟨E, e, r, ⟨hq, rfl⟩⟩ exact ⟨E, e, r ≫ (Sigma.desc f), by cases hq; simpa using Presieve.ofArrows.mk _, by simp⟩ apply Coverage.saturate_of_superset _ this apply Coverage.saturate.of refine Or.inl ⟨I, inferInstance, _, _, ⟨rfl, ?_⟩⟩ convert IsIso.id _ aesop | top => apply Coverage.saturate.top | transitive Y T => apply Coverage.saturate.transitive Y T<;> [assumption; assumption]
35
1,586,013,452,313,430.8
2
2
1
2,387
import Mathlib.NumberTheory.NumberField.ClassNumber import Mathlib.NumberTheory.Cyclotomic.Rat import Mathlib.NumberTheory.Cyclotomic.Embeddings universe u namespace IsCyclotomicExtension.Rat open NumberField Polynomial InfinitePlace Nat Real cyclotomic variable (K : Type u) [Field K] [NumberField K]
Mathlib/NumberTheory/Cyclotomic/PID.lean
30
41
theorem three_pid [IsCyclotomicExtension {3} ℚ K] : IsPrincipalIdealRing (𝓞 K) := by
apply RingOfIntegers.isPrincipalIdealRing_of_abs_discr_lt rw [absdiscr_prime 3 K, IsCyclotomicExtension.finrank (n := 3) K (irreducible_rat (by norm_num)), nrComplexPlaces_eq_totient_div_two 3, totient_prime PNat.prime_three] simp only [Int.reduceNeg, PNat.val_ofNat, succ_sub_succ_eq_sub, tsub_zero, zero_lt_two, Nat.div_self, pow_one, cast_ofNat, neg_mul, one_mul, abs_neg, Int.cast_abs, Int.cast_ofNat, factorial_two, gt_iff_lt, abs_of_pos (show (0 : ℝ) < 3 by norm_num)] suffices (2 * (3 / 4) * (2 ^ 2 / 2)) ^ 2 < (2 * (π / 4) * (2 ^ 2 / 2)) ^ 2 from lt_trans (by norm_num) this gcongr exact pi_gt_three
11
59,874.141715
2
2
2
2,388
import Mathlib.NumberTheory.NumberField.ClassNumber import Mathlib.NumberTheory.Cyclotomic.Rat import Mathlib.NumberTheory.Cyclotomic.Embeddings universe u namespace IsCyclotomicExtension.Rat open NumberField Polynomial InfinitePlace Nat Real cyclotomic variable (K : Type u) [Field K] [NumberField K] theorem three_pid [IsCyclotomicExtension {3} ℚ K] : IsPrincipalIdealRing (𝓞 K) := by apply RingOfIntegers.isPrincipalIdealRing_of_abs_discr_lt rw [absdiscr_prime 3 K, IsCyclotomicExtension.finrank (n := 3) K (irreducible_rat (by norm_num)), nrComplexPlaces_eq_totient_div_two 3, totient_prime PNat.prime_three] simp only [Int.reduceNeg, PNat.val_ofNat, succ_sub_succ_eq_sub, tsub_zero, zero_lt_two, Nat.div_self, pow_one, cast_ofNat, neg_mul, one_mul, abs_neg, Int.cast_abs, Int.cast_ofNat, factorial_two, gt_iff_lt, abs_of_pos (show (0 : ℝ) < 3 by norm_num)] suffices (2 * (3 / 4) * (2 ^ 2 / 2)) ^ 2 < (2 * (π / 4) * (2 ^ 2 / 2)) ^ 2 from lt_trans (by norm_num) this gcongr exact pi_gt_three
Mathlib/NumberTheory/Cyclotomic/PID.lean
44
55
theorem five_pid [IsCyclotomicExtension {5} ℚ K] : IsPrincipalIdealRing (𝓞 K) := by
apply RingOfIntegers.isPrincipalIdealRing_of_abs_discr_lt rw [absdiscr_prime 5 K, IsCyclotomicExtension.finrank (n := 5) K (irreducible_rat (by norm_num)), nrComplexPlaces_eq_totient_div_two 5, totient_prime PNat.prime_five] simp only [Int.reduceNeg, PNat.val_ofNat, succ_sub_succ_eq_sub, tsub_zero, reduceDiv, even_two, Even.neg_pow, one_pow, cast_ofNat, Int.reducePow, one_mul, Int.cast_abs, Int.cast_ofNat, div_pow, gt_iff_lt, show 4! = 24 by rfl, abs_of_pos (show (0 : ℝ) < 125 by norm_num)] suffices (2 * (3 ^ 2 / 4 ^ 2) * (4 ^ 4 / 24)) ^ 2 < (2 * (π ^ 2 / 4 ^ 2) * (4 ^ 4 / 24)) ^ 2 from lt_trans (by norm_num) this gcongr exact pi_gt_three
11
59,874.141715
2
2
2
2,388
import Mathlib.Geometry.Euclidean.Sphere.Power import Mathlib.Geometry.Euclidean.Triangle #align_import geometry.euclidean.sphere.ptolemy from "leanprover-community/mathlib"@"46b633fd842bef9469441c0209906f6dddd2b4f5" open Real open scoped EuclideanGeometry RealInnerProductSpace Real namespace EuclideanGeometry variable {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] variable {P : Type*} [MetricSpace P] [NormedAddTorsor V P]
Mathlib/Geometry/Euclidean/Sphere/Ptolemy.lean
53
70
theorem mul_dist_add_mul_dist_eq_mul_dist_of_cospherical {a b c d p : P} (h : Cospherical ({a, b, c, d} : Set P)) (hapc : ∠ a p c = π) (hbpd : ∠ b p d = π) : dist a b * dist c d + dist b c * dist d a = dist a c * dist b d := by
have h' : Cospherical ({a, c, b, d} : Set P) := by rwa [Set.insert_comm c b {d}] have hmul := mul_dist_eq_mul_dist_of_cospherical_of_angle_eq_pi h' hapc hbpd have hbp := left_dist_ne_zero_of_angle_eq_pi hbpd have h₁ : dist c d = dist c p / dist b p * dist a b := by rw [dist_mul_of_eq_angle_of_dist_mul b p a c p d, dist_comm a b] · rw [angle_eq_angle_of_angle_eq_pi_of_angle_eq_pi hbpd hapc, angle_comm] all_goals field_simp [mul_comm, hmul] have h₂ : dist d a = dist a p / dist b p * dist b c := by rw [dist_mul_of_eq_angle_of_dist_mul c p b d p a, dist_comm c b] · rwa [angle_comm, angle_eq_angle_of_angle_eq_pi_of_angle_eq_pi]; rwa [angle_comm] all_goals field_simp [mul_comm, hmul] have h₃ : dist d p = dist a p * dist c p / dist b p := by field_simp [mul_comm, hmul] have h₄ : ∀ x y : ℝ, x * (y * x) = x * x * y := fun x y => by rw [mul_left_comm, mul_comm] field_simp [h₁, h₂, dist_eq_add_dist_of_angle_eq_pi hbpd, h₃, hbp, dist_comm a b, h₄, ← sq, dist_sq_mul_dist_add_dist_sq_mul_dist b, hapc]
15
3,269,017.372472
2
2
1
2,389
import Mathlib.MeasureTheory.Constructions.Cylinders import Mathlib.MeasureTheory.Measure.Typeclasses open Set namespace MeasureTheory variable {ι : Type*} {α : ι → Type*} [∀ i, MeasurableSpace (α i)] {P : ∀ J : Finset ι, Measure (∀ j : J, α j)} def IsProjectiveMeasureFamily (P : ∀ J : Finset ι, Measure (∀ j : J, α j)) : Prop := ∀ (I J : Finset ι) (hJI : J ⊆ I), P J = (P I).map (fun (x : ∀ i : I, α i) (j : J) ↦ x ⟨j, hJI j.2⟩) def IsProjectiveLimit (μ : Measure (∀ i, α i)) (P : ∀ J : Finset ι, Measure (∀ j : J, α j)) : Prop := ∀ I : Finset ι, (μ.map fun x : ∀ i, α i ↦ fun i : I ↦ x i) = P I namespace IsProjectiveLimit variable {μ ν : Measure (∀ i, α i)} lemma measure_cylinder (h : IsProjectiveLimit μ P) (I : Finset ι) {s : Set (∀ i : I, α i)} (hs : MeasurableSet s) : μ (cylinder I s) = P I s := by rw [cylinder, ← Measure.map_apply _ hs, h I] exact measurable_pi_lambda _ (fun _ ↦ measurable_pi_apply _) lemma measure_univ_eq (hμ : IsProjectiveLimit μ P) (I : Finset ι) : μ univ = P I univ := by rw [← cylinder_univ I, hμ.measure_cylinder _ MeasurableSet.univ] lemma isFiniteMeasure [∀ i, IsFiniteMeasure (P i)] (hμ : IsProjectiveLimit μ P) : IsFiniteMeasure μ := by constructor rw [hμ.measure_univ_eq (∅ : Finset ι)] exact measure_lt_top _ _ lemma isProbabilityMeasure [∀ i, IsProbabilityMeasure (P i)] (hμ : IsProjectiveLimit μ P) : IsProbabilityMeasure μ := by constructor rw [hμ.measure_univ_eq (∅ : Finset ι)] exact measure_univ lemma measure_univ_unique (hμ : IsProjectiveLimit μ P) (hν : IsProjectiveLimit ν P) : μ univ = ν univ := by rw [hμ.measure_univ_eq (∅ : Finset ι), hν.measure_univ_eq (∅ : Finset ι)]
Mathlib/MeasureTheory/Constructions/Projective.lean
143
150
theorem unique [∀ i, IsFiniteMeasure (P i)] (hμ : IsProjectiveLimit μ P) (hν : IsProjectiveLimit ν P) : μ = ν := by
haveI : IsFiniteMeasure μ := hμ.isFiniteMeasure refine ext_of_generate_finite (measurableCylinders α) generateFrom_measurableCylinders.symm isPiSystem_measurableCylinders (fun s hs ↦ ?_) (hμ.measure_univ_unique hν) obtain ⟨I, S, hS, rfl⟩ := (mem_measurableCylinders _).mp hs rw [hμ.measure_cylinder _ hS, hν.measure_cylinder _ hS]
5
148.413159
2
2
1
2,390
import Mathlib.CategoryTheory.Linear.Basic import Mathlib.CategoryTheory.Preadditive.Biproducts import Mathlib.LinearAlgebra.Matrix.InvariantBasisNumber import Mathlib.Data.Set.Subsingleton #align_import category_theory.preadditive.hom_orthogonal from "leanprover-community/mathlib"@"829895f162a1f29d0133f4b3538f4cd1fb5bffd3" open scoped Classical open Matrix CategoryTheory.Limits universe v u namespace CategoryTheory variable {C : Type u} [Category.{v} C] def HomOrthogonal {ι : Type*} (s : ι → C) : Prop := Pairwise fun i j => Subsingleton (s i ⟶ s j) #align category_theory.hom_orthogonal CategoryTheory.HomOrthogonal namespace HomOrthogonal variable {ι : Type*} {s : ι → C} theorem eq_zero [HasZeroMorphisms C] (o : HomOrthogonal s) {i j : ι} (w : i ≠ j) (f : s i ⟶ s j) : f = 0 := (o w).elim _ _ #align category_theory.hom_orthogonal.eq_zero CategoryTheory.HomOrthogonal.eq_zero section variable [HasZeroMorphisms C] [HasFiniteBiproducts C] @[simps] noncomputable def matrixDecomposition (o : HomOrthogonal s) {α β : Type} [Finite α] [Finite β] {f : α → ι} {g : β → ι} : ((⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)) ≃ ∀ i : ι, Matrix (g ⁻¹' {i}) (f ⁻¹' {i}) (End (s i)) where toFun z i j k := eqToHom (by rcases k with ⟨k, ⟨⟩⟩ simp) ≫ biproduct.components z k j ≫ eqToHom (by rcases j with ⟨j, ⟨⟩⟩ simp) invFun z := biproduct.matrix fun j k => if h : f j = g k then z (f j) ⟨k, by simp [h]⟩ ⟨j, by simp⟩ ≫ eqToHom (by simp [h]) else 0 left_inv z := by ext j k simp only [biproduct.matrix_π, biproduct.ι_desc] split_ifs with h · simp rfl · symm apply o.eq_zero h right_inv z := by ext i ⟨j, w⟩ ⟨k, ⟨⟩⟩ simp only [eqToHom_refl, biproduct.matrix_components, Category.id_comp] split_ifs with h · simp · exfalso exact h w.symm #align category_theory.hom_orthogonal.matrix_decomposition CategoryTheory.HomOrthogonal.matrixDecomposition end section variable [Preadditive C] [HasFiniteBiproducts C] @[simps!] noncomputable def matrixDecompositionAddEquiv (o : HomOrthogonal s) {α β : Type} [Finite α] [Finite β] {f : α → ι} {g : β → ι} : ((⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)) ≃+ ∀ i : ι, Matrix (g ⁻¹' {i}) (f ⁻¹' {i}) (End (s i)) := { o.matrixDecomposition with map_add' := fun w z => by ext dsimp [biproduct.components] simp } #align category_theory.hom_orthogonal.matrix_decomposition_add_equiv CategoryTheory.HomOrthogonal.matrixDecompositionAddEquiv @[simp]
Mathlib/CategoryTheory/Preadditive/HomOrthogonal.lean
130
143
theorem matrixDecomposition_id (o : HomOrthogonal s) {α : Type} [Finite α] {f : α → ι} (i : ι) : o.matrixDecomposition (𝟙 (⨁ fun a => s (f a))) i = 1 := by
ext ⟨b, ⟨⟩⟩ ⟨a, j_property⟩ simp only [Set.mem_preimage, Set.mem_singleton_iff] at j_property simp only [Category.comp_id, Category.id_comp, Category.assoc, End.one_def, eqToHom_refl, Matrix.one_apply, HomOrthogonal.matrixDecomposition_apply, biproduct.components] split_ifs with h · cases h simp · simp at h -- Porting note: used to be `convert comp_zero`, but that does not work anymore have : biproduct.ι (fun a ↦ s (f a)) a ≫ biproduct.π (fun b ↦ s (f b)) b = 0 := by simpa using biproduct.ι_π_ne _ (Ne.symm h) rw [this, comp_zero]
12
162,754.791419
2
2
2
2,391
import Mathlib.CategoryTheory.Linear.Basic import Mathlib.CategoryTheory.Preadditive.Biproducts import Mathlib.LinearAlgebra.Matrix.InvariantBasisNumber import Mathlib.Data.Set.Subsingleton #align_import category_theory.preadditive.hom_orthogonal from "leanprover-community/mathlib"@"829895f162a1f29d0133f4b3538f4cd1fb5bffd3" open scoped Classical open Matrix CategoryTheory.Limits universe v u namespace CategoryTheory variable {C : Type u} [Category.{v} C] def HomOrthogonal {ι : Type*} (s : ι → C) : Prop := Pairwise fun i j => Subsingleton (s i ⟶ s j) #align category_theory.hom_orthogonal CategoryTheory.HomOrthogonal namespace HomOrthogonal variable {ι : Type*} {s : ι → C} theorem eq_zero [HasZeroMorphisms C] (o : HomOrthogonal s) {i j : ι} (w : i ≠ j) (f : s i ⟶ s j) : f = 0 := (o w).elim _ _ #align category_theory.hom_orthogonal.eq_zero CategoryTheory.HomOrthogonal.eq_zero section variable [HasZeroMorphisms C] [HasFiniteBiproducts C] @[simps] noncomputable def matrixDecomposition (o : HomOrthogonal s) {α β : Type} [Finite α] [Finite β] {f : α → ι} {g : β → ι} : ((⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)) ≃ ∀ i : ι, Matrix (g ⁻¹' {i}) (f ⁻¹' {i}) (End (s i)) where toFun z i j k := eqToHom (by rcases k with ⟨k, ⟨⟩⟩ simp) ≫ biproduct.components z k j ≫ eqToHom (by rcases j with ⟨j, ⟨⟩⟩ simp) invFun z := biproduct.matrix fun j k => if h : f j = g k then z (f j) ⟨k, by simp [h]⟩ ⟨j, by simp⟩ ≫ eqToHom (by simp [h]) else 0 left_inv z := by ext j k simp only [biproduct.matrix_π, biproduct.ι_desc] split_ifs with h · simp rfl · symm apply o.eq_zero h right_inv z := by ext i ⟨j, w⟩ ⟨k, ⟨⟩⟩ simp only [eqToHom_refl, biproduct.matrix_components, Category.id_comp] split_ifs with h · simp · exfalso exact h w.symm #align category_theory.hom_orthogonal.matrix_decomposition CategoryTheory.HomOrthogonal.matrixDecomposition end section variable [Preadditive C] [HasFiniteBiproducts C] @[simps!] noncomputable def matrixDecompositionAddEquiv (o : HomOrthogonal s) {α β : Type} [Finite α] [Finite β] {f : α → ι} {g : β → ι} : ((⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)) ≃+ ∀ i : ι, Matrix (g ⁻¹' {i}) (f ⁻¹' {i}) (End (s i)) := { o.matrixDecomposition with map_add' := fun w z => by ext dsimp [biproduct.components] simp } #align category_theory.hom_orthogonal.matrix_decomposition_add_equiv CategoryTheory.HomOrthogonal.matrixDecompositionAddEquiv @[simp] theorem matrixDecomposition_id (o : HomOrthogonal s) {α : Type} [Finite α] {f : α → ι} (i : ι) : o.matrixDecomposition (𝟙 (⨁ fun a => s (f a))) i = 1 := by ext ⟨b, ⟨⟩⟩ ⟨a, j_property⟩ simp only [Set.mem_preimage, Set.mem_singleton_iff] at j_property simp only [Category.comp_id, Category.id_comp, Category.assoc, End.one_def, eqToHom_refl, Matrix.one_apply, HomOrthogonal.matrixDecomposition_apply, biproduct.components] split_ifs with h · cases h simp · simp at h -- Porting note: used to be `convert comp_zero`, but that does not work anymore have : biproduct.ι (fun a ↦ s (f a)) a ≫ biproduct.π (fun b ↦ s (f b)) b = 0 := by simpa using biproduct.ι_π_ne _ (Ne.symm h) rw [this, comp_zero] #align category_theory.hom_orthogonal.matrix_decomposition_id CategoryTheory.HomOrthogonal.matrixDecomposition_id
Mathlib/CategoryTheory/Preadditive/HomOrthogonal.lean
146
166
theorem matrixDecomposition_comp (o : HomOrthogonal s) {α β γ : Type} [Finite α] [Fintype β] [Finite γ] {f : α → ι} {g : β → ι} {h : γ → ι} (z : (⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b)) (w : (⨁ fun b => s (g b)) ⟶ ⨁ fun c => s (h c)) (i : ι) : o.matrixDecomposition (z ≫ w) i = o.matrixDecomposition w i * o.matrixDecomposition z i := by
ext ⟨c, ⟨⟩⟩ ⟨a, j_property⟩ simp only [Set.mem_preimage, Set.mem_singleton_iff] at j_property simp only [Matrix.mul_apply, Limits.biproduct.components, HomOrthogonal.matrixDecomposition_apply, Category.comp_id, Category.id_comp, Category.assoc, End.mul_def, eqToHom_refl, eqToHom_trans_assoc, Finset.sum_congr] conv_lhs => rw [← Category.id_comp w, ← biproduct.total] simp only [Preadditive.sum_comp, Preadditive.comp_sum] apply Finset.sum_congr_set · intros simp · intro b nm simp only [Set.mem_preimage, Set.mem_singleton_iff] at nm simp only [Category.assoc] -- Porting note: this used to be 4 times `convert comp_zero` have : biproduct.ι (fun b ↦ s (g b)) b ≫ w ≫ biproduct.π (fun b ↦ s (h b)) c = 0 := by apply o.eq_zero nm simp only [this, comp_zero]
17
24,154,952.753575
2
2
2
2,391
import Mathlib.Analysis.Calculus.InverseFunctionTheorem.FDeriv import Mathlib.Analysis.Calculus.FDeriv.Add import Mathlib.Analysis.Calculus.FDeriv.Prod import Mathlib.Analysis.NormedSpace.Complemented #align_import analysis.calculus.implicit from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" noncomputable section open scoped Topology open Filter open ContinuousLinearMap (fst snd smulRight ker_prod) open ContinuousLinearEquiv (ofBijective) open LinearMap (ker range) -- Porting note(#5171): linter not yet ported @[nolint has_nonempty_instance] structure ImplicitFunctionData (𝕜 : Type*) [NontriviallyNormedField 𝕜] (E : Type*) [NormedAddCommGroup E] [NormedSpace 𝕜 E] [CompleteSpace E] (F : Type*) [NormedAddCommGroup F] [NormedSpace 𝕜 F] [CompleteSpace F] (G : Type*) [NormedAddCommGroup G] [NormedSpace 𝕜 G] [CompleteSpace G] where leftFun : E → F leftDeriv : E →L[𝕜] F rightFun : E → G rightDeriv : E →L[𝕜] G pt : E left_has_deriv : HasStrictFDerivAt leftFun leftDeriv pt right_has_deriv : HasStrictFDerivAt rightFun rightDeriv pt left_range : range leftDeriv = ⊤ right_range : range rightDeriv = ⊤ isCompl_ker : IsCompl (ker leftDeriv) (ker rightDeriv) #align implicit_function_data ImplicitFunctionData namespace ImplicitFunctionData variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] [CompleteSpace E] {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] [CompleteSpace F] {G : Type*} [NormedAddCommGroup G] [NormedSpace 𝕜 G] [CompleteSpace G] (φ : ImplicitFunctionData 𝕜 E F G) def prodFun (x : E) : F × G := (φ.leftFun x, φ.rightFun x) #align implicit_function_data.prod_fun ImplicitFunctionData.prodFun @[simp] theorem prodFun_apply (x : E) : φ.prodFun x = (φ.leftFun x, φ.rightFun x) := rfl #align implicit_function_data.prod_fun_apply ImplicitFunctionData.prodFun_apply protected theorem hasStrictFDerivAt : HasStrictFDerivAt φ.prodFun (φ.leftDeriv.equivProdOfSurjectiveOfIsCompl φ.rightDeriv φ.left_range φ.right_range φ.isCompl_ker : E →L[𝕜] F × G) φ.pt := φ.left_has_deriv.prod φ.right_has_deriv #align implicit_function_data.has_strict_fderiv_at ImplicitFunctionData.hasStrictFDerivAt def toPartialHomeomorph : PartialHomeomorph E (F × G) := φ.hasStrictFDerivAt.toPartialHomeomorph _ #align implicit_function_data.to_local_homeomorph ImplicitFunctionData.toPartialHomeomorph def implicitFunction : F → G → E := Function.curry <| φ.toPartialHomeomorph.symm #align implicit_function_data.implicit_function ImplicitFunctionData.implicitFunction @[simp] theorem toPartialHomeomorph_coe : ⇑φ.toPartialHomeomorph = φ.prodFun := rfl #align implicit_function_data.to_local_homeomorph_coe ImplicitFunctionData.toPartialHomeomorph_coe theorem toPartialHomeomorph_apply (x : E) : φ.toPartialHomeomorph x = (φ.leftFun x, φ.rightFun x) := rfl #align implicit_function_data.to_local_homeomorph_apply ImplicitFunctionData.toPartialHomeomorph_apply theorem pt_mem_toPartialHomeomorph_source : φ.pt ∈ φ.toPartialHomeomorph.source := φ.hasStrictFDerivAt.mem_toPartialHomeomorph_source #align implicit_function_data.pt_mem_to_local_homeomorph_source ImplicitFunctionData.pt_mem_toPartialHomeomorph_source theorem map_pt_mem_toPartialHomeomorph_target : (φ.leftFun φ.pt, φ.rightFun φ.pt) ∈ φ.toPartialHomeomorph.target := φ.toPartialHomeomorph.map_source <| φ.pt_mem_toPartialHomeomorph_source #align implicit_function_data.map_pt_mem_to_local_homeomorph_target ImplicitFunctionData.map_pt_mem_toPartialHomeomorph_target theorem prod_map_implicitFunction : ∀ᶠ p : F × G in 𝓝 (φ.prodFun φ.pt), φ.prodFun (φ.implicitFunction p.1 p.2) = p := φ.hasStrictFDerivAt.eventually_right_inverse.mono fun ⟨_, _⟩ h => h #align implicit_function_data.prod_map_implicit_function ImplicitFunctionData.prod_map_implicitFunction theorem left_map_implicitFunction : ∀ᶠ p : F × G in 𝓝 (φ.prodFun φ.pt), φ.leftFun (φ.implicitFunction p.1 p.2) = p.1 := φ.prod_map_implicitFunction.mono fun _ => congr_arg Prod.fst #align implicit_function_data.left_map_implicit_function ImplicitFunctionData.left_map_implicitFunction theorem right_map_implicitFunction : ∀ᶠ p : F × G in 𝓝 (φ.prodFun φ.pt), φ.rightFun (φ.implicitFunction p.1 p.2) = p.2 := φ.prod_map_implicitFunction.mono fun _ => congr_arg Prod.snd #align implicit_function_data.right_map_implicit_function ImplicitFunctionData.right_map_implicitFunction theorem implicitFunction_apply_image : ∀ᶠ x in 𝓝 φ.pt, φ.implicitFunction (φ.leftFun x) (φ.rightFun x) = x := φ.hasStrictFDerivAt.eventually_left_inverse #align implicit_function_data.implicit_function_apply_image ImplicitFunctionData.implicitFunction_apply_image theorem map_nhds_eq : map φ.leftFun (𝓝 φ.pt) = 𝓝 (φ.leftFun φ.pt) := show map (Prod.fst ∘ φ.prodFun) (𝓝 φ.pt) = 𝓝 (φ.prodFun φ.pt).1 by rw [← map_map, φ.hasStrictFDerivAt.map_nhds_eq_of_equiv, map_fst_nhds] #align implicit_function_data.map_nhds_eq ImplicitFunctionData.map_nhds_eq
Mathlib/Analysis/Calculus/Implicit.lean
201
214
theorem implicitFunction_hasStrictFDerivAt (g'inv : G →L[𝕜] E) (hg'inv : φ.rightDeriv.comp g'inv = ContinuousLinearMap.id 𝕜 G) (hg'invf : φ.leftDeriv.comp g'inv = 0) : HasStrictFDerivAt (φ.implicitFunction (φ.leftFun φ.pt)) g'inv (φ.rightFun φ.pt) := by
have := φ.hasStrictFDerivAt.to_localInverse simp only [prodFun] at this convert this.comp (φ.rightFun φ.pt) ((hasStrictFDerivAt_const _ _).prod (hasStrictFDerivAt_id _)) -- Porting note: added parentheses to help `simp` simp only [ContinuousLinearMap.ext_iff, (ContinuousLinearMap.comp_apply)] at hg'inv hg'invf ⊢ -- porting note (#10745): was `simp [ContinuousLinearEquiv.eq_symm_apply]`; -- both `simp` and `rw` fail here, `erw` works intro x erw [ContinuousLinearEquiv.eq_symm_apply] simp [*]
10
22,026.465795
2
2
1
2,392
import Mathlib.Algebra.Polynomial.DenomsClearable import Mathlib.Analysis.Calculus.MeanValue import Mathlib.Analysis.Calculus.Deriv.Polynomial import Mathlib.Data.Real.Irrational import Mathlib.Topology.Algebra.Polynomial #align_import number_theory.liouville.basic from "leanprover-community/mathlib"@"04e80bb7e8510958cd9aacd32fe2dc147af0b9f1" def Liouville (x : ℝ) := ∀ n : ℕ, ∃ a b : ℤ, 1 < b ∧ x ≠ a / b ∧ |x - a / b| < 1 / (b : ℝ) ^ n #align liouville Liouville namespace Liouville protected theorem irrational {x : ℝ} (h : Liouville x) : Irrational x := by -- By contradiction, `x = a / b`, with `a ∈ ℤ`, `0 < b ∈ ℕ` is a Liouville number, rintro ⟨⟨a, b, bN0, cop⟩, rfl⟩ -- clear up the mess of constructions of rationals rw [Rat.cast_mk'] at h -- Since `a / b` is a Liouville number, there are `p, q ∈ ℤ`, with `q1 : 1 < q`,∈ -- `a0 : a / b ≠ p / q` and `a1 : |a / b - p / q| < 1 / q ^ (b + 1)` rcases h (b + 1) with ⟨p, q, q1, a0, a1⟩ -- A few useful inequalities have qR0 : (0 : ℝ) < q := Int.cast_pos.mpr (zero_lt_one.trans q1) have b0 : (b : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr bN0 have bq0 : (0 : ℝ) < b * q := mul_pos (Nat.cast_pos.mpr bN0.bot_lt) qR0 -- At a1, clear denominators... replace a1 : |a * q - b * p| * q ^ (b + 1) < b * q := by rw [div_sub_div _ _ b0 qR0.ne', abs_div, div_lt_div_iff (abs_pos.mpr bq0.ne') (pow_pos qR0 _), abs_of_pos bq0, one_mul] at a1 exact mod_cast a1 -- At a0, clear denominators... replace a0 : a * q - ↑b * p ≠ 0 := by rw [Ne, div_eq_div_iff b0 qR0.ne', mul_comm (p : ℝ), ← sub_eq_zero] at a0 exact mod_cast a0 -- Actually, `q` is a natural number lift q to ℕ using (zero_lt_one.trans q1).le -- Looks innocuous, but we now have an integer with non-zero absolute value: this is at -- least one away from zero. The gain here is what gets the proof going. have ap : 0 < |a * ↑q - ↑b * p| := abs_pos.mpr a0 -- Actually, the absolute value of an integer is a natural number -- FIXME: This `lift` call duplicates the hypotheses `a1` and `ap` lift |a * ↑q - ↑b * p| to ℕ using abs_nonneg (a * ↑q - ↑b * p) with e he norm_cast at a1 ap q1 -- Recall this is by contradiction: we obtained the inequality `b * q ≤ x * q ^ (b + 1)`, so -- we are done. exact not_le.mpr a1 (Nat.mul_lt_mul_pow_succ ap q1).le #align liouville.irrational Liouville.irrational open Polynomial Metric Set Real RingHom open scoped Polynomial
Mathlib/NumberTheory/Liouville/Basic.lean
95
120
theorem exists_one_le_pow_mul_dist {Z N R : Type*} [PseudoMetricSpace R] {d : N → ℝ} {j : Z → N → R} {f : R → R} {α : R} {ε M : ℝ} -- denominators are positive (d0 : ∀ a : N, 1 ≤ d a) (e0 : 0 < ε) -- function is Lipschitz at α (B : ∀ ⦃y : R⦄, y ∈ closedBall α ε → dist (f α) (f y) ≤ dist α y * M) -- clear denominators (L : ∀ ⦃z : Z⦄, ∀ ⦃a : N⦄, j z a ∈ closedBall α ε → 1 ≤ d a * dist (f α) (f (j z a))) : ∃ A : ℝ, 0 < A ∧ ∀ z : Z, ∀ a : N, 1 ≤ d a * (dist α (j z a) * A) := by
-- A useful inequality to keep at hand have me0 : 0 < max (1 / ε) M := lt_max_iff.mpr (Or.inl (one_div_pos.mpr e0)) -- The maximum between `1 / ε` and `M` works refine ⟨max (1 / ε) M, me0, fun z a => ?_⟩ -- First, let's deal with the easy case in which we are far away from `α` by_cases dm1 : 1 ≤ dist α (j z a) * max (1 / ε) M · exact one_le_mul_of_one_le_of_one_le (d0 a) dm1 · -- `j z a = z / (a + 1)`: we prove that this ratio is close to `α` have : j z a ∈ closedBall α ε := by refine mem_closedBall'.mp (le_trans ?_ ((one_div_le me0 e0).mpr (le_max_left _ _))) exact (le_div_iff me0).mpr (not_le.mp dm1).le -- use the "separation from `1`" (assumption `L`) for numerators, refine (L this).trans ?_ -- remove a common factor and use the Lipschitz assumption `B` refine mul_le_mul_of_nonneg_left ((B this).trans ?_) (zero_le_one.trans (d0 a)) exact mul_le_mul_of_nonneg_left (le_max_right _ M) dist_nonneg
16
8,886,110.520508
2
2
2
2,393
import Mathlib.Algebra.Polynomial.DenomsClearable import Mathlib.Analysis.Calculus.MeanValue import Mathlib.Analysis.Calculus.Deriv.Polynomial import Mathlib.Data.Real.Irrational import Mathlib.Topology.Algebra.Polynomial #align_import number_theory.liouville.basic from "leanprover-community/mathlib"@"04e80bb7e8510958cd9aacd32fe2dc147af0b9f1" def Liouville (x : ℝ) := ∀ n : ℕ, ∃ a b : ℤ, 1 < b ∧ x ≠ a / b ∧ |x - a / b| < 1 / (b : ℝ) ^ n #align liouville Liouville namespace Liouville protected theorem irrational {x : ℝ} (h : Liouville x) : Irrational x := by -- By contradiction, `x = a / b`, with `a ∈ ℤ`, `0 < b ∈ ℕ` is a Liouville number, rintro ⟨⟨a, b, bN0, cop⟩, rfl⟩ -- clear up the mess of constructions of rationals rw [Rat.cast_mk'] at h -- Since `a / b` is a Liouville number, there are `p, q ∈ ℤ`, with `q1 : 1 < q`,∈ -- `a0 : a / b ≠ p / q` and `a1 : |a / b - p / q| < 1 / q ^ (b + 1)` rcases h (b + 1) with ⟨p, q, q1, a0, a1⟩ -- A few useful inequalities have qR0 : (0 : ℝ) < q := Int.cast_pos.mpr (zero_lt_one.trans q1) have b0 : (b : ℝ) ≠ 0 := Nat.cast_ne_zero.mpr bN0 have bq0 : (0 : ℝ) < b * q := mul_pos (Nat.cast_pos.mpr bN0.bot_lt) qR0 -- At a1, clear denominators... replace a1 : |a * q - b * p| * q ^ (b + 1) < b * q := by rw [div_sub_div _ _ b0 qR0.ne', abs_div, div_lt_div_iff (abs_pos.mpr bq0.ne') (pow_pos qR0 _), abs_of_pos bq0, one_mul] at a1 exact mod_cast a1 -- At a0, clear denominators... replace a0 : a * q - ↑b * p ≠ 0 := by rw [Ne, div_eq_div_iff b0 qR0.ne', mul_comm (p : ℝ), ← sub_eq_zero] at a0 exact mod_cast a0 -- Actually, `q` is a natural number lift q to ℕ using (zero_lt_one.trans q1).le -- Looks innocuous, but we now have an integer with non-zero absolute value: this is at -- least one away from zero. The gain here is what gets the proof going. have ap : 0 < |a * ↑q - ↑b * p| := abs_pos.mpr a0 -- Actually, the absolute value of an integer is a natural number -- FIXME: This `lift` call duplicates the hypotheses `a1` and `ap` lift |a * ↑q - ↑b * p| to ℕ using abs_nonneg (a * ↑q - ↑b * p) with e he norm_cast at a1 ap q1 -- Recall this is by contradiction: we obtained the inequality `b * q ≤ x * q ^ (b + 1)`, so -- we are done. exact not_le.mpr a1 (Nat.mul_lt_mul_pow_succ ap q1).le #align liouville.irrational Liouville.irrational open Polynomial Metric Set Real RingHom open scoped Polynomial theorem exists_one_le_pow_mul_dist {Z N R : Type*} [PseudoMetricSpace R] {d : N → ℝ} {j : Z → N → R} {f : R → R} {α : R} {ε M : ℝ} -- denominators are positive (d0 : ∀ a : N, 1 ≤ d a) (e0 : 0 < ε) -- function is Lipschitz at α (B : ∀ ⦃y : R⦄, y ∈ closedBall α ε → dist (f α) (f y) ≤ dist α y * M) -- clear denominators (L : ∀ ⦃z : Z⦄, ∀ ⦃a : N⦄, j z a ∈ closedBall α ε → 1 ≤ d a * dist (f α) (f (j z a))) : ∃ A : ℝ, 0 < A ∧ ∀ z : Z, ∀ a : N, 1 ≤ d a * (dist α (j z a) * A) := by -- A useful inequality to keep at hand have me0 : 0 < max (1 / ε) M := lt_max_iff.mpr (Or.inl (one_div_pos.mpr e0)) -- The maximum between `1 / ε` and `M` works refine ⟨max (1 / ε) M, me0, fun z a => ?_⟩ -- First, let's deal with the easy case in which we are far away from `α` by_cases dm1 : 1 ≤ dist α (j z a) * max (1 / ε) M · exact one_le_mul_of_one_le_of_one_le (d0 a) dm1 · -- `j z a = z / (a + 1)`: we prove that this ratio is close to `α` have : j z a ∈ closedBall α ε := by refine mem_closedBall'.mp (le_trans ?_ ((one_div_le me0 e0).mpr (le_max_left _ _))) exact (le_div_iff me0).mpr (not_le.mp dm1).le -- use the "separation from `1`" (assumption `L`) for numerators, refine (L this).trans ?_ -- remove a common factor and use the Lipschitz assumption `B` refine mul_le_mul_of_nonneg_left ((B this).trans ?_) (zero_le_one.trans (d0 a)) exact mul_le_mul_of_nonneg_left (le_max_right _ M) dist_nonneg #align liouville.exists_one_le_pow_mul_dist Liouville.exists_one_le_pow_mul_dist
Mathlib/NumberTheory/Liouville/Basic.lean
123
173
theorem exists_pos_real_of_irrational_root {α : ℝ} (ha : Irrational α) {f : ℤ[X]} (f0 : f ≠ 0) (fa : eval α (map (algebraMap ℤ ℝ) f) = 0) : ∃ A : ℝ, 0 < A ∧ ∀ a : ℤ, ∀ b : ℕ, (1 : ℝ) ≤ ((b : ℝ) + 1) ^ f.natDegree * (|α - a / (b + 1)| * A) := by
-- `fR` is `f` viewed as a polynomial with `ℝ` coefficients. set fR : ℝ[X] := map (algebraMap ℤ ℝ) f -- `fR` is non-zero, since `f` is non-zero. obtain fR0 : fR ≠ 0 := fun fR0 => (map_injective (algebraMap ℤ ℝ) fun _ _ A => Int.cast_inj.mp A).ne f0 (fR0.trans (Polynomial.map_zero _).symm) -- reformulating assumption `fa`: `α` is a root of `fR`. have ar : α ∈ (fR.roots.toFinset : Set ℝ) := Finset.mem_coe.mpr (Multiset.mem_toFinset.mpr ((mem_roots fR0).mpr (IsRoot.def.mpr fa))) -- Since the polynomial `fR` has finitely many roots, there is a closed interval centered at `α` -- such that `α` is the only root of `fR` in the interval. obtain ⟨ζ, z0, U⟩ : ∃ ζ > 0, closedBall α ζ ∩ fR.roots.toFinset = {α} := @exists_closedBall_inter_eq_singleton_of_discrete _ _ _ discrete_of_t1_of_finite _ ar -- Since `fR` is continuous, it is bounded on the interval above. obtain ⟨xm, -, hM⟩ : ∃ xm : ℝ, xm ∈ Icc (α - ζ) (α + ζ) ∧ IsMaxOn (|fR.derivative.eval ·|) (Icc (α - ζ) (α + ζ)) xm := IsCompact.exists_isMaxOn isCompact_Icc ⟨α, (sub_lt_self α z0).le, (lt_add_of_pos_right α z0).le⟩ (continuous_abs.comp fR.derivative.continuous_aeval).continuousOn -- Use the key lemma `exists_one_le_pow_mul_dist`: we are left to show that ... refine @exists_one_le_pow_mul_dist ℤ ℕ ℝ _ _ _ (fun y => fR.eval y) α ζ |fR.derivative.eval xm| ?_ z0 (fun y hy => ?_) fun z a hq => ?_ -- 1: the denominators are positive -- essentially by definition; · exact fun a => one_le_pow_of_one_le ((le_add_iff_nonneg_left 1).mpr a.cast_nonneg) _ -- 2: the polynomial `fR` is Lipschitz at `α` -- as its derivative continuous; · rw [mul_comm] rw [Real.closedBall_eq_Icc] at hy -- apply the Mean Value Theorem: the bound on the derivative comes from differentiability. refine Convex.norm_image_sub_le_of_norm_deriv_le (fun _ _ => fR.differentiableAt) (fun y h => by rw [fR.deriv]; exact hM h) (convex_Icc _ _) hy (mem_Icc_iff_abs_le.mp ?_) exact @mem_closedBall_self ℝ _ α ζ (le_of_lt z0) -- 3: the weird inequality of Liouville type with powers of the denominators. · show 1 ≤ (a + 1 : ℝ) ^ f.natDegree * |eval α fR - eval ((z : ℝ) / (a + 1)) fR| rw [fa, zero_sub, abs_neg] rw [show (a + 1 : ℝ) = ((a + 1 : ℕ) : ℤ) by norm_cast] at hq ⊢ -- key observation: the right-hand side of the inequality is an *integer*. Therefore, -- if its absolute value is not at least one, then it vanishes. Proceed by contradiction refine one_le_pow_mul_abs_eval_div (Int.natCast_succ_pos a) fun hy => ?_ -- As the evaluation of the polynomial vanishes, we found a root of `fR` that is rational. -- We know that `α` is the only root of `fR` in our interval, and `α` is irrational: -- follow your nose. refine (irrational_iff_ne_rational α).mp ha z (a + 1) (mem_singleton_iff.mp ?_).symm refine U.subset ?_ refine ⟨hq, Finset.mem_coe.mp (Multiset.mem_toFinset.mpr ?_)⟩ exact (mem_roots fR0).mpr (IsRoot.def.mpr hy)
47
258,131,288,619,006,750,000
2
2
2
2,393
import Mathlib.Control.Traversable.Equiv import Mathlib.Control.Traversable.Instances import Batteries.Data.LazyList import Mathlib.Lean.Thunk #align_import data.lazy_list.basic from "leanprover-community/mathlib"@"1f0096e6caa61e9c849ec2adbd227e960e9dff58" universe u namespace LazyList open Function def listEquivLazyList (α : Type*) : List α ≃ LazyList α where toFun := LazyList.ofList invFun := LazyList.toList right_inv := by intro xs induction xs using toList.induct · simp [toList, ofList] · simp [toList, ofList, *]; rfl left_inv := by intro xs induction xs · simp [toList, ofList] · simpa [ofList, toList] #align lazy_list.list_equiv_lazy_list LazyList.listEquivLazyList -- Porting note: Added a name to make the recursion work. instance decidableEq {α : Type u} [DecidableEq α] : DecidableEq (LazyList α) | nil, nil => isTrue rfl | cons x xs, cons y ys => if h : x = y then match decidableEq xs.get ys.get with | isFalse h2 => by apply isFalse; simp only [cons.injEq, not_and]; intro _ xs_ys; apply h2; rw [xs_ys] | isTrue h2 => by apply isTrue; congr; ext; exact h2 else by apply isFalse; simp only [cons.injEq, not_and]; intro; contradiction | nil, cons _ _ => by apply isFalse; simp | cons _ _, nil => by apply isFalse; simp protected def traverse {m : Type u → Type u} [Applicative m] {α β : Type u} (f : α → m β) : LazyList α → m (LazyList β) | LazyList.nil => pure LazyList.nil | LazyList.cons x xs => LazyList.cons <$> f x <*> Thunk.pure <$> xs.get.traverse f #align lazy_list.traverse LazyList.traverse instance : Traversable LazyList where map := @LazyList.traverse Id _ traverse := @LazyList.traverse instance : LawfulTraversable LazyList := by apply Equiv.isLawfulTraversable' listEquivLazyList <;> intros <;> ext <;> rename_i f xs · induction' xs using LazyList.rec with _ _ _ _ ih · simp only [Functor.map, LazyList.traverse, pure, Equiv.map, listEquivLazyList, Equiv.coe_fn_symm_mk, toList, Equiv.coe_fn_mk, ofList] · simpa only [Equiv.map, Functor.map, listEquivLazyList, Equiv.coe_fn_symm_mk, Equiv.coe_fn_mk, LazyList.traverse, Seq.seq, toList, ofList, cons.injEq, true_and] · ext; apply ih · simp only [Equiv.map, listEquivLazyList, Equiv.coe_fn_symm_mk, Equiv.coe_fn_mk, comp, Functor.mapConst] induction' xs using LazyList.rec with _ _ _ _ ih · simp only [LazyList.traverse, pure, Functor.map, toList, ofList] · simpa only [toList, ofList, LazyList.traverse, Seq.seq, Functor.map, cons.injEq, true_and] · congr; apply ih · simp only [traverse, Equiv.traverse, listEquivLazyList, Equiv.coe_fn_mk, Equiv.coe_fn_symm_mk] induction' xs using LazyList.rec with _ tl ih _ ih · simp only [LazyList.traverse, toList, List.traverse, map_pure, ofList] · replace ih : tl.get.traverse f = ofList <$> tl.get.toList.traverse f := ih simp [traverse.eq_2, ih, Functor.map_map, seq_map_assoc, toList, List.traverse, map_seq, Function.comp, Thunk.pure, ofList] · apply ih def init {α} : LazyList α → LazyList α | LazyList.nil => LazyList.nil | LazyList.cons x xs => let xs' := xs.get match xs' with | LazyList.nil => LazyList.nil | LazyList.cons _ _ => LazyList.cons x (init xs') #align lazy_list.init LazyList.init def find {α} (p : α → Prop) [DecidablePred p] : LazyList α → Option α | nil => none | cons h t => if p h then some h else t.get.find p #align lazy_list.find LazyList.find def interleave {α} : LazyList α → LazyList α → LazyList α | LazyList.nil, xs => xs | a@(LazyList.cons _ _), LazyList.nil => a | LazyList.cons x xs, LazyList.cons y ys => LazyList.cons x (LazyList.cons y (interleave xs.get ys.get)) #align lazy_list.interleave LazyList.interleave def interleaveAll {α} : List (LazyList α) → LazyList α | [] => LazyList.nil | x :: xs => interleave x (interleaveAll xs) #align lazy_list.interleave_all LazyList.interleaveAll protected def bind {α β} : LazyList α → (α → LazyList β) → LazyList β | LazyList.nil, _ => LazyList.nil | LazyList.cons x xs, f => (f x).append (xs.get.bind f) #align lazy_list.bind LazyList.bind def reverse {α} (xs : LazyList α) : LazyList α := ofList xs.toList.reverse #align lazy_list.reverse LazyList.reverse instance : Monad LazyList where pure := @LazyList.singleton bind := @LazyList.bind -- Porting note: Added `Thunk.pure` to definition.
Mathlib/Data/LazyList/Basic.lean
143
147
theorem append_nil {α} (xs : LazyList α) : xs.append (Thunk.pure LazyList.nil) = xs := by
induction' xs using LazyList.rec with _ _ _ _ ih · simp only [Thunk.pure, append, Thunk.get] · simpa only [append, cons.injEq, true_and] · ext; apply ih
4
54.59815
2
2
3
2,394
import Mathlib.Control.Traversable.Equiv import Mathlib.Control.Traversable.Instances import Batteries.Data.LazyList import Mathlib.Lean.Thunk #align_import data.lazy_list.basic from "leanprover-community/mathlib"@"1f0096e6caa61e9c849ec2adbd227e960e9dff58" universe u namespace LazyList open Function def listEquivLazyList (α : Type*) : List α ≃ LazyList α where toFun := LazyList.ofList invFun := LazyList.toList right_inv := by intro xs induction xs using toList.induct · simp [toList, ofList] · simp [toList, ofList, *]; rfl left_inv := by intro xs induction xs · simp [toList, ofList] · simpa [ofList, toList] #align lazy_list.list_equiv_lazy_list LazyList.listEquivLazyList -- Porting note: Added a name to make the recursion work. instance decidableEq {α : Type u} [DecidableEq α] : DecidableEq (LazyList α) | nil, nil => isTrue rfl | cons x xs, cons y ys => if h : x = y then match decidableEq xs.get ys.get with | isFalse h2 => by apply isFalse; simp only [cons.injEq, not_and]; intro _ xs_ys; apply h2; rw [xs_ys] | isTrue h2 => by apply isTrue; congr; ext; exact h2 else by apply isFalse; simp only [cons.injEq, not_and]; intro; contradiction | nil, cons _ _ => by apply isFalse; simp | cons _ _, nil => by apply isFalse; simp protected def traverse {m : Type u → Type u} [Applicative m] {α β : Type u} (f : α → m β) : LazyList α → m (LazyList β) | LazyList.nil => pure LazyList.nil | LazyList.cons x xs => LazyList.cons <$> f x <*> Thunk.pure <$> xs.get.traverse f #align lazy_list.traverse LazyList.traverse instance : Traversable LazyList where map := @LazyList.traverse Id _ traverse := @LazyList.traverse instance : LawfulTraversable LazyList := by apply Equiv.isLawfulTraversable' listEquivLazyList <;> intros <;> ext <;> rename_i f xs · induction' xs using LazyList.rec with _ _ _ _ ih · simp only [Functor.map, LazyList.traverse, pure, Equiv.map, listEquivLazyList, Equiv.coe_fn_symm_mk, toList, Equiv.coe_fn_mk, ofList] · simpa only [Equiv.map, Functor.map, listEquivLazyList, Equiv.coe_fn_symm_mk, Equiv.coe_fn_mk, LazyList.traverse, Seq.seq, toList, ofList, cons.injEq, true_and] · ext; apply ih · simp only [Equiv.map, listEquivLazyList, Equiv.coe_fn_symm_mk, Equiv.coe_fn_mk, comp, Functor.mapConst] induction' xs using LazyList.rec with _ _ _ _ ih · simp only [LazyList.traverse, pure, Functor.map, toList, ofList] · simpa only [toList, ofList, LazyList.traverse, Seq.seq, Functor.map, cons.injEq, true_and] · congr; apply ih · simp only [traverse, Equiv.traverse, listEquivLazyList, Equiv.coe_fn_mk, Equiv.coe_fn_symm_mk] induction' xs using LazyList.rec with _ tl ih _ ih · simp only [LazyList.traverse, toList, List.traverse, map_pure, ofList] · replace ih : tl.get.traverse f = ofList <$> tl.get.toList.traverse f := ih simp [traverse.eq_2, ih, Functor.map_map, seq_map_assoc, toList, List.traverse, map_seq, Function.comp, Thunk.pure, ofList] · apply ih def init {α} : LazyList α → LazyList α | LazyList.nil => LazyList.nil | LazyList.cons x xs => let xs' := xs.get match xs' with | LazyList.nil => LazyList.nil | LazyList.cons _ _ => LazyList.cons x (init xs') #align lazy_list.init LazyList.init def find {α} (p : α → Prop) [DecidablePred p] : LazyList α → Option α | nil => none | cons h t => if p h then some h else t.get.find p #align lazy_list.find LazyList.find def interleave {α} : LazyList α → LazyList α → LazyList α | LazyList.nil, xs => xs | a@(LazyList.cons _ _), LazyList.nil => a | LazyList.cons x xs, LazyList.cons y ys => LazyList.cons x (LazyList.cons y (interleave xs.get ys.get)) #align lazy_list.interleave LazyList.interleave def interleaveAll {α} : List (LazyList α) → LazyList α | [] => LazyList.nil | x :: xs => interleave x (interleaveAll xs) #align lazy_list.interleave_all LazyList.interleaveAll protected def bind {α β} : LazyList α → (α → LazyList β) → LazyList β | LazyList.nil, _ => LazyList.nil | LazyList.cons x xs, f => (f x).append (xs.get.bind f) #align lazy_list.bind LazyList.bind def reverse {α} (xs : LazyList α) : LazyList α := ofList xs.toList.reverse #align lazy_list.reverse LazyList.reverse instance : Monad LazyList where pure := @LazyList.singleton bind := @LazyList.bind -- Porting note: Added `Thunk.pure` to definition. theorem append_nil {α} (xs : LazyList α) : xs.append (Thunk.pure LazyList.nil) = xs := by induction' xs using LazyList.rec with _ _ _ _ ih · simp only [Thunk.pure, append, Thunk.get] · simpa only [append, cons.injEq, true_and] · ext; apply ih #align lazy_list.append_nil LazyList.append_nil
Mathlib/Data/LazyList/Basic.lean
150
155
theorem append_assoc {α} (xs ys zs : LazyList α) : (xs.append ys).append zs = xs.append (ys.append zs) := by
induction' xs using LazyList.rec with _ _ _ _ ih · simp only [append, Thunk.get] · simpa only [append, cons.injEq, true_and] · ext; apply ih
4
54.59815
2
2
3
2,394
import Mathlib.Control.Traversable.Equiv import Mathlib.Control.Traversable.Instances import Batteries.Data.LazyList import Mathlib.Lean.Thunk #align_import data.lazy_list.basic from "leanprover-community/mathlib"@"1f0096e6caa61e9c849ec2adbd227e960e9dff58" universe u namespace LazyList open Function def listEquivLazyList (α : Type*) : List α ≃ LazyList α where toFun := LazyList.ofList invFun := LazyList.toList right_inv := by intro xs induction xs using toList.induct · simp [toList, ofList] · simp [toList, ofList, *]; rfl left_inv := by intro xs induction xs · simp [toList, ofList] · simpa [ofList, toList] #align lazy_list.list_equiv_lazy_list LazyList.listEquivLazyList -- Porting note: Added a name to make the recursion work. instance decidableEq {α : Type u} [DecidableEq α] : DecidableEq (LazyList α) | nil, nil => isTrue rfl | cons x xs, cons y ys => if h : x = y then match decidableEq xs.get ys.get with | isFalse h2 => by apply isFalse; simp only [cons.injEq, not_and]; intro _ xs_ys; apply h2; rw [xs_ys] | isTrue h2 => by apply isTrue; congr; ext; exact h2 else by apply isFalse; simp only [cons.injEq, not_and]; intro; contradiction | nil, cons _ _ => by apply isFalse; simp | cons _ _, nil => by apply isFalse; simp protected def traverse {m : Type u → Type u} [Applicative m] {α β : Type u} (f : α → m β) : LazyList α → m (LazyList β) | LazyList.nil => pure LazyList.nil | LazyList.cons x xs => LazyList.cons <$> f x <*> Thunk.pure <$> xs.get.traverse f #align lazy_list.traverse LazyList.traverse instance : Traversable LazyList where map := @LazyList.traverse Id _ traverse := @LazyList.traverse instance : LawfulTraversable LazyList := by apply Equiv.isLawfulTraversable' listEquivLazyList <;> intros <;> ext <;> rename_i f xs · induction' xs using LazyList.rec with _ _ _ _ ih · simp only [Functor.map, LazyList.traverse, pure, Equiv.map, listEquivLazyList, Equiv.coe_fn_symm_mk, toList, Equiv.coe_fn_mk, ofList] · simpa only [Equiv.map, Functor.map, listEquivLazyList, Equiv.coe_fn_symm_mk, Equiv.coe_fn_mk, LazyList.traverse, Seq.seq, toList, ofList, cons.injEq, true_and] · ext; apply ih · simp only [Equiv.map, listEquivLazyList, Equiv.coe_fn_symm_mk, Equiv.coe_fn_mk, comp, Functor.mapConst] induction' xs using LazyList.rec with _ _ _ _ ih · simp only [LazyList.traverse, pure, Functor.map, toList, ofList] · simpa only [toList, ofList, LazyList.traverse, Seq.seq, Functor.map, cons.injEq, true_and] · congr; apply ih · simp only [traverse, Equiv.traverse, listEquivLazyList, Equiv.coe_fn_mk, Equiv.coe_fn_symm_mk] induction' xs using LazyList.rec with _ tl ih _ ih · simp only [LazyList.traverse, toList, List.traverse, map_pure, ofList] · replace ih : tl.get.traverse f = ofList <$> tl.get.toList.traverse f := ih simp [traverse.eq_2, ih, Functor.map_map, seq_map_assoc, toList, List.traverse, map_seq, Function.comp, Thunk.pure, ofList] · apply ih def init {α} : LazyList α → LazyList α | LazyList.nil => LazyList.nil | LazyList.cons x xs => let xs' := xs.get match xs' with | LazyList.nil => LazyList.nil | LazyList.cons _ _ => LazyList.cons x (init xs') #align lazy_list.init LazyList.init def find {α} (p : α → Prop) [DecidablePred p] : LazyList α → Option α | nil => none | cons h t => if p h then some h else t.get.find p #align lazy_list.find LazyList.find def interleave {α} : LazyList α → LazyList α → LazyList α | LazyList.nil, xs => xs | a@(LazyList.cons _ _), LazyList.nil => a | LazyList.cons x xs, LazyList.cons y ys => LazyList.cons x (LazyList.cons y (interleave xs.get ys.get)) #align lazy_list.interleave LazyList.interleave def interleaveAll {α} : List (LazyList α) → LazyList α | [] => LazyList.nil | x :: xs => interleave x (interleaveAll xs) #align lazy_list.interleave_all LazyList.interleaveAll protected def bind {α β} : LazyList α → (α → LazyList β) → LazyList β | LazyList.nil, _ => LazyList.nil | LazyList.cons x xs, f => (f x).append (xs.get.bind f) #align lazy_list.bind LazyList.bind def reverse {α} (xs : LazyList α) : LazyList α := ofList xs.toList.reverse #align lazy_list.reverse LazyList.reverse instance : Monad LazyList where pure := @LazyList.singleton bind := @LazyList.bind -- Porting note: Added `Thunk.pure` to definition. theorem append_nil {α} (xs : LazyList α) : xs.append (Thunk.pure LazyList.nil) = xs := by induction' xs using LazyList.rec with _ _ _ _ ih · simp only [Thunk.pure, append, Thunk.get] · simpa only [append, cons.injEq, true_and] · ext; apply ih #align lazy_list.append_nil LazyList.append_nil theorem append_assoc {α} (xs ys zs : LazyList α) : (xs.append ys).append zs = xs.append (ys.append zs) := by induction' xs using LazyList.rec with _ _ _ _ ih · simp only [append, Thunk.get] · simpa only [append, cons.injEq, true_and] · ext; apply ih #align lazy_list.append_assoc LazyList.append_assoc -- Porting note: Rewrote proof of `append_bind`.
Mathlib/Data/LazyList/Basic.lean
159
168
theorem append_bind {α β} (xs : LazyList α) (ys : Thunk (LazyList α)) (f : α → LazyList β) : (xs.append ys).bind f = (xs.bind f).append (ys.get.bind f) := by
match xs with | LazyList.nil => simp only [append, Thunk.get, LazyList.bind] | LazyList.cons x xs => simp only [append, Thunk.get, LazyList.bind] have := append_bind xs.get ys f simp only [Thunk.get] at this rw [this, append_assoc]
8
2,980.957987
2
2
3
2,394
import Mathlib.Analysis.Calculus.FDeriv.Pi import Mathlib.Analysis.Calculus.Deriv.Basic variable {𝕜 ι : Type*} [DecidableEq ι] [Fintype ι] [NontriviallyNormedField 𝕜]
Mathlib/Analysis/Calculus/Deriv/Pi.lean
15
22
theorem hasDerivAt_update (x : ι → 𝕜) (i : ι) (y : 𝕜) : HasDerivAt (Function.update x i) (Pi.single i (1 : 𝕜)) y := by
convert (hasFDerivAt_update x y).hasDerivAt ext z j rw [Pi.single, Function.update_apply] split_ifs with h · simp [h] · simp [Pi.single_eq_of_ne h]
6
403.428793
2
2
1
2,395
import Mathlib.Topology.MetricSpace.PseudoMetric open Filter open scoped Uniformity Topology universe u v w variable {α : Type u} {β : Type v} {X ι : Type*} variable [PseudoMetricSpace α] theorem Metric.complete_of_convergent_controlled_sequences (B : ℕ → Real) (hB : ∀ n, 0 < B n) (H : ∀ u : ℕ → α, (∀ N n m : ℕ, N ≤ n → N ≤ m → dist (u n) (u m) < B N) → ∃ x, Tendsto u atTop (𝓝 x)) : CompleteSpace α := UniformSpace.complete_of_convergent_controlled_sequences (fun n => { p : α × α | dist p.1 p.2 < B n }) (fun n => dist_mem_uniformity <| hB n) H #align metric.complete_of_convergent_controlled_sequences Metric.complete_of_convergent_controlled_sequences theorem Metric.complete_of_cauchySeq_tendsto : (∀ u : ℕ → α, CauchySeq u → ∃ a, Tendsto u atTop (𝓝 a)) → CompleteSpace α := EMetric.complete_of_cauchySeq_tendsto #align metric.complete_of_cauchy_seq_tendsto Metric.complete_of_cauchySeq_tendsto section CauchySeq variable [Nonempty β] [SemilatticeSup β] -- Porting note: @[nolint ge_or_gt] doesn't exist theorem Metric.cauchySeq_iff {u : β → α} : CauchySeq u ↔ ∀ ε > 0, ∃ N, ∀ m ≥ N, ∀ n ≥ N, dist (u m) (u n) < ε := uniformity_basis_dist.cauchySeq_iff #align metric.cauchy_seq_iff Metric.cauchySeq_iff theorem Metric.cauchySeq_iff' {u : β → α} : CauchySeq u ↔ ∀ ε > 0, ∃ N, ∀ n ≥ N, dist (u n) (u N) < ε := uniformity_basis_dist.cauchySeq_iff' #align metric.cauchy_seq_iff' Metric.cauchySeq_iff' -- see Note [nolint_ge] -- Porting note: no attr @[nolint ge_or_gt]
Mathlib/Topology/MetricSpace/Cauchy.lean
72
91
theorem Metric.uniformCauchySeqOn_iff {γ : Type*} {F : β → γ → α} {s : Set γ} : UniformCauchySeqOn F atTop s ↔ ∀ ε > (0 : ℝ), ∃ N : β, ∀ m ≥ N, ∀ n ≥ N, ∀ x ∈ s, dist (F m x) (F n x) < ε := by
constructor · intro h ε hε let u := { a : α × α | dist a.fst a.snd < ε } have hu : u ∈ 𝓤 α := Metric.mem_uniformity_dist.mpr ⟨ε, hε, by simp [u]⟩ rw [← @Filter.eventually_atTop_prod_self' _ _ _ fun m => ∀ x ∈ s, dist (F m.fst x) (F m.snd x) < ε] specialize h u hu rw [prod_atTop_atTop_eq] at h exact h.mono fun n h x hx => h x hx · intro h u hu rcases Metric.mem_uniformity_dist.mp hu with ⟨ε, hε, hab⟩ rcases h ε hε with ⟨N, hN⟩ rw [prod_atTop_atTop_eq, eventually_atTop] use (N, N) intro b hb x hx rcases hb with ⟨hbl, hbr⟩ exact hab (hN b.fst hbl.ge b.snd hbr.ge x hx)
17
24,154,952.753575
2
2
2
2,396
import Mathlib.Topology.MetricSpace.PseudoMetric open Filter open scoped Uniformity Topology universe u v w variable {α : Type u} {β : Type v} {X ι : Type*} variable [PseudoMetricSpace α] theorem Metric.complete_of_convergent_controlled_sequences (B : ℕ → Real) (hB : ∀ n, 0 < B n) (H : ∀ u : ℕ → α, (∀ N n m : ℕ, N ≤ n → N ≤ m → dist (u n) (u m) < B N) → ∃ x, Tendsto u atTop (𝓝 x)) : CompleteSpace α := UniformSpace.complete_of_convergent_controlled_sequences (fun n => { p : α × α | dist p.1 p.2 < B n }) (fun n => dist_mem_uniformity <| hB n) H #align metric.complete_of_convergent_controlled_sequences Metric.complete_of_convergent_controlled_sequences theorem Metric.complete_of_cauchySeq_tendsto : (∀ u : ℕ → α, CauchySeq u → ∃ a, Tendsto u atTop (𝓝 a)) → CompleteSpace α := EMetric.complete_of_cauchySeq_tendsto #align metric.complete_of_cauchy_seq_tendsto Metric.complete_of_cauchySeq_tendsto section CauchySeq variable [Nonempty β] [SemilatticeSup β] -- Porting note: @[nolint ge_or_gt] doesn't exist theorem Metric.cauchySeq_iff {u : β → α} : CauchySeq u ↔ ∀ ε > 0, ∃ N, ∀ m ≥ N, ∀ n ≥ N, dist (u m) (u n) < ε := uniformity_basis_dist.cauchySeq_iff #align metric.cauchy_seq_iff Metric.cauchySeq_iff theorem Metric.cauchySeq_iff' {u : β → α} : CauchySeq u ↔ ∀ ε > 0, ∃ N, ∀ n ≥ N, dist (u n) (u N) < ε := uniformity_basis_dist.cauchySeq_iff' #align metric.cauchy_seq_iff' Metric.cauchySeq_iff' -- see Note [nolint_ge] -- Porting note: no attr @[nolint ge_or_gt] theorem Metric.uniformCauchySeqOn_iff {γ : Type*} {F : β → γ → α} {s : Set γ} : UniformCauchySeqOn F atTop s ↔ ∀ ε > (0 : ℝ), ∃ N : β, ∀ m ≥ N, ∀ n ≥ N, ∀ x ∈ s, dist (F m x) (F n x) < ε := by constructor · intro h ε hε let u := { a : α × α | dist a.fst a.snd < ε } have hu : u ∈ 𝓤 α := Metric.mem_uniformity_dist.mpr ⟨ε, hε, by simp [u]⟩ rw [← @Filter.eventually_atTop_prod_self' _ _ _ fun m => ∀ x ∈ s, dist (F m.fst x) (F m.snd x) < ε] specialize h u hu rw [prod_atTop_atTop_eq] at h exact h.mono fun n h x hx => h x hx · intro h u hu rcases Metric.mem_uniformity_dist.mp hu with ⟨ε, hε, hab⟩ rcases h ε hε with ⟨N, hN⟩ rw [prod_atTop_atTop_eq, eventually_atTop] use (N, N) intro b hb x hx rcases hb with ⟨hbl, hbr⟩ exact hab (hN b.fst hbl.ge b.snd hbr.ge x hx) #align metric.uniform_cauchy_seq_on_iff Metric.uniformCauchySeqOn_iff theorem cauchySeq_of_le_tendsto_0' {s : β → α} (b : β → ℝ) (h : ∀ n m : β, n ≤ m → dist (s n) (s m) ≤ b n) (h₀ : Tendsto b atTop (𝓝 0)) : CauchySeq s := Metric.cauchySeq_iff'.2 fun ε ε0 => (h₀.eventually (gt_mem_nhds ε0)).exists.imp fun N hN n hn => calc dist (s n) (s N) = dist (s N) (s n) := dist_comm _ _ _ ≤ b N := h _ _ hn _ < ε := hN #align cauchy_seq_of_le_tendsto_0' cauchySeq_of_le_tendsto_0' theorem cauchySeq_of_le_tendsto_0 {s : β → α} (b : β → ℝ) (h : ∀ n m N : β, N ≤ n → N ≤ m → dist (s n) (s m) ≤ b N) (h₀ : Tendsto b atTop (𝓝 0)) : CauchySeq s := cauchySeq_of_le_tendsto_0' b (fun _n _m hnm => h _ _ _ le_rfl hnm) h₀ #align cauchy_seq_of_le_tendsto_0 cauchySeq_of_le_tendsto_0
Mathlib/Topology/MetricSpace/Cauchy.lean
113
123
theorem cauchySeq_bdd {u : ℕ → α} (hu : CauchySeq u) : ∃ R > 0, ∀ m n, dist (u m) (u n) < R := by
rcases Metric.cauchySeq_iff'.1 hu 1 zero_lt_one with ⟨N, hN⟩ rsuffices ⟨R, R0, H⟩ : ∃ R > 0, ∀ n, dist (u n) (u N) < R · exact ⟨_, add_pos R0 R0, fun m n => lt_of_le_of_lt (dist_triangle_right _ _ _) (add_lt_add (H m) (H n))⟩ let R := Finset.sup (Finset.range N) fun n => nndist (u n) (u N) refine ⟨↑R + 1, add_pos_of_nonneg_of_pos R.2 zero_lt_one, fun n => ?_⟩ rcases le_or_lt N n with h | h · exact lt_of_lt_of_le (hN _ h) (le_add_of_nonneg_left R.2) · have : _ ≤ R := Finset.le_sup (Finset.mem_range.2 h) exact lt_of_le_of_lt this (lt_add_of_pos_right _ zero_lt_one)
10
22,026.465795
2
2
2
2,396
import Mathlib.FieldTheory.Adjoin open Polynomial namespace IntermediateField variable (F E K : Type*) [Field F] [Field E] [Field K] [Algebra F E] [Algebra F K] {S : Set E} structure Lifts where carrier : IntermediateField F E emb : carrier →ₐ[F] K #align intermediate_field.lifts IntermediateField.Lifts variable {F E K} instance : PartialOrder (Lifts F E K) where le L₁ L₂ := ∃ h : L₁.carrier ≤ L₂.carrier, ∀ x, L₂.emb (inclusion h x) = L₁.emb x le_refl L := ⟨le_rfl, by simp⟩ le_trans L₁ L₂ L₃ := by rintro ⟨h₁₂, h₁₂'⟩ ⟨h₂₃, h₂₃'⟩ refine ⟨h₁₂.trans h₂₃, fun _ ↦ ?_⟩ rw [← inclusion_inclusion h₁₂ h₂₃, h₂₃', h₁₂'] le_antisymm := by rintro ⟨L₁, e₁⟩ ⟨L₂, e₂⟩ ⟨h₁₂, h₁₂'⟩ ⟨h₂₁, h₂₁'⟩ obtain rfl : L₁ = L₂ := h₁₂.antisymm h₂₁ congr exact AlgHom.ext h₂₁' noncomputable instance : OrderBot (Lifts F E K) where bot := ⟨⊥, (Algebra.ofId F K).comp (botEquiv F E)⟩ bot_le L := ⟨bot_le, fun x ↦ by obtain ⟨x, rfl⟩ := (botEquiv F E).symm.surjective x simp_rw [AlgHom.comp_apply, AlgHom.coe_coe, AlgEquiv.apply_symm_apply] exact L.emb.commutes x⟩ noncomputable instance : Inhabited (Lifts F E K) := ⟨⊥⟩
Mathlib/FieldTheory/Extension.lean
57
70
theorem Lifts.exists_upper_bound (c : Set (Lifts F E K)) (hc : IsChain (· ≤ ·) c) : ∃ ub, ∀ a ∈ c, a ≤ ub := by
let t (i : ↑(insert ⊥ c)) := i.val.carrier let t' (i) := (t i).toSubalgebra have hc := hc.insert fun _ _ _ ↦ .inl bot_le have dir : Directed (· ≤ ·) t := hc.directedOn.directed_val.mono_comp _ fun _ _ h ↦ h.1 refine ⟨⟨iSup t, (Subalgebra.iSupLift t' dir (fun i ↦ i.val.emb) (fun i j h ↦ ?_) _ rfl).comp (Subalgebra.equivOfEq _ _ <| toSubalgebra_iSup_of_directed dir)⟩, fun L hL ↦ have hL := Set.mem_insert_of_mem ⊥ hL; ⟨le_iSup t ⟨L, hL⟩, fun x ↦ ?_⟩⟩ · refine AlgHom.ext fun x ↦ (hc.total i.2 j.2).elim (fun hij ↦ (hij.snd x).symm) fun hji ↦ ?_ erw [AlgHom.comp_apply, ← hji.snd (Subalgebra.inclusion h x), inclusion_inclusion, inclusion_self, AlgHom.id_apply x] · dsimp only [AlgHom.comp_apply] exact Subalgebra.iSupLift_inclusion (K := t') (i := ⟨L, hL⟩) x (le_iSup t' ⟨L, hL⟩)
12
162,754.791419
2
2
1
2,397
import Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL2 #align_import measure_theory.function.conditional_expectation.condexp_L1 from "leanprover-community/mathlib"@"d8bbb04e2d2a44596798a9207ceefc0fb236e41e" noncomputable section open TopologicalSpace MeasureTheory.Lp Filter ContinuousLinearMap open scoped NNReal ENNReal Topology MeasureTheory namespace MeasureTheory variable {α β F F' G G' 𝕜 : Type*} {p : ℝ≥0∞} [RCLike 𝕜] -- 𝕜 for ℝ or ℂ -- F for a Lp submodule [NormedAddCommGroup F] [NormedSpace 𝕜 F] -- F' for integrals on a Lp submodule [NormedAddCommGroup F'] [NormedSpace 𝕜 F'] [NormedSpace ℝ F'] [CompleteSpace F'] -- G for a Lp add_subgroup [NormedAddCommGroup G] -- G' for integrals on a Lp add_subgroup [NormedAddCommGroup G'] [NormedSpace ℝ G'] [CompleteSpace G'] section CondexpInd variable {m m0 : MeasurableSpace α} {μ : Measure α} {s t : Set α} [NormedSpace ℝ G] section CondexpIndL1Fin set_option linter.uppercaseLean3 false def condexpIndL1Fin (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : G) : α →₁[μ] G := (integrable_condexpIndSMul hm hs hμs x).toL1 _ #align measure_theory.condexp_ind_L1_fin MeasureTheory.condexpIndL1Fin theorem condexpIndL1Fin_ae_eq_condexpIndSMul (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : G) : condexpIndL1Fin hm hs hμs x =ᵐ[μ] condexpIndSMul hm hs hμs x := (integrable_condexpIndSMul hm hs hμs x).coeFn_toL1 #align measure_theory.condexp_ind_L1_fin_ae_eq_condexp_ind_smul MeasureTheory.condexpIndL1Fin_ae_eq_condexpIndSMul variable {hm : m ≤ m0} [SigmaFinite (μ.trim hm)] -- Porting note: this lemma fills the hole in `refine' (Memℒp.coeFn_toLp _) ...` -- which is not automatically filled in Lean 4 private theorem q {hs : MeasurableSet s} {hμs : μ s ≠ ∞} {x : G} : Memℒp (condexpIndSMul hm hs hμs x) 1 μ := by rw [memℒp_one_iff_integrable]; apply integrable_condexpIndSMul
Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean
92
102
theorem condexpIndL1Fin_add (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x y : G) : condexpIndL1Fin hm hs hμs (x + y) = condexpIndL1Fin hm hs hμs x + condexpIndL1Fin hm hs hμs y := by
ext1 refine (Memℒp.coeFn_toLp q).trans ?_ refine EventuallyEq.trans ?_ (Lp.coeFn_add _ _).symm refine EventuallyEq.trans ?_ (EventuallyEq.add (Memℒp.coeFn_toLp q).symm (Memℒp.coeFn_toLp q).symm) rw [condexpIndSMul_add] refine (Lp.coeFn_add _ _).trans (eventually_of_forall fun a => ?_) rfl
8
2,980.957987
2
2
4
2,398
import Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL2 #align_import measure_theory.function.conditional_expectation.condexp_L1 from "leanprover-community/mathlib"@"d8bbb04e2d2a44596798a9207ceefc0fb236e41e" noncomputable section open TopologicalSpace MeasureTheory.Lp Filter ContinuousLinearMap open scoped NNReal ENNReal Topology MeasureTheory namespace MeasureTheory variable {α β F F' G G' 𝕜 : Type*} {p : ℝ≥0∞} [RCLike 𝕜] -- 𝕜 for ℝ or ℂ -- F for a Lp submodule [NormedAddCommGroup F] [NormedSpace 𝕜 F] -- F' for integrals on a Lp submodule [NormedAddCommGroup F'] [NormedSpace 𝕜 F'] [NormedSpace ℝ F'] [CompleteSpace F'] -- G for a Lp add_subgroup [NormedAddCommGroup G] -- G' for integrals on a Lp add_subgroup [NormedAddCommGroup G'] [NormedSpace ℝ G'] [CompleteSpace G'] section CondexpInd variable {m m0 : MeasurableSpace α} {μ : Measure α} {s t : Set α} [NormedSpace ℝ G] section CondexpIndL1Fin set_option linter.uppercaseLean3 false def condexpIndL1Fin (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : G) : α →₁[μ] G := (integrable_condexpIndSMul hm hs hμs x).toL1 _ #align measure_theory.condexp_ind_L1_fin MeasureTheory.condexpIndL1Fin theorem condexpIndL1Fin_ae_eq_condexpIndSMul (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : G) : condexpIndL1Fin hm hs hμs x =ᵐ[μ] condexpIndSMul hm hs hμs x := (integrable_condexpIndSMul hm hs hμs x).coeFn_toL1 #align measure_theory.condexp_ind_L1_fin_ae_eq_condexp_ind_smul MeasureTheory.condexpIndL1Fin_ae_eq_condexpIndSMul variable {hm : m ≤ m0} [SigmaFinite (μ.trim hm)] -- Porting note: this lemma fills the hole in `refine' (Memℒp.coeFn_toLp _) ...` -- which is not automatically filled in Lean 4 private theorem q {hs : MeasurableSet s} {hμs : μ s ≠ ∞} {x : G} : Memℒp (condexpIndSMul hm hs hμs x) 1 μ := by rw [memℒp_one_iff_integrable]; apply integrable_condexpIndSMul theorem condexpIndL1Fin_add (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x y : G) : condexpIndL1Fin hm hs hμs (x + y) = condexpIndL1Fin hm hs hμs x + condexpIndL1Fin hm hs hμs y := by ext1 refine (Memℒp.coeFn_toLp q).trans ?_ refine EventuallyEq.trans ?_ (Lp.coeFn_add _ _).symm refine EventuallyEq.trans ?_ (EventuallyEq.add (Memℒp.coeFn_toLp q).symm (Memℒp.coeFn_toLp q).symm) rw [condexpIndSMul_add] refine (Lp.coeFn_add _ _).trans (eventually_of_forall fun a => ?_) rfl #align measure_theory.condexp_ind_L1_fin_add MeasureTheory.condexpIndL1Fin_add
Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean
105
113
theorem condexpIndL1Fin_smul (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : ℝ) (x : G) : condexpIndL1Fin hm hs hμs (c • x) = c • condexpIndL1Fin hm hs hμs x := by
ext1 refine (Memℒp.coeFn_toLp q).trans ?_ refine EventuallyEq.trans ?_ (Lp.coeFn_smul _ _).symm rw [condexpIndSMul_smul hs hμs c x] refine (Lp.coeFn_smul _ _).trans ?_ refine (condexpIndL1Fin_ae_eq_condexpIndSMul hm hs hμs x).mono fun y hy => ?_ simp only [Pi.smul_apply, hy]
7
1,096.633158
2
2
4
2,398
import Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL2 #align_import measure_theory.function.conditional_expectation.condexp_L1 from "leanprover-community/mathlib"@"d8bbb04e2d2a44596798a9207ceefc0fb236e41e" noncomputable section open TopologicalSpace MeasureTheory.Lp Filter ContinuousLinearMap open scoped NNReal ENNReal Topology MeasureTheory namespace MeasureTheory variable {α β F F' G G' 𝕜 : Type*} {p : ℝ≥0∞} [RCLike 𝕜] -- 𝕜 for ℝ or ℂ -- F for a Lp submodule [NormedAddCommGroup F] [NormedSpace 𝕜 F] -- F' for integrals on a Lp submodule [NormedAddCommGroup F'] [NormedSpace 𝕜 F'] [NormedSpace ℝ F'] [CompleteSpace F'] -- G for a Lp add_subgroup [NormedAddCommGroup G] -- G' for integrals on a Lp add_subgroup [NormedAddCommGroup G'] [NormedSpace ℝ G'] [CompleteSpace G'] section CondexpInd variable {m m0 : MeasurableSpace α} {μ : Measure α} {s t : Set α} [NormedSpace ℝ G] section CondexpIndL1Fin set_option linter.uppercaseLean3 false def condexpIndL1Fin (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : G) : α →₁[μ] G := (integrable_condexpIndSMul hm hs hμs x).toL1 _ #align measure_theory.condexp_ind_L1_fin MeasureTheory.condexpIndL1Fin theorem condexpIndL1Fin_ae_eq_condexpIndSMul (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : G) : condexpIndL1Fin hm hs hμs x =ᵐ[μ] condexpIndSMul hm hs hμs x := (integrable_condexpIndSMul hm hs hμs x).coeFn_toL1 #align measure_theory.condexp_ind_L1_fin_ae_eq_condexp_ind_smul MeasureTheory.condexpIndL1Fin_ae_eq_condexpIndSMul variable {hm : m ≤ m0} [SigmaFinite (μ.trim hm)] -- Porting note: this lemma fills the hole in `refine' (Memℒp.coeFn_toLp _) ...` -- which is not automatically filled in Lean 4 private theorem q {hs : MeasurableSet s} {hμs : μ s ≠ ∞} {x : G} : Memℒp (condexpIndSMul hm hs hμs x) 1 μ := by rw [memℒp_one_iff_integrable]; apply integrable_condexpIndSMul theorem condexpIndL1Fin_add (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x y : G) : condexpIndL1Fin hm hs hμs (x + y) = condexpIndL1Fin hm hs hμs x + condexpIndL1Fin hm hs hμs y := by ext1 refine (Memℒp.coeFn_toLp q).trans ?_ refine EventuallyEq.trans ?_ (Lp.coeFn_add _ _).symm refine EventuallyEq.trans ?_ (EventuallyEq.add (Memℒp.coeFn_toLp q).symm (Memℒp.coeFn_toLp q).symm) rw [condexpIndSMul_add] refine (Lp.coeFn_add _ _).trans (eventually_of_forall fun a => ?_) rfl #align measure_theory.condexp_ind_L1_fin_add MeasureTheory.condexpIndL1Fin_add theorem condexpIndL1Fin_smul (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : ℝ) (x : G) : condexpIndL1Fin hm hs hμs (c • x) = c • condexpIndL1Fin hm hs hμs x := by ext1 refine (Memℒp.coeFn_toLp q).trans ?_ refine EventuallyEq.trans ?_ (Lp.coeFn_smul _ _).symm rw [condexpIndSMul_smul hs hμs c x] refine (Lp.coeFn_smul _ _).trans ?_ refine (condexpIndL1Fin_ae_eq_condexpIndSMul hm hs hμs x).mono fun y hy => ?_ simp only [Pi.smul_apply, hy] #align measure_theory.condexp_ind_L1_fin_smul MeasureTheory.condexpIndL1Fin_smul
Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean
116
125
theorem condexpIndL1Fin_smul' [NormedSpace ℝ F] [SMulCommClass ℝ 𝕜 F] (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : 𝕜) (x : F) : condexpIndL1Fin hm hs hμs (c • x) = c • condexpIndL1Fin hm hs hμs x := by
ext1 refine (Memℒp.coeFn_toLp q).trans ?_ refine EventuallyEq.trans ?_ (Lp.coeFn_smul _ _).symm rw [condexpIndSMul_smul' hs hμs c x] refine (Lp.coeFn_smul _ _).trans ?_ refine (condexpIndL1Fin_ae_eq_condexpIndSMul hm hs hμs x).mono fun y hy => ?_ simp only [Pi.smul_apply, hy]
7
1,096.633158
2
2
4
2,398
import Mathlib.MeasureTheory.Function.ConditionalExpectation.CondexpL2 #align_import measure_theory.function.conditional_expectation.condexp_L1 from "leanprover-community/mathlib"@"d8bbb04e2d2a44596798a9207ceefc0fb236e41e" noncomputable section open TopologicalSpace MeasureTheory.Lp Filter ContinuousLinearMap open scoped NNReal ENNReal Topology MeasureTheory namespace MeasureTheory variable {α β F F' G G' 𝕜 : Type*} {p : ℝ≥0∞} [RCLike 𝕜] -- 𝕜 for ℝ or ℂ -- F for a Lp submodule [NormedAddCommGroup F] [NormedSpace 𝕜 F] -- F' for integrals on a Lp submodule [NormedAddCommGroup F'] [NormedSpace 𝕜 F'] [NormedSpace ℝ F'] [CompleteSpace F'] -- G for a Lp add_subgroup [NormedAddCommGroup G] -- G' for integrals on a Lp add_subgroup [NormedAddCommGroup G'] [NormedSpace ℝ G'] [CompleteSpace G'] section CondexpInd variable {m m0 : MeasurableSpace α} {μ : Measure α} {s t : Set α} [NormedSpace ℝ G] section CondexpIndL1Fin set_option linter.uppercaseLean3 false def condexpIndL1Fin (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : G) : α →₁[μ] G := (integrable_condexpIndSMul hm hs hμs x).toL1 _ #align measure_theory.condexp_ind_L1_fin MeasureTheory.condexpIndL1Fin theorem condexpIndL1Fin_ae_eq_condexpIndSMul (hm : m ≤ m0) [SigmaFinite (μ.trim hm)] (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : G) : condexpIndL1Fin hm hs hμs x =ᵐ[μ] condexpIndSMul hm hs hμs x := (integrable_condexpIndSMul hm hs hμs x).coeFn_toL1 #align measure_theory.condexp_ind_L1_fin_ae_eq_condexp_ind_smul MeasureTheory.condexpIndL1Fin_ae_eq_condexpIndSMul variable {hm : m ≤ m0} [SigmaFinite (μ.trim hm)] -- Porting note: this lemma fills the hole in `refine' (Memℒp.coeFn_toLp _) ...` -- which is not automatically filled in Lean 4 private theorem q {hs : MeasurableSet s} {hμs : μ s ≠ ∞} {x : G} : Memℒp (condexpIndSMul hm hs hμs x) 1 μ := by rw [memℒp_one_iff_integrable]; apply integrable_condexpIndSMul theorem condexpIndL1Fin_add (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x y : G) : condexpIndL1Fin hm hs hμs (x + y) = condexpIndL1Fin hm hs hμs x + condexpIndL1Fin hm hs hμs y := by ext1 refine (Memℒp.coeFn_toLp q).trans ?_ refine EventuallyEq.trans ?_ (Lp.coeFn_add _ _).symm refine EventuallyEq.trans ?_ (EventuallyEq.add (Memℒp.coeFn_toLp q).symm (Memℒp.coeFn_toLp q).symm) rw [condexpIndSMul_add] refine (Lp.coeFn_add _ _).trans (eventually_of_forall fun a => ?_) rfl #align measure_theory.condexp_ind_L1_fin_add MeasureTheory.condexpIndL1Fin_add theorem condexpIndL1Fin_smul (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : ℝ) (x : G) : condexpIndL1Fin hm hs hμs (c • x) = c • condexpIndL1Fin hm hs hμs x := by ext1 refine (Memℒp.coeFn_toLp q).trans ?_ refine EventuallyEq.trans ?_ (Lp.coeFn_smul _ _).symm rw [condexpIndSMul_smul hs hμs c x] refine (Lp.coeFn_smul _ _).trans ?_ refine (condexpIndL1Fin_ae_eq_condexpIndSMul hm hs hμs x).mono fun y hy => ?_ simp only [Pi.smul_apply, hy] #align measure_theory.condexp_ind_L1_fin_smul MeasureTheory.condexpIndL1Fin_smul theorem condexpIndL1Fin_smul' [NormedSpace ℝ F] [SMulCommClass ℝ 𝕜 F] (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (c : 𝕜) (x : F) : condexpIndL1Fin hm hs hμs (c • x) = c • condexpIndL1Fin hm hs hμs x := by ext1 refine (Memℒp.coeFn_toLp q).trans ?_ refine EventuallyEq.trans ?_ (Lp.coeFn_smul _ _).symm rw [condexpIndSMul_smul' hs hμs c x] refine (Lp.coeFn_smul _ _).trans ?_ refine (condexpIndL1Fin_ae_eq_condexpIndSMul hm hs hμs x).mono fun y hy => ?_ simp only [Pi.smul_apply, hy] #align measure_theory.condexp_ind_L1_fin_smul' MeasureTheory.condexpIndL1Fin_smul'
Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL1.lean
128
143
theorem norm_condexpIndL1Fin_le (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : G) : ‖condexpIndL1Fin hm hs hμs x‖ ≤ (μ s).toReal * ‖x‖ := by
have : 0 ≤ ∫ a : α, ‖condexpIndL1Fin hm hs hμs x a‖ ∂μ := by positivity rw [L1.norm_eq_integral_norm, ← ENNReal.toReal_ofReal (norm_nonneg x), ← ENNReal.toReal_mul, ← ENNReal.toReal_ofReal this, ENNReal.toReal_le_toReal ENNReal.ofReal_ne_top (ENNReal.mul_ne_top hμs ENNReal.ofReal_ne_top), ofReal_integral_norm_eq_lintegral_nnnorm] swap; · rw [← memℒp_one_iff_integrable]; exact Lp.memℒp _ have h_eq : ∫⁻ a, ‖condexpIndL1Fin hm hs hμs x a‖₊ ∂μ = ∫⁻ a, ‖condexpIndSMul hm hs hμs x a‖₊ ∂μ := by refine lintegral_congr_ae ?_ refine (condexpIndL1Fin_ae_eq_condexpIndSMul hm hs hμs x).mono fun z hz => ?_ dsimp only rw [hz] rw [h_eq, ofReal_norm_eq_coe_nnnorm] exact lintegral_nnnorm_condexpIndSMul_le hm hs hμs x
14
1,202,604.284165
2
2
4
2,398
import Mathlib.Topology.Perfect import Mathlib.Topology.MetricSpace.Polish import Mathlib.Topology.MetricSpace.CantorScheme #align_import topology.perfect from "leanprover-community/mathlib"@"3905fa80e62c0898131285baab35559fbc4e5cda" open Set Filter section CantorInjMetric open Function ENNReal variable {α : Type*} [MetricSpace α] {C : Set α} (hC : Perfect C) {ε : ℝ≥0∞} private theorem Perfect.small_diam_aux (ε_pos : 0 < ε) {x : α} (xC : x ∈ C) : let D := closure (EMetric.ball x (ε / 2) ∩ C) Perfect D ∧ D.Nonempty ∧ D ⊆ C ∧ EMetric.diam D ≤ ε := by have : x ∈ EMetric.ball x (ε / 2) := by apply EMetric.mem_ball_self rw [ENNReal.div_pos_iff] exact ⟨ne_of_gt ε_pos, by norm_num⟩ have := hC.closure_nhds_inter x xC this EMetric.isOpen_ball refine ⟨this.1, this.2, ?_, ?_⟩ · rw [IsClosed.closure_subset_iff hC.closed] apply inter_subset_right rw [EMetric.diam_closure] apply le_trans (EMetric.diam_mono inter_subset_left) convert EMetric.diam_ball (x := x) rw [mul_comm, ENNReal.div_mul_cancel] <;> norm_num variable (hnonempty : C.Nonempty)
Mathlib/Topology/MetricSpace/Perfect.lean
62
73
theorem Perfect.small_diam_splitting (ε_pos : 0 < ε) : ∃ C₀ C₁ : Set α, (Perfect C₀ ∧ C₀.Nonempty ∧ C₀ ⊆ C ∧ EMetric.diam C₀ ≤ ε) ∧ (Perfect C₁ ∧ C₁.Nonempty ∧ C₁ ⊆ C ∧ EMetric.diam C₁ ≤ ε) ∧ Disjoint C₀ C₁ := by
rcases hC.splitting hnonempty with ⟨D₀, D₁, ⟨perf0, non0, sub0⟩, ⟨perf1, non1, sub1⟩, hdisj⟩ cases' non0 with x₀ hx₀ cases' non1 with x₁ hx₁ rcases perf0.small_diam_aux ε_pos hx₀ with ⟨perf0', non0', sub0', diam0⟩ rcases perf1.small_diam_aux ε_pos hx₁ with ⟨perf1', non1', sub1', diam1⟩ refine ⟨closure (EMetric.ball x₀ (ε / 2) ∩ D₀), closure (EMetric.ball x₁ (ε / 2) ∩ D₁), ⟨perf0', non0', sub0'.trans sub0, diam0⟩, ⟨perf1', non1', sub1'.trans sub1, diam1⟩, ?_⟩ apply Disjoint.mono _ _ hdisj <;> assumption
9
8,103.083928
2
2
2
2,399
import Mathlib.Topology.Perfect import Mathlib.Topology.MetricSpace.Polish import Mathlib.Topology.MetricSpace.CantorScheme #align_import topology.perfect from "leanprover-community/mathlib"@"3905fa80e62c0898131285baab35559fbc4e5cda" open Set Filter section CantorInjMetric open Function ENNReal variable {α : Type*} [MetricSpace α] {C : Set α} (hC : Perfect C) {ε : ℝ≥0∞} private theorem Perfect.small_diam_aux (ε_pos : 0 < ε) {x : α} (xC : x ∈ C) : let D := closure (EMetric.ball x (ε / 2) ∩ C) Perfect D ∧ D.Nonempty ∧ D ⊆ C ∧ EMetric.diam D ≤ ε := by have : x ∈ EMetric.ball x (ε / 2) := by apply EMetric.mem_ball_self rw [ENNReal.div_pos_iff] exact ⟨ne_of_gt ε_pos, by norm_num⟩ have := hC.closure_nhds_inter x xC this EMetric.isOpen_ball refine ⟨this.1, this.2, ?_, ?_⟩ · rw [IsClosed.closure_subset_iff hC.closed] apply inter_subset_right rw [EMetric.diam_closure] apply le_trans (EMetric.diam_mono inter_subset_left) convert EMetric.diam_ball (x := x) rw [mul_comm, ENNReal.div_mul_cancel] <;> norm_num variable (hnonempty : C.Nonempty) theorem Perfect.small_diam_splitting (ε_pos : 0 < ε) : ∃ C₀ C₁ : Set α, (Perfect C₀ ∧ C₀.Nonempty ∧ C₀ ⊆ C ∧ EMetric.diam C₀ ≤ ε) ∧ (Perfect C₁ ∧ C₁.Nonempty ∧ C₁ ⊆ C ∧ EMetric.diam C₁ ≤ ε) ∧ Disjoint C₀ C₁ := by rcases hC.splitting hnonempty with ⟨D₀, D₁, ⟨perf0, non0, sub0⟩, ⟨perf1, non1, sub1⟩, hdisj⟩ cases' non0 with x₀ hx₀ cases' non1 with x₁ hx₁ rcases perf0.small_diam_aux ε_pos hx₀ with ⟨perf0', non0', sub0', diam0⟩ rcases perf1.small_diam_aux ε_pos hx₁ with ⟨perf1', non1', sub1', diam1⟩ refine ⟨closure (EMetric.ball x₀ (ε / 2) ∩ D₀), closure (EMetric.ball x₁ (ε / 2) ∩ D₁), ⟨perf0', non0', sub0'.trans sub0, diam0⟩, ⟨perf1', non1', sub1'.trans sub1, diam1⟩, ?_⟩ apply Disjoint.mono _ _ hdisj <;> assumption #align perfect.small_diam_splitting Perfect.small_diam_splitting open CantorScheme
Mathlib/Topology/MetricSpace/Perfect.lean
80
129
theorem Perfect.exists_nat_bool_injection [CompleteSpace α] : ∃ f : (ℕ → Bool) → α, range f ⊆ C ∧ Continuous f ∧ Injective f := by
obtain ⟨u, -, upos', hu⟩ := exists_seq_strictAnti_tendsto' (zero_lt_one' ℝ≥0∞) have upos := fun n => (upos' n).1 let P := Subtype fun E : Set α => Perfect E ∧ E.Nonempty choose C0 C1 h0 h1 hdisj using fun {C : Set α} (hC : Perfect C) (hnonempty : C.Nonempty) {ε : ℝ≥0∞} (hε : 0 < ε) => hC.small_diam_splitting hnonempty hε let DP : List Bool → P := fun l => by induction' l with a l ih; · exact ⟨C, ⟨hC, hnonempty⟩⟩ cases a · use C0 ih.property.1 ih.property.2 (upos (l.length + 1)) exact ⟨(h0 _ _ _).1, (h0 _ _ _).2.1⟩ use C1 ih.property.1 ih.property.2 (upos (l.length + 1)) exact ⟨(h1 _ _ _).1, (h1 _ _ _).2.1⟩ let D : List Bool → Set α := fun l => (DP l).val have hanti : ClosureAntitone D := by refine Antitone.closureAntitone ?_ fun l => (DP l).property.1.closed intro l a cases a · exact (h0 _ _ _).2.2.1 exact (h1 _ _ _).2.2.1 have hdiam : VanishingDiam D := by intro x apply tendsto_of_tendsto_of_tendsto_of_le_of_le' tendsto_const_nhds hu · simp rw [eventually_atTop] refine ⟨1, fun m (hm : 1 ≤ m) => ?_⟩ rw [Nat.one_le_iff_ne_zero] at hm rcases Nat.exists_eq_succ_of_ne_zero hm with ⟨n, rfl⟩ dsimp cases x n · convert (h0 _ _ _).2.2.2 rw [PiNat.res_length] convert (h1 _ _ _).2.2.2 rw [PiNat.res_length] have hdisj' : CantorScheme.Disjoint D := by rintro l (a | a) (b | b) hab <;> try contradiction · exact hdisj _ _ _ exact (hdisj _ _ _).symm have hdom : ∀ {x : ℕ → Bool}, x ∈ (inducedMap D).1 := fun {x} => by rw [hanti.map_of_vanishingDiam hdiam fun l => (DP l).property.2] apply mem_univ refine ⟨fun x => (inducedMap D).2 ⟨x, hdom⟩, ?_, ?_, ?_⟩ · rintro y ⟨x, rfl⟩ exact map_mem ⟨_, hdom⟩ 0 · apply hdiam.map_continuous.comp continuity intro x y hxy simpa only [← Subtype.val_inj] using hdisj'.map_injective hxy
48
701,673,591,209,763,100,000
2
2
2
2,399
import Mathlib.Data.Set.Basic #align_import order.well_founded from "leanprover-community/mathlib"@"2c84c2c5496117349007d97104e7bbb471381592" variable {α β γ : Type*} namespace WellFounded variable {r r' : α → α → Prop} #align well_founded_relation.r WellFoundedRelation.rel protected theorem isAsymm (h : WellFounded r) : IsAsymm α r := ⟨h.asymmetric⟩ #align well_founded.is_asymm WellFounded.isAsymm protected theorem isIrrefl (h : WellFounded r) : IsIrrefl α r := @IsAsymm.isIrrefl α r h.isAsymm #align well_founded.is_irrefl WellFounded.isIrrefl instance [WellFoundedRelation α] : IsAsymm α WellFoundedRelation.rel := WellFoundedRelation.wf.isAsymm instance : IsIrrefl α WellFoundedRelation.rel := IsAsymm.isIrrefl theorem mono (hr : WellFounded r) (h : ∀ a b, r' a b → r a b) : WellFounded r' := Subrelation.wf (h _ _) hr #align well_founded.mono WellFounded.mono theorem onFun {α β : Sort*} {r : β → β → Prop} {f : α → β} : WellFounded r → WellFounded (r on f) := InvImage.wf _ #align well_founded.on_fun WellFounded.onFun theorem has_min {α} {r : α → α → Prop} (H : WellFounded r) (s : Set α) : s.Nonempty → ∃ a ∈ s, ∀ x ∈ s, ¬r x a | ⟨a, ha⟩ => show ∃ b ∈ s, ∀ x ∈ s, ¬r x b from Acc.recOn (H.apply a) (fun x _ IH => not_imp_not.1 fun hne hx => hne <| ⟨x, hx, fun y hy hyx => hne <| IH y hyx hy⟩) ha #align well_founded.has_min WellFounded.has_min noncomputable def min {r : α → α → Prop} (H : WellFounded r) (s : Set α) (h : s.Nonempty) : α := Classical.choose (H.has_min s h) #align well_founded.min WellFounded.min theorem min_mem {r : α → α → Prop} (H : WellFounded r) (s : Set α) (h : s.Nonempty) : H.min s h ∈ s := let ⟨h, _⟩ := Classical.choose_spec (H.has_min s h) h #align well_founded.min_mem WellFounded.min_mem theorem not_lt_min {r : α → α → Prop} (H : WellFounded r) (s : Set α) (h : s.Nonempty) {x} (hx : x ∈ s) : ¬r x (H.min s h) := let ⟨_, h'⟩ := Classical.choose_spec (H.has_min s h) h' _ hx #align well_founded.not_lt_min WellFounded.not_lt_min
Mathlib/Order/WellFounded.lean
82
89
theorem wellFounded_iff_has_min {r : α → α → Prop} : WellFounded r ↔ ∀ s : Set α, s.Nonempty → ∃ m ∈ s, ∀ x ∈ s, ¬r x m := by
refine ⟨fun h => h.has_min, fun h => ⟨fun x => ?_⟩⟩ by_contra hx obtain ⟨m, hm, hm'⟩ := h {x | ¬Acc r x} ⟨x, hx⟩ refine hm ⟨_, fun y hy => ?_⟩ by_contra hy' exact hm' y hy' hy
6
403.428793
2
2
1
2,400
import Mathlib.Analysis.SpecificLimits.Basic #align_import analysis.hofer from "leanprover-community/mathlib"@"f2ce6086713c78a7f880485f7917ea547a215982" open scoped Classical open Topology open Filter Finset local notation "d" => dist #noalign pos_div_pow_pos
Mathlib/Analysis/Hofer.lean
33
104
theorem hofer {X : Type*} [MetricSpace X] [CompleteSpace X] (x : X) (ε : ℝ) (ε_pos : 0 < ε) {ϕ : X → ℝ} (cont : Continuous ϕ) (nonneg : ∀ y, 0 ≤ ϕ y) : ∃ ε' > 0, ∃ x' : X, ε' ≤ ε ∧ d x' x ≤ 2 * ε ∧ ε * ϕ x ≤ ε' * ϕ x' ∧ ∀ y, d x' y ≤ ε' → ϕ y ≤ 2 * ϕ x' := by
by_contra H have reformulation : ∀ (x') (k : ℕ), ε * ϕ x ≤ ε / 2 ^ k * ϕ x' ↔ 2 ^ k * ϕ x ≤ ϕ x' := by intro x' k rw [div_mul_eq_mul_div, le_div_iff, mul_assoc, mul_le_mul_left ε_pos, mul_comm] positivity -- Now let's specialize to `ε/2^k` replace H : ∀ k : ℕ, ∀ x', d x' x ≤ 2 * ε ∧ 2 ^ k * ϕ x ≤ ϕ x' → ∃ y, d x' y ≤ ε / 2 ^ k ∧ 2 * ϕ x' < ϕ y := by intro k x' push_neg at H have := H (ε / 2 ^ k) (by positivity) x' (by simp [ε_pos.le, one_le_two]) simpa [reformulation] using this clear reformulation haveI : Nonempty X := ⟨x⟩ choose! F hF using H -- Use the axiom of choice -- Now define u by induction starting at x, with u_{n+1} = F(n, u_n) let u : ℕ → X := fun n => Nat.recOn n x F -- The properties of F translate to properties of u have hu : ∀ n, d (u n) x ≤ 2 * ε ∧ 2 ^ n * ϕ x ≤ ϕ (u n) → d (u n) (u <| n + 1) ≤ ε / 2 ^ n ∧ 2 * ϕ (u n) < ϕ (u <| n + 1) := by intro n exact hF n (u n) clear hF -- Key properties of u, to be proven by induction have key : ∀ n, d (u n) (u (n + 1)) ≤ ε / 2 ^ n ∧ 2 * ϕ (u n) < ϕ (u (n + 1)) := by intro n induction' n using Nat.case_strong_induction_on with n IH · simpa [u, ε_pos.le] using hu 0 have A : d (u (n + 1)) x ≤ 2 * ε := by rw [dist_comm] let r := range (n + 1) -- range (n+1) = {0, ..., n} calc d (u 0) (u (n + 1)) ≤ ∑ i ∈ r, d (u i) (u <| i + 1) := dist_le_range_sum_dist u (n + 1) _ ≤ ∑ i ∈ r, ε / 2 ^ i := (sum_le_sum fun i i_in => (IH i <| Nat.lt_succ_iff.mp <| Finset.mem_range.mp i_in).1) _ = (∑ i ∈ r, (1 / 2 : ℝ) ^ i) * ε := by rw [Finset.sum_mul] congr with i field_simp _ ≤ 2 * ε := by gcongr; apply sum_geometric_two_le have B : 2 ^ (n + 1) * ϕ x ≤ ϕ (u (n + 1)) := by refine @geom_le (ϕ ∘ u) _ zero_le_two (n + 1) fun m hm => ?_ exact (IH _ <| Nat.lt_add_one_iff.1 hm).2.le exact hu (n + 1) ⟨A, B⟩ cases' forall_and.mp key with key₁ key₂ clear hu key -- Hence u is Cauchy have cauchy_u : CauchySeq u := by refine cauchySeq_of_le_geometric _ ε one_half_lt_one fun n => ?_ simpa only [one_div, inv_pow] using key₁ n -- So u converges to some y obtain ⟨y, limy⟩ : ∃ y, Tendsto u atTop (𝓝 y) := CompleteSpace.complete cauchy_u -- And ϕ ∘ u goes to +∞ have lim_top : Tendsto (ϕ ∘ u) atTop atTop := by let v n := (ϕ ∘ u) (n + 1) suffices Tendsto v atTop atTop by rwa [tendsto_add_atTop_iff_nat] at this have hv₀ : 0 < v 0 := by calc 0 ≤ 2 * ϕ (u 0) := by specialize nonneg x; positivity _ < ϕ (u (0 + 1)) := key₂ 0 apply tendsto_atTop_of_geom_le hv₀ one_lt_two exact fun n => (key₂ (n + 1)).le -- But ϕ ∘ u also needs to go to ϕ(y) have lim : Tendsto (ϕ ∘ u) atTop (𝓝 (ϕ y)) := Tendsto.comp cont.continuousAt limy -- So we have our contradiction! exact not_tendsto_atTop_of_tendsto_nhds lim lim_top
69
925,378,172,558,778,900,000,000,000,000
2
2
1
2,401
import Mathlib.Analysis.Complex.RemovableSingularity import Mathlib.Analysis.Calculus.UniformLimitsDeriv import Mathlib.Analysis.NormedSpace.FunctionSeries #align_import analysis.complex.locally_uniform_limit from "leanprover-community/mathlib"@"fe44cd36149e675eb5dec87acc7e8f1d6568e081" open Set Metric MeasureTheory Filter Complex intervalIntegral open scoped Real Topology variable {E ι : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] {U K : Set ℂ} {z : ℂ} {M r δ : ℝ} {φ : Filter ι} {F : ι → ℂ → E} {f g : ℂ → E} namespace Complex section Cderiv noncomputable def cderiv (r : ℝ) (f : ℂ → E) (z : ℂ) : E := (2 * π * I : ℂ)⁻¹ • ∮ w in C(z, r), ((w - z) ^ 2)⁻¹ • f w #align complex.cderiv Complex.cderiv theorem cderiv_eq_deriv (hU : IsOpen U) (hf : DifferentiableOn ℂ f U) (hr : 0 < r) (hzr : closedBall z r ⊆ U) : cderiv r f z = deriv f z := two_pi_I_inv_smul_circleIntegral_sub_sq_inv_smul_of_differentiable hU hzr hf (mem_ball_self hr) #align complex.cderiv_eq_deriv Complex.cderiv_eq_deriv
Mathlib/Analysis/Complex/LocallyUniformLimit.lean
50
64
theorem norm_cderiv_le (hr : 0 < r) (hf : ∀ w ∈ sphere z r, ‖f w‖ ≤ M) : ‖cderiv r f z‖ ≤ M / r := by
have hM : 0 ≤ M := by obtain ⟨w, hw⟩ : (sphere z r).Nonempty := NormedSpace.sphere_nonempty.mpr hr.le exact (norm_nonneg _).trans (hf w hw) have h1 : ∀ w ∈ sphere z r, ‖((w - z) ^ 2)⁻¹ • f w‖ ≤ M / r ^ 2 := by intro w hw simp only [mem_sphere_iff_norm, norm_eq_abs] at hw simp only [norm_smul, inv_mul_eq_div, hw, norm_eq_abs, map_inv₀, Complex.abs_pow] exact div_le_div hM (hf w hw) (sq_pos_of_pos hr) le_rfl have h2 := circleIntegral.norm_integral_le_of_norm_le_const hr.le h1 simp only [cderiv, norm_smul] refine (mul_le_mul le_rfl h2 (norm_nonneg _) (norm_nonneg _)).trans (le_of_eq ?_) field_simp [_root_.abs_of_nonneg Real.pi_pos.le] ring
13
442,413.392009
2
2
4
2,402
import Mathlib.Analysis.Complex.RemovableSingularity import Mathlib.Analysis.Calculus.UniformLimitsDeriv import Mathlib.Analysis.NormedSpace.FunctionSeries #align_import analysis.complex.locally_uniform_limit from "leanprover-community/mathlib"@"fe44cd36149e675eb5dec87acc7e8f1d6568e081" open Set Metric MeasureTheory Filter Complex intervalIntegral open scoped Real Topology variable {E ι : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] {U K : Set ℂ} {z : ℂ} {M r δ : ℝ} {φ : Filter ι} {F : ι → ℂ → E} {f g : ℂ → E} namespace Complex section Cderiv noncomputable def cderiv (r : ℝ) (f : ℂ → E) (z : ℂ) : E := (2 * π * I : ℂ)⁻¹ • ∮ w in C(z, r), ((w - z) ^ 2)⁻¹ • f w #align complex.cderiv Complex.cderiv theorem cderiv_eq_deriv (hU : IsOpen U) (hf : DifferentiableOn ℂ f U) (hr : 0 < r) (hzr : closedBall z r ⊆ U) : cderiv r f z = deriv f z := two_pi_I_inv_smul_circleIntegral_sub_sq_inv_smul_of_differentiable hU hzr hf (mem_ball_self hr) #align complex.cderiv_eq_deriv Complex.cderiv_eq_deriv theorem norm_cderiv_le (hr : 0 < r) (hf : ∀ w ∈ sphere z r, ‖f w‖ ≤ M) : ‖cderiv r f z‖ ≤ M / r := by have hM : 0 ≤ M := by obtain ⟨w, hw⟩ : (sphere z r).Nonempty := NormedSpace.sphere_nonempty.mpr hr.le exact (norm_nonneg _).trans (hf w hw) have h1 : ∀ w ∈ sphere z r, ‖((w - z) ^ 2)⁻¹ • f w‖ ≤ M / r ^ 2 := by intro w hw simp only [mem_sphere_iff_norm, norm_eq_abs] at hw simp only [norm_smul, inv_mul_eq_div, hw, norm_eq_abs, map_inv₀, Complex.abs_pow] exact div_le_div hM (hf w hw) (sq_pos_of_pos hr) le_rfl have h2 := circleIntegral.norm_integral_le_of_norm_le_const hr.le h1 simp only [cderiv, norm_smul] refine (mul_le_mul le_rfl h2 (norm_nonneg _) (norm_nonneg _)).trans (le_of_eq ?_) field_simp [_root_.abs_of_nonneg Real.pi_pos.le] ring #align complex.norm_cderiv_le Complex.norm_cderiv_le
Mathlib/Analysis/Complex/LocallyUniformLimit.lean
67
76
theorem cderiv_sub (hr : 0 < r) (hf : ContinuousOn f (sphere z r)) (hg : ContinuousOn g (sphere z r)) : cderiv r (f - g) z = cderiv r f z - cderiv r g z := by
have h1 : ContinuousOn (fun w : ℂ => ((w - z) ^ 2)⁻¹) (sphere z r) := by refine ((continuous_id'.sub continuous_const).pow 2).continuousOn.inv₀ fun w hw h => hr.ne ?_ rwa [mem_sphere_iff_norm, sq_eq_zero_iff.mp h, norm_zero] at hw simp_rw [cderiv, ← smul_sub] congr 1 simpa only [Pi.sub_apply, smul_sub] using circleIntegral.integral_sub ((h1.smul hf).circleIntegrable hr.le) ((h1.smul hg).circleIntegrable hr.le)
8
2,980.957987
2
2
4
2,402
import Mathlib.Analysis.Complex.RemovableSingularity import Mathlib.Analysis.Calculus.UniformLimitsDeriv import Mathlib.Analysis.NormedSpace.FunctionSeries #align_import analysis.complex.locally_uniform_limit from "leanprover-community/mathlib"@"fe44cd36149e675eb5dec87acc7e8f1d6568e081" open Set Metric MeasureTheory Filter Complex intervalIntegral open scoped Real Topology variable {E ι : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] {U K : Set ℂ} {z : ℂ} {M r δ : ℝ} {φ : Filter ι} {F : ι → ℂ → E} {f g : ℂ → E} namespace Complex section Cderiv noncomputable def cderiv (r : ℝ) (f : ℂ → E) (z : ℂ) : E := (2 * π * I : ℂ)⁻¹ • ∮ w in C(z, r), ((w - z) ^ 2)⁻¹ • f w #align complex.cderiv Complex.cderiv theorem cderiv_eq_deriv (hU : IsOpen U) (hf : DifferentiableOn ℂ f U) (hr : 0 < r) (hzr : closedBall z r ⊆ U) : cderiv r f z = deriv f z := two_pi_I_inv_smul_circleIntegral_sub_sq_inv_smul_of_differentiable hU hzr hf (mem_ball_self hr) #align complex.cderiv_eq_deriv Complex.cderiv_eq_deriv theorem norm_cderiv_le (hr : 0 < r) (hf : ∀ w ∈ sphere z r, ‖f w‖ ≤ M) : ‖cderiv r f z‖ ≤ M / r := by have hM : 0 ≤ M := by obtain ⟨w, hw⟩ : (sphere z r).Nonempty := NormedSpace.sphere_nonempty.mpr hr.le exact (norm_nonneg _).trans (hf w hw) have h1 : ∀ w ∈ sphere z r, ‖((w - z) ^ 2)⁻¹ • f w‖ ≤ M / r ^ 2 := by intro w hw simp only [mem_sphere_iff_norm, norm_eq_abs] at hw simp only [norm_smul, inv_mul_eq_div, hw, norm_eq_abs, map_inv₀, Complex.abs_pow] exact div_le_div hM (hf w hw) (sq_pos_of_pos hr) le_rfl have h2 := circleIntegral.norm_integral_le_of_norm_le_const hr.le h1 simp only [cderiv, norm_smul] refine (mul_le_mul le_rfl h2 (norm_nonneg _) (norm_nonneg _)).trans (le_of_eq ?_) field_simp [_root_.abs_of_nonneg Real.pi_pos.le] ring #align complex.norm_cderiv_le Complex.norm_cderiv_le theorem cderiv_sub (hr : 0 < r) (hf : ContinuousOn f (sphere z r)) (hg : ContinuousOn g (sphere z r)) : cderiv r (f - g) z = cderiv r f z - cderiv r g z := by have h1 : ContinuousOn (fun w : ℂ => ((w - z) ^ 2)⁻¹) (sphere z r) := by refine ((continuous_id'.sub continuous_const).pow 2).continuousOn.inv₀ fun w hw h => hr.ne ?_ rwa [mem_sphere_iff_norm, sq_eq_zero_iff.mp h, norm_zero] at hw simp_rw [cderiv, ← smul_sub] congr 1 simpa only [Pi.sub_apply, smul_sub] using circleIntegral.integral_sub ((h1.smul hf).circleIntegrable hr.le) ((h1.smul hg).circleIntegrable hr.le) #align complex.cderiv_sub Complex.cderiv_sub
Mathlib/Analysis/Complex/LocallyUniformLimit.lean
79
86
theorem norm_cderiv_lt (hr : 0 < r) (hfM : ∀ w ∈ sphere z r, ‖f w‖ < M) (hf : ContinuousOn f (sphere z r)) : ‖cderiv r f z‖ < M / r := by
obtain ⟨L, hL1, hL2⟩ : ∃ L < M, ∀ w ∈ sphere z r, ‖f w‖ ≤ L := by have e1 : (sphere z r).Nonempty := NormedSpace.sphere_nonempty.mpr hr.le have e2 : ContinuousOn (fun w => ‖f w‖) (sphere z r) := continuous_norm.comp_continuousOn hf obtain ⟨x, hx, hx'⟩ := (isCompact_sphere z r).exists_isMaxOn e1 e2 exact ⟨‖f x‖, hfM x hx, hx'⟩ exact (norm_cderiv_le hr hL2).trans_lt ((div_lt_div_right hr).mpr hL1)
6
403.428793
2
2
4
2,402
import Mathlib.Analysis.Complex.RemovableSingularity import Mathlib.Analysis.Calculus.UniformLimitsDeriv import Mathlib.Analysis.NormedSpace.FunctionSeries #align_import analysis.complex.locally_uniform_limit from "leanprover-community/mathlib"@"fe44cd36149e675eb5dec87acc7e8f1d6568e081" open Set Metric MeasureTheory Filter Complex intervalIntegral open scoped Real Topology variable {E ι : Type*} [NormedAddCommGroup E] [NormedSpace ℂ E] [CompleteSpace E] {U K : Set ℂ} {z : ℂ} {M r δ : ℝ} {φ : Filter ι} {F : ι → ℂ → E} {f g : ℂ → E} namespace Complex section Cderiv noncomputable def cderiv (r : ℝ) (f : ℂ → E) (z : ℂ) : E := (2 * π * I : ℂ)⁻¹ • ∮ w in C(z, r), ((w - z) ^ 2)⁻¹ • f w #align complex.cderiv Complex.cderiv theorem cderiv_eq_deriv (hU : IsOpen U) (hf : DifferentiableOn ℂ f U) (hr : 0 < r) (hzr : closedBall z r ⊆ U) : cderiv r f z = deriv f z := two_pi_I_inv_smul_circleIntegral_sub_sq_inv_smul_of_differentiable hU hzr hf (mem_ball_self hr) #align complex.cderiv_eq_deriv Complex.cderiv_eq_deriv theorem norm_cderiv_le (hr : 0 < r) (hf : ∀ w ∈ sphere z r, ‖f w‖ ≤ M) : ‖cderiv r f z‖ ≤ M / r := by have hM : 0 ≤ M := by obtain ⟨w, hw⟩ : (sphere z r).Nonempty := NormedSpace.sphere_nonempty.mpr hr.le exact (norm_nonneg _).trans (hf w hw) have h1 : ∀ w ∈ sphere z r, ‖((w - z) ^ 2)⁻¹ • f w‖ ≤ M / r ^ 2 := by intro w hw simp only [mem_sphere_iff_norm, norm_eq_abs] at hw simp only [norm_smul, inv_mul_eq_div, hw, norm_eq_abs, map_inv₀, Complex.abs_pow] exact div_le_div hM (hf w hw) (sq_pos_of_pos hr) le_rfl have h2 := circleIntegral.norm_integral_le_of_norm_le_const hr.le h1 simp only [cderiv, norm_smul] refine (mul_le_mul le_rfl h2 (norm_nonneg _) (norm_nonneg _)).trans (le_of_eq ?_) field_simp [_root_.abs_of_nonneg Real.pi_pos.le] ring #align complex.norm_cderiv_le Complex.norm_cderiv_le theorem cderiv_sub (hr : 0 < r) (hf : ContinuousOn f (sphere z r)) (hg : ContinuousOn g (sphere z r)) : cderiv r (f - g) z = cderiv r f z - cderiv r g z := by have h1 : ContinuousOn (fun w : ℂ => ((w - z) ^ 2)⁻¹) (sphere z r) := by refine ((continuous_id'.sub continuous_const).pow 2).continuousOn.inv₀ fun w hw h => hr.ne ?_ rwa [mem_sphere_iff_norm, sq_eq_zero_iff.mp h, norm_zero] at hw simp_rw [cderiv, ← smul_sub] congr 1 simpa only [Pi.sub_apply, smul_sub] using circleIntegral.integral_sub ((h1.smul hf).circleIntegrable hr.le) ((h1.smul hg).circleIntegrable hr.le) #align complex.cderiv_sub Complex.cderiv_sub theorem norm_cderiv_lt (hr : 0 < r) (hfM : ∀ w ∈ sphere z r, ‖f w‖ < M) (hf : ContinuousOn f (sphere z r)) : ‖cderiv r f z‖ < M / r := by obtain ⟨L, hL1, hL2⟩ : ∃ L < M, ∀ w ∈ sphere z r, ‖f w‖ ≤ L := by have e1 : (sphere z r).Nonempty := NormedSpace.sphere_nonempty.mpr hr.le have e2 : ContinuousOn (fun w => ‖f w‖) (sphere z r) := continuous_norm.comp_continuousOn hf obtain ⟨x, hx, hx'⟩ := (isCompact_sphere z r).exists_isMaxOn e1 e2 exact ⟨‖f x‖, hfM x hx, hx'⟩ exact (norm_cderiv_le hr hL2).trans_lt ((div_lt_div_right hr).mpr hL1) #align complex.norm_cderiv_lt Complex.norm_cderiv_lt theorem norm_cderiv_sub_lt (hr : 0 < r) (hfg : ∀ w ∈ sphere z r, ‖f w - g w‖ < M) (hf : ContinuousOn f (sphere z r)) (hg : ContinuousOn g (sphere z r)) : ‖cderiv r f z - cderiv r g z‖ < M / r := cderiv_sub hr hf hg ▸ norm_cderiv_lt hr hfg (hf.sub hg) #align complex.norm_cderiv_sub_lt Complex.norm_cderiv_sub_lt
Mathlib/Analysis/Complex/LocallyUniformLimit.lean
95
110
theorem _root_.TendstoUniformlyOn.cderiv (hF : TendstoUniformlyOn F f φ (cthickening δ K)) (hδ : 0 < δ) (hFn : ∀ᶠ n in φ, ContinuousOn (F n) (cthickening δ K)) : TendstoUniformlyOn (cderiv δ ∘ F) (cderiv δ f) φ K := by
rcases φ.eq_or_neBot with rfl | hne · simp only [TendstoUniformlyOn, eventually_bot, imp_true_iff] have e1 : ContinuousOn f (cthickening δ K) := TendstoUniformlyOn.continuousOn hF hFn rw [tendstoUniformlyOn_iff] at hF ⊢ rintro ε hε filter_upwards [hF (ε * δ) (mul_pos hε hδ), hFn] with n h h' z hz simp_rw [dist_eq_norm] at h ⊢ have e2 : ∀ w ∈ sphere z δ, ‖f w - F n w‖ < ε * δ := fun w hw1 => h w (closedBall_subset_cthickening hz δ (sphere_subset_closedBall hw1)) have e3 := sphere_subset_closedBall.trans (closedBall_subset_cthickening hz δ) have hf : ContinuousOn f (sphere z δ) := e1.mono (sphere_subset_closedBall.trans (closedBall_subset_cthickening hz δ)) simpa only [mul_div_cancel_right₀ _ hδ.ne.symm] using norm_cderiv_sub_lt hδ e2 hf (h'.mono e3)
13
442,413.392009
2
2
4
2,402
import Mathlib.LinearAlgebra.Isomorphisms import Mathlib.Algebra.Category.ModuleCat.Kernels import Mathlib.Algebra.Category.ModuleCat.Limits import Mathlib.CategoryTheory.Abelian.Exact #align_import algebra.category.Module.abelian from "leanprover-community/mathlib"@"09f981f72d43749f1fa072deade828d9c1e185bb" open CategoryTheory open CategoryTheory.Limits noncomputable section universe w v u namespace ModuleCat variable {R : Type u} [Ring R] {M N : ModuleCat.{v} R} (f : M ⟶ N) def normalMono (hf : Mono f) : NormalMono f where Z := of R (N ⧸ LinearMap.range f) g := f.range.mkQ w := LinearMap.range_mkQ_comp _ isLimit := IsKernel.isoKernel _ _ (kernelIsLimit _) (LinearEquiv.toModuleIso' ((Submodule.quotEquivOfEqBot _ (ker_eq_bot_of_mono _)).symm ≪≫ₗ (LinearMap.quotKerEquivRange f ≪≫ₗ LinearEquiv.ofEq _ _ (Submodule.ker_mkQ _).symm))) <| by ext; rfl set_option linter.uppercaseLean3 false in #align Module.normal_mono ModuleCat.normalMono def normalEpi (hf : Epi f) : NormalEpi f where W := of R (LinearMap.ker f) g := (LinearMap.ker f).subtype w := LinearMap.comp_ker_subtype _ isColimit := IsCokernel.cokernelIso _ _ (cokernelIsColimit _) (LinearEquiv.toModuleIso' (Submodule.quotEquivOfEq _ _ (Submodule.range_subtype _) ≪≫ₗ LinearMap.quotKerEquivRange f ≪≫ₗ LinearEquiv.ofTop _ (range_eq_top_of_epi _))) <| by ext; rfl set_option linter.uppercaseLean3 false in #align Module.normal_epi ModuleCat.normalEpi instance abelian : Abelian (ModuleCat.{v} R) where has_cokernels := hasCokernels_moduleCat normalMonoOfMono := normalMono normalEpiOfEpi := normalEpi set_option linter.uppercaseLean3 false in #align Module.abelian ModuleCat.abelian variable {O : ModuleCat.{v} R} (g : N ⟶ O) open LinearMap attribute [local instance] Preadditive.hasEqualizers_of_hasKernels
Mathlib/Algebra/Category/ModuleCat/Abelian.lean
123
127
theorem exact_iff : Exact f g ↔ LinearMap.range f = LinearMap.ker g := by
rw [abelian.exact_iff' f g (kernelIsLimit _) (cokernelIsColimit _)] exact ⟨fun h => le_antisymm (range_le_ker_iff.2 h.1) (ker_le_range_iff.2 h.2), fun h => ⟨range_le_ker_iff.1 <| le_of_eq h, ker_le_range_iff.1 <| le_of_eq h.symm⟩⟩
4
54.59815
2
2
1
2,403
import Mathlib.Order.Filter.AtTopBot import Mathlib.Tactic.FieldSimp import Mathlib.Tactic.LinearCombination import Mathlib.Tactic.Linarith.Frontend #align_import algebra.quadratic_discriminant from "leanprover-community/mathlib"@"e085d1df33274f4b32f611f483aae678ba0b42df" open Filter section Ring variable {R : Type*} def discrim [Ring R] (a b c : R) : R := b ^ 2 - 4 * a * c #align discrim discrim @[simp] lemma discrim_neg [Ring R] (a b c : R) : discrim (-a) (-b) (-c) = discrim a b c := by simp [discrim] #align discrim_neg discrim_neg variable [CommRing R] {a b c : R} lemma discrim_eq_sq_of_quadratic_eq_zero {x : R} (h : a * x * x + b * x + c = 0) : discrim a b c = (2 * a * x + b) ^ 2 := by rw [discrim] linear_combination -4 * a * h #align discrim_eq_sq_of_quadratic_eq_zero discrim_eq_sq_of_quadratic_eq_zero
Mathlib/Algebra/QuadraticDiscriminant.lean
63
70
theorem quadratic_eq_zero_iff_discrim_eq_sq [NeZero (2 : R)] [NoZeroDivisors R] (ha : a ≠ 0) (x : R) : a * x * x + b * x + c = 0 ↔ discrim a b c = (2 * a * x + b) ^ 2 := by
refine ⟨discrim_eq_sq_of_quadratic_eq_zero, fun h ↦ ?_⟩ rw [discrim] at h have ha : 2 * 2 * a ≠ 0 := mul_ne_zero (mul_ne_zero (NeZero.ne _) (NeZero.ne _)) ha apply mul_left_cancel₀ ha linear_combination -h
5
148.413159
2
2
1
2,404
import Mathlib.Data.Num.Lemmas import Mathlib.Data.Nat.Prime import Mathlib.Tactic.Ring #align_import data.num.prime from "leanprover-community/mathlib"@"58581d0fe523063f5651df0619be2bf65012a94a" namespace PosNum def minFacAux (n : PosNum) : ℕ → PosNum → PosNum | 0, _ => n | fuel + 1, k => if n < k.bit1 * k.bit1 then n else if k.bit1 ∣ n then k.bit1 else minFacAux n fuel k.succ #align pos_num.min_fac_aux PosNum.minFacAux set_option linter.deprecated false in
Mathlib/Data/Num/Prime.lean
44
54
theorem minFacAux_to_nat {fuel : ℕ} {n k : PosNum} (h : Nat.sqrt n < fuel + k.bit1) : (minFacAux n fuel k : ℕ) = Nat.minFacAux n k.bit1 := by
induction' fuel with fuel ih generalizing k <;> rw [minFacAux, Nat.minFacAux] · rw [Nat.zero_add, Nat.sqrt_lt] at h simp only [h, ite_true] simp_rw [← mul_to_nat] simp only [cast_lt, dvd_to_nat] split_ifs <;> try rfl rw [ih] <;> [congr; convert Nat.lt_succ_of_lt h using 1] <;> simp only [_root_.bit1, _root_.bit0, cast_bit1, cast_succ, Nat.succ_eq_add_one, add_assoc, add_left_comm, ← one_add_one_eq_two]
9
8,103.083928
2
2
2
2,405
import Mathlib.Data.Num.Lemmas import Mathlib.Data.Nat.Prime import Mathlib.Tactic.Ring #align_import data.num.prime from "leanprover-community/mathlib"@"58581d0fe523063f5651df0619be2bf65012a94a" namespace PosNum def minFacAux (n : PosNum) : ℕ → PosNum → PosNum | 0, _ => n | fuel + 1, k => if n < k.bit1 * k.bit1 then n else if k.bit1 ∣ n then k.bit1 else minFacAux n fuel k.succ #align pos_num.min_fac_aux PosNum.minFacAux set_option linter.deprecated false in theorem minFacAux_to_nat {fuel : ℕ} {n k : PosNum} (h : Nat.sqrt n < fuel + k.bit1) : (minFacAux n fuel k : ℕ) = Nat.minFacAux n k.bit1 := by induction' fuel with fuel ih generalizing k <;> rw [minFacAux, Nat.minFacAux] · rw [Nat.zero_add, Nat.sqrt_lt] at h simp only [h, ite_true] simp_rw [← mul_to_nat] simp only [cast_lt, dvd_to_nat] split_ifs <;> try rfl rw [ih] <;> [congr; convert Nat.lt_succ_of_lt h using 1] <;> simp only [_root_.bit1, _root_.bit0, cast_bit1, cast_succ, Nat.succ_eq_add_one, add_assoc, add_left_comm, ← one_add_one_eq_two] #align pos_num.min_fac_aux_to_nat PosNum.minFacAux_to_nat def minFac : PosNum → PosNum | 1 => 1 | bit0 _ => 2 | bit1 n => minFacAux (bit1 n) n 1 #align pos_num.min_fac PosNum.minFac @[simp]
Mathlib/Data/Num/Prime.lean
65
83
theorem minFac_to_nat (n : PosNum) : (minFac n : ℕ) = Nat.minFac n := by
cases' n with n · rfl · rw [minFac, Nat.minFac_eq, if_neg] swap · simp rw [minFacAux_to_nat] · rfl simp only [cast_one, cast_bit1] unfold _root_.bit1 _root_.bit0 rw [Nat.sqrt_lt] calc (n : ℕ) + (n : ℕ) + 1 ≤ (n : ℕ) + (n : ℕ) + (n : ℕ) := by simp _ = (n : ℕ) * (1 + 1 + 1) := by simp only [mul_add, mul_one] _ < _ := by set_option simprocs false in simp [mul_lt_mul] · rw [minFac, Nat.minFac_eq, if_pos] · rfl simp
18
65,659,969.137331
2
2
2
2,405
import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic import Mathlib.Dynamics.Ergodic.MeasurePreserving import Mathlib.Combinatorics.Pigeonhole #align_import dynamics.ergodic.conservative from "leanprover-community/mathlib"@"bf6a01357ff5684b1ebcd0f1a13be314fc82c0bf" noncomputable section open scoped Classical open Set Filter MeasureTheory Finset Function TopologicalSpace open scoped Classical open Topology variable {ι : Type*} {α : Type*} [MeasurableSpace α] {f : α → α} {s : Set α} {μ : Measure α} namespace MeasureTheory open Measure structure Conservative (f : α → α) (μ : Measure α) extends QuasiMeasurePreserving f μ μ : Prop where exists_mem_iterate_mem : ∀ ⦃s⦄, MeasurableSet s → μ s ≠ 0 → ∃ x ∈ s, ∃ m ≠ 0, f^[m] x ∈ s #align measure_theory.conservative MeasureTheory.Conservative protected theorem MeasurePreserving.conservative [IsFiniteMeasure μ] (h : MeasurePreserving f μ μ) : Conservative f μ := ⟨h.quasiMeasurePreserving, fun _ hsm h0 => h.exists_mem_iterate_mem hsm h0⟩ #align measure_theory.measure_preserving.conservative MeasureTheory.MeasurePreserving.conservative namespace Conservative protected theorem id (μ : Measure α) : Conservative id μ := { toQuasiMeasurePreserving := QuasiMeasurePreserving.id μ exists_mem_iterate_mem := fun _ _ h0 => let ⟨x, hx⟩ := nonempty_of_measure_ne_zero h0 ⟨x, hx, 1, one_ne_zero, hx⟩ } #align measure_theory.conservative.id MeasureTheory.Conservative.id
Mathlib/Dynamics/Ergodic/Conservative.lean
83
106
theorem frequently_measure_inter_ne_zero (hf : Conservative f μ) (hs : MeasurableSet s) (h0 : μ s ≠ 0) : ∃ᶠ m in atTop, μ (s ∩ f^[m] ⁻¹' s) ≠ 0 := by
by_contra H simp only [not_frequently, eventually_atTop, Ne, Classical.not_not] at H rcases H with ⟨N, hN⟩ induction' N with N ihN · apply h0 simpa using hN 0 le_rfl rw [imp_false] at ihN push_neg at ihN rcases ihN with ⟨n, hn, hμn⟩ set T := s ∩ ⋃ n ≥ N + 1, f^[n] ⁻¹' s have hT : MeasurableSet T := hs.inter (MeasurableSet.biUnion (to_countable _) fun _ _ => hf.measurable.iterate _ hs) have hμT : μ T = 0 := by convert (measure_biUnion_null_iff <| to_countable _).2 hN rw [← inter_iUnion₂] rfl have : μ ((s ∩ f^[n] ⁻¹' s) \ T) ≠ 0 := by rwa [measure_diff_null hμT] rcases hf.exists_mem_iterate_mem ((hs.inter (hf.measurable.iterate n hs)).diff hT) this with ⟨x, ⟨⟨hxs, _⟩, hxT⟩, m, hm0, ⟨_, hxm⟩, _⟩ refine hxT ⟨hxs, mem_iUnion₂.2 ⟨n + m, ?_, ?_⟩⟩ · exact add_le_add hn (Nat.one_le_of_lt <| pos_iff_ne_zero.2 hm0) · rwa [Set.mem_preimage, ← iterate_add_apply] at hxm
22
3,584,912,846.131591
2
2
3
2,406
import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic import Mathlib.Dynamics.Ergodic.MeasurePreserving import Mathlib.Combinatorics.Pigeonhole #align_import dynamics.ergodic.conservative from "leanprover-community/mathlib"@"bf6a01357ff5684b1ebcd0f1a13be314fc82c0bf" noncomputable section open scoped Classical open Set Filter MeasureTheory Finset Function TopologicalSpace open scoped Classical open Topology variable {ι : Type*} {α : Type*} [MeasurableSpace α] {f : α → α} {s : Set α} {μ : Measure α} namespace MeasureTheory open Measure structure Conservative (f : α → α) (μ : Measure α) extends QuasiMeasurePreserving f μ μ : Prop where exists_mem_iterate_mem : ∀ ⦃s⦄, MeasurableSet s → μ s ≠ 0 → ∃ x ∈ s, ∃ m ≠ 0, f^[m] x ∈ s #align measure_theory.conservative MeasureTheory.Conservative protected theorem MeasurePreserving.conservative [IsFiniteMeasure μ] (h : MeasurePreserving f μ μ) : Conservative f μ := ⟨h.quasiMeasurePreserving, fun _ hsm h0 => h.exists_mem_iterate_mem hsm h0⟩ #align measure_theory.measure_preserving.conservative MeasureTheory.MeasurePreserving.conservative namespace Conservative protected theorem id (μ : Measure α) : Conservative id μ := { toQuasiMeasurePreserving := QuasiMeasurePreserving.id μ exists_mem_iterate_mem := fun _ _ h0 => let ⟨x, hx⟩ := nonempty_of_measure_ne_zero h0 ⟨x, hx, 1, one_ne_zero, hx⟩ } #align measure_theory.conservative.id MeasureTheory.Conservative.id theorem frequently_measure_inter_ne_zero (hf : Conservative f μ) (hs : MeasurableSet s) (h0 : μ s ≠ 0) : ∃ᶠ m in atTop, μ (s ∩ f^[m] ⁻¹' s) ≠ 0 := by by_contra H simp only [not_frequently, eventually_atTop, Ne, Classical.not_not] at H rcases H with ⟨N, hN⟩ induction' N with N ihN · apply h0 simpa using hN 0 le_rfl rw [imp_false] at ihN push_neg at ihN rcases ihN with ⟨n, hn, hμn⟩ set T := s ∩ ⋃ n ≥ N + 1, f^[n] ⁻¹' s have hT : MeasurableSet T := hs.inter (MeasurableSet.biUnion (to_countable _) fun _ _ => hf.measurable.iterate _ hs) have hμT : μ T = 0 := by convert (measure_biUnion_null_iff <| to_countable _).2 hN rw [← inter_iUnion₂] rfl have : μ ((s ∩ f^[n] ⁻¹' s) \ T) ≠ 0 := by rwa [measure_diff_null hμT] rcases hf.exists_mem_iterate_mem ((hs.inter (hf.measurable.iterate n hs)).diff hT) this with ⟨x, ⟨⟨hxs, _⟩, hxT⟩, m, hm0, ⟨_, hxm⟩, _⟩ refine hxT ⟨hxs, mem_iUnion₂.2 ⟨n + m, ?_, ?_⟩⟩ · exact add_le_add hn (Nat.one_le_of_lt <| pos_iff_ne_zero.2 hm0) · rwa [Set.mem_preimage, ← iterate_add_apply] at hxm #align measure_theory.conservative.frequently_measure_inter_ne_zero MeasureTheory.Conservative.frequently_measure_inter_ne_zero theorem exists_gt_measure_inter_ne_zero (hf : Conservative f μ) (hs : MeasurableSet s) (h0 : μ s ≠ 0) (N : ℕ) : ∃ m > N, μ (s ∩ f^[m] ⁻¹' s) ≠ 0 := let ⟨m, hm, hmN⟩ := ((hf.frequently_measure_inter_ne_zero hs h0).and_eventually (eventually_gt_atTop N)).exists ⟨m, hmN, hm⟩ #align measure_theory.conservative.exists_gt_measure_inter_ne_zero MeasureTheory.Conservative.exists_gt_measure_inter_ne_zero
Mathlib/Dynamics/Ergodic/Conservative.lean
121
130
theorem measure_mem_forall_ge_image_not_mem_eq_zero (hf : Conservative f μ) (hs : MeasurableSet s) (n : ℕ) : μ ({ x ∈ s | ∀ m ≥ n, f^[m] x ∉ s }) = 0 := by
by_contra H have : MeasurableSet (s ∩ { x | ∀ m ≥ n, f^[m] x ∉ s }) := by simp only [setOf_forall, ← compl_setOf] exact hs.inter (MeasurableSet.biInter (to_countable _) fun m _ => hf.measurable.iterate m hs.compl) rcases (hf.exists_gt_measure_inter_ne_zero this H) n with ⟨m, hmn, hm⟩ rcases nonempty_of_measure_ne_zero hm with ⟨x, ⟨_, hxn⟩, hxm, -⟩ exact hxn m hmn.lt.le hxm
8
2,980.957987
2
2
3
2,406
import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic import Mathlib.Dynamics.Ergodic.MeasurePreserving import Mathlib.Combinatorics.Pigeonhole #align_import dynamics.ergodic.conservative from "leanprover-community/mathlib"@"bf6a01357ff5684b1ebcd0f1a13be314fc82c0bf" noncomputable section open scoped Classical open Set Filter MeasureTheory Finset Function TopologicalSpace open scoped Classical open Topology variable {ι : Type*} {α : Type*} [MeasurableSpace α] {f : α → α} {s : Set α} {μ : Measure α} namespace MeasureTheory open Measure structure Conservative (f : α → α) (μ : Measure α) extends QuasiMeasurePreserving f μ μ : Prop where exists_mem_iterate_mem : ∀ ⦃s⦄, MeasurableSet s → μ s ≠ 0 → ∃ x ∈ s, ∃ m ≠ 0, f^[m] x ∈ s #align measure_theory.conservative MeasureTheory.Conservative protected theorem MeasurePreserving.conservative [IsFiniteMeasure μ] (h : MeasurePreserving f μ μ) : Conservative f μ := ⟨h.quasiMeasurePreserving, fun _ hsm h0 => h.exists_mem_iterate_mem hsm h0⟩ #align measure_theory.measure_preserving.conservative MeasureTheory.MeasurePreserving.conservative namespace Conservative protected theorem id (μ : Measure α) : Conservative id μ := { toQuasiMeasurePreserving := QuasiMeasurePreserving.id μ exists_mem_iterate_mem := fun _ _ h0 => let ⟨x, hx⟩ := nonempty_of_measure_ne_zero h0 ⟨x, hx, 1, one_ne_zero, hx⟩ } #align measure_theory.conservative.id MeasureTheory.Conservative.id theorem frequently_measure_inter_ne_zero (hf : Conservative f μ) (hs : MeasurableSet s) (h0 : μ s ≠ 0) : ∃ᶠ m in atTop, μ (s ∩ f^[m] ⁻¹' s) ≠ 0 := by by_contra H simp only [not_frequently, eventually_atTop, Ne, Classical.not_not] at H rcases H with ⟨N, hN⟩ induction' N with N ihN · apply h0 simpa using hN 0 le_rfl rw [imp_false] at ihN push_neg at ihN rcases ihN with ⟨n, hn, hμn⟩ set T := s ∩ ⋃ n ≥ N + 1, f^[n] ⁻¹' s have hT : MeasurableSet T := hs.inter (MeasurableSet.biUnion (to_countable _) fun _ _ => hf.measurable.iterate _ hs) have hμT : μ T = 0 := by convert (measure_biUnion_null_iff <| to_countable _).2 hN rw [← inter_iUnion₂] rfl have : μ ((s ∩ f^[n] ⁻¹' s) \ T) ≠ 0 := by rwa [measure_diff_null hμT] rcases hf.exists_mem_iterate_mem ((hs.inter (hf.measurable.iterate n hs)).diff hT) this with ⟨x, ⟨⟨hxs, _⟩, hxT⟩, m, hm0, ⟨_, hxm⟩, _⟩ refine hxT ⟨hxs, mem_iUnion₂.2 ⟨n + m, ?_, ?_⟩⟩ · exact add_le_add hn (Nat.one_le_of_lt <| pos_iff_ne_zero.2 hm0) · rwa [Set.mem_preimage, ← iterate_add_apply] at hxm #align measure_theory.conservative.frequently_measure_inter_ne_zero MeasureTheory.Conservative.frequently_measure_inter_ne_zero theorem exists_gt_measure_inter_ne_zero (hf : Conservative f μ) (hs : MeasurableSet s) (h0 : μ s ≠ 0) (N : ℕ) : ∃ m > N, μ (s ∩ f^[m] ⁻¹' s) ≠ 0 := let ⟨m, hm, hmN⟩ := ((hf.frequently_measure_inter_ne_zero hs h0).and_eventually (eventually_gt_atTop N)).exists ⟨m, hmN, hm⟩ #align measure_theory.conservative.exists_gt_measure_inter_ne_zero MeasureTheory.Conservative.exists_gt_measure_inter_ne_zero theorem measure_mem_forall_ge_image_not_mem_eq_zero (hf : Conservative f μ) (hs : MeasurableSet s) (n : ℕ) : μ ({ x ∈ s | ∀ m ≥ n, f^[m] x ∉ s }) = 0 := by by_contra H have : MeasurableSet (s ∩ { x | ∀ m ≥ n, f^[m] x ∉ s }) := by simp only [setOf_forall, ← compl_setOf] exact hs.inter (MeasurableSet.biInter (to_countable _) fun m _ => hf.measurable.iterate m hs.compl) rcases (hf.exists_gt_measure_inter_ne_zero this H) n with ⟨m, hmn, hm⟩ rcases nonempty_of_measure_ne_zero hm with ⟨x, ⟨_, hxn⟩, hxm, -⟩ exact hxn m hmn.lt.le hxm #align measure_theory.conservative.measure_mem_forall_ge_image_not_mem_eq_zero MeasureTheory.Conservative.measure_mem_forall_ge_image_not_mem_eq_zero
Mathlib/Dynamics/Ergodic/Conservative.lean
135
140
theorem ae_mem_imp_frequently_image_mem (hf : Conservative f μ) (hs : MeasurableSet s) : ∀ᵐ x ∂μ, x ∈ s → ∃ᶠ n in atTop, f^[n] x ∈ s := by
simp only [frequently_atTop, @forall_swap (_ ∈ s), ae_all_iff] intro n filter_upwards [measure_zero_iff_ae_nmem.1 (hf.measure_mem_forall_ge_image_not_mem_eq_zero hs n)] simp
4
54.59815
2
2
3
2,406
import Mathlib.CategoryTheory.Sites.Sheaf #align_import category_theory.sites.plus from "leanprover-community/mathlib"@"70fd9563a21e7b963887c9360bd29b2393e6225a" namespace CategoryTheory.GrothendieckTopology open CategoryTheory open CategoryTheory.Limits open Opposite universe w v u variable {C : Type u} [Category.{v} C] (J : GrothendieckTopology C) variable {D : Type w} [Category.{max v u} D] noncomputable section variable [∀ (P : Cᵒᵖ ⥤ D) (X : C) (S : J.Cover X), HasMultiequalizer (S.index P)] variable (P : Cᵒᵖ ⥤ D) @[simps] def diagram (X : C) : (J.Cover X)ᵒᵖ ⥤ D where obj S := multiequalizer (S.unop.index P) map {S _} f := Multiequalizer.lift _ _ (fun I => Multiequalizer.ι (S.unop.index P) (I.map f.unop)) fun I => Multiequalizer.condition (S.unop.index P) (I.map f.unop) #align category_theory.grothendieck_topology.diagram CategoryTheory.GrothendieckTopology.diagram @[simps] def diagramPullback {X Y : C} (f : X ⟶ Y) : J.diagram P Y ⟶ (J.pullback f).op ⋙ J.diagram P X where app S := Multiequalizer.lift _ _ (fun I => Multiequalizer.ι (S.unop.index P) I.base) fun I => Multiequalizer.condition (S.unop.index P) I.base naturality S T f := Multiequalizer.hom_ext _ _ _ (fun I => by dsimp; simp; rfl) #align category_theory.grothendieck_topology.diagram_pullback CategoryTheory.GrothendieckTopology.diagramPullback @[simps] def diagramNatTrans {P Q : Cᵒᵖ ⥤ D} (η : P ⟶ Q) (X : C) : J.diagram P X ⟶ J.diagram Q X where app W := Multiequalizer.lift _ _ (fun i => Multiequalizer.ι _ _ ≫ η.app _) (fun i => by dsimp only erw [Category.assoc, Category.assoc, ← η.naturality, ← η.naturality, Multiequalizer.condition_assoc] rfl) #align category_theory.grothendieck_topology.diagram_nat_trans CategoryTheory.GrothendieckTopology.diagramNatTrans @[simp]
Mathlib/CategoryTheory/Sites/Plus.lean
71
77
theorem diagramNatTrans_id (X : C) (P : Cᵒᵖ ⥤ D) : J.diagramNatTrans (𝟙 P) X = 𝟙 (J.diagram P X) := by
ext : 2 refine Multiequalizer.hom_ext _ _ _ (fun i => ?_) dsimp simp only [limit.lift_π, Multifork.ofι_pt, Multifork.ofι_π_app, Category.id_comp] erw [Category.comp_id]
5
148.413159
2
2
3
2,407