Skip to content

Commit 23e13cc

Browse files
YaelDilliescallesonne
authored andcommitted
feat: NNRat.cast (#11203)
Define the canonical coercion from the nonnegative rationals to any division semiring. From LeanAPAP
1 parent 6dbe457 commit 23e13cc

File tree

44 files changed

+411
-77
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+411
-77
lines changed

Mathlib/Algebra/DirectLimit.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,7 @@ protected noncomputable def field [DirectedSystem G fun i j h => f' i j h] :
10111011
inv := inv G fun i j h => f' i j h
10121012
mul_inv_cancel := fun p => DirectLimit.mul_inv_cancel G fun i j h => f' i j h
10131013
inv_zero := dif_pos rfl
1014+
nnqsmul := _
10141015
qsmul := _
10151016
#align field.direct_limit.field Field.DirectLimit.field
10161017

Mathlib/Algebra/Field/Basic.lean

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ noncomputable def DivisionRing.ofIsUnitOrEqZero [Ring R] (h : ∀ a : R, IsUnit
268268
DivisionRing R where
269269
toRing := ‹Ring R›
270270
__ := groupWithZeroOfIsUnitOrEqZero h
271+
nnqsmul := _
271272
qsmul := _
272273
#align division_ring_of_is_unit_or_eq_zero DivisionRing.ofIsUnitOrEqZero
273274

@@ -282,20 +283,23 @@ noncomputable def Field.ofIsUnitOrEqZero [CommRing R] (h : ∀ a : R, IsUnit a
282283
end NoncomputableDefs
283284

284285
namespace Function.Injective
285-
variable [Zero α] [Add α] [Neg α] [Sub α] [One α] [Mul α] [Inv α] [Div α] [SMul ℕ α]
286-
[SMul α] [SMul ℚ α] [Pow α ℕ] [Pow α ℤ] [NatCast α] [IntCast α] [RatCast α]
286+
variable [Zero α] [Add α] [Neg α] [Sub α] [One α] [Mul α] [Inv α] [Div α] [SMul ℕ α] [SMul ℤ α]
287+
[SMul ℚ≥0 α] [SMul ℚ α] [Pow α ℕ] [Pow α ℤ] [NatCast α] [IntCast α] [NNRatCast α] [RatCast α]
287288
(f : α → β) (hf : Injective f)
288289

289290
/-- Pullback a `DivisionSemiring` along an injective function. -/
290291
@[reducible] -- See note [reducible non-instances]
291292
protected def divisionSemiring [DivisionSemiring β] (zero : f 0 = 0) (one : f 1 = 1)
292293
(add : ∀ x y, f (x + y) = f x + f y) (mul : ∀ x y, f (x * y) = f x * f y)
293294
(inv : ∀ x, f x⁻¹ = (f x)⁻¹) (div : ∀ x y, f (x / y) = f x / f y)
294-
(nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x)
295+
(nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x) (nnqsmul : ∀ (q : ℚ≥0) (x), f (q • x) = q • f x)
295296
(npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n) (zpow : ∀ (x) (n : ℤ), f (x ^ n) = f x ^ n)
296-
(natCast : ∀ n : ℕ, f n = n) : DivisionSemiring α where
297+
(natCast : ∀ n : ℕ, f n = n) (nnratCast : ∀ q : ℚ≥0, f q = q) : DivisionSemiring α where
297298
toSemiring := hf.semiring f zero one add mul nsmul npow natCast
298299
__ := hf.groupWithZero f zero one mul inv div npow zpow
300+
nnratCast_def q := hf $ by rw [nnratCast, NNRat.cast_def, div, natCast, natCast]
301+
nnqsmul := (· • ·)
302+
nnqsmul_def q a := hf $ by rw [nnqsmul, NNRat.smul_def, mul, nnratCast]
299303
#align function.injective.division_semiring Function.Injective.divisionSemiring
300304

301305
/-- Pullback a `DivisionSemiring` along an injective function. -/
@@ -304,14 +308,14 @@ protected def divisionRing [DivisionRing β] (zero : f 0 = 0) (one : f 1 = 1)
304308
(add : ∀ x y, f (x + y) = f x + f y) (mul : ∀ x y, f (x * y) = f x * f y)
305309
(neg : ∀ x, f (-x) = -f x) (sub : ∀ x y, f (x - y) = f x - f y) (inv : ∀ x, f x⁻¹ = (f x)⁻¹)
306310
(div : ∀ x y, f (x / y) = f x / f y)
307-
(nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x)
308-
(zsmul : ∀ (n : ) (x), f (n • x) = n • f x) (qsmul : ∀ (q : ℚ) (x), f (q • x) = q • f x)
311+
(nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x) (zsmul : ∀ (n : ℤ) (x), f (n • x) = n • f x)
312+
(nnqsmul : ∀ (q : ℚ≥0) (x), f (q • x) = q • f x) (qsmul : ∀ (q : ℚ) (x), f (q • x) = q • f x)
309313
(npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n) (zpow : ∀ (x) (n : ℤ), f (x ^ n) = f x ^ n)
310-
(natCast : ∀ n : ℕ, f n = n) (intCast : ∀ n : ℤ, f n = n)
314+
(natCast : ∀ n : ℕ, f n = n) (intCast : ∀ n : ℤ, f n = n) (nnratCast : ∀ q : ℚ≥0, f q = q)
311315
(ratCast : ∀ q : ℚ, f q = q) : DivisionRing α where
312316
toRing := hf.ring f zero one add mul neg sub nsmul zsmul npow natCast intCast
313317
__ := hf.groupWithZero f zero one mul inv div npow zpow
314-
__ := hf.divisionSemiring f zero one add mul inv div nsmul npow zpow natCast
318+
__ := hf.divisionSemiring f zero one add mul inv div nsmul nnqsmul npow zpow natCast nnratCast
315319
ratCast_def q := hf $ by erw [ratCast, div, intCast, natCast, Rat.cast_def]
316320
qsmul := (· • ·)
317321
qsmul_def q a := hf $ by erw [qsmul, mul, Rat.smul_def, ratCast]
@@ -322,12 +326,12 @@ protected def divisionRing [DivisionRing β] (zero : f 0 = 0) (one : f 1 = 1)
322326
protected def semifield [Semifield β] (zero : f 0 = 0) (one : f 1 = 1)
323327
(add : ∀ x y, f (x + y) = f x + f y) (mul : ∀ x y, f (x * y) = f x * f y)
324328
(inv : ∀ x, f x⁻¹ = (f x)⁻¹) (div : ∀ x y, f (x / y) = f x / f y)
325-
(nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x)
329+
(nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x) (nnqsmul : ∀ (q : ℚ≥0) (x), f (q • x) = q • f x)
326330
(npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n) (zpow : ∀ (x) (n : ℤ), f (x ^ n) = f x ^ n)
327-
(natCast : ∀ n : ℕ, f n = n) : Semifield α where
331+
(natCast : ∀ n : ℕ, f n = n) (nnratCast : ∀ q : ℚ≥0, f q = q) : Semifield α where
328332
toCommSemiring := hf.commSemiring f zero one add mul nsmul npow natCast
329333
__ := hf.commGroupWithZero f zero one mul inv div npow zpow
330-
__ := hf.divisionSemiring f zero one add mul inv div nsmul npow zpow natCast
334+
__ := hf.divisionSemiring f zero one add mul inv div nsmul nnqsmul npow zpow natCast nnratCast
331335
#align function.injective.semifield Function.Injective.semifield
332336

333337
/-- Pullback a `Field` along an injective function. -/
@@ -336,15 +340,15 @@ protected def field [Field β] (zero : f 0 = 0) (one : f 1 = 1)
336340
(add : ∀ x y, f (x + y) = f x + f y) (mul : ∀ x y, f (x * y) = f x * f y)
337341
(neg : ∀ x, f (-x) = -f x) (sub : ∀ x y, f (x - y) = f x - f y) (inv : ∀ x, f x⁻¹ = (f x)⁻¹)
338342
(div : ∀ x y, f (x / y) = f x / f y)
339-
(nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x)
340-
(zsmul : ∀ (n : ) (x), f (n • x) = n • f x) (qsmul : ∀ (q : ℚ) (x), f (q • x) = q • f x)
343+
(nsmul : ∀ (n : ℕ) (x), f (n • x) = n • f x) (zsmul : ∀ (n : ℤ) (x), f (n • x) = n • f x)
344+
(nnqsmul : ∀ (q : ℚ≥0) (x), f (q • x) = q • f x) (qsmul : ∀ (q : ℚ) (x), f (q • x) = q • f x)
341345
(npow : ∀ (x) (n : ℕ), f (x ^ n) = f x ^ n) (zpow : ∀ (x) (n : ℤ), f (x ^ n) = f x ^ n)
342-
(natCast : ∀ n : ℕ, f n = n) (intCast : ∀ n : ℤ, f n = n)
346+
(natCast : ∀ n : ℕ, f n = n) (intCast : ∀ n : ℤ, f n = n) (nnratCast : ∀ q : ℚ≥0, f q = q)
343347
(ratCast : ∀ q : ℚ, f q = q) :
344348
Field α where
345349
toCommRing := hf.commRing f zero one add mul neg sub nsmul zsmul npow natCast intCast
346-
__ := hf.divisionRing f zero one add mul neg sub inv div nsmul zsmul qsmul npow zpow
347-
natCast intCast ratCast
350+
__ := hf.divisionRing f zero one add mul neg sub inv div nsmul zsmul nnqsmul qsmul npow zpow
351+
natCast intCast nnratCast ratCast
348352
#align function.injective.field Function.Injective.field
349353

350354
end Function.Injective

Mathlib/Algebra/Field/Defs.lean

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/-
22
Copyright (c) 2014 Robert Lewis. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
4-
Authors: Robert Lewis, Leonardo de Moura, Johannes Hölzl, Mario Carneiro
4+
Authors: Robert Lewis, Leonardo de Moura, Johannes Hölzl, Mario Carneiro, Yaël Dillies
55
-/
66
import Mathlib.Algebra.Ring.Defs
77
import Mathlib.Data.Rat.Init
@@ -59,6 +59,14 @@ universe u
5959

6060
variable {α β K : Type*}
6161

62+
/-- The default definition of the coercion `ℚ≥0 → K` for a division semiring `K`.
63+
64+
`↑q : K` is defined as `(q.num : K) / (q.den : K)`.
65+
66+
Do not use this directly (instances of `DivisionSemiring` are allowed to override that default for
67+
better definitional properties). Instead, use the coercion. -/
68+
def NNRat.castRec [NatCast K] [Div K] (q : ℚ≥0) : K := q.num / q.den
69+
6270
/-- The default definition of the coercion `ℚ → K` for a division ring `K`.
6371
6472
`↑q : K` is defined as `(q.num : K) / (q.den : K)`.
@@ -79,7 +87,23 @@ itself). See also note [forgetful inheritance].
7987
8088
If the division semiring has positive characteristic `p`, our division by zero convention forces
8189
`nnratCast (1 / p) = 1 / 0 = 0`. -/
82-
class DivisionSemiring (α : Type*) extends Semiring α, GroupWithZero α where
90+
class DivisionSemiring (α : Type*) extends Semiring α, GroupWithZero α, NNRatCast α where
91+
protected nnratCast := NNRat.castRec
92+
/-- However `NNRat.cast` is defined, it must be propositionally equal to `a / b`.
93+
94+
Do not use this lemma directly. Use `NNRat.cast_def` instead. -/
95+
protected nnratCast_def (q : ℚ≥0) : (NNRat.cast q : α) = q.num / q.den := by intros; rfl
96+
/-- Scalar multiplication by a nonnegative rational number.
97+
98+
Unless there is a risk of a `Module ℚ≥0 _` instance diamond, write `nnqsmul := _`. This will set
99+
`nnqsmul` to `(NNRat.cast · * ·)` thanks to unification in the default proof of `nnqsmul_def`.
100+
101+
Do not use directly. Instead use the `•` notation. -/
102+
protected nnqsmul : ℚ≥0 → α → α
103+
/-- However `qsmul` is defined, it must be propositionally equal to multiplication by `Rat.cast`.
104+
105+
Do not use this lemma directly. Use `NNRat.smul_def` instead. -/
106+
protected nnqsmul_def (q : ℚ≥0) (a : α) : nnqsmul q a = NNRat.cast q * a := by intros; rfl
83107
#align division_semiring DivisionSemiring
84108

85109
/-- A `DivisionRing` is a `Ring` with multiplicative inverses for nonzero elements.
@@ -93,11 +117,27 @@ See also note [forgetful inheritance]. Similarly, there are maps `nnratCast ℚ
93117
If the division ring has positive characteristic `p`, our division by zero convention forces
94118
`ratCast (1 / p) = 1 / 0 = 0`. -/
95119
class DivisionRing (α : Type*)
96-
extends Ring α, DivInvMonoid α, Nontrivial α, RatCast α where
120+
extends Ring α, DivInvMonoid α, Nontrivial α, NNRatCast α, RatCast α where
97121
/-- For a nonzero `a`, `a⁻¹` is a right multiplicative inverse. -/
98122
protected mul_inv_cancel : ∀ (a : α), a ≠ 0 → a * a⁻¹ = 1
99123
/-- The inverse of `0` is `0` by convention. -/
100124
protected inv_zero : (0 : α)⁻¹ = 0
125+
protected nnratCast := NNRat.castRec
126+
/-- However `NNRat.cast` is defined, it must be equal to `a / b`.
127+
128+
Do not use this lemma directly. Use `NNRat.cast_def` instead. -/
129+
protected nnratCast_def (q : ℚ≥0) : (NNRat.cast q : α) = q.num / q.den := by intros; rfl
130+
/-- Scalar multiplication by a nonnegative rational number.
131+
132+
Unless there is a risk of a `Module ℚ≥0 _` instance diamond, write `nnqsmul := _`. This will set
133+
`nnqsmul` to `(NNRat.cast · * ·)` thanks to unification in the default proof of `nnqsmul_def`.
134+
135+
Do not use directly. Instead use the `•` notation. -/
136+
protected nnqsmul : ℚ≥0 → α → α
137+
/-- However `qsmul` is defined, it must be propositionally equal to multiplication by `Rat.cast`.
138+
139+
Do not use this lemma directly. Use `NNRat.smul_def` instead. -/
140+
protected nnqsmul_def (q : ℚ≥0) (a : α) : nnqsmul q a = NNRat.cast q * a := by intros; rfl
101141
protected ratCast := Rat.castRec
102142
/-- However `Rat.cast q` is defined, it must be propositionally equal to `q.num / q.den`.
103143
@@ -150,6 +190,20 @@ class Field (K : Type u) extends CommRing K, DivisionRing K
150190
instance (priority := 100) Field.toSemifield [Field α] : Semifield α := { ‹Field α› with }
151191
#align field.to_semifield Field.toSemifield
152192

193+
namespace NNRat
194+
variable [DivisionSemiring α]
195+
196+
instance (priority := 100) smulDivisionSemiring : SMul ℚ≥0 α := ⟨DivisionSemiring.nnqsmul⟩
197+
198+
lemma cast_def (q : ℚ≥0) : (q : α) = q.num / q.den := DivisionSemiring.nnratCast_def _
199+
lemma smul_def (q : ℚ≥0) (a : α) : q • a = q * a := DivisionSemiring.nnqsmul_def q a
200+
201+
variable (α)
202+
203+
@[simp] lemma smul_one_eq_coe (q : ℚ≥0) : q • (1 : α) = q := by rw [NNRat.smul_def, mul_one]
204+
205+
end NNRat
206+
153207
namespace Rat
154208
variable [DivisionRing K] {a b : K}
155209

Mathlib/Algebra/Field/IsField.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ noncomputable def IsField.toSemifield {R : Type u} [Semiring R] (h : IsField R)
6969
inv a := if ha : a = 0 then 0 else Classical.choose (h.mul_inv_cancel ha)
7070
inv_zero := dif_pos rfl
7171
mul_inv_cancel a ha := by convert Classical.choose_spec (h.mul_inv_cancel ha); exact dif_neg ha
72+
nnqsmul := _
7273
#align is_field.to_semifield IsField.toSemifield
7374

7475
/-- Transferring from `IsField` to `Field`. -/

Mathlib/Algebra/Field/MinimalAxioms.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,5 @@ def Field.ofMinimalAxioms (K : Type u)
4242
{ exists_pair_ne := exists_pair_ne
4343
mul_inv_cancel := mul_inv_cancel
4444
inv_zero := inv_zero
45+
nnqsmul := _
4546
qsmul := _ }

Mathlib/Algebra/Field/Opposite.lean

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,31 @@ variable {α : Type*}
1717

1818
namespace MulOpposite
1919

20+
@[to_additive] instance instNNRatCast [NNRatCast α] : NNRatCast αᵐᵒᵖ := ⟨fun q ↦ op q⟩
2021
@[to_additive] instance instRatCast [RatCast α] : RatCast αᵐᵒᵖ := ⟨fun q ↦ op q⟩
2122

2223
@[to_additive (attr := simp, norm_cast)]
23-
theorem op_ratCast [RatCast α] (q : ℚ) : op (q : α) = q :=
24-
rfl
24+
lemma op_nnratCast [NNRatCast α] (q : ℚ≥0) : op (q : α) = q := rfl
25+
26+
@[to_additive (attr := simp, norm_cast)]
27+
lemma unop_nnratCast [NNRatCast α] (q : ℚ≥0) : unop (q : αᵐᵒᵖ) = q := rfl
28+
29+
@[to_additive (attr := simp, norm_cast)]
30+
lemma op_ratCast [RatCast α] (q : ℚ) : op (q : α) = q := rfl
2531
#align mul_opposite.op_rat_cast MulOpposite.op_ratCast
2632
#align add_opposite.op_rat_cast AddOpposite.op_ratCast
2733

2834
@[to_additive (attr := simp, norm_cast)]
29-
theorem unop_ratCast [RatCast α] (q : ℚ) : unop (q : αᵐᵒᵖ) = q :=
30-
rfl
35+
lemma unop_ratCast [RatCast α] (q : ℚ) : unop (q : αᵐᵒᵖ) = q := rfl
3136
#align mul_opposite.unop_rat_cast MulOpposite.unop_ratCast
3237
#align add_opposite.unop_rat_cast AddOpposite.unop_ratCast
3338

3439
instance instDivisionSemiring [DivisionSemiring α] : DivisionSemiring αᵐᵒᵖ where
3540
__ := instSemiring
3641
__ := instGroupWithZero
42+
nnqsmul := _
43+
nnratCast_def q := unop_injective $ by rw [unop_nnratCast, unop_div, unop_natCast, unop_natCast,
44+
NNRat.cast_def, div_eq_mul_inv, Nat.cast_comm]
3745

3846
instance instDivisionRing [DivisionRing α] : DivisionRing αᵐᵒᵖ where
3947
__ := instRing
@@ -57,6 +65,9 @@ namespace AddOpposite
5765
instance instDivisionSemiring [DivisionSemiring α] : DivisionSemiring αᵃᵒᵖ where
5866
__ := instSemiring
5967
__ := instGroupWithZero
68+
nnqsmul := _
69+
nnratCast_def q := unop_injective $ by rw [unop_nnratCast, unop_div, unop_natCast, unop_natCast,
70+
NNRat.cast_def, div_eq_mul_inv]
6071

6172
instance instDivisionRing [DivisionRing α] : DivisionRing αᵃᵒᵖ where
6273
__ := instRing

Mathlib/Algebra/Field/ULift.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ variable {α : Type u} {x y : ULift.{v} α}
2121

2222
namespace ULift
2323

24+
instance instNNRatCast [NNRatCast α] : NNRatCast (ULift α) where nnratCast q := up q
2425
instance instRatCast [RatCast α] : RatCast (ULift α) where ratCast q := up q
2526

27+
@[simp, norm_cast] lemma up_nnratCast [NNRatCast α] (q : ℚ≥0) : up (q : α) = q := rfl
28+
@[simp, norm_cast] lemma down_nnratCast [NNRatCast α] (q : ℚ≥0) : down (q : ULift α) = q := rfl
2629
@[simp, norm_cast] lemma up_ratCast [RatCast α] (q : ℚ) : up (q : α) = q := rfl
2730
@[simp, norm_cast] lemma down_ratCast [RatCast α] (q : ℚ) : down (q : ULift α) = q := rfl
2831
#align ulift.up_rat_cast ULift.up_ratCast

Mathlib/Algebra/Module/Basic.lean

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -482,11 +482,6 @@ theorem map_rat_smul [AddCommGroup M] [AddCommGroup M₂]
482482
map_ratCast_smul f ℚ ℚ c x
483483
#align map_rat_smul map_rat_smul
484484

485-
486-
/-- A `Module` over `ℚ` restricts to a `Module` over `ℚ≥0`. -/
487-
instance [AddCommMonoid α] [Module ℚ α] : Module NNRat α :=
488-
Module.compHom α NNRat.coeHom
489-
490485
/-- There can be at most one `Module ℚ E` structure on an additive commutative group. -/
491486
instance subsingleton_rat_module (E : Type*) [AddCommGroup E] : Subsingleton (Module ℚ E) :=
492487
fun P Q => (Module.ext' P Q) fun r x =>

Mathlib/Algebra/Order/Archimedean.lean

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Copyright (c) 2018 Mario Carneiro. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Mario Carneiro
55
-/
6-
import Mathlib.Algebra.GroupPower.Order
76
import Mathlib.Algebra.Order.Field.Power
87
import Mathlib.Data.Int.LeastGreatest
98
import Mathlib.Data.Rat.Floor

Mathlib/Algebra/Order/CauSeq/Completion.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,10 @@ section
203203
variable {α : Type*} [LinearOrderedField α]
204204
variable {β : Type*} [DivisionRing β] {abv : β → α} [IsAbsoluteValue abv]
205205

206+
instance instNNRatCast : NNRatCast (Cauchy abv) where nnratCast q := ofRat q
206207
instance instRatCast : RatCast (Cauchy abv) where ratCast q := ofRat q
207208

209+
@[simp, norm_cast] lemma ofRat_nnratCast (q : ℚ≥0) : ofRat (q : β) = (q : Cauchy abv) := rfl
208210
@[simp, norm_cast] lemma ofRat_ratCast (q : ℚ) : ofRat (q : β) = (q : Cauchy abv) := rfl
209211
#align cau_seq.completion.of_rat_rat_cast CauSeq.Completion.ofRat_ratCast
210212

@@ -272,8 +274,11 @@ noncomputable instance Cauchy.divisionRing : DivisionRing (Cauchy abv) where
272274
exists_pair_ne := ⟨0, 1, zero_ne_one⟩
273275
inv_zero := inv_zero
274276
mul_inv_cancel x := CauSeq.Completion.mul_inv_cancel
277+
nnqsmul := (· • ·)
275278
qsmul := (· • ·)
279+
nnratCast_def q := by simp_rw [← ofRat_nnratCast, NNRat.cast_def, ofRat_div, ofRat_natCast]
276280
ratCast_def q := by rw [← ofRat_ratCast, Rat.cast_def, ofRat_div, ofRat_natCast, ofRat_intCast]
281+
nnqsmul_def q x := Quotient.inductionOn x fun f ↦ congr_arg mk <| ext fun i ↦ NNRat.smul_def _ _
277282
qsmul_def q x := Quotient.inductionOn x fun f ↦ congr_arg mk <| ext fun i ↦ Rat.smul_def _ _
278283

279284
/-- Show the first 10 items of a representative of this equivalence class of cauchy sequences.

0 commit comments

Comments
 (0)