Skip to content
Open
Changes from 19 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7333c7e
1. add variant equivCongrLeft' of equivCongrLeft, and corresponding ……
TentativeConvert May 19, 2026
8da74c5
Add …of lemma for sigmaCurry, i.e. sigmaCurry_of.
TentativeConvert May 19, 2026
ed508da
Add sigmaFiberAddEquiv: the equivalence between a direct sum indexed …
TentativeConvert May 20, 2026
438facb
add DocString for DirectSum.equivCongrLeft'
TentativeConvert May 20, 2026
6805b5c
Apply suggestion from @themathqueen
TentativeConvert Jun 22, 2026
e28e218
remove equivCongrLeft' again
TentativeConvert Jun 23, 2026
0869d2b
Merge remote-tracking branch 'upstream/master' into sigma-fiber-equiv
TentativeConvert Jun 23, 2026
42403fa
remove doubled dedidability assumption
TentativeConvert Jun 23, 2026
d5f3612
adapt spacing
TentativeConvert Jun 23, 2026
c5c3aec
adapt spacing
TentativeConvert Jun 23, 2026
ba5a211
remove 'by exact'
TentativeConvert Jun 23, 2026
4ae1133
indent calc block
TentativeConvert Jun 23, 2026
064fcd4
remove unnecessary explicit cast
TentativeConvert Jun 23, 2026
5f6c2f0
shorten proof to rfl
TentativeConvert Jun 23, 2026
a5ea556
shorten proof to rfl
TentativeConvert Jun 23, 2026
0d58d24
add missing space
TentativeConvert Jun 23, 2026
e48c29c
simplify last step of calc proof
TentativeConvert Jun 23, 2026
f6c69a1
adapt spacing
TentativeConvert Jun 24, 2026
25fbafa
replace explicit use of sigmaCurry_of with simp call
TentativeConvert Jun 24, 2026
d3ae57e
reintroduce line break deleted by accidenent
TentativeConvert Jun 24, 2026
9808ab6
adjust spacing of doc string in line with other review suggestions
TentativeConvert Jun 24, 2026
112d499
further adjust docstring spacing
TentativeConvert Jun 24, 2026
13ec498
adapt spacing
TentativeConvert Jun 27, 2026
4d5c061
rename …apply' -> …apply; …apply -> …apply_apply
TentativeConvert Jun 27, 2026
69a1787
shorten '∀ i : ι₁' to '∀ i'
TentativeConvert Jun 28, 2026
6b1bc34
don't need initial "by" in pure calc proof
TentativeConvert Jun 28, 2026
565ae11
Merge branch 'master' into sigma-fiber-equiv
TentativeConvert Jun 29, 2026
cdfcc16
change \forall to \Pi
TentativeConvert Jun 29, 2026
fb1a532
improve readability of docstring following a suggestion by Jon Eugster
TentativeConvert Jul 14, 2026
3a427c0
Merge branch 'master' into sigma-fiber-equiv
TentativeConvert Jul 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 46 additions & 4 deletions Mathlib/Algebra/DirectSum/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module
public import Mathlib.Algebra.Group.Submonoid.Operations
public import Mathlib.Data.DFinsupp.Sigma
public import Mathlib.Data.DFinsupp.Submonoid

Comment thread
TentativeConvert marked this conversation as resolved.
/-!
# Direct sum

Expand Down Expand Up @@ -302,14 +301,20 @@ section CongrLeft

variable {κ : Type*}

/-- Reindexing terms of a direct sum. -/
/-- Reindexing terms of a direct sum: change indexing type from `ι` to `κ` along an equivalence
`h : ι ≃ κ`. -/
def equivCongrLeft (h : ι ≃ κ) : (⨁ i, β i) ≃+ ⨁ k, β (h.symm k) :=
{ DFinsupp.equivCongrLeft h with map_add' := DFinsupp.comapDomain'_add _ h.right_inv }

@[simp]
theorem equivCongrLeft_apply (h : ι ≃ κ) (f : ⨁ i, β i) (k : κ) :
equivCongrLeft h f k = f (h.symm k) := by
exact DFinsupp.comapDomain'_apply _ h.right_inv _ _
equivCongrLeft h f k = f (h.symm k) :=
DFinsupp.comapDomain'_apply _ h.right_inv _ _

@[simp]
theorem equivCongrLeft_of [DecidableEq ι] [DecidableEq κ] (h : ι ≃ κ) (k : κ) (x : β (h.symm k)) :
equivCongrLeft h (of β (h.symm k) x) = of (fun k ↦ β (h.symm k)) k x :=
DFinsupp.comapDomain'_single h.symm h.right_inv _ _

end CongrLeft

Expand Down Expand Up @@ -339,6 +344,12 @@ theorem sigmaCurry_apply (f : ⨁ i : Σ _i, _, δ i.1 i.2) (i : ι) (j : α i)
sigmaCurry f i j = f ⟨i, j⟩ :=
DFinsupp.sigmaCurry_apply (δ := δ) _ i j

@[simp]
theorem sigmaCurry_of [∀ i : ι, DecidableEq (α i)] (k : (i : ι) × α i) (x : δ k.1 k.2) :
sigmaCurry (of (fun k ↦ δ k.1 k.2) k x) =
of (fun i' ↦ ⨁ (j' : α i'), δ i' j') k.1 (of (fun j' ↦ δ k.1 j') k.2 x) :=
DFinsupp.sigmaCurry_single k x

/-- The natural map between `⨁ i (j : α i), δ i j` and `Π₀ (i : Σ i, α i), δ i.1 i.2`, inverse of
`curry`. -/
def sigmaUncurry : (⨁ (i) (j), δ i j) →+ ⨁ i : Σ _i, _, δ i.1 i.2 where
Expand All @@ -357,6 +368,37 @@ def sigmaCurryEquiv : (⨁ i : Σ _i, _, δ i.1 i.2) ≃+ ⨁ (i) (j), δ i j :=

end Sigma

section SigmaFiber

variable {ι₁ ι₂ : Type v} [DecidableEq ι₂] (f : ι₁ → ι₂)
variable {β : ι₁ → Type w} [∀ i : ι₁, AddCommMonoid (β i)]
Comment thread
TentativeConvert marked this conversation as resolved.
Outdated

/-- The equivalence between a direct sum indexed by a type `ι₁` and the
double sum indexed by a type `ι₂` and the fibres of a map `f : ι₁ → ι₂`. -/
def sigmaFiberAddEquiv : (⨁ i, β i) ≃+ ⨁ (j : ι₂) (i : { i : ι₁ // f i = j}), β ↑i :=
(equivCongrLeft (Equiv.sigmaFiberEquiv f).symm).trans
(sigmaCurryEquiv (δ := fun j ↦ (fun (i : { i : ι₁ // f i = j}) ↦ β i)))

theorem sigmaFiberAddEquiv_apply' (x : ⨁ i, β i) :
sigmaFiberAddEquiv f x = sigmaCurry (equivCongrLeft (Equiv.sigmaFiberEquiv f).symm x) := rfl

@[simp]
theorem sigmaFiberAddEquiv_apply (x : ⨁ i, β i) (j : ι₂) (i' : { i : ι₁ // f i = j}) :
Comment thread
TentativeConvert marked this conversation as resolved.
Outdated
sigmaFiberAddEquiv f x j i' = x i' := rfl
Comment thread
TentativeConvert marked this conversation as resolved.
Outdated

@[simp]
theorem sigmaFiberAddEquiv_of [DecidableEq ι₁] (i : ι₁) (x : β i) :
sigmaFiberAddEquiv f (of _ i x) = of _ (f i) (of _ ⟨i, rfl⟩ x) := by
Comment thread
TentativeConvert marked this conversation as resolved.
Outdated
let h := Equiv.sigmaFiberEquiv f
let k : (j : ι₂) × {i₁ : ι₁ // f i₁ = j} := ⟨f i, ⟨i, rfl⟩⟩
calc sigmaFiberAddEquiv f (of β (h k) x)
_ = sigmaCurry (of (fun k : (j' : ι₂) × {i // f i = j'} ↦ β k.2) k x) := by
rw [sigmaFiberAddEquiv_apply']
exact congrArg sigmaCurry (equivCongrLeft_of (h := h.symm) _ _)
_ = of _ k.1 (of _ k.2 x) := by simp

end SigmaFiber

/-- The canonical embedding from `⨁ i, A i` to `M` where `A` is a collection of `AddSubmonoid M`
indexed by `ι`.

Expand Down
Loading