l3lab/ntp-mathlib huggingface dataset:
theorem vecAlt0_vecAppend (v : Fin n → α) : vecAlt0 rfl (vecAppend rfl v v) = v ∘ bit0 := by
  ext i
  simp_rw [Function.comp, bit0, vecAlt0, vecAppend_eq_ite]
  split_ifs with h <;> congr
  · rw [Fin.val_mk] at h
    exact (Nat.mod_eq_of_lt h).symm
  · rw [Fin.val_mk, not_lt] at h
    simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk, Nat.mod_eq_sub_mod h]
    refine' (Nat.mod_eq_of_lt _).symm
    

Proof state:
case neg.e_a.e_val
α : Type u
m n o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
v : Fin n → α
i : Fin n
h : n ≤ ↑i + ↑i
⊢ ↑i + ↑i - n < n

Next tactic:
rw [tsub_lt_iff_left h]
theorem vecAlt0_vecAppend (v : Fin n → α) : vecAlt0 rfl (vecAppend rfl v v) = v ∘ bit0 := by
  ext i
  simp_rw [Function.comp, bit0, vecAlt0, vecAppend_eq_ite]
  split_ifs with h <;> congr
  · rw [Fin.val_mk] at h
    exact (Nat.mod_eq_of_lt h).symm
  · rw [Fin.val_mk, not_lt] at h
    simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk, Nat.mod_eq_sub_mod h]
    refine' (Nat.mod_eq_of_lt _).symm
    rw [tsub_lt_iff_left h]
    

Proof state:
case neg.e_a.e_val
α : Type u
m n o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
v : Fin n → α
i : Fin n
h : n ≤ ↑i + ↑i
⊢ ↑i + ↑i < n + n

Next tactic:
exact add_lt_add i.2 i.2
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  

Proof state:
α : Type u
m n o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
v : Fin (n + 1) → α
⊢ vecAlt1 (_ : n + 1 + (n + 1) = n + 1 + (n + 1)) (vecAppend (_ : n + 1 + (n + 1) = n + 1 + (n + 1)) v v) = v ∘ bit1

Next tactic:
ext i
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  

Proof state:
case h
α : Type u
m n o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
v : Fin (n + 1) → α
i : Fin (n + 1)
⊢ vecAlt1 (_ : n + 1 + (n + 1) = n + 1 + (n + 1)) (vecAppend (_ : n + 1 + (n + 1) = n + 1 + (n + 1)) v v) i =
    (v ∘ bit1) i

Next tactic:
simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
  

Proof state:
case h
α : Type u
m n o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
v : Fin (n + 1) → α
i : Fin (n + 1)
⊢ (if h : ↑i + ↑i + 1 < n + 1 then
      v
        { val := ↑i + ↑i + 1,
          isLt := (_ : ↑{ val := ↑i + ↑i + 1, isLt := (_ : ↑i + ↑i + 1 < n + 1 + (n + 1)) } < n + 1) }
    else
      v
        { val := ↑i + ↑i + 1 - (n + 1),
          isLt := (_ : ↑{ val := ↑i + ↑i + 1, isLt := (_ : ↑i + ↑i + 1 < n + 1 + (n + 1)) } - (n + 1) < n + 1) }) =
    v (bit1 i)

Next tactic:
cases n with
  | zero =>
    cases' i with i hi
    simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; subst i; rfl
  | succ n =>
    split_ifs with h <;> simp_rw [bit1, bit0] <;> congr
    · rw [Fin.val_mk] at h
      rw [Nat.mod_eq_of_lt (Nat.lt_of_succ_lt h)]
      erw [Nat.mod_eq_of_lt h]
    · rw [Fin.val_mk, not_lt] at h
      simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk, Nat.mod_add_mod, Fin.val_one,
        Nat.mod_eq_sub_mod h, show 1 % (n + 2) = 1 from Nat.mod_eq_of_lt (by simp)]
      refine (Nat.mod_eq_of_lt ?_).symm
      rw [tsub_lt_iff_left h]
      exact Nat.add_succ_lt_add i.2 i.2
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
  cases n with
  

Proof state:
case h.zero
α : Type u
m o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
v : Fin (Nat.zero + 1) → α
i : Fin (Nat.zero + 1)
⊢ (if h : ↑i + ↑i + 1 < Nat.zero + 1 then
      v
        { val := ↑i + ↑i + 1,
          isLt :=
            (_ : ↑{ val := ↑i + ↑i + 1, isLt := (_ : ↑i + ↑i + 1 < Nat.zero + 1 + (Nat.zero + 1)) } < Nat.zero + 1) }
    else
      v
        { val := ↑i + ↑i + 1 - (Nat.zero + 1),
          isLt :=
            (_ :
              ↑{ val := ↑i + ↑i + 1, isLt := (_ : ↑i + ↑i + 1 < Nat.zero + 1 + (Nat.zero + 1)) } - (Nat.zero + 1) <
                Nat.zero + 1) }) =
    v (bit1 i)

Next tactic:
| zero =>
    cases' i with i hi
    simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; subst i; rfl
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
  cases n with
  | zero =>
    

Proof state:
case h.zero
α : Type u
m o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
v : Fin (Nat.zero + 1) → α
i : Fin (Nat.zero + 1)
⊢ (if h : ↑i + ↑i + 1 < Nat.zero + 1 then
      v
        { val := ↑i + ↑i + 1,
          isLt :=
            (_ : ↑{ val := ↑i + ↑i + 1, isLt := (_ : ↑i + ↑i + 1 < Nat.zero + 1 + (Nat.zero + 1)) } < Nat.zero + 1) }
    else
      v
        { val := ↑i + ↑i + 1 - (Nat.zero + 1),
          isLt :=
            (_ :
              ↑{ val := ↑i + ↑i + 1, isLt := (_ : ↑i + ↑i + 1 < Nat.zero + 1 + (Nat.zero + 1)) } - (Nat.zero + 1) <
                Nat.zero + 1) }) =
    v (bit1 i)

Next tactic:
cases' i with i hi
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
  cases n with
  | zero =>
    cases' i with i hi
    

Proof state:
case h.zero.mk
α : Type u
m o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
v : Fin (Nat.zero + 1) → α
i : ℕ
hi : i < Nat.zero + 1
⊢ (if h : ↑{ val := i, isLt := hi } + ↑{ val := i, isLt := hi } + 1 < Nat.zero + 1 then
      v
        { val := ↑{ val := i, isLt := hi } + ↑{ val := i, isLt := hi } + 1,
          isLt :=
            (_ :
              ↑{ val := ↑{ val := i, isLt := hi } + ↑{ val := i, isLt := hi } + 1,
                    isLt :=
                      (_ :
                        ↑{ val := i, isLt := hi } + ↑{ val := i, isLt := hi } + 1 < Nat.zero + 1 + (Nat.zero + 1)) } <
                Nat.zero + 1) }
    else
      v
        { val := ↑{ val := i, isLt := hi } + ↑{ val := i, isLt := hi } + 1 - (Nat.zero + 1),
          isLt :=
            (_ :
              ↑{ val := ↑{ val := i, isLt := hi } + ↑{ val := i, isLt := hi } + 1,
                      isLt :=
                        (_ :
                          ↑{ val := i, isLt := hi } + ↑{ val := i, isLt := hi } + 1 < Nat.zero + 1 + (Nat.zero + 1)) } -
                  (Nat.zero + 1) <
                Nat.zero + 1) }) =
    v (bit1 { val := i, isLt := hi })

Next tactic:
simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
  cases n with
  | zero =>
    cases' i with i hi
    simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; 

