Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit a6179f6

Browse files
committed
feat(linear_algebra/affine_space/affine_equiv): isomorphism with the units (#10798)
This adds: * `affine_equiv.equiv_units_affine_map` (the main point in this PR) * `affine_map.linear_hom` * `affine_equiv.linear_hom` * `simps` configuration for `affine_equiv`. In order to makes `simp` happy, we adjust the order of the implicit variables to all lemmas in this file, so that they match the order of the arguments to `affine_equiv`. The new definition can be used to majorly golf `homothety_units_mul_hom`
1 parent 2c4e66f commit a6179f6

File tree

2 files changed

+46
-29
lines changed

2 files changed

+46
-29
lines changed

src/linear_algebra/affine_space/affine_equiv.lean

Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ We define the following equivalences:
2323
`category_theory` convention (apply `e`, then `e'`), not the convention used in function
2424
composition and compositions of bundled morphisms.
2525
26+
We equip `affine_equiv k P P` with a `group` structure with multiplication corresponding to
27+
composition in `affine_equiv.group`.
28+
2629
## Tags
2730
2831
affine space, affine equivalence
@@ -45,7 +48,7 @@ structure affine_equiv (k P₁ P₂ : Type*) {V₁ V₂ : Type*} [ring k]
4548

4649
notation P₁ ` ≃ᵃ[`:25 k:25 `] `:0 P₂:0 := affine_equiv k P₁ P₂
4750

48-
variables {k V₁ V₂ V₃ V₄ P₁ P₂ P₃ P₄ : Type*} [ring k]
51+
variables {k P₁ P₂ P₃ P₄ V₁ V₂ V₃ V₄ : Type*} [ring k]
4952
[add_comm_group V₁] [module k V₁] [add_torsor V₁ P₁]
5053
[add_comm_group V₂] [module k V₂] [add_torsor V₂ P₂]
5154
[add_comm_group V₃] [module k V₃] [add_torsor V₃ P₃]
@@ -162,6 +165,15 @@ def mk' (e : P₁ → P₂) (e' : V₁ ≃ₗ[k] V₂) (p : P₁) (h : ∀ p' :
162165

163166
@[simp] lemma symm_linear (e : P₁ ≃ᵃ[k] P₂) : e.linear.symm = e.symm.linear := rfl
164167

168+
/-- See Note [custom simps projection] -/
169+
def simps.apply (e : P₁ ≃ᵃ[k] P₂) : P₁ → P₂ := e
170+
171+
/-- See Note [custom simps projection] -/
172+
def simps.symm_apply (e : P₁ ≃ᵃ[k] P₂) : P₂ → P₁ := e.symm
173+
174+
initialize_simps_projections affine_equiv
175+
(to_equiv_to_fun → apply, to_equiv_inv_fun → symm_apply, linear → linear as_prefix, -to_equiv)
176+
165177
protected lemma bijective (e : P₁ ≃ᵃ[k] P₂) : bijective e := e.to_equiv.bijective
166178
protected lemma surjective (e : P₁ ≃ᵃ[k] P₂) : surjective e := e.to_equiv.surjective
167179
protected lemma injective (e : P₁ ≃ᵃ[k] P₂) : injective e := e.to_equiv.injective
@@ -242,21 +254,39 @@ lemma mul_def (e e' : P₁ ≃ᵃ[k] P₁) : e * e' = e'.trans e := rfl
242254

243255
lemma inv_def (e : P₁ ≃ᵃ[k] P₁) : e⁻¹ = e.symm := rfl
244256

257+
/-- `affine_equiv.linear` on automorphisms is a `monoid_hom`. -/
258+
@[simps] def linear_hom : (P₁ ≃ᵃ[k] P₁) →* (V₁ ≃ₗ[k] V₁) :=
259+
{ to_fun := linear,
260+
map_one' := rfl,
261+
map_mul' := λ _ _, rfl }
262+
263+
/-- The group of `affine_equiv`s are equivalent to the group of units of `affine_map`.
264+
265+
This is the affine version of `linear_map.general_linear_group.general_linear_equiv`. -/
266+
@[simps]
267+
def equiv_units_affine_map : (P₁ ≃ᵃ[k] P₁) ≃* units (P₁ →ᵃ[k] P₁) :=
268+
{ to_fun := λ e, ⟨e, e.symm, congr_arg coe e.symm_trans_self, congr_arg coe e.self_trans_symm⟩,
269+
inv_fun := λ u,
270+
{ to_fun := (u : P₁ →ᵃ[k] P₁), inv_fun := (↑(u⁻¹) : P₁ →ᵃ[k] P₁),
271+
left_inv := affine_map.congr_fun u.inv_mul,
272+
right_inv := affine_map.congr_fun u.mul_inv,
273+
linear := linear_map.general_linear_group.general_linear_equiv _ _ $
274+
units.map (by exact affine_map.linear_hom) u,
275+
map_vadd' := λ _ _, (u : P₁ →ᵃ[k] P₁).map_vadd _ _ },
276+
left_inv := λ e, affine_equiv.ext $ λ x, rfl,
277+
right_inv := λ u, units.ext $ affine_map.ext $ λ x, rfl,
278+
map_mul' := λ e₁ e₂, rfl }
279+
245280
variable (k)
246281

247282
/-- The map `v ↦ v +ᵥ b` as an affine equivalence between a module `V` and an affine space `P` with
248283
tangent space `V`. -/
284+
@[simps]
249285
def vadd_const (b : P₁) : V₁ ≃ᵃ[k] P₁ :=
250286
{ to_equiv := equiv.vadd_const b,
251287
linear := linear_equiv.refl _ _,
252288
map_vadd' := λ p v, add_vadd _ _ _ }
253289

254-
@[simp] lemma linear_vadd_const (b : P₁) : (vadd_const k b).linear = linear_equiv.refl k V₁ := rfl
255-
256-
@[simp] lemma vadd_const_apply (b : P₁) (v : V₁) : vadd_const k b v = v +ᵥ b := rfl
257-
258-
@[simp] lemma vadd_const_symm_apply (b p : P₁) : (vadd_const k b).symm p = p -ᵥ b := rfl
259-
260290
/-- `p' ↦ p -ᵥ p'` as an equivalence. -/
261291
def const_vsub (p : P₁) : P₁ ≃ᵃ[k] V₁ :=
262292
{ to_equiv := equiv.const_vsub p,
@@ -270,17 +300,12 @@ def const_vsub (p : P₁) : P₁ ≃ᵃ[k] V₁ :=
270300
variable (P₁)
271301

272302
/-- The map `p ↦ v +ᵥ p` as an affine automorphism of an affine space. -/
303+
@[simps]
273304
def const_vadd (v : V₁) : P₁ ≃ᵃ[k] P₁ :=
274305
{ to_equiv := equiv.const_vadd P₁ v,
275306
linear := linear_equiv.refl _ _,
276307
map_vadd' := λ p w, vadd_comm _ _ _ }
277308

278-
@[simp] lemma linear_const_vadd (v : V₁) : (const_vadd k P₁ v).linear = linear_equiv.refl _ _ := rfl
279-
280-
@[simp] lemma const_vadd_apply (v : V₁) (p : P₁) : const_vadd k P₁ v p = v +ᵥ p := rfl
281-
282-
@[simp] lemma const_vadd_symm_apply (v : V₁) (p : P₁) : (const_vadd k P₁ v).symm p = -v +ᵥ p := rfl
283-
284309
section homothety
285310

286311
omit V₁
@@ -291,21 +316,7 @@ include V
291316
/-- Fixing a point in affine space, homothety about this point gives a group homomorphism from (the
292317
centre of) the units of the scalars into the group of affine equivalences. -/
293318
def homothety_units_mul_hom (p : P) : units R →* P ≃ᵃ[R] P :=
294-
{ to_fun := λ t,
295-
{ to_fun := affine_map.homothety p (t : R),
296-
inv_fun := affine_map.homothety p (↑t⁻¹ : R),
297-
left_inv := λ p, by simp [← affine_map.comp_apply, ← affine_map.homothety_mul],
298-
right_inv := λ p, by simp [← affine_map.comp_apply, ← affine_map.homothety_mul],
299-
linear :=
300-
{ inv_fun := linear_map.lsmul R V (↑t⁻¹ : R),
301-
left_inv := λ v, by simp [smul_smul],
302-
right_inv := λ v, by simp [smul_smul],
303-
.. linear_map.lsmul R V t, },
304-
map_vadd' := λ p v, by simp only [vadd_vsub_assoc, smul_add, add_vadd, affine_map.coe_line_map,
305-
affine_map.homothety_eq_line_map, equiv.coe_fn_mk, linear_equiv.coe_mk,
306-
linear_map.lsmul_apply, linear_map.to_fun_eq_coe], },
307-
map_one' := by { ext, simp, },
308-
map_mul' := λ t₁ t₂, by { ext, simp [← affine_map.comp_apply, ← affine_map.homothety_mul], }, }
319+
equiv_units_affine_map.symm.to_monoid_hom.comp $ units.map (affine_map.homothety_hom p)
309320

310321
@[simp] lemma coe_homothety_units_mul_hom_apply (p : P) (t : units R) :
311322
(homothety_units_mul_hom p t : P → P) = affine_map.homothety p (t : R) :=
@@ -318,7 +329,7 @@ rfl
318329
@[simp] lemma coe_homothety_units_mul_hom_eq_homothety_hom_coe (p : P) :
319330
(coe : (P ≃ᵃ[R] P) → P →ᵃ[R] P) ∘ homothety_units_mul_hom p =
320331
(affine_map.homothety_hom p) ∘ (coe : units R → R) :=
321-
by { ext, simp, }
332+
funext $ λ _, rfl
322333

323334
end homothety
324335

src/linear_algebra/affine_space/affine_map.lean

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,12 @@ instance : monoid (P1 →ᵃ[k] P1) :=
306306
@[simp] lemma coe_mul (f g : P1 →ᵃ[k] P1) : ⇑(f * g) = f ∘ g := rfl
307307
@[simp] lemma coe_one : ⇑(1 : P1 →ᵃ[k] P1) = _root_.id := rfl
308308

309+
/-- `affine_map.linear` on endomorphisms is a `monoid_hom`. -/
310+
@[simps] def linear_hom : (P1 →ᵃ[k] P1) →* (V1 →ₗ[k] V1) :=
311+
{ to_fun := linear,
312+
map_one' := rfl,
313+
map_mul' := λ _ _, rfl }
314+
309315
include V2
310316

311317
@[simp] lemma injective_iff_linear_injective (f : P1 →ᵃ[k] P2) :

0 commit comments

Comments
 (0)