Skip to content

Commit df50f6d

Browse files
author
mathlib4-bot
committed
Merge remote-tracking branch 'upstream/master' into bump/v4.31.0
2 parents 0a04433 + c1e30e1 commit df50f6d

14 files changed

Lines changed: 559 additions & 114 deletions

File tree

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4338,6 +4338,7 @@ public import Mathlib.Dynamics.Ergodic.Function
43384338
public import Mathlib.Dynamics.Ergodic.MeasurePreserving
43394339
public import Mathlib.Dynamics.Ergodic.RadonNikodym
43404340
public import Mathlib.Dynamics.FixedPoints.Basic
4341+
public import Mathlib.Dynamics.FixedPoints.Defs
43414342
public import Mathlib.Dynamics.FixedPoints.Prufer
43424343
public import Mathlib.Dynamics.FixedPoints.Topology
43434344
public import Mathlib.Dynamics.Flow

Mathlib/Algebra/Lie/Graded.lean

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ public import Mathlib.Algebra.Lie.Derivation.Basic
1212
# Graded Lie algebras
1313
1414
This file defines typeclasses `SetLike.GradedBracket` and `GradedLieAlgebra`, for working with Lie
15-
algebras that are graded by a collection `ℒ` of submodules. The additivity of degree with respect to
16-
the bracket product is encoded by an addition condition so we can avoid the usual difficulties of
17-
adding elements of `A (i + j)` to elements of `A (j + i)`.
15+
algebras that are graded by a collection `ℒ` of submodules.
1816
1917
## Main definitions
2018
@@ -25,6 +23,12 @@ adding elements of `A (i + j)` to elements of `A (j + i)`.
2523
* `LieDerivation.ofGrading`: A Lie derivation on a graded Lie algebra, that scalar-multiplies graded
2624
pieces by an additive map applied to degree.
2725
26+
## Implementation notes
27+
28+
For now we only implement internally-graded Lie algebras; supporting the externally-graded case
29+
would be achieved by generalizing the `LieRing (⨁ i, ℒ i)` instance to take a family of types,
30+
and defining a new `GradedMonoid.GBracket` class to provide the data piecewise.
31+
2832
-/
2933

3034
@[expose] public section
@@ -38,7 +42,7 @@ section SetLike
3842
/-- A class that ensures a bracket product preserves an additive grading. -/
3943
class SetLike.GradedBracket [SetLike σ L] [Bracket L L] [Add ι] (ℒ : ι → σ) : Prop where
4044
/-- Bracket is homogeneous -/
41-
bracket_mem : ∀ ⦃i j k⦄ {gi gj}, i + j = k → gi ∈ ℒ i → gj ∈ ℒ j → ⁅gi, gj⁆ ∈ ℒ k
45+
bracket_mem : ∀ ⦃i j⦄ {gi gj}, gi ∈ ℒ i → gj ∈ ℒ j → ⁅gi, gj⁆ ∈ ℒ (i + j)
4246

