|
| 1 | +/- |
| 2 | +Copyright (c) 2022 Andrew Yang. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Andrew Yang |
| 5 | +
|
| 6 | +! This file was ported from Lean 3 source module ring_theory.ring_hom.surjective |
| 7 | +! leanprover-community/mathlib commit 831c494092374cfe9f50591ed0ac81a25efc5b86 |
| 8 | +! Please do not edit these lines, except to modify the commit id |
| 9 | +! if you have ported upstream changes. |
| 10 | +-/ |
| 11 | +import Mathlib.RingTheory.LocalProperties |
| 12 | + |
| 13 | +/-! |
| 14 | +
|
| 15 | +# The meta properties of surjective ring homomorphisms. |
| 16 | +
|
| 17 | +-/ |
| 18 | + |
| 19 | + |
| 20 | +namespace RingHom |
| 21 | + |
| 22 | +open scoped TensorProduct |
| 23 | + |
| 24 | +open TensorProduct Algebra.TensorProduct |
| 25 | + |
| 26 | +local notation "surjective" => fun {X Y : Type _} [CommRing X] [CommRing Y] => fun f : X →+* Y => |
| 27 | + Function.Surjective f |
| 28 | + |
| 29 | +theorem surjective_stableUnderComposition : StableUnderComposition surjective := by |
| 30 | + introv R hf hg; exact hg.comp hf |
| 31 | +#align ring_hom.surjective_stable_under_composition RingHom.surjective_stableUnderComposition |
| 32 | + |
| 33 | +theorem surjective_respectsIso : RespectsIso surjective := by |
| 34 | + apply surjective_stableUnderComposition.respectsIso |
| 35 | + intros _ _ _ _ e |
| 36 | + exact e.surjective |
| 37 | +#align ring_hom.surjective_respects_iso RingHom.surjective_respectsIso |
| 38 | + |
| 39 | +theorem surjective_stableUnderBaseChange : StableUnderBaseChange surjective := by |
| 40 | + refine' StableUnderBaseChange.mk _ surjective_respectsIso _ |
| 41 | + classical |
| 42 | + introv h x |
| 43 | + skip |
| 44 | + induction' x using TensorProduct.induction_on with x y x y ex ey |
| 45 | + · exact ⟨0, map_zero _⟩ |
| 46 | + · obtain ⟨y, rfl⟩ := h y; use y • x; dsimp |
| 47 | + rw [TensorProduct.smul_tmul, Algebra.algebraMap_eq_smul_one] |
| 48 | + · obtain ⟨⟨x, rfl⟩, ⟨y, rfl⟩⟩ := ex, ey; exact ⟨x + y, map_add _ x y⟩ |
| 49 | +#align ring_hom.surjective_stable_under_base_change RingHom.surjective_stableUnderBaseChange |
| 50 | + |
| 51 | +open scoped BigOperators |
| 52 | + |
| 53 | +theorem surjective_ofLocalizationSpan : OfLocalizationSpan surjective := by |
| 54 | + introv R hs H |
| 55 | + skip |
| 56 | + letI := f.toAlgebra |
| 57 | + show Function.Surjective (Algebra.ofId R S) |
| 58 | + rw [← Algebra.range_top_iff_surjective, eq_top_iff] |
| 59 | + rintro x - |
| 60 | + obtain ⟨l, hl⟩ := |
| 61 | + (Finsupp.mem_span_iff_total R s 1).mp (show _ ∈ Ideal.span s by rw [hs]; trivial) |
| 62 | + fapply |
| 63 | + Subalgebra.mem_of_finset_sum_eq_one_of_pow_smul_mem _ l.support (fun x : s => f x) fun x : s => |
| 64 | + f (l x) |
| 65 | + · dsimp only; simp_rw [← _root_.map_mul, ← map_sum, ← f.map_one]; exact f.congr_arg hl |
| 66 | + · exact fun _ => Set.mem_range_self _ |
| 67 | + · exact fun _ => Set.mem_range_self _ |
| 68 | + · intro r |
| 69 | + obtain ⟨y, hy⟩ := H r (IsLocalization.mk' _ x (1 : Submonoid.powers (f r))) |
| 70 | + obtain ⟨z, ⟨_, n, rfl⟩, rfl⟩ := IsLocalization.mk'_surjective (Submonoid.powers (r : R)) y |
| 71 | + erw [IsLocalization.map_mk', IsLocalization.eq] at hy |
| 72 | + obtain ⟨⟨_, m, rfl⟩, hm⟩ := hy |
| 73 | + refine' ⟨m + n, _⟩ |
| 74 | + dsimp at hm ⊢ |
| 75 | + simp_rw [_root_.one_mul, ← _root_.mul_assoc, ← map_pow, ← f.map_mul, ← pow_add, map_pow] at hm |
| 76 | + exact ⟨_, hm⟩ |
| 77 | +#align ring_hom.surjective_of_localization_span RingHom.surjective_ofLocalizationSpan |
| 78 | + |
| 79 | +end RingHom |
0 commit comments