Sitelet https://github.com/math-comp/math-comp/issues/1536
Skip to content

use raddf0 with GRing.Scale.law #1536

Description

@affeldt-aist

We (@mkerjean ) were surprised that the following didn't work:

From HB Require Import structures.
From mathcomp Require Import all_ssreflect ssralg ssrnum.

Section scale_law_raddf0.
Context {R : numDomainType} {E F : lmodType R} {s : GRing.Scale.law R F}.

Import GRing.Theory.

Lemma try_raddf0 : linear_for s ((fun=> 0%R) : E -> F).
Proof.
move => r x y /=.
Fail rewrite raddf0.
Abort.

It looks as if GRing.Scale.law doesn't have the additive structure by default:

From mathcomp Require Import all_ssreflect ssralg ssrnum.

Section scale_law_raddf0.
Context {R : numDomainType} {E F : lmodType R} {s : GRing.Scale.law R F}.

Import GRing.Theory.

Lemma try_raddf0 : linear_for s ((fun=> 0%R) : E -> F).
Proof.
move => r x y /=.
Fail rewrite raddf0.
Abort.

Lemma it_is_additive r : @Algebra.isNmodMorphism F F (s r).
Proof.
split.
by apply: GRing.Scale.op_nmod_morphism.
Qed.

HB.instance Definition _ r := it_is_additive r.

Lemma try_raddf0 : linear_for s ((fun=> 0%R) : E -> F).
Proof.
move => r x y /=.
by rewrite raddf0 addr0.
Qed.

End scale_law_raddf0.

Did we for example forget to open a namespace? @pi8027 @CohenCyril

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: questionIssue asking a question about math-comp.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions