More lemmas about Fin and big operators #
@[irreducible]
def
Fin.succRecOnSameFinType
{r : ℕ}
[NeZero r]
{motive : Fin r → Prop}
(zero : motive 0)
(succ : ∀ (i : Fin r), ↑i + 1 < r → motive i → motive (i + 1))
(i : Fin r)
:
motive i
Recursion principle for Fin r that iterates upwards from 0.
This is useful when the type Fin r is fixed and we want to induct on the element.
It's similar to Fin.inductionOn, but formulated with an explicit upper bound check.
Equations
Instances For
@[irreducible]
def
Fin.predRecOnSameFinType
{r : ℕ}
[NeZero r]
{motive : Fin r → Sort u_1}
(last : motive ⟨r - 1, ⋯⟩)
(succ : (i : Fin r) → ↑i > 0 → motive i → motive ⟨↑i - 1, ⋯⟩)
(i : Fin r)
:
motive i
Recursion principle for Fin r that iterates downwards from r - 1.
This is useful for definitions that process elements in reverse order, like foldr.
Equations
Instances For
Splits a sum over Fin (2^n) into a sum over even indices and a sum over odd indices.
Useful for Fast Fourier Transform (FFT) type recursions.
theorem
sum_Icc_split
{α : Type u_1}
[AddCommMonoid α]
(f : ℕ → α)
(a b c : ℕ)
(h₁ : a ≤ b)
(h₂ : b ≤ c)
:
Splits a sum over an interval [a, c] into two sums over [a, b] and [b+1, c].
Requires a ≤ b ≤ c.