File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -600,6 +600,7 @@ theorem ofScientific_true_def : Rat.ofScientific m true e = mkRat m (10 ^ e) :=
600600theorem ofScientific_false_def : Rat.ofScientific m false e = (m * 10 ^ e : Nat) := by
601601 unfold Rat.ofScientific; rfl
602602
603+ -- See also `ofScientific_def'` below.
603604theorem ofScientific_def : Rat.ofScientific m s e =
604605 if s then mkRat m (10 ^ e) else (m * 10 ^ e : Nat) := by
605606 cases s; exact ofScientific_false_def; exact ofScientific_true_def
@@ -1007,6 +1008,21 @@ theorem intCast_neg_iff {a : Int} :
10071008 (a : Rat) < 0 ↔ a < 0 :=
10081009 Rat.intCast_lt_intCast
10091010
1011+ /--
1012+ Alternative statement of `ofScientific_def`.
1013+ -/
1014+ @[grind =]
1015+ theorem ofScientific_def' :
1016+ (OfScientific.ofScientific m s e : Rat) = m * (10 ^ (if s then -e else e : Int)) := by
1017+ change Rat.ofScientific _ _ _ = _
1018+ rw [ofScientific_def]
1019+ split
1020+ · rw [Rat.zpow_neg, ← Rat.div_def, Rat.zpow_natCast, mkRat_eq_div]
1021+ push_cast
1022+ rfl
1023+ · push_cast
1024+ rfl
1025+
10101026theorem floor_def (a : Rat) : a.floor = a.num / a.den := by
10111027 rw [Rat.floor]
10121028 split <;> simp_all
You can’t perform that action at this time.
0 commit comments