Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Lean/Mathlib/Mathlib/Algebra/MonoidAlgebra/     Datei vom 15.10.2026 mit Größe 4 kB image not shown  

Quelle  Ideal.lean   Sprache: Lean

 

/-
Copyright (c) 2023 Eric Wieser. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Eric Wieser
-/

module

public import Mathlib.Algebra.MonoidAlgebra.Defs
public import Mathlib.RingTheory.Ideal.Span

import Mathlib.RingTheory.Ideal.BigOperators

set_option doc.verso true
set_option doc.verso.suggestions false

/-!
# Lemmas about ideals of `MonoidAlgebra` and `AddMonoidAlgebra`
-/


public section


variable {k A G : Type*}

/-- If `x` belongs to the ideal generated by generators in `s`, then every element of the support of
`x` factors through an element of `s`.

We could spell `∃ d, m = d * m` as `MulOpposite.op m' ∣ MulOpposite.op m` but this would be worse.
-/

theorem MonoidAlgebra.mem_ideal_span_of_image [Monoid G] [Semiring k] {s : Set G}
    {x : MonoidAlgebra k G} :
    x ∈ Ideal.span (MonoidAlgebra.of k G '' s) ↔
      ∀ m ∈ x.coeff.support, ∃ m' ∈ s, ∃ d, m = d * m' := by
  classical
  let RHS : Ideal (MonoidAlgebra k G) :=
    { carrier := { p | ∀ m : G, m ∈ p.coeff.support → ∃ m' ∈ s, ∃ d, m = d * m' }
      add_mem' {x y} hx hy m hm := (Finset.mem_union.1 <| Finsupp.support_add hm).elim (hx m) (hy m)
      zero_mem' := by simp
      smul_mem' x y hy m hm := by
        simp only [smul_eq_mul, mul_def, coeff_finsuppSum] at hm
        obtain ⟨xm, -, hm⟩ := Finset.mem_biUnion.mp (Finsupp.support_sum hm)
        obtain ⟨ym, hym, hm⟩ := Finset.mem_biUnion.mp (Finsupp.support_sum hm)
        obtain rfl := Finset.mem_singleton.mp (Finsupp.support_single_subset hm)
        refine (hy _ hym).imp fun sm p => And.imp_right ?_ p
        rintro ⟨d, rfl⟩
        exact ⟨xm * d, (mul_assoc _ _ _).symm⟩ }
  change _ ↔ x ∈ RHS
  constructor
  · suffices Ideal.span (⇑(of k G) '' s) ≤ RHS from @this x
    rw [Ideal.span_le]
    rintro _ ⟨i, hi, rfl⟩ m hm
    refine ⟨_, hi, 1, ?_⟩
    simpa using Finsupp.support_single_subset hm
  · intro hx
    rw [← x.sum_coeff_single]
    apply Ideal.sum_mem _ fun i hi ↦ ?_
    obtain ⟨d, hd, d2, rfl⟩ := hx _ hi
    simpa using Ideal.mul_mem_left _ (.single d2 <| x.coeff (d2 * d)) (b := of k G d)
      (Ideal.subset_span <| Set.mem_image_of_mem _ hd)

/-- If `x` belongs to the ideal generated by generators in `s`, then every element of the support of
`x` factors additively through an element of `s`.
-/

theorem AddMonoidAlgebra.mem_ideal_span_of'_image [AddMonoid A] [Semiring k] {s : Set A}
    {x : AddMonoidAlgebra k A} :
    x ∈ Ideal.span (AddMonoidAlgebra.of' k A '' s) ↔
      ∀ m ∈ x.coeff.support, ∃ m' ∈ s, ∃ d, m = d + m' := by
  -- TODO: this proof is a direct copy of MonoidAlgebra.mem_ideal_span_of_image.
  -- Alternatively, we could prove it via the equiv between `MonoidAlgebra` and `AddMonoidAlgebra`,
  -- but that would require a lot more API.
  classical
  let RHS : Ideal (AddMonoidAlgebra k A) := {
    carrier := { p | ∀ m : A, m ∈ p.coeff.support → ∃ m' ∈ s, ∃ d, m = d + m' }
    add_mem' {x y} hx hy m hm := (Finset.mem_union.1 <| Finsupp.support_add hm).elim (hx m) (hy m)
    zero_mem' := by simp
    smul_mem' x y hy m hm := by
      simp only [smul_eq_mul, mul_def, coeff_finsuppSum] at hm
      obtain ⟨xm, -, hm⟩ := Finset.mem_biUnion.mp <| Finsupp.support_sum hm
      obtain ⟨ym, hym, hm⟩ := Finset.mem_biUnion.mp <| Finsupp.support_sum hm
      obtain rfl := Finset.mem_singleton.mp <| Finsupp.support_single_subset hm
      refine (hy _ hym).imp fun sm ↦ .imp_right ?_
      rintro ⟨d, rfl⟩
      exact ⟨xm + d, (add_assoc ..).symm⟩
  }
  change _ ↔ x ∈ RHS
  constructor
  · suffices Ideal.span (of' k A '' s) ≤ RHS from @this x
    rw [Ideal.span_le]
    rintro _ ⟨i, hi, rfl⟩ m hm
    refine ⟨_, hi, 0, ?_⟩
    simpa using Finsupp.support_single_subset hm
  · intro hx
    rw [← x.sum_coeff_single]
    apply Ideal.sum_mem _ fun i hi ↦ ?_
    obtain ⟨d, hd, d2, rfl⟩ := hx _ hi
    simpa using Ideal.mul_mem_left _ (.single d2 <| x.coeff (d2 + d))
      (b := of' k A d) (Ideal.subset_span <| Set.mem_image_of_mem _ hd)

Messung
CHZG
9310010097

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland