Skip to content

Commit

Permalink
feat(data/equiv,linear_algebra): Pi_congr_right for mul_equiv and…
Browse files Browse the repository at this point in the history
… `linear_equiv` (#7489)

This PR generalizes `equiv.Pi_congr_right` to linear equivs, adding the `mul_equiv`/`add_equiv` version as well.

To be used in the `bundled-basis` refactor





Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
  • Loading branch information
Vierkantor and Vierkantor committed May 6, 2021
1 parent 652357a commit 48bdd1e
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/data/equiv/mul_add.lean
Expand Up @@ -314,6 +314,41 @@ def monoid_hom_congr {M N P Q} [mul_one_class M] [mul_one_class N] [comm_monoid
right_inv := λ k, by { ext, simp, },
map_mul' := λ h k, by { ext, simp, }, }

/-- A family of multiplicative equivalences `Π j, (Ms j ≃* Ns j)` generates a
multiplicative equivalence between `Π j, Ms j` and `Π j, Ns j`.
This is the `mul_equiv` version of `equiv.Pi_congr_right`, and the dependent version of
`mul_equiv.arrow_congr`.
-/
@[to_additive add_equiv.Pi_congr_right "A family of additive equivalences `Π j, (Ms j ≃+ Ns j)`
generates an additive equivalence between `Π j, Ms j` and `Π j, Ns j`.
This is the `add_equiv` version of `equiv.Pi_congr_right`, and the dependent version of
`add_equiv.arrow_congr`.", simps apply]
def Pi_congr_right {η : Type*}
{Ms Ns : η → Type*} [Π j, mul_one_class (Ms j)] [Π j, mul_one_class (Ns j)]
(es : ∀ j, Ms j ≃* Ns j) : (Π j, Ms j) ≃* (Π j, Ns j) :=
{ to_fun := λ x j, es j (x j),
inv_fun := λ x j, (es j).symm (x j),
map_mul' := λ x y, funext $ λ j, (es j).map_mul (x j) (y j),
.. equiv.Pi_congr_right (λ j, (es j).to_equiv) }

@[simp]
lemma Pi_congr_right_refl {η : Type*} {Ms : η → Type*} [Π j, mul_one_class (Ms j)] :
Pi_congr_right (λ j, mul_equiv.refl (Ms j)) = mul_equiv.refl _ := rfl

@[simp]
lemma Pi_congr_right_symm {η : Type*}
{Ms Ns : η → Type*} [Π j, mul_one_class (Ms j)] [Π j, mul_one_class (Ns j)]
(es : ∀ j, Ms j ≃* Ns j) : (Pi_congr_right es).symm = (Pi_congr_right $ λ i, (es i).symm) := rfl

@[simp]
lemma Pi_congr_right_trans {η : Type*}
{Ms Ns Ps : η → Type*} [Π j, mul_one_class (Ms j)] [Π j, mul_one_class (Ns j)]
[Π j, mul_one_class (Ps j)]
(es : ∀ j, Ms j ≃* Ns j) (fs : ∀ j, Ns j ≃* Ps j) :
(Pi_congr_right es).trans (Pi_congr_right fs) = (Pi_congr_right $ λ i, (es i).trans (fs i)) := rfl

/-!
# Groups
-/
Expand Down
32 changes: 32 additions & 0 deletions src/linear_algebra/basic.lean
Expand Up @@ -1935,6 +1935,38 @@ def of_submodule (p : submodule R M) : p ≃ₗ[R] ↥(p.map ↑e : submodule R

end

/-- A family of linear equivalences `Π j, (Ms j ≃ₗ[R] Ns j)` generates a
linear equivalence between `Π j, Ms j` and `Π j, Ns j`. -/
@[simps apply]
def Pi_congr_right {η : Type*} {Ms Ns : η → Type*}
[Π j, add_comm_monoid (Ms j)] [Π j, module R (Ms j)]
[Π j, add_comm_monoid (Ns j)] [Π j, module R (Ns j)]
(es : ∀ j, Ms j ≃ₗ[R] Ns j) : (Π j, Ms j) ≃ₗ[R] (Π j, Ns j) :=
{ to_fun := λ x j, es j (x j),
inv_fun := λ x j, (es j).symm (x j),
map_smul' := λ m x, by { ext j, simp },
.. add_equiv.Pi_congr_right (λ j, (es j).to_add_equiv) }

@[simp]
lemma Pi_congr_right_refl {η : Type*} {Ms : η → Type*}
[Π j, add_comm_monoid (Ms j)] [Π j, module R (Ms j)] :
Pi_congr_right (λ j, refl R (Ms j)) = refl _ _ := rfl

@[simp]
lemma Pi_congr_right_symm {η : Type*} {Ms Ns : η → Type*}
[Π j, add_comm_monoid (Ms j)] [Π j, module R (Ms j)]
[Π j, add_comm_monoid (Ns j)] [Π j, module R (Ns j)]
(es : ∀ j, Ms j ≃ₗ[R] Ns j) :
(Pi_congr_right es).symm = (Pi_congr_right $ λ i, (es i).symm) := rfl

@[simp]
lemma Pi_congr_right_trans {η : Type*} {Ms Ns Ps : η → Type*}
[Π j, add_comm_monoid (Ms j)] [Π j, module R (Ms j)]
[Π j, add_comm_monoid (Ns j)] [Π j, module R (Ns j)]
[Π j, add_comm_monoid (Ps j)] [Π j, module R (Ps j)]
(es : ∀ j, Ms j ≃ₗ[R] Ns j) (fs : ∀ j, Ns j ≃ₗ[R] Ps j) :
(Pi_congr_right es).trans (Pi_congr_right fs) = (Pi_congr_right $ λ i, (es i).trans (fs i)) :=
rfl

section uncurry

Expand Down

0 comments on commit 48bdd1e

Please sign in to comment.