@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
4
4
Authors: Mario Carneiro, Johan Commelin
5
5
6
6
! This file was ported from Lean 3 source module algebra.group.with_one.defs
7
- ! leanprover-community/mathlib commit e574b1a4e891376b0ef974b926da39e05da12a06
7
+ ! leanprover-community/mathlib commit 995b47e555f1b6297c7cf16855f1023e355219fb
8
8
! Please do not edit these lines, except to modify the commit id
9
9
! if you have ported upstream changes.
10
10
-/
@@ -98,7 +98,7 @@ instance inhabited : Inhabited (WithOne α) :=
98
98
instance nontrivial [Nonempty α] : Nontrivial (WithOne α) :=
99
99
Option.nontrivial
100
100
101
- -- porting note: this new declaration is here to make `((a : α): WithOne α)` have type `WithOne α` ;
101
+ -- porting note: this new declaration is here to make `((a : α): WithOne α)` have type `WithOne α`;
102
102
-- otherwise the coercion kicks in and it becomes `Option.some a : WithOne α` which
103
103
-- becomes `Option.some a : Option α`.
104
104
/-- The canonical map from `α` into `WithOne α` -/
@@ -190,11 +190,6 @@ protected theorem cases_on {P : WithOne α → Prop} : ∀ x : WithOne α, P 1
190
190
-- port note: I don't know if `elab_as_elim` is being added to the additivised declaration.
191
191
attribute [elab_as_elim] WithZero.cases_on
192
192
193
- -- porting note: in Lean 3 there was the following comment:
194
- -- the `show` statements in the proofs are important, because otherwise the generated lemmas
195
- -- `WithOne.mulOneClass._proof_{1,2}` have an ill-typed statement after `WithOne` is made
196
- -- irreducible. Maybe one day when mathlib is ported to Lean 4 we can experiment
197
- -- to see if these `show` comments can be removed.
198
193
@[to_additive]
199
194
instance mulOneClass [Mul α] : MulOneClass (WithOne α) where
200
195
mul := (· * ·)
@@ -290,7 +285,7 @@ instance commMonoidWithZero [CommMonoid α] : CommMonoidWithZero (WithZero α) :
290
285
{ WithZero.monoidWithZero, WithZero.commSemigroup with }
291
286
292
287
/-- Given an inverse operation on `α` there is an inverse operation
293
- on `WithZero α` sending `0` to `0`-/
288
+ on `WithZero α` sending `0` to `0`. -/
294
289
instance inv [Inv α] : Inv (WithZero α) :=
295
290
⟨fun a => Option.map Inv.inv a⟩
296
291
0 commit comments