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

Commit 7db9e13

Browse files
committed
feat(data/monoid_algebra): ext lemma (#4162)
A small lemma that was useful in the Witt vector project. Co-authored by: Johan Commelin <johan@commelin.net> Co-authored-by: Rob Lewis <rob.y.lewis@gmail.com>
1 parent 9f9a8c0 commit 7db9e13

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/data/monoid_algebra.lean

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,16 @@ def lift [comm_semiring k] [add_monoid G] {R : Type u₃} [semiring R] [algebra
668668
-- It is hard to state the equivalent of `distrib_mul_action G (monoid_algebra k G)`
669669
-- because we've never discussed actions of additive groups.
670670

671+
lemma alg_hom_ext {R : Type u₃} [comm_semiring k] [add_monoid G]
672+
[semiring R] [algebra k R] ⦃φ₁ φ₂ : add_monoid_algebra k G →ₐ[k] R⦄
673+
(h : ∀ x, φ₁ (finsupp.single x 1) = φ₂ (finsupp.single x 1)) : φ₁ = φ₂ :=
674+
lift.symm.injective $ by {ext, apply h}
675+
676+
lemma alg_hom_ext_iff {R : Type u₃} [comm_semiring k] [add_monoid G]
677+
[semiring R] [algebra k R] ⦃φ₁ φ₂ : add_monoid_algebra k G →ₐ[k] R⦄ :
678+
(∀ x, φ₁ (finsupp.single x 1) = φ₂ (finsupp.single x 1)) ↔ φ₁ = φ₂ :=
679+
⟨λ h, alg_hom_ext h, by rintro rfl _; refl⟩
680+
671681
universe ui
672682
variable {ι : Type ui}
673683

0 commit comments

Comments
 (0)