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

Commit 32c2768

Browse files
urkudmergify[bot]
andauthored
chore(linear_algebra/basic): simplify two proofs (#2123)
* chore(linear_algebra/basic): simplify two proofs Also drop `linear_map.congr_right` in favor of `linear_equiv.congr_right`. I'll restore the deleted `congr_right` as `comp_map : (M₂ →ₗ[R] M₃) →ₗ[R] (M →ₗ[R] M₂) →ₗ[R] (M →ₗ[R] M₃)` soon. * Fix compile * Restore `congr_right` under the name `comp_right`. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent aec62dc commit 32c2768

File tree

5 files changed

+23
-38
lines changed

5 files changed

+23
-38
lines changed

src/linear_algebra/basic.lean

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ module.of_core $ by refine { smul := (•), ..};
293293

294294
/-- Composition by `f : M₂ → M₃` is a linear map from the space of linear maps `M → M₂` to the space of
295295
linear maps `M₂ → M₃`. -/
296-
def congr_right (f : M₂ →ₗ[R] M₃) : (M →ₗ[R] M₂) →ₗ[R] (M →ₗ[R] M₃) :=
296+
def comp_right (f : M₂ →ₗ[R] M₃) : (M →ₗ[R] M₂) →ₗ[R] (M →ₗ[R] M₃) :=
297297
⟨linear_map.comp f,
298298
λ _ _, linear_map.ext $ λ _, f.2 _ _,
299299
λ _ _, linear_map.ext $ λ _, f.3 _ _⟩
@@ -626,53 +626,39 @@ lemma span_union (s t : set M) : span R (s ∪ t) = span R s ⊔ span R t :=
626626
lemma span_Union {ι} (s : ι → set M) : span R (⋃ i, s i) = ⨆ i, span R (s i) :=
627627
(submodule.gi R M).gc.l_supr
628628

629-
@[simp] theorem Union_coe_of_directed {ι} (hι : nonempty ι)
630-
(S : ι → submodule R M)
631-
(H : ∀ i j, ∃ k, S i ≤ S k ∧ S j ≤ S k) :
629+
@[simp] theorem coe_supr_of_directed {ι} [hι : nonempty ι]
630+
(S : ι → submodule R M) (H : directed (≤) S) :
632631
((supr S : submodule R M) : set M) = ⋃ i, S i :=
633632
begin
634633
refine subset.antisymm _ (Union_subset $ le_supr S),
635-
rw [show supr S = ⨆ i, span R (S i), by simp, ← span_Union],
636-
unfreezeI,
637-
refine λ x hx, span_induction hx (λ _, id) _ _ _,
638-
{ cases hι with i, exact mem_Union.2 ⟨i, by simp⟩ },
639-
{ simp, intros x y i hi j hj,
634+
suffices : (span R (⋃ i, (S i : set M)) : set M) ⊆ ⋃ (i : ι), ↑(S i),
635+
by simpa only [span_Union, span_eq] using this,
636+
refine (λ x hx, span_induction hx (λ _, id) _ _ _);
637+
simp only [mem_Union, exists_imp_distrib],
638+
{ exact hι.elim (λ i, ⟨i, (S i).zero_mem⟩) },
639+
{ intros x y i hi j hj,
640640
rcases H i j with ⟨k, ik, jk⟩,
641641
exact ⟨k, add_mem _ (ik hi) (jk hj)⟩ },
642-
{ simp [-mem_coe]; exact λ a x i hi, ⟨i, smul_mem _ a hi⟩ },
642+
{ exact λ a x i hi, ⟨i, smul_mem _ a hi⟩ },
643643
end
644644

645645
lemma mem_supr_of_mem {ι : Sort*} {b : M} (p : ι → submodule R M) (i : ι) (h : b ∈ p i) :
646646
b ∈ (⨆i, p i) :=
647647
have p i ≤ (⨆i, p i) := le_supr p i,
648648
@this b h
649649

650-
@[simp] theorem mem_supr_of_directed {ι} (hι : nonempty ι)
651-
(S : ι → submodule R M)
652-
(H : ∀ i j, ∃ k, S i ≤ S k ∧ S j ≤ S k) {x} :
650+
@[simp] theorem mem_supr_of_directed {ι} [nonempty ι]
651+
(S : ι → submodule R M) (H : directed (≤) S) {x} :
653652
x ∈ supr S ↔ ∃ i, x ∈ S i :=
654-
by rw [← mem_coe, Union_coe_of_directed hι S H, mem_Union]; refl
653+
by { rw [← mem_coe, coe_supr_of_directed S H, mem_Union], refl }
655654

656655
theorem mem_Sup_of_directed {s : set (submodule R M)}
657-
{z} (hzs : z ∈ Sup s) (x ∈ s)
658-
(hdir : ∀ i ∈ s, ∀ j ∈ s, ∃ k ∈ s, i ≤ k ∧ j ≤ k) :
659-
∃ y ∈ s, z ∈ y :=
656+
{z} (hs : s.nonempty) (hdir : directed_on (≤) s) :
657+
z ∈ Sup s ↔ ∃ y ∈ s, z ∈ y :=
660658
begin
661-
haveI := classical.dec, rw Sup_eq_supr at hzs,
662-
have : ∃ (i : submodule R M), z ∈ ⨆ (H : i ∈ s), i,
663-
{ refine (mem_supr_of_directed ⟨⊥⟩ _ (λ i j, _)).1 hzs,
664-
by_cases his : i ∈ s; by_cases hjs : j ∈ s,
665-
{ rcases hdir i his j hjs with ⟨k, hks, hik, hjk⟩,
666-
exact ⟨k, le_supr_of_le hks (supr_le $ λ _, hik),
667-
le_supr_of_le hks (supr_le $ λ _, hjk)⟩ },
668-
{ exact ⟨i, le_refl _, supr_le $ hjs.elim⟩ },
669-
{ exact ⟨j, supr_le $ his.elim, le_refl _⟩ },
670-
{ exact ⟨⊥, supr_le $ his.elim, supr_le $ hjs.elim⟩ } },
671-
cases this with N hzn, by_cases hns : N ∈ s,
672-
{ have : (⨆ (H : N ∈ s), N) ≤ N := supr_le (λ _, le_refl _),
673-
exact ⟨N, hns, this hzn⟩ },
674-
{ have : (⨆ (H : N ∈ s), N) ≤ ⊥ := supr_le hns.elim,
675-
cases (mem_bot R).1 (this hzn), exact ⟨x, H, x.zero_mem⟩ }
659+
haveI : nonempty s := hs.to_subtype,
660+
rw [Sup_eq_supr, supr_subtype', mem_supr_of_directed, subtype.exists],
661+
exact (directed_on_iff_directed _).1 hdir
676662
end
677663

678664
section
@@ -1475,7 +1461,7 @@ def congr_right (f : M₂ ≃ₗ[R] M₃) : (M →ₗ[R] M₂) ≃ₗ (M →ₗ
14751461

14761462
/-- If M and M₂ are linearly isomorphic then the two spaces of linear maps from M and M₂ to themselves
14771463
are linearly isomorphic. -/
1478-
def conj (e : M ≃ₗ[R] M₂) : (M →ₗ[R] M) ≃ₗ[R] (M₂ →ₗ[R] M₂) := arrow_congr e e
1464+
def conj (e : M ≃ₗ[R] M₂) : (module.End R M) ≃ₗ[R] (module.End R M₂) := arrow_congr e e
14791465

14801466
end comm_ring
14811467

src/ring_theory/ideal_operations.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ le_antisymm (le_Inf $ λ J hJ, hJ.2.radical_le_iff.2 hJ.1) $
379379
λ r hr, classical.by_contradiction $ λ hri,
380380
let ⟨m, (hrm : r ∉ radical m), him, hm⟩ := zorn.zorn_partial_order₀ {K : ideal R | r ∉ radical K}
381381
(λ c hc hcc y hyc, ⟨Sup c, λ ⟨n, hrnc⟩, let ⟨y, hyc, hrny⟩ :=
382-
submodule.mem_Sup_of_directed hrnc y hyc hcc.directed_on in hc hyc ⟨n, hrny⟩,
382+
(submodule.mem_Sup_of_directed ⟨y, hyc hcc.directed_on).1 hrnc in hc hyc ⟨n, hrny⟩,
383383
λ z, le_Sup⟩) I hri in
384384
have ∀ x ∉ m, r ∈ radical (m ⊔ span {x}) := λ x hxm, classical.by_contradiction $ λ hrmx, hxm $
385385
hm (m ⊔ span {x}) hrmx le_sup_left ▸ (le_sup_right : _ ≤ m ⊔ span {x}) (subset_span $ set.mem_singleton _),

src/ring_theory/ideals.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ begin
142142
cases h J J0 (le_of_lt hJ), exact lt_irrefl _ hJ },
143143
{ intros S SC cC I IS,
144144
refine ⟨Sup S, λ H, _, λ _, le_Sup⟩,
145-
rcases submodule.mem_Sup_of_directed ((eq_top_iff_one _).1 H) I IS cC.directed_on with ⟨J, JS, J0⟩,
145+
obtain ⟨J, JS, J0⟩ : ∃ J ∈ S, (1 : α) ∈ J,
146+
from (submodule.mem_Sup_of_directed ⟨I, IS⟩ cC.directed_on).1 ((eq_top_iff_one _).1 H),
146147
exact SC JS ((eq_top_iff_one _).2 J0) }
147148
end
148149

src/ring_theory/noetherian.lean

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,9 @@ theorem is_noetherian_iff_well_founded
250250
have hN' : ∀ {a b}, a ≤ b → N a ≤ N b :=
251251
λ a b, (strict_mono.le_iff_le (λ _ _, hN.1)).2,
252252
have : t ⊆ ⋃ i, (N i : set β),
253-
{ rw [← submodule.Union_coe_of_directed _ N _],
253+
{ rw [← submodule.coe_supr_of_directed N _],
254254
{ show t ⊆ M, rw ← h₂,
255255
apply submodule.subset_span },
256-
{ apply_instance },
257256
{ exact λ i j, ⟨max i j,
258257
hN' (le_max_left _ _),
259258
hN' (le_max_right _ _)⟩ } },

src/ring_theory/polynomial.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ begin
213213
simp only [mem_leading_coeff_nth],
214214
{ split, { rintro ⟨i, p, hpI, hpdeg, rfl⟩, exact ⟨p, hpI, rfl⟩ },
215215
rintro ⟨p, hpI, rfl⟩, exact ⟨nat_degree p, p, hpI, degree_le_nat_degree, rfl⟩ },
216-
{ exact ⟨0⟩ },
217216
intros i j, exact ⟨i + j, I.leading_coeff_nth_mono (nat.le_add_right _ _),
218217
I.leading_coeff_nth_mono (nat.le_add_left _ _)⟩
219218
end

0 commit comments

Comments
 (0)