Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(algebra/monoid_algebra): remove simp from of_apply #13791

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/algebra/monoid_algebra/basic.lean
Expand Up @@ -1202,10 +1202,10 @@ def of' : G → add_monoid_algebra k G := λ a, single a 1

end

@[simp] lemma of_apply [add_zero_class G] (a : multiplicative G) : of k G a = single a.to_add 1 :=
lemma of_apply [add_zero_class G] (a : multiplicative G) : of k G a = single a.to_add 1 :=
rfl

@[simp] lemma of'_apply (a : G) : of' k G a = single a 1 := rfl
lemma of'_apply (a : G) : of' k G a = single a 1 := rfl

lemma of'_eq_of [add_zero_class G] (a : G) : of' k G a = of k G a := rfl

Expand Down Expand Up @@ -1542,11 +1542,11 @@ lemma lift_unique' (F : add_monoid_algebra k G →ₐ[k] A) :
/-- Decomposition of a `k`-algebra homomorphism from `monoid_algebra k G` by
its values on `F (single a 1)`. -/
lemma lift_unique (F : add_monoid_algebra k G →ₐ[k] A) (f : monoid_algebra k G) :
F f = f.sum (λ a b, b • F (single a 1)) :=
by conv_lhs { rw lift_unique' F, simp [lift_apply] }
F f = f.sum (λ a b, b • F (of k G a)) :=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't type correct any more, it needs to be either

Suggested change
F f = f.sum (λ a b, b • F (of k G a)) :=
F f = f.sum (λ a b, b • F (of k G (multiplicative.of_add a))) :=

or

Suggested change
F f = f.sum (λ a b, b • F (of k G a)) :=
F f = f.sum (λ a b, b • F (of' k G a)) :=

by { conv_lhs { rw lift_unique' F, simp [lift_apply], }, refl, }

lemma alg_hom_ext_iff {φ₁ φ₂ : add_monoid_algebra k G →ₐ[k] A} :
(∀ x, φ₁ (finsupp.single x 1) = φ₂ (finsupp.single x 1)) ↔ φ₁ = φ₂ :=
(∀ x, φ₁ (of k G x) = φ₂ (of k G x)) ↔ φ₁ = φ₂ :=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feel slike it will be irritating, because it introduces x : multiplicative G instead of x : G like it used to. Changing from of to of' would fix this.

⟨λ h, alg_hom_ext h, by rintro rfl _; refl⟩

end lift
Expand Down
2 changes: 1 addition & 1 deletion src/algebra/monoid_algebra/grading.lean
Expand Up @@ -177,7 +177,7 @@ graded_algebra.of_alg_hom _
(decompose_aux f)
(begin
ext : 2,
dsimp,
dsimp [add_monoid_algebra.of_apply],
rw [decompose_aux_single, direct_sum.submodule_coe_alg_hom_of, subtype.coe_mk],
end)
(λ i x, by convert (decompose_aux_coe f x : _))
Expand Down
2 changes: 1 addition & 1 deletion src/data/polynomial/monomial.lean
Expand Up @@ -60,7 +60,7 @@ begin
have A : f' = g',
{ ext,
{ simp [h₁, ring_equiv.to_ring_hom_eq_coe] },
{ simpa [ring_equiv.to_ring_hom_eq_coe] using h₂, } },
{ simpa [ring_equiv.to_ring_hom_eq_coe, add_monoid_algebra.of_apply] using h₂, } },
have B : f = f'.comp (to_finsupp_iso R),
by { rw [hf', ring_hom.comp_assoc], ext x, simp only [ring_equiv.to_ring_hom_eq_coe,
ring_equiv.symm_apply_apply, function.comp_app, ring_hom.coe_comp,
Expand Down