Skip to content

Commit 7c7ae20

Browse files
committed
This library note got upstreamed to Batteries; we can delete it here.
1 parent 978aba0 commit 7c7ae20

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

Mathlib/Data/Nat/Cast/Defs.lean

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,6 @@ class AddMonoidWithOne (R : Type*) extends NatCast R, AddMonoid R, One R where
7171
/-- An `AddCommMonoidWithOne` is an `AddMonoidWithOne` satisfying `a + b = b + a`. -/
7272
class AddCommMonoidWithOne (R : Type*) extends AddMonoidWithOne R, AddCommMonoid R
7373

74-
library_note2 «coercion into rings»
75-
/--
76-
Coercions such as `Nat.castCoe` that go from a concrete structure such as
77-
`ℕ` to an arbitrary ring `R` should be set up as follows:
78-
```lean
79-
instance : CoeTail ℕ R where coe := ...
80-
instance : CoeHTCT ℕ R where coe := ...
81-
```
82-
83-
It needs to be `CoeTail` instead of `Coe` because otherwise type-class
84-
inference would loop when constructing the transitive coercion `ℕ → ℕ → ℕ → ...`.
85-
Sometimes we also need to declare the `CoeHTCT` instance
86-
if we need to shadow another coercion
87-
(e.g. `Nat.cast` should be used over `Int.ofNat`).
88-
-/
89-
9074
namespace Nat
9175

9276
variable [AddMonoidWithOne R]

0 commit comments

Comments
 (0)