4347
variable [DecidableEq ι] [AddCommMonoid ι] [CommRing R] [LieRing L] [LieAlgebra R L]
4448
(ℒ : ι → Submodule R L)
@@ -125,7 +129,7 @@ def ofGradingSum (φ : ι →+ R) : LieDerivation R (⨁ i, ℒ i) (⨁ i, ℒ i
125129
add_lie, smul_add, add_sub, ← sub_sub]
126130
congr 1
127131
have : (decompose ℒ).symm ⁅of (fun i ↦ ℒ i) i a, of (fun i ↦ ℒ i) k b⁆ ∈ ℒ (i + k) := by
128-
simp [SetLike.GradedBracket.bracket_mem rfl (Submodule.coe_mem a) (Submodule.coe_mem b)]
132+
simp [SetLike.GradedBracket.bracket_mem (Submodule.coe_mem a) (Submodule.coe_mem b)]
129133
rw [hM _ _ this, hM k (of (ℒ ·) k b) (by simp), ← lie_skew (of (ℒ ·) k b),
130134
add_sub_right_comm, add_right_cancel_iff, add_comm i k, map_add, add_smul,
131135
DirectSum.add_apply, Submodule.coe_add, sub_eq_add_neg, lie_smul, add_left_cancel_iff,

Mathlib/Algebra/Module/Torsion/PrimaryComponent.lean

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module
77

88
public import Mathlib.Algebra.Module.Torsion.Basic
99
public import Mathlib.RingTheory.DedekindDomain.Ideal.Lemmas
10+
public import Mathlib.RingTheory.DedekindDomain.Factorization
1011

1112
/-!
1213
# I-Primary Components of modules
@@ -15,7 +16,7 @@ Let `A` be a commutative ring and `I`, an ideal of `A`.
1516
Given an `A`-Module `M` it's `I`-primary component is defined as
1617
$$M(I) := \bigcup_{i : \mathbb{N}} \text{torsionBySet A M } I ^ i.$$
1718
18-
For `P : HeightOneSpectrum A`, the main result of this file (TODO) is that
19+
For `P : HeightOneSpectrum A`, the main result of this file is that
1920
$$M \cong \bigoplus_{P} M(P).$$
2021
2122
## Main definitions
@@ -28,6 +29,8 @@ For `P : HeightOneSpectrum A`, the main result of this file (TODO) is that
2829

2930
variable {A M M₁ M₂ : Type*} [CommRing A]
3031

32+
open IsDedekindDomain Submodule Module HeightOneSpectrum Set Function
33+
3134
namespace Ideal
3235

3336
variable (I : Ideal A)
@@ -127,6 +130,64 @@ theorem primaryComponent_sup (N₁ N₂ : Submodule A M) (hD : Disjoint N₁ N
127130
aesop
128131
· use y, hymem, z, hzmem
129132

133+
section IsDedekindDomain
134+
135+
variable [IsDedekindDomain A]
136+
137+
open scoped nonZeroDivisors
138+
139+
theorem iSup_primaryComponent_eq_top (h : IsTorsion A M) :
140+
⨆ P : HeightOneSpectrum A, primaryComponent M (P : Ideal A) = ⊤ := by
141+
rw [eq_top_iff']
142+
intro x
143+
obtain ⟨⟨a : A, ha : a ∈ A⁰⟩, hmem : a • x = 0⟩ := h (x := x)
144+
replace hmem : x ∈ torsionBySet A M (span {a}) := by
145+
simp_all [← torsionBySet_eq_torsionBySet_span {a}]
146+
have ha0 : span {a} ≠ ⊥ := by simpa using nonZeroDivisors.ne_zero ha
147+
rw [← iInf_maxPowDividing_eq ha0] at hmem
148+
let : Fintype (mulSupport fun v : HeightOneSpectrum A => v.maxPowDividing (span {a})) :=
149+
Finite.fintype (hasFiniteMulSupport ha0)
150+
let S := (mulSupport fun v : HeightOneSpectrum A => v.maxPowDividing (span {a})).toFinset
151+
have : (⨅ i : HeightOneSpectrum A, i.maxPowDividing (span {a})) =
152+
(⨅ i ∈ S, i.maxPowDividing (span {a})) := by
153+
ext x
154+
constructor
155+
· aesop
156+
· simp only [mem_iInf]
157+
intro h i
158+
by_cases htop : i.maxPowDividing (span {a}) = ⊤ <;> simp_all [S]
159+
have hPairwise : (S : Set (HeightOneSpectrum _)).Pairwise
160+
fun i j ↦ i.maxPowDividing (span {a}) ⊔ j.maxPowDividing (span {a}) = ⊤ :=
161+
fun r hr s hs hrs ↦ (isCoprime_pow_of_ne _ _ hrs _ _).sup_eq
162+
rw [this, ← iSup_torsionBySet_ideal_eq_torsionBySet_iInf hPairwise] at hmem
163+
revert x
164+
rw [← SetLike.le_def]
165+
refine iSup_mono (fun P x hxmem ↦ ?_)
166+
by_cases hPS : P ∈ S
167+
· simp_all only [mem_nonZeroDivisors_iff_ne_zero, ne_eq, mem_toFinset, mem_mulSupport,
168+
one_eq_top, primaryComponent_mem, mem_torsionBySet_iff, SetLike.coe_sort_coe,
169+
Subtype.forall, iSup_pos, S]
170+
exact ⟨(Associates.mk P.asIdeal).count (Associates.mk (span {a})).factors, fun _ b ↦ hxmem _ b⟩
171+
· simp_all
172+
173+
variable (A M) in
174+
theorem iSupIndep_primaryComponent :
175+
iSupIndep fun P : HeightOneSpectrum A => primaryComponent M (P : Ideal A) := by
176+
rw [iSupIndep_iff_finset_sum_eq_zero_imp_eq_zero]
177+
intro s p hmem hsum
178+
simp only [primaryComponent_mem] at hmem
179+
choose! f hmem using hmem
180+
let m := s.sup f
181+
have hSupIndep : iSupIndep fun i : HeightOneSpectrum A ↦ torsionBySet A M ↑(i.asIdeal ^ m) := by
182+
rw [iSupIndep_iff_supIndep]
183+
exact fun _ ↦ supIndep_torsionBySet_ideal
184+
fun _ _ _ _ hPQ ↦ (isCoprime_pow_of_ne _ _ hPQ _ _).sup_eq
185+
rw [iSupIndep_iff_finset_sum_eq_zero_imp_eq_zero] at hSupIndep
186+
apply hSupIndep _ _ ?_ hsum
187+
exact fun P hP ↦ torsionBySet_le_torsionBySet_pow _ _ (Finset.le_sup hP) _ (hmem P hP)
188+
189+
end IsDedekindDomain
190+
130191
end AddCommGroup
131192

132193
end CommRing

Mathlib/Dynamics/FixedPoints/Basic.lean

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,12 @@ module
77

88
public import Mathlib.Algebra.Group.End
99
public import Mathlib.Data.Set.Function
10+
public import Mathlib.Dynamics.FixedPoints.Defs
1011

1112
/-!
1213
# Fixed points of a self-map
1314
14-
In this file we define
15-
16-
* the predicate `IsFixedPt f x := f x = x`;
17-
* the set `fixedPoints f` of fixed points of a self-map `f`.
18-
19-
We also prove some simple lemmas about `IsFixedPt` and `∘`, `iterate`, and `Semiconj`.
15+
We prove some simple lemmas about `IsFixedPt` and `∘`, `iterate`, and `Semiconj`.
2016
2117
## Tags
2218
@@ -25,34 +21,18 @@ fixed point
2521

2622
@[expose] public section
2723

28-
2924
open Equiv
3025

3126
universe u v
3227

33-
variable: Type u} {β : Type v} {f fa g : α → α} {x : α} {fb : β → β} {e : Perm α}
28+
variable {α β : Type*} {f fa g : α → α} {x : α} {fb : β → β} {e : Perm α}
3429

3530
namespace Function
3631

3732
open Function (Commute)
3833

39-
/-- Every point is a fixed point of `id`. -/
40-
theorem isFixedPt_id (x : α) : IsFixedPt id x :=
41-
(rfl :)
42-
43-
/-- A function fixes every point iff it is the identity. -/
44-
@[simp] theorem forall_isFixedPt_iff : (∀ x, IsFixedPt f x) ↔ f = id :=
45-
⟨funext, fun h ↦ h ▸ isFixedPt_id⟩
46-
4734
namespace IsFixedPt
4835

49-
instance decidable [h : DecidableEq α] {f : α → α} {x : α} : Decidable (IsFixedPt f x) :=
50-
h (f x) x
51-
52-
/-- If `x` is a fixed point of `f`, then `f x = x`. This is useful, e.g., for `rw` or `simp`. -/
53-
protected theorem eq (hf : IsFixedPt f x) : f x = x :=
54-
hf
55-
5636
/-- If `x` is a fixed point of `f` and `g`, then it is a fixed point of `f ∘ g`. -/
5737
protected theorem comp (hf : IsFixedPt f x) (hg : IsFixedPt g x) : IsFixedPt (f ∘ g) x :=
5838
calc
@@ -114,27 +94,6 @@ theorem Injective.isFixedPt_apply_iff (hf : Injective f) {x : α} :
11494
IsFixedPt f (f x) ↔ IsFixedPt f x :=
11595
fun h => hf h.eq, IsFixedPt.apply⟩
11696

117-
/-- The set of fixed points of a map `f : α → α`. -/
118-
def fixedPoints (f : α → α) : Set α :=
119-
{ x : α | IsFixedPt f x }
120-
121-
instance fixedPoints.decidable [DecidableEq α] (f : α → α) (x : α) :
122-
Decidable (x ∈ fixedPoints f) :=
123-
IsFixedPt.decidable
124-
125-
@[simp]
126-
theorem mem_fixedPoints : x ∈ fixedPoints f ↔ IsFixedPt f x :=
127-
Iff.rfl
128-
129-
theorem mem_fixedPoints_iff {α : Type*} {f : α → α} {x : α} : x ∈ fixedPoints f ↔ f x = x := by
130-
rfl
131-
132-
@[simp]
133-
theorem fixedPoints_id : fixedPoints (@id α) = Set.univ :=
134-
Set.ext fun _ => by simpa using isFixedPt_id _
135-
136-
theorem fixedPoints_subset_range : fixedPoints f ⊆ Set.range f := fun x hx => ⟨x, hx⟩
137-
13897
/-- If `g` semiconjugates `fa` to `fb`, then it sends fixed points of `fa` to fixed points
13998
of `fb`. -/
14099
theorem Semiconj.mapsTo_fixedPoints {g : α → β} (h : Semiconj g fa fb) :
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/-
2+
Copyright (c) 2020 Yury Kudryashov. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Yury Kudryashov
5+
-/
6+
module
7+
8+
public import Mathlib.Data.Set.Operations
9+
10+
/-!
11+
# Fixed points of a self-map
12+
13+
In this file we define the set `Function.fixedPoints` of fixed points of a function `f : α → α`.
14+
The related predicate `IsFixedPt` is defined in `Mathlib.Logic.Function.Defs`.
15+
16+
## Tags
17+
18+
fixed point
19+
-/
20+
21+
@[expose] public section
22+
23+
namespace Function
24+
25+
variable {α : Type*} {x : α} {f : α → α}
26+
27+
/-- The set of fixed points of a map `f : α → α`. -/
28+
def fixedPoints (f : α → α) : Set α :=
29+
{ x : α | IsFixedPt f x }
30+
31+
instance fixedPoints.decidable [DecidableEq α] (f : α → α) (x : α) :
32+
Decidable (x ∈ fixedPoints f) :=
33+
IsFixedPt.decidable
34+
35+
@[simp]
36+
theorem mem_fixedPoints : x ∈ fixedPoints f ↔ IsFixedPt f x :=
37+
.rfl
38+
39+
theorem mem_fixedPoints_iff {α : Type*} {f : α → α} {x : α} : x ∈ fixedPoints f ↔ f x = x :=
40+
.rfl
41+
42+
@[simp]
43+
theorem fixedPoints_id : fixedPoints (@id α) = Set.univ :=
44+
Set.ext fun _ => by simpa using isFixedPt_id _
45+
46+
theorem fixedPoints_subset_range : fixedPoints f ⊆ Set.range f := fun x hx => ⟨x, hx⟩
47+
48+
end Function

Mathlib/LinearAlgebra/TensorProduct/Pi.lean

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,14 @@ section
4343

4444
variable {ι} (M : ι → Type*) [∀ i, AddCommMonoid (M i)] [∀ i, Module R (M i)]
4545

46-
set_option backward.privateInPublic true in
47-
private def piRightHomBil : N →ₗ[S] (∀ i, M i) →ₗ[R] ∀ i, N ⊗[R] M i where
46+
/-- (Implementation): Bilinear map for defining `TensorProduct.piRightHom`. -/
47+
def piRightHomBil : N →ₗ[S] (∀ i, M i) →ₗ[R] ∀ i, N ⊗[R] M i where
4848
toFun n := LinearMap.pi (fun i ↦ mk R N (M i) n ∘ₗ LinearMap.proj i)
4949
map_add' _ _ := by
5050
ext
5151
simp
5252
map_smul' _ _ := rfl
5353

54-
set_option backward.privateInPublic true in
55-
set_option backward.privateInPublic.warn false in
5654
/-- For any `R`-module `N`, index type `ι` and family of `R`-modules `Mᵢ`, there is a natural
5755
linear map `N ⊗[R] (∀ i, M i) →ₗ ∀ i, N ⊗[R] M i`. This map is an isomorphism if `ι` is finite. -/
5856
def piRightHom : N ⊗[R] (∀ i, M i) →ₗ[S] ∀ i, N ⊗[R] M i :=
@@ -65,8 +63,7 @@ lemma piRightHom_tmul (x : N) (f : ∀ i, M i) :
6563

6664
variable [Fintype ι] [DecidableEq ι]
6765

68-
set_option backward.privateInPublic true in
69-
private
66+
/-- (Implementation): Inverse for `TensorProduct.piRight`. -/
7067
def piRightInv : (∀ i, N ⊗[R] M i) →ₗ[S] N ⊗[R] ∀ i, M i :=
7168
LinearMap.lsum S (fun i ↦ N ⊗[R] M i) S <| fun i ↦
7269
AlgebraTensorModule.map LinearMap.id (single R M i)
@@ -90,8 +87,6 @@ private lemma piRightInv_single (x : N) (i : ι) (m : M i) :
9087
rw [this]
9188
simp
9289

93-
set_option backward.privateInPublic true in
94-
set_option backward.privateInPublic.warn false in
9590
/-- Tensor product commutes with finite products on the right. -/
9691
def piRight : N ⊗[R] (∀ i, M i) ≃ₗ[S] ∀ i, N ⊗[R] M i :=
9792
LinearEquiv.ofLinear
@@ -122,8 +117,8 @@ TODO: generalize to `S`-linear. -/
122117

123118
end
124119

125-
set_option backward.privateInPublic true in
126-
private def piScalarRightHomBil : N →ₗ[S] (ι → R) →ₗ[R] (ι → N) where
120+
/-- (Implementation): Bilinear map for defining `TensorProduct.piScalarRightHom`. -/
121+
def piScalarRightHomBil : N →ₗ[S] (ι → R) →ₗ[R] (ι → N) where
127122
toFun n := LinearMap.compLeft (toSpanSingleton R N n) ι
128123
map_add' x y := by
129124
ext i j
@@ -135,8 +130,6 @@ private def piScalarRightHomBil : N →ₗ[S] (ι → R) →ₗ[R] (ι → N) wh
135130
rw [← IsScalarTower.smul_assoc, _root_.Algebra.smul_def, mul_comm, mul_smul]
136131
simp
137132

138-
set_option backward.privateInPublic true in
139-
set_option backward.privateInPublic.warn false in
140133
/-- For any `R`-module `N` and index type `ι`, there is a natural
141134
linear map `N ⊗[R] (ι → R) →ₗ (ι → N)`. This map is an isomorphism if `ι` is finite. -/
142135
def piScalarRightHom : N ⊗[R] (ι → R) →ₗ[S] (ι → N) :=
@@ -150,8 +143,7 @@ lemma piScalarRightHom_tmul (x : N) (f : ι → R) :
150143

151144
variable [Fintype ι] [DecidableEq ι]
152145

153-
set_option backward.privateInPublic true in
154-
private
146+
/-- (Implementation): Inverse for `TensorProduct.piScalarRight`. -/
155147
def piScalarRightInv : (ι → N) →ₗ[S] N ⊗[R] (ι → R) :=
156148
LinearMap.lsum S (fun _ ↦ N) S <| fun i ↦ {
157149
toFun := fun n ↦ n ⊗ₜ Pi.single i 1
@@ -164,8 +156,6 @@ private lemma piScalarRightInv_single (x : N) (i : ι) :
164156
piScalarRightInv R S N ι (Pi.single i x) = x ⊗ₜ Pi.single i 1 := by
165157
simp [piScalarRightInv, Pi.single_apply, TensorProduct.ite_tmul]
166158

167-
set_option backward.privateInPublic true in
168-
set_option backward.privateInPublic.warn false in
169159
/-- For any `R`-module `N` and finite index type `ι`, `N ⊗[R] (ι → R)` is canonically
170160
isomorphic to `ι → N`. -/
171161
def piScalarRight : N ⊗[R] (ι → R) ≃ₗ[S] (ι → N) :=

Mathlib/Logic/Equiv/Defs.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,8 @@ noncomputable def ofBijective (f : α → β) (hf : Bijective f) : α ≃ β whe
818818
left_inv := leftInverse_surjInv hf
819819
right_inv := rightInverse_surjInv _
820820

821+
@[simp] lemma coe_ofBijective (f : α → β) (hf : Bijective f) : ⇑(ofBijective f hf) = f := rfl
822+
821823
lemma ofBijective_apply_symm_apply (f : α → β) (hf : Bijective f) (x : β) :
822824
f ((ofBijective f hf).symm x) = x :=
823825
(ofBijective f hf).apply_symm_apply x

Mathlib/Logic/Function/Defs.lean

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,25 @@ variable {α : Type u₁} {β : Type u₂}
7575
/-- A point `x` is a fixed point of `f : α → α` if `f x = x`. -/
7676
def IsFixedPt (f : α → α) (x : α) := f x = x
7777

78+
/-- If `x` is a fixed point of `f`, then `f x = x`. This is useful, e.g., for `rw` or `simp`. -/
79+
protected theorem IsFixedPt.eq {f : α → α} {x : α} (hf : IsFixedPt f x) : f x = x :=
80+
hf
81+
82+
instance IsFixedPt.decidable [h : DecidableEq α] {f : α → α} {x : α} : Decidable (IsFixedPt f x) :=
83+
h (f x) x
84+
7885
@[nontriviality]
7986
theorem IsFixedPt.of_subsingleton [Subsingleton α] (f : α → α) (x : α) : IsFixedPt f x :=
8087
Subsingleton.elim _ _
8188

89+
/-- Every point is a fixed point of `id`. -/
90+
theorem isFixedPt_id (x : α) : IsFixedPt id x :=
91+
rfl
92+
93+
/-- A function fixes every point iff it is the identity. -/
94+
@[simp] theorem forall_isFixedPt_iff {f : α → α} : (∀ x, IsFixedPt f x) ↔ f = id :=
95+
⟨funext, fun h ↦ h ▸ isFixedPt_id⟩
96+
8297
end Function
8398

8499
namespace Pi

0 commit comments

Comments
 (0)