Proof state:
case h.zero.mk
α : Type u
m o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
v : Fin (Nat.zero + 1) → α
i : ℕ
hi✝ : i < Nat.zero + 1
hi : i = 0
⊢ (if h : ↑{ val := i, isLt := hi✝ } + ↑{ val := i, isLt := hi✝ } + 1 < Nat.zero + 1 then
      v
        { val := ↑{ val := i, isLt := hi✝ } + ↑{ val := i, isLt := hi✝ } + 1,
          isLt :=
            (_ :
              ↑{ val := ↑{ val := i, isLt := hi✝ } + ↑{ val := i, isLt := hi✝ } + 1,
                    isLt :=
                      (_ :
                        ↑{ val := i, isLt := hi✝ } + ↑{ val := i, isLt := hi✝ } + 1 < Nat.zero + 1 + (Nat.zero + 1)) } <
                Nat.zero + 1) }
    else
      v
        { val := ↑{ val := i, isLt := hi✝ } + ↑{ val := i, isLt := hi✝ } + 1 - (Nat.zero + 1),
          isLt :=
            (_ :
              ↑{ val := ↑{ val := i, isLt := hi✝ } + ↑{ val := i, isLt := hi✝ } + 1,
                      isLt :=
                        (_ :
                          ↑{ val := i, isLt := hi✝ } + ↑{ val := i, isLt := hi✝ } + 1 <
                            Nat.zero + 1 + (Nat.zero + 1)) } -
                  (Nat.zero + 1) <
                Nat.zero + 1) }) =
    v (bit1 { val := i, isLt := hi✝ })

Next tactic:
subst i
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
  cases n with
  | zero =>
    cases' i with i hi
    simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; subst i; 

Proof state:
case h.zero.mk
α : Type u
m o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
v : Fin (Nat.zero + 1) → α
hi : 0 < Nat.zero + 1
⊢ (if h : ↑{ val := 0, isLt := hi } + ↑{ val := 0, isLt := hi } + 1 < Nat.zero + 1 then
      v
        { val := ↑{ val := 0, isLt := hi } + ↑{ val := 0, isLt := hi } + 1,
          isLt :=
            (_ :
              ↑{ val := ↑{ val := 0, isLt := hi } + ↑{ val := 0, isLt := hi } + 1,
                    isLt :=
                      (_ :
                        ↑{ val := 0, isLt := hi } + ↑{ val := 0, isLt := hi } + 1 < Nat.zero + 1 + (Nat.zero + 1)) } <
                Nat.zero + 1) }
    else
      v
        { val := ↑{ val := 0, isLt := hi } + ↑{ val := 0, isLt := hi } + 1 - (Nat.zero + 1),
          isLt :=
            (_ :
              ↑{ val := ↑{ val := 0, isLt := hi } + ↑{ val := 0, isLt := hi } + 1,
                      isLt :=
                        (_ :
                          ↑{ val := 0, isLt := hi } + ↑{ val := 0, isLt := hi } + 1 < Nat.zero + 1 + (Nat.zero + 1)) } -
                  (Nat.zero + 1) <
                Nat.zero + 1) }) =
    v (bit1 { val := 0, isLt := hi })

Next tactic:
rfl
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
  cases n with
  | zero =>
    cases' i with i hi
    simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; subst i; rfl
  

Proof state:
case h.succ
α : Type u
m o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
n : ℕ
v : Fin (Nat.succ n + 1) → α
i : Fin (Nat.succ n + 1)
⊢ (if h : ↑i + ↑i + 1 < Nat.succ n + 1 then
      v
        { val := ↑i + ↑i + 1,
          isLt :=
            (_ :
              ↑{ val := ↑i + ↑i + 1, isLt := (_ : ↑i + ↑i + 1 < Nat.succ n + 1 + (Nat.succ n + 1)) } < Nat.succ n + 1) }
    else
      v
        { val := ↑i + ↑i + 1 - (Nat.succ n + 1),
          isLt :=
            (_ :
              ↑{ val := ↑i + ↑i + 1, isLt := (_ : ↑i + ↑i + 1 < Nat.succ n + 1 + (Nat.succ n + 1)) } -
                  (Nat.succ n + 1) <
                Nat.succ n + 1) }) =
    v (bit1 i)

Next tactic:
| succ n =>
    split_ifs with h <;> simp_rw [bit1, bit0] <;> congr
    · rw [Fin.val_mk] at h
      rw [Nat.mod_eq_of_lt (Nat.lt_of_succ_lt h)]
      erw [Nat.mod_eq_of_lt h]
    · rw [Fin.val_mk, not_lt] at h
      simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk, Nat.mod_add_mod, Fin.val_one,
        Nat.mod_eq_sub_mod h, show 1 % (n + 2) = 1 from Nat.mod_eq_of_lt (by simp)]
      refine (Nat.mod_eq_of_lt ?_).symm
      rw [tsub_lt_iff_left h]
      exact Nat.add_succ_lt_add i.2 i.2
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
  cases n with
  | zero =>
    cases' i with i hi
    simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; subst i; rfl
  | succ n =>
    

