Documentation

LeanPool.Redhill.Common.MaxAbs

Maximum absolute value of a tuple of integers #

def maxAbs {n : } (a : Fin n) :

The maximum absolute value of a tuple of integers (0 if empty).

Equations
Instances For
    theorem maxAbs_zero {a : Fin 0} :
    maxAbs a = 0
    theorem maxAbs_one {a : Fin 1} :
    maxAbs a = (a 0).natAbs
    theorem maxAbs_eq_foldr {n : } {a : Fin n} :
    maxAbs a = List.foldr max 0 (List.ofFn fun (i : Fin n) => (a i).natAbs)
    theorem maxAbs_eq_of_forall_le {n : } {a : Fin n} {i : Fin n} (hi : ∀ (j : Fin n), (a j).natAbs (a i).natAbs) :
    maxAbs a = (a i).natAbs