@@ -21,7 +21,7 @@ universe u
21
21
namespace Nat
22
22
23
23
/-- `bit b` appends the digit `b` to the little end of the binary representation of
24
- its natural number input. -/
24
+ its natural number input. -/
25
25
def bit (b : Bool) (n : Nat) : Nat :=
26
26
cond b (2 * n + 1 ) (2 * n)
27
27
@@ -63,7 +63,7 @@ def binaryRec {motive : Nat → Sort u} (z : motive 0) (f : ∀ b n, motive n
63
63
decreasing_by exact bitwise_rec_lemma n0
64
64
65
65
/-- The same as `binaryRec`, but the induction step can assume that if `n=0`,
66
- the bit being appended is `true`-/
66
+ the bit being appended is `true` -/
67
67
@[elab_as_elim, specialize]
68
68
def binaryRec' {motive : Nat → Sort u} (z : motive 0 )
69
69
(f : ∀ b n, (n = 0 → b = true ) → motive n → motive (bit b n)) :
@@ -118,11 +118,11 @@ theorem bitCasesOn_bit (h : ∀ b n, motive (bit b n)) (b : Bool) (n : Nat) :
118
118
rw [testBit_bit_zero, bit_shiftRight_one]
119
119
intros; rfl
120
120
121
- unseal binaryRec in
122
121
@[simp]
123
122
theorem binaryRec_zero (z : motive 0 ) (f : ∀ b n, motive n → motive (bit b n)) :
124
- binaryRec z f 0 = z :=
125
- rfl
123
+ binaryRec z f 0 = z := by
124
+ rw [binaryRec]
125
+ simp
126
126
127
127
@[simp]
128
128
theorem binaryRec_one (z : motive 0 ) (f : ∀ b n, motive n → motive (bit b n)) :
0 commit comments