Skip to content

Commit e899c46

Browse files
j-loreauxkim-em
andcommitted
refactor: make Unitization into a one-field structure (#37014)
I've been meaning to do this for a while; indeed, I created this branch 2 years ago! The purpose now is to avoid some defeq abuse related to `Unitization`. In this case, especially since I already had this branch, I decided that the easiest thing to do would be to turn it into a one-field structure. I have removed a few of the `IsDefEq.respectTransparency` overrides, just to verify that this really solved the problem and that it didn't lie elsewhere. Probably more can be removed elsewhere, but we'll leave those to automation. Co-authored-by: Kim Morrison <477956+kim-em@users.noreply.github.com>
1 parent ec3a721 commit e899c46

File tree

5 files changed

+221
-172
lines changed

5 files changed

+221
-172
lines changed

Mathlib/Algebra/Algebra/Spectrum/Quasispectrum.lean

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ variable (R A) in
123123
def unitsFstOne : Subgroup (Unitization R A)ˣ where
124124
carrier := {x | x.val.fst = 1}
125125
one_mem' := rfl
126-
mul_mem' {x} {y} (hx : fst x.val = 1) (hy : fst y.val = 1) := by simp [hx, hy]
127-
inv_mem' {x} (hx : fst x.val = 1) := by
126+
mul_mem' {x} {y} (hx : x.val.fst = 1) (hy : y.val.fst = 1) := by simp [hx, hy]
127+
inv_mem' {x} (hx : x.val.fst = 1) := by
128128
simpa [-Units.mul_inv, hx] using congr(fstHom R A $(x.mul_inv))
129129

130130
@[simp]
@@ -145,30 +145,32 @@ scalar part is `1 : R` (i.e., `Unitization.unitsFstOne`) is isomorphic to the gr
145145
@[simps]
146146
def unitsFstOne_mulEquiv_quasiregular : unitsFstOne R A ≃* (PreQuasiregular A)ˣ where
147147
toFun x :=
148-
{ val := equiv x.val.val.snd
149-
inv := equiv x⁻¹.val.val.snd
150-
val_inv := equiv.symm.injective <| by
151-
simpa [-Units.mul_inv] using congr(snd $(x.val.mul_inv))
152-
inv_val := equiv.symm.injective <| by
153-
simpa [-Units.inv_mul] using congr(snd $(x.val.inv_mul)) }
148+
{ val := PreQuasiregular.equiv x.val.val.snd
149+
inv := PreQuasiregular.equiv x⁻¹.val.val.snd
150+
val_inv := PreQuasiregular.equiv.symm.injective <| by
151+
simpa [-Units.mul_inv] using congr($(x.val.mul_inv).snd)
152+
inv_val := PreQuasiregular.equiv.symm.injective <| by
153+
simpa [-Units.inv_mul] using congr($(x.val.inv_mul).snd) }
154154
invFun x :=
155155
{ val :=
156-
{ val := 1 + equiv.symm x.val
157-
inv := 1 + equiv.symm x⁻¹.val
156+
{ val := 1 + PreQuasiregular.equiv.symm x.val
157+
inv := 1 + PreQuasiregular.equiv.symm x⁻¹.val
158158
val_inv := by
159159
convert congr((1 + $(inv_add_add_mul_eq_zero x) : Unitization R A)) using 1
160-
· simp only [mul_one, equiv_symm_apply, one_mul, mul_add, add_mul, inr_add, inr_mul]
160+
· simp only [mul_one, PreQuasiregular.equiv_symm_apply, one_mul, mul_add,
161+
add_mul, inr_add, inr_mul]
161162
abel
162163
· simp only [inr_zero, add_zero]
163164
inv_val := by
164165
convert congr((1 + $(add_inv_add_mul_eq_zero x) : Unitization R A)) using 1
165-
· simp only [mul_one, equiv_symm_apply, one_mul, mul_add, add_mul, inr_add, inr_mul]
166+
· simp only [mul_one, PreQuasiregular.equiv_symm_apply, one_mul, mul_add,
167+
add_mul, inr_add, inr_mul]
166168
abel
167169
· simp only [inr_zero, add_zero] }
168170
property := by simp }
169171
left_inv x := Subtype.ext <| Units.ext <| by simpa using x.val.val.inl_fst_add_inr_snd_eq
170-
right_inv x := Units.ext <| by simp [-equiv_symm_apply]
171-
map_mul' x y := Units.ext <| equiv.symm.injective <| by simp
172+
right_inv x := Units.ext <| by simp [-PreQuasiregular.equiv_symm_apply]
173+
map_mul' x y := Units.ext <| PreQuasiregular.equiv.symm.injective <| by simp
172174

173175
end Unitization
174176

0 commit comments

Comments
 (0)