Debian Codegraph @

src/Algebra/Module/Properties/Semimodule.agda

raw
1 ------------------------------------------------------------------------
2 -- The Agda standard library
3 --
4 -- Properties of semimodules.
5 ------------------------------------------------------------------------
6
7 {-# OPTIONS --cubical-compatible --safe #-}
8
9 open import Algebra.Bundles using (CommutativeSemiring)
10 open import Algebra.Module.Bundles using (Semimodule)
11 open import Level using (Level)
12
13 module Algebra.Module.Properties.Semimodule
14 {r ℓr m ℓm : Level}
15 {semiring : CommutativeSemiring r ℓr}
16 (semimod : Semimodule semiring m ℓm)
17 where
18
19 open CommutativeSemiring semiring
20 open Semimodule semimod
21 open import Relation.Binary.Reasoning.Setoid ≈ᴹ-setoid
22 open import Relation.Nullary.Negation using (contraposition)
23
24 x≈0⇒x*y≈0 : ∀ {x y} → x ≈ 0# → x *ₗ y ≈ᴹ 0ᴹ
25 x≈0⇒x*y≈0 {x} {y} x≈0 = begin
26 x *ₗ y ≈⟨ *ₗ-congʳ x≈0 ⟩
27 0# *ₗ y ≈⟨ *ₗ-zeroˡ y ⟩
28 0ᴹ ∎
29
30 y≈0⇒x*y≈0 : ∀ {x y} → y ≈ᴹ 0ᴹ → x *ₗ y ≈ᴹ 0ᴹ
31 y≈0⇒x*y≈0 {x} {y} y≈0 = begin
32 x *ₗ y ≈⟨ *ₗ-congˡ y≈0 ⟩
33 x *ₗ 0ᴹ ≈⟨ *ₗ-zeroʳ x ⟩
34 0ᴹ ∎
35
36 x*y≉0⇒x≉0 : ∀ {x y} → x *ₗ y ≉ᴹ 0ᴹ → x ≉ 0#
37 x*y≉0⇒x≉0 = contraposition x≈0⇒x*y≈0
38
39 x*y≉0⇒y≉0 : ∀ {x y} → x *ₗ y ≉ᴹ 0ᴹ → y ≉ᴹ 0ᴹ
40 x*y≉0⇒y≉0 = contraposition y≈0⇒x*y≈0