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

Commit be2e42f

Browse files
jcommelingebner
andcommitted
chore(ring_theory/algebraic): speedup slow proof (#3336)
Co-authored-by: Gabriel Ebner <gebner@gebner.org>
1 parent c06f500 commit be2e42f

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/ring_theory/algebra.lean

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,9 +723,15 @@ instance to_algebra {R : Type u} {A : Type v} [comm_semiring R] [comm_semiring A
723723
[algebra R A] (S : subalgebra R A) : algebra S A :=
724724
algebra.of_subsemiring _
725725

726+
-- todo: standardize on the names these morphisms
727+
-- compare with submodule.subtype
728+
726729
/-- Embedding of a subalgebra into the algebra. -/
727730
def val : S →ₐ[R] A :=
728-
by refine_struct { to_fun := subtype.val }; intros; refl
731+
by refine_struct { to_fun := (coe : S → A) }; intros; refl
732+
733+
@[simp]
734+
lemma val_apply (x : S) : S.val x = (x : A) := rfl
729735

730736
/-- Convert a `subalgebra` to `submodule` -/
731737
def to_submodule : submodule R A :=

src/ring_theory/algebraic.lean

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ variables {R A}
4242

4343
/-- A subalgebra is algebraic if and only if it is algebraic an algebra. -/
4444
lemma subalgebra.is_algebraic_iff (S : subalgebra R A) :
45-
S.is_algebraic ↔ @algebra.is_algebraic R S _ _ (by convert S.algebra) :=
45+
S.is_algebraic ↔ @algebra.is_algebraic R S _ _ (S.algebra) :=
4646
begin
4747
delta algebra.is_algebraic subalgebra.is_algebraic,
4848
rw [subtype.forall'],
@@ -51,12 +51,7 @@ begin
5151
apply and_congr iff.rfl,
5252
have h : function.injective (S.val) := subtype.val_injective,
5353
conv_rhs { rw [← h.eq_iff, alg_hom.map_zero], },
54-
apply eq_iff_eq_cancel_right.mpr,
55-
symmetry,
56-
-- TODO: add an `aeval`-specific version of `hom_eval₂`
57-
simp only [aeval_def],
58-
convert hom_eval₂ p (algebra_map R S) ↑S.val ⟨x, hx⟩,
59-
refl
54+
rw [← aeval_alg_hom_apply, S.val_apply, subtype.val_eq_coe],
6055
end
6156

6257
/-- An algebra is algebraic if and only if it is algebraic as a subalgebra. -/

0 commit comments

Comments
 (0)