Proof state:
case h.succ
α : Type u
m o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
n : ℕ
v : Fin (Nat.succ n + 1) → α
i : Fin (Nat.succ n + 1)
⊢ (if h : ↑i + ↑i + 1 < Nat.succ n + 1 then
      v
        { val := ↑i + ↑i + 1,
          isLt :=
            (_ :
              ↑{ val := ↑i + ↑i + 1, isLt := (_ : ↑i + ↑i + 1 < Nat.succ n + 1 + (Nat.succ n + 1)) } < Nat.succ n + 1) }
    else
      v
        { val := ↑i + ↑i + 1 - (Nat.succ n + 1),
          isLt :=
            (_ :
              ↑{ val := ↑i + ↑i + 1, isLt := (_ : ↑i + ↑i + 1 < Nat.succ n + 1 + (Nat.succ n + 1)) } -
                  (Nat.succ n + 1) <
                Nat.succ n + 1) }) =
    v (bit1 i)

Next tactic:
split_ifs with h
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
  cases n with
  | zero =>
    cases' i with i hi
    simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; subst i; rfl
  | succ n =>
    split_ifs with h <;> 

Proof state:
case pos
α : Type u
m o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
n : ℕ
v : Fin (Nat.succ n + 1) → α
i : Fin (Nat.succ n + 1)
h : ↑i + ↑i + 1 < Nat.succ n + 1
⊢ v
      { val := ↑i + ↑i + 1,
        isLt :=
          (_ :
            ↑{ val := ↑i + ↑i + 1, isLt := (_ : ↑i + ↑i + 1 < Nat.succ n + 1 + (Nat.succ n + 1)) } < Nat.succ n + 1) } =
    v (bit1 i)

Next tactic:
simp_rw [bit1, bit0]
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
  cases n with
  | zero =>
    cases' i with i hi
    simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; subst i; rfl
  | succ n =>
    split_ifs with h <;> 

Proof state:
case neg
α : Type u
m o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
n : ℕ
v : Fin (Nat.succ n + 1) → α
i : Fin (Nat.succ n + 1)
h : ¬↑i + ↑i + 1 < Nat.succ n + 1
⊢ v
      { val := ↑i + ↑i + 1 - (Nat.succ n + 1),
        isLt :=
          (_ :
            ↑{ val := ↑i + ↑i + 1, isLt := (_ : ↑i + ↑i + 1 < Nat.succ n + 1 + (Nat.succ n + 1)) } - (Nat.succ n + 1) <
              Nat.succ n + 1) } =
    v (bit1 i)

Next tactic:
simp_rw [bit1, bit0]
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
  cases n with
  | zero =>
    cases' i with i hi
    simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; subst i; rfl
  | succ n =>
    split_ifs with h <;> simp_rw [bit1, bit0] <;> 

Proof state:
case pos
α : Type u
m o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
n : ℕ
v : Fin (Nat.succ n + 1) → α
i : Fin (Nat.succ n + 1)
h : ↑i + ↑i + 1 < Nat.succ n + 1
⊢ v
      { val := ↑i + ↑i + 1,
        isLt :=
          (_ :
            ↑{ val := ↑i + ↑i + 1, isLt := (_ : ↑i + ↑i + 1 < Nat.succ n + 1 + (Nat.succ n + 1)) } < Nat.succ n + 1) } =
    v (i + i + 1)

Next tactic:
congr
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
  cases n with
  | zero =>
    cases' i with i hi
    simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; subst i; rfl
  | succ n =>
    split_ifs with h <;> simp_rw [bit1, bit0] <;> 

