AlgebraicAnalysis/RingTheory/TwoGeneratorIdentity.lean

AlgebraicAnalysis library · bbbbf3fc358ca8100b158cec4cf47f336ab70163

1 module
2 public import Mathlib.RingTheory.OreLocalization.Ring
3 public import AlgebraicAnalysis.Ore.RightLocalization
4 
5 @[expose] public section
6 
7 /-!
8 # Two-generator identities and unit-denominator transport
9 
10 This neutral module extracts the reusable algebraic kernel formerly declared as
11 `Stafford38.LocalizationCorollaries.S38`,
12 `Stafford38.LocalizationCorollaries.s38_of_rightClearing`, and
13 `Stafford38.LocalizationCorollaries.s38_of_leftUnitClearing`.
14 
15 Source record: Stafford38 commit `1585e4c7`, originally
16 `Stafford38/LocalizationCorollaries.lean` and
17 `Stafford38/LeftDenominatorTransport.lean`.
18 The extracted declarations are application-independent; Stafford38-specific
19 names and imports are intentionally absent.  The written multiplication order
20 is preserved.
21 -/
22 
23 namespace AlgebraicAnalysis
24 
25 universe u v
26 
27 /-- The two-generator identity in a ring, with the distinguished factor on
28 the left of the first product and in the middle of the second. -/
29 def TwoGeneratorIdentity (R : Type u) [Ring R] : Prop :=
30   ∀ d : R, d ≠ 0 → ∃ F r s : R, (1 : R) = d * r + F * d * s
31 
32 /-- Right-clearing transport of the two-generator identity. -/
33 theorem TwoGeneratorIdentity.of_rightUnitClearing
34     {R : Type u} {L : Type v} [Ring R] [Ring L]
35     {f : R →+* L} (hR : TwoGeneratorIdentity R)
36     (hclear : ∀ q : L, q ≠ 0 →
37       ∃ a s : R, IsUnit (f s) ∧ q * f s = f a) :
38     TwoGeneratorIdentity L := by
39   intro q hq
40   rcases hclear q hq with ⟨a, s, hs, hqa⟩
41   have ha : a ≠ 0 := by
42     intro ha
43     have hzero : q * f s = 0 := by simpa [ha] using hqa
44     exact hq (hs.mul_right_cancel (by simpa using hzero))
45   rcases hR a ha with ⟨F, r, t, hone⟩
46   refine ⟨f F, f s * f r, f s * f t, ?_⟩
47   have hm := congrArg f hone
48   simp only [map_add, map_mul] at hm
49   calc
50     (1 : L) = f a * f r + f F * f a * f t := by simpa using hm
51     _ = q * (f s * f r) + f F * q * (f s * f t) := by
52       rw [← hqa]
53       simp [mul_assoc]
54 
55 /-- Left-clearing transport of the two-generator identity. -/
56 theorem TwoGeneratorIdentity.of_leftUnitClearing
57     {R : Type u} {L : Type v} [Ring R] [Ring L]
58     {f : R →+* L} (hR : TwoGeneratorIdentity R)
59     (hclear : ∀ q : L, q ≠ 0 →
60       ∃ a : R, ∃ u : L, IsUnit u ∧ u * q = f a) :
61     TwoGeneratorIdentity L := by
62   intro q hq
63   rcases hclear q hq with ⟨a, u, hu, hqa⟩
64   have ha : a ≠ 0 := by
65     intro ha
66     have hzero : u * q = 0 := by simpa [ha] using hqa
67     exact hq (hu.mul_left_cancel (by simpa using hzero))
68   rcases hR a ha with ⟨F, r, t, hone⟩
69   let U : Lˣ := hu.unit
70   let ui : L := U.inv
71   have hui : ui * u = 1 := by
72     dsimp [ui, U]
73     exact U.inv_mul
74   have hui' : u * ui = 1 := by
75     dsimp [ui, U]
76     exact U.val_inv
77   refine ⟨ui * f F * u, f r * u, f t * u, ?_⟩
78   have hm := congrArg f hone
79   simp only [map_add, map_mul] at hm
80   have hm' : (1 : L) = (u * q) * f r + f F * (u * q) * f t := by
81     simpa [hqa] using hm
82   have hm'' := congrArg (fun z : L => ui * z * u) hm'
83   have hm''' : (1 : L) = ui * ((u * q) * f r + f F * (u * q) * f t) * u := by
84     simpa [hui, mul_assoc] using hm''
85   calc
86     (1 : L) = ui * ((u * q) * f r + f F * (u * q) * f t) * u := hm'''
87     _ = q * (f r * u) + (ui * f F * u) * q * (f t * u) := by
88       simp only [mul_add, add_mul, ← mul_assoc, hui, one_mul]
89 
90 /-- The two-generator identity is preserved by the right Ore localization
91 implemented through the opposite ring. -/
92 theorem TwoGeneratorIdentity.of_rightOreLocalization
93     {R : Type u} [Ring R] {S : Submonoid R}
94     [OreLocalization.OreSet
95       (AlgebraicAnalysis.OreRightLocalization.oppositeSubmonoid S)]
96     (hR : TwoGeneratorIdentity R) :
97     TwoGeneratorIdentity
98       (AlgebraicAnalysis.OreRightLocalization.RightOreLocalization R S) := by
99   apply TwoGeneratorIdentity.of_rightUnitClearing hR
100   intro q hq
101   rcases AlgebraicAnalysis.OreRightLocalization.rightOre_clear (S := S) q with
102     ⟨a, s, _, hs, hclear⟩
103   exact ⟨a, s, hs, hclear⟩
104 
105 end AlgebraicAnalysis
106