This PR renames `Stream` to `Std.Stream` so that the name becomes available to mathlib after a deprecation cycle.
9 lines
302 B
Text
9 lines
302 B
Text
@[simp] def Std.Stream.hasLength [Stream stream value] (n : Nat) (s : stream) : Bool :=
|
|
match n, Stream.next? s with
|
|
| 0, none => true
|
|
| n + 1, some (_, s') => hasLength n s'
|
|
| _, _ => false
|
|
|
|
#check @Std.Stream.hasLength.eq_1
|
|
#check @Std.Stream.hasLength.eq_2
|
|
#check @Std.Stream.hasLength.eq_3
|