精益:定义 R-ideal 和 R-module 的乘积

Lean: define product of R-ideal and R-module

我正在尝试学习精益,我正在尝试弄清楚如何从理想的 I 和 R 模块 M 中创建一个新的 R 模块 I*M = {i*m | i in I, m in M}

所以我的尝试是首先定义一个映射 ideal_mult 来创建一个新的 R 模块,然后弄清楚如何为它分配一个好的符号。

import ring_theory.ideals
import algebra.module

universes u v
variables {R : Type u} {M : Type v}
variables [comm_ring R] [add_comm_group M] [module R M]
variables (I: ideal R)

def ideal_mult (I: ideal R) (M: Type v)
        [add_comm_group M] [module R M]: Type v
        :=
    sorry

#check ideal_mult I M

我该如何定义它,以便我可以陈述一个假设,例如 (h: I*M = M)?

感谢您的帮助!

你应该import ring_theory.ideal_operations。它在 https://github.com/leanprover-community/mathlib/blob/master/src/ring_theory/ideal_operations.lean#L556

处具有您想要的定义

然后您可以为产品输入 I • ⊤ = "\bullet",在 VScode-lean 中,也可以 = "\top",这是 M 的最大子模块,即,您可以将其视为 M 本身)。你的假设会变成 I • ⊤ = ⊤.