File: .lake/packages/batteries/Batteries/Data/Fin/Lemmas.lean

full_name: Fin.le_antisymm_iff
code: protected theorem le_antisymm_iff {x y : Fin n} : x = y ↔ x ≤ y ∧ y ≤ x 
goal: x = y ↔ x ≤ y ∧ y ≤ x

full_name: Fin.le_antisymm
code: protected theorem le_antisymm {x y : Fin n} (h1 : x ≤ y) (h2 : y ≤ x) : x = y 
goal: x = y

full_name: Fin.coe_clamp
code: @[simp] theorem coe_clamp (n m : Nat) : (clamp n m : Nat) = min n m 
goal: ↑(Fin.clamp n m) = min n m

full_name: Fin.size_enum
code: @[simp] theorem size_enum (n) : (enum n).size = n 
goal: (Fin.enum n).size = n

full_name: Fin.enum_zero
code: @[simp] theorem enum_zero : (enum 0) = #[] 
goal: Fin.enum 0 = #[]

full_name: Fin.getElem_enum
code: @[simp] theorem getElem_enum (i) (h : i < (enum n).size) : (enum n)[i] = ⟨i, size_enum n ▸ h⟩ 
goal: (Fin.enum n)[i] = ⟨i, ⋯⟩

full_name: Fin.length_list
code: @[simp] theorem length_list (n) : (list n).length = n 
goal: (Fin.list n).length = n

full_name: Fin.getElem_list
code: @[simp] theorem getElem_list (i : Nat) (h : i < (list n).length) :
    (list n)[i] = cast (length_list n) ⟨i, h⟩ 
goal: (Fin.list n)[i] = Fin.cast ⋯ ⟨i, h⟩

full_name: Fin.get_list
code: @[deprecated getElem_list (since := "2024-06-12")]
theorem get_list (i : Fin (list n).length) : (list n).get i = i.cast (length_list n) 
goal: (Fin.list n).get i = Fin.cast ⋯ i

full_name: Fin.list_zero
code: @[simp] theorem list_zero : list 0 = [] 
goal: Fin.list 0 = []

full_name: Fin.list_succ
code: theorem list_succ (n) : list (n+1) = 0 :: (list n).map Fin.succ 
goal: Fin.list (n + 1) = 0 :: List.map Fin.succ (Fin.list n)

full_name: Fin.list_succ_last
code: theorem list_succ_last (n) : list (n+1) = (list n).map castSucc ++ [last n] 
goal: Fin.list (n + 1) = List.map Fin.castSucc (Fin.list n) ++ [Fin.last n]

full_name: Fin.list_reverse
code: theorem list_reverse (n) : (list n).reverse = (list n).map rev 
goal: (Fin.list n).reverse = List.map Fin.rev (Fin.list n)

full_name: Fin.foldl_loop_lt
code: theorem foldl_loop_lt (f : α → Fin n → α) (x) (h : m < n) :
    foldl.loop n f x m = foldl.loop n f (f x ⟨m, h⟩) (m+1) 
goal: Fin.foldl.loop n f x m = Fin.foldl.loop n f (f x ⟨m, h⟩) (m + 1)

full_name: Fin.foldl_loop_eq
code: theorem foldl_loop_eq (f : α → Fin n → α) (x) : foldl.loop n f x n = x 
goal: Fin.foldl.loop n f x n = x

full_name: Fin.foldl_loop
code: theorem foldl_loop (f : α → Fin (n+1) → α) (x) (h : m < n+1) :
    foldl.loop (n+1) f x m = foldl.loop n (fun x i => f x i.succ) (f x ⟨m, h⟩) m 
goal: Fin.foldl.loop (n + 1) f x m = Fin.foldl.loop n (fun x i => f x i.succ) (f x ⟨m, h⟩) m

full_name: Fin.foldl_zero
code: @[simp] theorem foldl_zero (f : α → Fin 0 → α) (x) : foldl 0 f x = x 
goal: Fin.foldl 0 f x = x