Proof state:
case neg
α : Type u
m o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
n : ℕ
v : Fin (Nat.succ n + 1) → α
i : Fin (Nat.succ n + 1)
h : ¬↑i + ↑i + 1 < Nat.succ n + 1
⊢ v
      { val := ↑i + ↑i + 1 - (Nat.succ n + 1),
        isLt :=
          (_ :
            ↑{ val := ↑i + ↑i + 1, isLt := (_ : ↑i + ↑i + 1 < Nat.succ n + 1 + (Nat.succ n + 1)) } - (Nat.succ n + 1) <
              Nat.succ n + 1) } =
    v (i + i + 1)

Next tactic:
congr
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
  cases n with
  | zero =>
    cases' i with i hi
    simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; subst i; rfl
  | succ n =>
    split_ifs with h <;> simp_rw [bit1, bit0] <;> congr
    · 

Proof state:
case pos.e_a.e_val
α : Type u
m o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
n : ℕ
v : Fin (Nat.succ n + 1) → α
i : Fin (Nat.succ n + 1)
h : ↑i + ↑i + 1 < Nat.succ n + 1
⊢ ↑i + ↑i + 1 = ((↑i + ↑i) % (Nat.succ n + 1) + 1 % (Nat.succ n + 1)) % (Nat.succ n + 1)

Next tactic:
rw [Fin.val_mk] at h
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
  cases n with
  | zero =>
    cases' i with i hi
    simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; subst i; rfl
  | succ n =>
    split_ifs with h <;> simp_rw [bit1, bit0] <;> congr
    · rw [Fin.val_mk] at h
      

Proof state:
case pos.e_a.e_val
α : Type u
m o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
n : ℕ
v : Fin (Nat.succ n + 1) → α
i : Fin (Nat.succ n + 1)
h : ↑i + ↑i + 1 < Nat.succ n + 1
⊢ ↑i + ↑i + 1 = ((↑i + ↑i) % (Nat.succ n + 1) + 1 % (Nat.succ n + 1)) % (Nat.succ n + 1)

Next tactic:
rw [Nat.mod_eq_of_lt (Nat.lt_of_succ_lt h)]
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
  cases n with
  | zero =>
    cases' i with i hi
    simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; subst i; rfl
  | succ n =>
    split_ifs with h <;> simp_rw [bit1, bit0] <;> congr
    · rw [Fin.val_mk] at h
      rw [Nat.mod_eq_of_lt (Nat.lt_of_succ_lt h)]
      

Proof state:
case pos.e_a.e_val
α : Type u
m o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
n : ℕ
v : Fin (Nat.succ n + 1) → α
i : Fin (Nat.succ n + 1)
h : ↑i + ↑i + 1 < Nat.succ n + 1
⊢ ↑i + ↑i + 1 = (↑i + ↑i + 1 % (Nat.succ n + 1)) % (Nat.succ n + 1)

Next tactic:
erw [Nat.mod_eq_of_lt h]
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
  cases n with
  | zero =>
    cases' i with i hi
    simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; subst i; rfl
  | succ n =>
    split_ifs with h <;> simp_rw [bit1, bit0] <;> congr
    · rw [Fin.val_mk] at h
      rw [Nat.mod_eq_of_lt (Nat.lt_of_succ_lt h)]
      erw [Nat.mod_eq_of_lt h]
    · 

Proof state:
case neg.e_a.e_val
α : Type u
m o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
n : ℕ
v : Fin (Nat.succ n + 1) → α
i : Fin (Nat.succ n + 1)
h : ¬↑i + ↑i + 1 < Nat.succ n + 1
⊢ ↑i + ↑i + 1 - (Nat.succ n + 1) = ((↑i + ↑i) % (Nat.succ n + 1) + 1 % (Nat.succ n + 1)) % (Nat.succ n + 1)

Next tactic:
rw [Fin.val_mk, not_lt] at h
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
  cases n with
  | zero =>
    cases' i with i hi
    simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; subst i; rfl
  | succ n =>
    split_ifs with h <;> simp_rw [bit1, bit0] <;> congr
    · rw [Fin.val_mk] at h
      rw [Nat.mod_eq_of_lt (Nat.lt_of_succ_lt h)]
      erw [Nat.mod_eq_of_lt h]
    · rw [Fin.val_mk, not_lt] at h
      

