@@ -456,8 +456,9 @@ theorem floor_add_one (ha : 0 ≤ a) : ⌊a + 1⌋₊ = ⌊a⌋₊ + 1 := by
456
456
rw [← cast_one, floor_add_nat ha 1 ]
457
457
#align nat.floor_add_one Nat.floor_add_one
458
458
459
+ -- See note [no_index around OfNat.ofNat]
459
460
theorem floor_add_ofNat (ha : 0 ≤ a) (n : ℕ) [n.AtLeastTwo] :
460
- ⌊a + OfNat.ofNat n⌋₊ = ⌊a⌋₊ + OfNat.ofNat n :=
461
+ ⌊a + (no_index ( OfNat.ofNat n)) ⌋₊ = ⌊a⌋₊ + OfNat.ofNat n :=
461
462
floor_add_nat ha n
462
463
463
464
@[simp]
@@ -476,9 +477,10 @@ theorem floor_sub_nat [Sub α] [OrderedSub α] [ExistsAddOfLE α] (a : α) (n :
476
477
theorem floor_sub_one [Sub α] [OrderedSub α] [ExistsAddOfLE α] (a : α) : ⌊a - 1 ⌋₊ = ⌊a⌋₊ - 1 :=
477
478
mod_cast floor_sub_nat a 1
478
479
480
+ -- See note [no_index around OfNat.ofNat]
479
481
@[simp]
480
482
theorem floor_sub_ofNat [Sub α] [OrderedSub α] [ExistsAddOfLE α] (a : α) (n : ℕ) [n.AtLeastTwo] :
481
- ⌊a - OfNat.ofNat n⌋₊ = ⌊a⌋₊ - OfNat.ofNat n :=
483
+ ⌊a - (no_index ( OfNat.ofNat n)) ⌋₊ = ⌊a⌋₊ - OfNat.ofNat n :=
482
484
floor_sub_nat a n
483
485
484
486
theorem ceil_add_nat (ha : 0 ≤ a) (n : ℕ) : ⌈a + n⌉₊ = ⌈a⌉₊ + n :=
@@ -496,8 +498,9 @@ theorem ceil_add_one (ha : 0 ≤ a) : ⌈a + 1⌉₊ = ⌈a⌉₊ + 1 := by
496
498
rw [cast_one.symm, ceil_add_nat ha 1 ]
497
499
#align nat.ceil_add_one Nat.ceil_add_one
498
500
501
+ -- See note [no_index around OfNat.ofNat]
499
502
theorem ceil_add_ofNat (ha : 0 ≤ a) (n : ℕ) [n.AtLeastTwo] :
500
- ⌈a + OfNat.ofNat n⌉₊ = ⌈a⌉₊ + OfNat.ofNat n :=
503
+ ⌈a + (no_index ( OfNat.ofNat n)) ⌉₊ = ⌈a⌉₊ + OfNat.ofNat n :=
501
504
ceil_add_nat ha n
502
505
503
506
theorem ceil_lt_add_one (ha : 0 ≤ a) : (⌈a⌉₊ : α) < a + 1 :=
@@ -543,8 +546,9 @@ theorem floor_div_nat (a : α) (n : ℕ) : ⌊a / n⌋₊ = ⌊a⌋₊ / n := by
543
546
· exact cast_pos.2 hn
544
547
#align nat.floor_div_nat Nat.floor_div_nat
545
548
549
+ -- See note [no_index around OfNat.ofNat]
546
550
theorem floor_div_ofNat (a : α) (n : ℕ) [n.AtLeastTwo] :
547
- ⌊a / OfNat.ofNat n⌋₊ = ⌊a⌋₊ / OfNat.ofNat n :=
551
+ ⌊a / (no_index ( OfNat.ofNat n)) ⌋₊ = ⌊a⌋₊ / OfNat.ofNat n :=
548
552
floor_div_nat a n
549
553
550
554
/-- Natural division is the floor of field division. -/
@@ -738,7 +742,9 @@ theorem floor_zero : ⌊(0 : α)⌋ = 0 := by rw [← cast_zero, floor_intCast]
738
742
theorem floor_one : ⌊(1 : α)⌋ = 1 := by rw [← cast_one, floor_intCast]
739
743
#align int.floor_one Int.floor_one
740
744
741
- @[simp] theorem floor_ofNat (n : ℕ) [n.AtLeastTwo] : ⌊(OfNat.ofNat n : α)⌋ = n := floor_natCast n
745
+ -- See note [no_index around OfNat.ofNat]
746
+ @[simp] theorem floor_ofNat (n : ℕ) [n.AtLeastTwo] : ⌊(no_index (OfNat.ofNat n : α))⌋ = n :=
747
+ floor_natCast n
742
748
743
749
@[mono]
744
750
theorem floor_mono : Monotone (floor : α → ℤ) :=
@@ -786,19 +792,21 @@ theorem floor_int_add (z : ℤ) (a : α) : ⌊↑z + a⌋ = z + ⌊a⌋ := by
786
792
theorem floor_add_nat (a : α) (n : ℕ) : ⌊a + n⌋ = ⌊a⌋ + n := by rw [← Int.cast_ofNat, floor_add_int]
787
793
#align int.floor_add_nat Int.floor_add_nat
788
794
795
+ -- See note [no_index around OfNat.ofNat]
789
796
@[simp]
790
797
theorem floor_add_ofNat (a : α) (n : ℕ) [n.AtLeastTwo] :
791
- ⌊a + OfNat.ofNat n⌋ = ⌊a⌋ + OfNat.ofNat n :=
798
+ ⌊a + (no_index ( OfNat.ofNat n)) ⌋ = ⌊a⌋ + OfNat.ofNat n :=
792
799
floor_add_nat a n
793
800
794
801
@[simp]
795
802
theorem floor_nat_add (n : ℕ) (a : α) : ⌊↑n + a⌋ = n + ⌊a⌋ := by
796
803
rw [← Int.cast_ofNat, floor_int_add]
797
804
#align int.floor_nat_add Int.floor_nat_add
798
805
806
+ -- See note [no_index around OfNat.ofNat]
799
807
@[simp]
800
808
theorem floor_ofNat_add (n : ℕ) [n.AtLeastTwo] (a : α) :
801
- ⌊OfNat.ofNat n + a⌋ = OfNat.ofNat n + ⌊a⌋ :=
809
+ ⌊(no_index ( OfNat.ofNat n)) + a⌋ = OfNat.ofNat n + ⌊a⌋ :=
802
810
floor_nat_add n a
803
811
804
812
@[simp]
@@ -812,9 +820,10 @@ theorem floor_sub_nat (a : α) (n : ℕ) : ⌊a - n⌋ = ⌊a⌋ - n := by rw [
812
820
813
821
@[simp] theorem floor_sub_one (a : α) : ⌊a - 1 ⌋ = ⌊a⌋ - 1 := mod_cast floor_sub_nat a 1
814
822
823
+ -- See note [no_index around OfNat.ofNat]
815
824
@[simp]
816
825
theorem floor_sub_ofNat (a : α) (n : ℕ) [n.AtLeastTwo] :
817
- ⌊a - OfNat.ofNat n⌋ = ⌊a⌋ - OfNat.ofNat n :=
826
+ ⌊a - (no_index ( OfNat.ofNat n)) ⌋ = ⌊a⌋ - OfNat.ofNat n :=
818
827
floor_sub_nat a n
819
828
820
829
theorem abs_sub_lt_one_of_floor_eq_floor {α : Type *} [LinearOrderedCommRing α] [FloorRing α]
@@ -883,8 +892,10 @@ theorem fract_add_nat (a : α) (m : ℕ) : fract (a + m) = fract a := by
883
892
@[simp]
884
893
theorem fract_add_one (a : α) : fract (a + 1 ) = fract a := mod_cast fract_add_nat a 1
885
894
895
+ -- See note [no_index around OfNat.ofNat]
886
896
@[simp]
887
- theorem fract_add_ofNat (a : α) (n : ℕ) [n.AtLeastTwo] : fract (a + OfNat.ofNat n) = fract a :=
897
+ theorem fract_add_ofNat (a : α) (n : ℕ) [n.AtLeastTwo] :
898
+ fract (a + (no_index (OfNat.ofNat n))) = fract a :=
888
899
fract_add_nat a n
889
900
890
901
@[simp]
@@ -897,8 +908,10 @@ theorem fract_nat_add (n : ℕ) (a : α) : fract (↑n + a) = fract a := by rw [
897
908
@[simp]
898
909
theorem fract_one_add (a : α) : fract (1 + a) = fract a := mod_cast fract_nat_add 1 a
899
910
911
+ -- See note [no_index around OfNat.ofNat]
900
912
@[simp]
901
- theorem fract_ofNat_add (n : ℕ) [n.AtLeastTwo] (a : α) : fract (OfNat.ofNat n + a) = fract a :=
913
+ theorem fract_ofNat_add (n : ℕ) [n.AtLeastTwo] (a : α) :
914
+ fract ((no_index (OfNat.ofNat n)) + a) = fract a :=
902
915
fract_nat_add n a
903
916
904
917
@[simp]
@@ -916,8 +929,10 @@ theorem fract_sub_nat (a : α) (n : ℕ) : fract (a - n) = fract a := by
916
929
@[simp]
917
930
theorem fract_sub_one (a : α) : fract (a - 1 ) = fract a := mod_cast fract_sub_nat a 1
918
931
932
+ -- See note [no_index around OfNat.ofNat]
919
933
@[simp]
920
- theorem fract_sub_ofNat (a : α) (n : ℕ) [n.AtLeastTwo] : fract (a - OfNat.ofNat n) = fract a :=
934
+ theorem fract_sub_ofNat (a : α) (n : ℕ) [n.AtLeastTwo] :
935
+ fract (a - (no_index (OfNat.ofNat n))) = fract a :=
921
936
fract_sub_nat a n
922
937
923
938
-- Was a duplicate lemma under a bad name
@@ -985,8 +1000,11 @@ theorem fract_intCast (z : ℤ) : fract (z : α) = 0 := by
985
1000
theorem fract_natCast (n : ℕ) : fract (n : α) = 0 := by simp [fract]
986
1001
#align int.fract_nat_cast Int.fract_natCast
987
1002
1003
+ -- See note [no_index around OfNat.ofNat]
988
1004
@[simp]
989
- theorem fract_ofNat (n : ℕ) [n.AtLeastTwo] : fract (OfNat.ofNat n : α) = 0 := fract_natCast n
1005
+ theorem fract_ofNat (n : ℕ) [n.AtLeastTwo] :
1006
+ fract ((no_index (OfNat.ofNat n)) : α) = 0 :=
1007
+ fract_natCast n
990
1008
991
1009
-- porting note: simp can prove this
992
1010
-- @[ simp ]
@@ -1213,8 +1231,9 @@ theorem ceil_natCast (n : ℕ) : ⌈(n : α)⌉ = n :=
1213
1231
eq_of_forall_ge_iff fun a => by rw [ceil_le, ← cast_ofNat, cast_le]
1214
1232
#align int.ceil_nat_cast Int.ceil_natCast
1215
1233
1234
+ -- See note [no_index around OfNat.ofNat]
1216
1235
@[simp]
1217
- theorem ceil_ofNat (n : ℕ) [n.AtLeastTwo] : ⌈(OfNat.ofNat n : α)⌉ = n := ceil_natCast n
1236
+ theorem ceil_ofNat (n : ℕ) [n.AtLeastTwo] : ⌈(no_index ( OfNat.ofNat n : α) )⌉ = n := ceil_natCast n
1218
1237
1219
1238
theorem ceil_mono : Monotone (ceil : α → ℤ) :=
1220
1239
gc_ceil_coe.monotone_l
@@ -1238,8 +1257,10 @@ theorem ceil_add_one (a : α) : ⌈a + 1⌉ = ⌈a⌉ + 1 := by
1238
1257
rw [← ceil_add_int a (1 : ℤ), cast_one]
1239
1258
#align int.ceil_add_one Int.ceil_add_one
1240
1259
1260
+ -- See note [no_index around OfNat.ofNat]
1241
1261
@[simp]
1242
- theorem ceil_add_ofNat (a : α) (n : ℕ) [n.AtLeastTwo] : ⌈a + OfNat.ofNat n⌉ = ⌈a⌉ + OfNat.ofNat n :=
1262
+ theorem ceil_add_ofNat (a : α) (n : ℕ) [n.AtLeastTwo] :
1263
+ ⌈a + (no_index (OfNat.ofNat n))⌉ = ⌈a⌉ + OfNat.ofNat n :=
1243
1264
ceil_add_nat a n
1244
1265
1245
1266
@[simp]
@@ -1258,8 +1279,10 @@ theorem ceil_sub_one (a : α) : ⌈a - 1⌉ = ⌈a⌉ - 1 := by
1258
1279
rw [eq_sub_iff_add_eq, ← ceil_add_one, sub_add_cancel]
1259
1280
#align int.ceil_sub_one Int.ceil_sub_one
1260
1281
1282
+ -- See note [no_index around OfNat.ofNat]
1261
1283
@[simp]
1262
- theorem ceil_sub_ofNat (a : α) (n : ℕ) [n.AtLeastTwo] : ⌈a - OfNat.ofNat n⌉ = ⌈a⌉ - OfNat.ofNat n :=
1284
+ theorem ceil_sub_ofNat (a : α) (n : ℕ) [n.AtLeastTwo] :
1285
+ ⌈a - (no_index (OfNat.ofNat n))⌉ = ⌈a⌉ - OfNat.ofNat n :=
1263
1286
ceil_sub_nat a n
1264
1287
1265
1288
theorem ceil_lt_add_one (a : α) : (⌈a⌉ : α) < a + 1 := by
@@ -1438,8 +1461,10 @@ theorem round_one : round (1 : α) = 1 := by simp [round]
1438
1461
theorem round_natCast (n : ℕ) : round (n : α) = n := by simp [round]
1439
1462
#align round_nat_cast round_natCast
1440
1463
1464
+ -- See note [no_index around OfNat.ofNat]
1441
1465
@[simp]
1442
- theorem round_ofNat (n : ℕ) [n.AtLeastTwo] : round (OfNat.ofNat n : α) = n := round_natCast n
1466
+ theorem round_ofNat (n : ℕ) [n.AtLeastTwo] : round (no_index (OfNat.ofNat n : α)) = n :=
1467
+ round_natCast n
1443
1468
1444
1469
@[simp]
1445
1470
theorem round_intCast (n : ℤ) : round (n : α) = n := by simp [round]
@@ -1474,19 +1499,21 @@ theorem round_add_nat (x : α) (y : ℕ) : round (x + y) = round x + y :=
1474
1499
mod_cast round_add_int x y
1475
1500
#align round_add_nat round_add_nat
1476
1501
1502
+ -- See note [no_index around OfNat.ofNat]
1477
1503
@[simp]
1478
1504
theorem round_add_ofNat (x : α) (n : ℕ) [n.AtLeastTwo] :
1479
- round (x + OfNat.ofNat n) = round x + OfNat.ofNat n :=
1505
+ round (x + (no_index ( OfNat.ofNat n)) ) = round x + OfNat.ofNat n :=
1480
1506
round_add_nat x n
1481
1507
1482
1508
@[simp]
1483
1509
theorem round_sub_nat (x : α) (y : ℕ) : round (x - y) = round x - y :=
1484
1510
mod_cast round_sub_int x y
1485
1511
#align round_sub_nat round_sub_nat
1486
1512
1513
+ -- See note [no_index around OfNat.ofNat]
1487
1514
@[simp]
1488
1515
theorem round_sub_ofNat (x : α) (n : ℕ) [n.AtLeastTwo] :
1489
- round (x - OfNat.ofNat n) = round x - OfNat.ofNat n :=
1516
+ round (x - (no_index ( OfNat.ofNat n)) ) = round x - OfNat.ofNat n :=
1490
1517
round_sub_nat x n
1491
1518
1492
1519
@[simp]
@@ -1499,9 +1526,10 @@ theorem round_nat_add (x : α) (y : ℕ) : round ((y : α) + x) = y + round x :=
1499
1526
rw [add_comm, round_add_nat, add_comm]
1500
1527
#align round_nat_add round_nat_add
1501
1528
1529
+ -- See note [no_index around OfNat.ofNat]
1502
1530
@[simp]
1503
1531
theorem round_ofNat_add (n : ℕ) [n.AtLeastTwo] (x : α) :
1504
- round (OfNat.ofNat n + x) = OfNat.ofNat n + round x :=
1532
+ round ((no_index ( OfNat.ofNat n)) + x) = OfNat.ofNat n + round x :=
1505
1533
round_nat_add x n
1506
1534
1507
1535
theorem abs_sub_round_eq_min (x : α) : |x - round x| = min (fract x) (1 - fract x) := by
0 commit comments