Skip to content

Commit 06e4a53

Browse files
committed
feat: a bit more API around ContinuousAffineEquiv.pointReflection (leanprover-community#40889)
Following its introduction in leanprover-community#40637.
1 parent cba4173 commit 06e4a53

2 files changed

Lines changed: 55 additions & 22 deletions

File tree

Mathlib/LinearAlgebra/AffineSpace/AffineEquiv.lean

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ def vaddConst (b : P₁) : V₁ ≃ᵃ[k] P₁ where
427427
map_vadd' _ _ := add_vadd _ _ _
428428

429429
/-- `p' ↦ p -ᵥ p'` as an equivalence. -/
430+
@[simps! linear apply symm_apply]
430431
def constVSub (p : P₁) : P₁ ≃ᵃ[k] V₁ where
431432
toEquiv := Equiv.constVSub p
432433
linear := LinearEquiv.neg k
@@ -514,10 +515,13 @@ This is `Equiv.pointReflection` as an `AffineEquiv`. -/
514515
def pointReflection (x : P₁) : P₁ ≃ᵃ[k] P₁ :=
515516
(constVSub k x).trans (vaddConst k x)
516517

517-
@[simp] lemma pointReflection_apply_eq_equivPointReflection_apply (x y : P₁) :
518-
pointReflection k x y = Equiv.pointReflection x y :=
518+
@[simp]
519+
lemma coe_pointReflection (x y : P₁) : pointReflection k x y = Equiv.pointReflection x y :=
519520
rfl
520521

522+
@[deprecated (since := "2026-06-22")]
523+
alias pointReflection_apply_eq_equivPointReflection_apply := coe_pointReflection
524+
521525
theorem pointReflection_apply (x y : P₁) : pointReflection k x y = (x -ᵥ y) +ᵥ x :=
522526
rfl
523527

Mathlib/Topology/Algebra/ContinuousAffineEquiv.lean

Lines changed: 49 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,6 @@ theorem coe_coe (e : P₁ ≃ᴬ[k] P₂) : ⇑(e : P₁ ≃ᵃ[k] P₂) = e :=
9797
theorem coe_toEquiv (e : P₁ ≃ᴬ[k] P₂) : ⇑e.toEquiv = e :=
9898
rfl
9999

100-
/-- See Note [custom simps projection].
101-
We need to specify this projection explicitly in this case,
102-
because it is a composition of multiple projections. -/
103-
def Simps.apply (e : P₁ ≃ᴬ[k] P₂) : P₁ → P₂ :=
104-
e
105-
106-
/-- See Note [custom simps projection]. -/
107-
def Simps.symm_apply (e : P₁ ≃ᴬ[k] P₂) : P₂ → P₁ :=
108-
e.symm
109-
110-
initialize_simps_projections ContinuousAffineEquiv (toFun → apply, invFun → symm_apply)
111-
112100
@[ext]
113101
theorem ext {e e' : P₁ ≃ᴬ[k] P₂} (h : ∀ x, e x = e' x) : e = e' :=
114102
DFunLike.ext _ _ h
@@ -178,6 +166,18 @@ def symm (e : P₁ ≃ᴬ[k] P₂) : P₂ ≃ᴬ[k] P₁ where
178166
continuous_toFun := e.continuous_invFun
179167
continuous_invFun := e.continuous_toFun
180168

169+
/-- See Note [custom simps projection].
170+
We need to specify this projection explicitly in this case,
171+
because it is a composition of multiple projections. -/
172+
def Simps.apply (e : P₁ ≃ᴬ[k] P₂) : P₁ → P₂ :=
173+
e
174+
175+
/-- See Note [custom simps projection]. -/
176+
def Simps.symm_apply (e : P₁ ≃ᴬ[k] P₂) : P₂ → P₁ :=
177+
e.symm
178+
179+
initialize_simps_projections ContinuousAffineEquiv (toFun → apply, invFun → symm_apply)
180+
181181
@[simp]
182182
theorem toAffineEquiv_symm (e : P₁ ≃ᴬ[k] P₂) : e.symm.toAffineEquiv = e.toAffineEquiv.symm :=
183183
rfl
@@ -312,16 +312,34 @@ section
312312
variable (k)
313313
variable [TopologicalSpace V₁] [IsTopologicalAddTorsor P₁]
314314

315+
/-- The affine homeomorphism `V ≃ᴬ[k] P` given by `v ↦ v +ᵥ p`. This is `Equiv.vaddConst`
316+
as a `ContinuousAffineEquiv`. -/
317+
@[simps! apply symm_apply]
318+
def vaddConst (p : P₁) : V₁ ≃ᴬ[k] P₁ where
319+
__ := AffineEquiv.vaddConst k p
320+
__ := Homeomorph.vaddConst p
321+
322+
@[simp]
323+
lemma toAffineEquiv_vaddConst {p : P₁} : vaddConst k p = AffineEquiv.vaddConst k p := rfl
324+
325+
/-- The affine homeomorphism given by `p' ↦ p -ᵥ p'`. This is `Equiv.constVSub` as a
326+
`ContinuousAffineEquiv`. -/
327+
@[simps! apply symm_apply]
328+
def constVSub (p : P₁) : P₁ ≃ᴬ[k] V₁ where
329+
__ := AffineEquiv.constVSub k p
330+
__ := Homeomorph.constVSub p
331+
332+
@[simp]
333+
lemma toAffineEquiv_constVSub {p : P₁} : constVSub k p = AffineEquiv.constVSub k p := rfl
334+
315335
/-- The affine homeomorphism given by reflection about the point `x`.
316336
This is `Equiv.pointReflection` as a `ContinuousAffineEquiv`. -/
317-
@[simps toAffineEquiv]
318-
def pointReflection (x : P₁) : P₁ ≃ᴬ[k] P₁ where
319-
toAffineEquiv := AffineEquiv.pointReflection k x
320-
continuous_toFun := by dsimp [Equiv.pointReflection]; fun_prop
321-
continuous_invFun := by
322-
let : ContinuousNeg V₁ :=
323-
IsTopologicalAddTorsor.to_isTopologicalAddGroup (V := V₁) (P := P₁) |>.toContinuousNeg
324-
dsimp [Equiv.pointReflection]; fun_prop
337+
def pointReflection (x : P₁) : P₁ ≃ᴬ[k] P₁ :=
338+
(constVSub k x).trans (vaddConst k x)
339+
340+
@[simp]
341+
lemma coe_pointReflection (x : P₁) :
342+
(pointReflection k x : P₁ → P₁) = Equiv.pointReflection x := rfl
325343

326344
theorem pointReflection_apply (x y : P₁) : pointReflection k x y = (x -ᵥ y) +ᵥ x :=
327345
rfl
@@ -330,6 +348,17 @@ theorem pointReflection_apply (x y : P₁) : pointReflection k x y = (x -ᵥ y)
330348
theorem pointReflection_symm (x : P₁) : (pointReflection k x).symm = pointReflection k x :=
331349
toAffineEquiv_injective <| AffineEquiv.pointReflection_symm k x
332350

351+
@[simp]
352+
theorem toAffineEquiv_pointReflection (x : P₁) :
353+
(pointReflection k x).toAffineEquiv = AffineEquiv.pointReflection k x :=
354+
rfl
355+
356+
theorem pointReflection_self (x : P₁) : pointReflection k x x = x :=
357+
vsub_vadd _ _
358+
359+
theorem pointReflection_involutive (x : P₁) : Involutive (pointReflection k x : P₁ → P₁) :=
360+
Equiv.pointReflection_involutive x
361+
333362
end
334363

335364
section

0 commit comments

Comments
 (0)