Proof state:
case neg.e_a.e_val
α : Type u
m o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
n : ℕ
v : Fin (Nat.succ n + 1) → α
i : Fin (Nat.succ n + 1)
h : Nat.succ n + 1 ≤ ↑i + ↑i + 1
⊢ ↑i + ↑i + 1 - (Nat.succ n + 1) = ((↑i + ↑i) % (Nat.succ n + 1) + 1 % (Nat.succ n + 1)) % (Nat.succ n + 1)

Next tactic:
simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk, Nat.mod_add_mod, Fin.val_one,
        Nat.mod_eq_sub_mod h, show 1 % (n + 2) = 1 from Nat.mod_eq_of_lt (by simp)]
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
  cases n with
  | zero =>
    cases' i with i hi
    simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; subst i; rfl
  | succ n =>
    split_ifs with h <;> simp_rw [bit1, bit0] <;> congr
    · rw [Fin.val_mk] at h
      rw [Nat.mod_eq_of_lt (Nat.lt_of_succ_lt h)]
      erw [Nat.mod_eq_of_lt h]
    · rw [Fin.val_mk, not_lt] at h
      simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk, Nat.mod_add_mod, Fin.val_one,
        Nat.mod_eq_sub_mod h, show 1 % (n + 2) = 1 from Nat.mod_eq_of_lt (by 

Proof state:
α : Type u
m o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
n : ℕ
v : Fin (Nat.succ n + 1) → α
i : Fin (Nat.succ n + 1)
h : Nat.succ n + 1 ≤ ↑i + ↑i + 1
⊢ 1 < n + 2

Next tactic:
simp
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
  cases n with
  | zero =>
    cases' i with i hi
    simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; subst i; rfl
  | succ n =>
    split_ifs with h <;> simp_rw [bit1, bit0] <;> congr
    · rw [Fin.val_mk] at h
      rw [Nat.mod_eq_of_lt (Nat.lt_of_succ_lt h)]
      erw [Nat.mod_eq_of_lt h]
    · rw [Fin.val_mk, not_lt] at h
      simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk, Nat.mod_add_mod, Fin.val_one,
        Nat.mod_eq_sub_mod h, show 1 % (n + 2) = 1 from Nat.mod_eq_of_lt (by simp)]
      

Proof state:
case neg.e_a.e_val
α : Type u
m o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
n : ℕ
v : Fin (Nat.succ n + 1) → α
i : Fin (Nat.succ n + 1)
h : Nat.succ n + 1 ≤ ↑i + ↑i + 1
⊢ ↑i + ↑i + 1 - (Nat.succ n + 1) = (↑i + ↑i + 1 - (Nat.succ n + 1)) % (Nat.succ n + 1)

Next tactic:
refine (Nat.mod_eq_of_lt ?_).symm
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
  cases n with
  | zero =>
    cases' i with i hi
    simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; subst i; rfl
  | succ n =>
    split_ifs with h <;> simp_rw [bit1, bit0] <;> congr
    · rw [Fin.val_mk] at h
      rw [Nat.mod_eq_of_lt (Nat.lt_of_succ_lt h)]
      erw [Nat.mod_eq_of_lt h]
    · rw [Fin.val_mk, not_lt] at h
      simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk, Nat.mod_add_mod, Fin.val_one,
        Nat.mod_eq_sub_mod h, show 1 % (n + 2) = 1 from Nat.mod_eq_of_lt (by simp)]
      refine (Nat.mod_eq_of_lt ?_).symm
      

Proof state:
case neg.e_a.e_val
α : Type u
m o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
n : ℕ
v : Fin (Nat.succ n + 1) → α
i : Fin (Nat.succ n + 1)
h : Nat.succ n + 1 ≤ ↑i + ↑i + 1
⊢ ↑i + ↑i + 1 - (Nat.succ n + 1) < Nat.succ n + 1

