Skip to content

Commit

Permalink
chore(algebra/module): add some missing *_cast tags (#1863)
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
urkud and mergify[bot] committed Jan 11, 2020
1 parent ff2a41e commit f67df78
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/algebra/module.lean
Expand Up @@ -309,10 +309,10 @@ instance : has_zero p := ⟨⟨0, zero_mem _⟩⟩
instance : has_neg p := ⟨λx, ⟨-x.1, neg_mem _ x.2⟩⟩
instance : has_scalar α p := ⟨λ c x, ⟨c • x.1, smul_mem _ c x.2⟩⟩

@[simp] lemma coe_add (x y : p) : (↑(x + y) : β) = ↑x + ↑y := rfl
@[simp] lemma coe_zero : ((0 : p) : β) = 0 := rfl
@[simp] lemma coe_neg (x : p) : ((-x : p) : β) = -x := rfl
@[simp] lemma coe_smul (r : α) (x : p) : ((r • x : p) : β) = r • ↑x := rfl
@[simp, move_cast] lemma coe_add (x y : p) : (↑(x + y) : β) = ↑x + ↑y := rfl
@[simp, elim_cast] lemma coe_zero : ((0 : p) : β) = 0 := rfl
@[simp, move_cast] lemma coe_neg (x : p) : ((-x : p) : β) = -x := rfl
@[simp, move_cast] lemma coe_smul (r : α) (x : p) : ((r • x : p) : β) = r • ↑x := rfl

instance : add_comm_group p :=
by refine {add := (+), zero := 0, neg := has_neg.neg, ..};
Expand All @@ -323,7 +323,7 @@ instance submodule_is_add_subgroup : is_add_subgroup (p : set β) :=
add_mem := p.add,
neg_mem := λ _, p.neg_mem }

lemma coe_sub (x y : p) : (↑(x - y) : β) = ↑x - ↑y := by simp
@[move_cast] lemma coe_sub (x y : p) : (↑(x - y) : β) = ↑x - ↑y := by simp

instance : module α p :=
by refine {smul := (•), ..};
Expand Down

0 comments on commit f67df78

Please sign in to comment.