Documentation

Init.Data.Range.Lemmas

Lemmas about Std.Range #

We provide lemmas rewriting for loops over Std.Range in terms of List.range'.

theorem Std.Range.mem_of_mem_range' {x : Nat} {r : Std.Range} (h : x List.range' r.start r.size r.step) :
x r
@[simp]
theorem Std.Range.forIn'_eq_forIn'_range' {m : Type u_1 → Type u_2} {β : Type u_1} [Monad m] (r : Std.Range) (init : β) (f : (a : Nat) → a rβm (ForInStep β)) :
forIn' r init f = forIn' (List.range' r.start r.size r.step) init fun (a : Nat) (h : a List.range' r.start r.size r.step) => f a
@[simp]
theorem Std.Range.forIn_eq_forIn_range' {m : Type u_1 → Type u_2} {β : Type u_1} [Monad m] (r : Std.Range) (init : β) (f : Natβm (ForInStep β)) :
forIn r init f = forIn (List.range' r.start r.size r.step) init f
@[simp]
theorem Std.Range.forM_eq_forM_range' {m : Type u_1 → Type u_2} [Monad m] (r : Std.Range) (f : Natm PUnit) :
forM r f = forM (List.range' r.start r.size r.step) f