full_name: Fin.foldl_succ
code: theorem foldl_succ (f : α → Fin (n+1) → α) (x) :
    foldl (n+1) f x = foldl n (fun x i => f x i.succ) (f x 0) 
goal: Fin.foldl (n + 1) f x = Fin.foldl n (fun x i => f x i.succ) (f x 0)

full_name: Fin.foldl_succ_last
code: theorem foldl_succ_last (f : α → Fin (n+1) → α) (x) :
    foldl (n+1) f x = f (foldl n (f · ·.castSucc) x) (last n) 
goal: Fin.foldl (n + 1) f x = f (Fin.foldl n (fun x x_1 => f x x_1.castSucc) x) (Fin.last n)

full_name: Fin.foldl_eq_foldl_list
code: theorem foldl_eq_foldl_list (f : α → Fin n → α) (x) : foldl n f x = (list n).foldl f x 
goal: Fin.foldl n f x = List.foldl f x (Fin.list n)

full_name: Fin.foldr_loop_zero
code: theorem foldr_loop_zero (f : Fin n → α → α) (x) : foldr.loop n f ⟨0, Nat.zero_le _⟩ x = x 
goal: Fin.foldr.loop n f ⟨0, ⋯⟩ x = x

full_name: Fin.foldr_loop_succ
code: theorem foldr_loop_succ (f : Fin n → α → α) (x) (h : m < n) :
    foldr.loop n f ⟨m+1, h⟩ x = foldr.loop n f ⟨m, Nat.le_of_lt h⟩ (f ⟨m, h⟩ x) 
goal: Fin.foldr.loop n f ⟨m + 1, h⟩ x = Fin.foldr.loop n f ⟨m, ⋯⟩ (f ⟨m, h⟩ x)

full_name: Fin.foldr_loop
code: theorem foldr_loop (f : Fin (n+1) → α → α) (x) (h : m+1 ≤ n+1) :
    foldr.loop (n+1) f ⟨m+1, h⟩ x =
      f 0 (foldr.loop n (fun i => f i.succ) ⟨m, Nat.le_of_succ_le_succ h⟩ x) 
goal: Fin.foldr.loop (n + 1) f ⟨m + 1, h⟩ x = f 0 (Fin.foldr.loop n (fun i => f i.succ) ⟨m, ⋯⟩ x)

full_name: Fin.foldr_zero
code: @[simp] theorem foldr_zero (f : Fin 0 → α → α) (x) :
    foldr 0 f x = x 
goal: Fin.foldr 0 f x = x

full_name: Fin.foldr_succ
code: theorem foldr_succ (f : Fin (n+1) → α → α) (x) :
    foldr (n+1) f x = f 0 (foldr n (fun i => f i.succ) x) 
goal: Fin.foldr (n + 1) f x = f 0 (Fin.foldr n (fun i => f i.succ) x)

full_name: Fin.foldr_succ_last
code: theorem foldr_succ_last (f : Fin (n+1) → α → α) (x) :
    foldr (n+1) f x = foldr n (f ·.castSucc) (f (last n) x) 
goal: Fin.foldr (n + 1) f x = Fin.foldr n (fun x => f x.castSucc) (f (Fin.last n) x)

full_name: Fin.foldr_eq_foldr_list
code: theorem foldr_eq_foldr_list (f : Fin n → α → α) (x) : foldr n f x = (list n).foldr f x 
goal: Fin.foldr n f x = List.foldr f x (Fin.list n)

full_name: Fin.foldl_rev
code: theorem foldl_rev (f : Fin n → α → α) (x) :
    foldl n (fun x i => f i.rev x) x = foldr n f x 
goal: Fin.foldl n (fun x i => f i.rev x) x = Fin.foldr n f x

full_name: Fin.foldr_rev
code: theorem foldr_rev (f : α → Fin n → α) (x) :
     foldr n (fun i x => f x i.rev) x = foldl n f x 
goal: Fin.foldr n (fun i x => f x i.rev) x = Fin.foldl n f x