Next tactic:
rw [tsub_lt_iff_left h]
theorem vecAlt1_vecAppend (v : Fin (n + 1) → α) : vecAlt1 rfl (vecAppend rfl v v) = v ∘ bit1 := by
  ext i
  simp_rw [Function.comp, vecAlt1, vecAppend_eq_ite]
  cases n with
  | zero =>
    cases' i with i hi
    simp only [Nat.zero_eq, zero_add, Nat.lt_one_iff] at hi; subst i; rfl
  | succ n =>
    split_ifs with h <;> simp_rw [bit1, bit0] <;> congr
    · rw [Fin.val_mk] at h
      rw [Nat.mod_eq_of_lt (Nat.lt_of_succ_lt h)]
      erw [Nat.mod_eq_of_lt h]
    · rw [Fin.val_mk, not_lt] at h
      simp only [Fin.ext_iff, Fin.val_add, Fin.val_mk, Nat.mod_add_mod, Fin.val_one,
        Nat.mod_eq_sub_mod h, show 1 % (n + 2) = 1 from Nat.mod_eq_of_lt (by simp)]
      refine (Nat.mod_eq_of_lt ?_).symm
      rw [tsub_lt_iff_left h]
      

Proof state:
case neg.e_a.e_val
α : Type u
m o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
n : ℕ
v : Fin (Nat.succ n + 1) → α
i : Fin (Nat.succ n + 1)
h : Nat.succ n + 1 ≤ ↑i + ↑i + 1
⊢ ↑i + ↑i + 1 < Nat.succ n + 1 + (Nat.succ n + 1)

Next tactic:
exact Nat.add_succ_lt_add i.2 i.2
@[simp]
theorem vecHead_vecAlt1 (hm : m + 2 = n + 1 + (n + 1)) (v : Fin (m + 2) → α) :
    vecHead (vecAlt1 hm v) = v 1 := by 

Proof state:
α : Type u
m n o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
hm : m + 2 = n + 1 + (n + 1)
v : Fin (m + 2) → α
⊢ vecHead (vecAlt1 hm v) = v 1

Next tactic:
simp [vecHead, vecAlt1]
@[simp]
theorem cons_vec_bit0_eq_alt0 (x : α) (u : Fin n → α) (i : Fin (n + 1)) :
    vecCons x u (bit0 i) = vecAlt0 rfl (vecAppend rfl (vecCons x u) (vecCons x u)) i := by
  

Proof state:
α : Type u
m n o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
x : α
u : Fin n → α
i : Fin (n + 1)
⊢ vecCons x u (bit0 i) =
    vecAlt0 (_ : Nat.succ n + Nat.succ n = Nat.succ n + Nat.succ n)
      (vecAppend (_ : Nat.succ n + Nat.succ n = Nat.succ n + Nat.succ n) (vecCons x u) (vecCons x u)) i

Next tactic:
rw [vecAlt0_vecAppend]
@[simp]
theorem cons_vec_bit0_eq_alt0 (x : α) (u : Fin n → α) (i : Fin (n + 1)) :
    vecCons x u (bit0 i) = vecAlt0 rfl (vecAppend rfl (vecCons x u) (vecCons x u)) i := by
  rw [vecAlt0_vecAppend]; 

Proof state:
α : Type u
m n o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
x : α
u : Fin n → α
i : Fin (n + 1)
⊢ vecCons x u (bit0 i) = (vecCons x u ∘ bit0) i

Next tactic:
rfl
@[simp]
theorem cons_vec_bit1_eq_alt1 (x : α) (u : Fin n → α) (i : Fin (n + 1)) :
    vecCons x u (bit1 i) = vecAlt1 rfl (vecAppend rfl (vecCons x u) (vecCons x u)) i := by
  

Proof state:
α : Type u
m n o : ℕ
m' : Type u_1
n' : Type u_2
o' : Type u_3
x : α
u : Fin n → α
i : Fin (n + 1)
⊢ vecCons x u (bit1 i) =
    vecAlt1 (_ : Nat.succ n + Nat.succ n = Nat.succ n + Nat.succ n)
      (vecAppend (_ : Nat.succ n + Nat.succ n = Nat.succ n + Nat.succ n) (vecCons x u) (vecCons x u)) i

Next tactic:
rw [vecAlt1_vecAppend]