@@ -12,8 +12,11 @@ public import Mathlib.Algebra.Polynomial.AlgebraMap
1212
1313## Main results
1414
15- * `Polynomial .instCommSemiringAdjoinSingleton, instCommRingAdjoinSingleton`:
15+ * `Algebra .instCommSemiringAdjoinSingleton, Algebra. instCommRingAdjoinSingleton`:
1616 adjoining an element to a commutative (semi)ring gives a commutative (semi)ring
17+ * `Algebra.adjoin_singleton_induction`:
18+ proving a fact about `a : adjoin R {x}` is the same as proving it for `aeval x p` where `p`
19+ is an arbitrary polynomial
1720 -/
1821
1922@[expose] public section
@@ -24,7 +27,7 @@ open Finset
2427
2528open Polynomial
2629
27- namespace Polynomial
30+ namespace Algebra
2831
2932universe u v w z
3033
@@ -39,53 +42,55 @@ variable [Algebra R A] [Algebra R B]
3942variable {p q : R[X]} (x : A)
4043
4144@[simp]
42- theorem adjoin_X : adjoin R ({X} : Set R[X]) = ⊤ := by
45+ theorem _root_.Polynomial. adjoin_X : adjoin R ({X} : Set R[X]) = ⊤ := by
4346 refine top_unique fun p _hp => ?_
4447 set S := adjoin R ({X} : Set R[X])
4548 rw [← sum_monomial_eq p]; simp only [← smul_X_eq_monomial]
4649 exact S.sum_mem fun n _hn => S.smul_mem (S.pow_mem (subset_adjoin rfl) _) _
4750
4851variable (R)
49- theorem _root_.Algebra. adjoin_singleton_eq_range_aeval (x : A) :
52+ theorem adjoin_singleton_eq_range_aeval (x : A) :
5053 adjoin R {x} = (aeval x).range := by
5154 rw [← Algebra.map_top, ← adjoin_X, AlgHom.map_adjoin, Set.image_singleton, aeval_X]
5255
5356@[simp]
54- theorem aeval_mem_adjoin_singleton : aeval x p ∈ adjoin R {x} := by
57+ theorem _root_.Polynomial. aeval_mem_adjoin_singleton : aeval x p ∈ adjoin R {x} := by
5558 simp [adjoin_singleton_eq_range_aeval]
5659
57- theorem _root_.Algebra. adjoin_mem_exists_aeval {a : A} (h : a ∈ Algebra.adjoin R {x}) :
60+ theorem adjoin_mem_exists_aeval {a : A} (h : a ∈ Algebra.adjoin R {x}) :
5861 ∃ p : R[X], aeval x p = a := by
5962 rw [Algebra.adjoin_singleton_eq_range_aeval] at h
6063 simp_all
6164
62- theorem _root_.Algebra. adjoin_eq_exists_aeval (a : Algebra.adjoin R {x}) :
65+ theorem adjoin_eq_exists_aeval (a : Algebra.adjoin R {x}) :
6366 ∃ p : R[X], aeval x p = a := by
6467 have : (a : A) ∈ Algebra.adjoin R {x} := by simp
6568 set y := (a : A) with h
6669 rw [Algebra.adjoin_singleton_eq_range_aeval] at this
6770 simp_all
6871
72+ /--
73+ Proving a fact about `a : adjoin R {x}` is the same as proving it for
74+ `aeval x p` where `p`is an arbitrary polynomial. -/
6975@[elab_as_elim]
70- theorem _root_.Algebra. adjoin_singleton_induction {M : (adjoin R {x}) → Prop }
76+ theorem adjoin_singleton_induction {M : (adjoin R {x}) → Prop }
7177 (a : adjoin R {x}) (f : ∀ (p : Polynomial R),
7278 M (⟨aeval x p, aeval_mem_adjoin_singleton R x⟩ : adjoin R {x})) :
7379 M a := by
7480 obtain ⟨p, hp⟩ := Algebra.adjoin_eq_exists_aeval _ x a
7581 grind
7682
7783instance instCommSemiringAdjoinSingleton :
78- CommSemiring <| adjoin R {x} :=
79- { mul_comm := fun ⟨p, hp⟩ ⟨q, hq⟩ ↦ by
84+ CommSemiring <| adjoin R {x} where
85+ mul_comm := fun ⟨p, hp⟩ ⟨q, hq⟩ ↦ by
8086 obtain ⟨p', rfl⟩ := Algebra.adjoin_singleton_eq_range_aeval R x ▸ hp
8187 obtain ⟨q', rfl⟩ := Algebra.adjoin_singleton_eq_range_aeval R x ▸ hq
8288 simp only [AlgHom.toRingHom_eq_coe, RingHom.coe_coe, MulMemClass.mk_mul_mk, ← map_mul,
83- mul_comm p' q'] }
89+ mul_comm p' q']
8490
8591instance instCommRingAdjoinSingleton {R A : Type *} [CommRing R] [Ring A] [Algebra R A] (x : A) :
86- CommRing <| Algebra.adjoin R {x} :=
87- { mul_comm := mul_comm }
92+ CommRing <| Algebra.adjoin R {x} where
8893
8994end aeval
9095
91- end Polynomial
96+ end Algebra
0 commit comments