Skip to content

Commit 3824061

Browse files
authored
chore: add Rat.max_def lemma (#10886)
Closes #10842.
1 parent 3768c07 commit 3824061

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/Init/Data/Rat/Lemmas.lean

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,6 +1023,19 @@ theorem ofScientific_def' :
10231023
· push_cast
10241024
rfl
10251025

1026+
/-!
1027+
# min and max
1028+
-/
1029+
1030+
@[grind =] protected theorem max_def {n m : Rat} : max n m = if n ≤ m then m else n := rfl
1031+
1032+
@[grind =] protected theorem min_def {n m : Rat} : min n m = if n ≤ m then n else m := rfl
1033+
1034+
1035+
/-!
1036+
# floor
1037+
-/
1038+
10261039
theorem floor_def (a : Rat) : a.floor = a.num / a.den := by
10271040
rw [Rat.floor]
10281041
split <;> simp_all

tests/lean/run/grind_rat.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
example : (1 : Rat) + max 2 3 = 4 := by grind

0 commit comments

Comments
 (0)