l3lab/ntp-mathlib huggingface dataset:
theorem Products.max_eq_eval (l : Products I) (hl : l.val ≠ [])
    (hlh : l.val.head! = term I ho) :
    Linear_CC' C hsC ho (l.eval C) = l.Tail.eval (C' C ho) := by
  have hlc : ((term I ho) :: l.Tail.val).Chain' (·>·)
  · rw [← max_eq_o_cons_tail ho l hl hlh]; exact l.prop
  rw [max_eq_o_cons_tail' ho l hl hlh hlc, Products.evalCons]
  ext x
  simp only [Linear_CC', Linear_CC'₀, Linear_CC'₁, LocallyConstant.comapₗ, Subtype.coe_eta,
    LinearMap.sub_apply, LinearMap.coe_mk, AddHom.coe_mk, LocallyConstant.sub_apply,
    continuous_CC'₀, continuous_CC'₁, LocallyConstant.coe_comap, LocallyConstant.coe_mul,
    Function.comp_apply, Pi.mul_apply]
  rw [CC'₁, CC'₀, Products.eval_eq, Products.eval_eq, Products.eval_eq]
  simp only [mul_ite, mul_one, mul_zero]
  have hi' : ∀ i, i ∈ l.Tail.val → (x.val i = SwapTrue o x.val i)
  · intro i hi
    simp only [SwapTrue, @eq_comm _ (x.val i), ite_eq_right_iff, ord_term ho]
    rintro rfl
    exact ((List.Chain.rel hlc hi).ne rfl).elim
  have H :
    (∀ i, i ∈ l.Tail.val → (x.val i = true)) = (∀ i, i ∈ l.Tail.val → (SwapTrue o x.val i = true))
  · apply forall_congr; intro i; apply forall_congr; intro hi; rw [hi' i hi]
  

Proof state:
case h
I : Type u
inst✝² : Inhabited I
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
hC : IsClosed C
hsC : contained C (Order.succ o)
ho : o < Ordinal.type fun x x_1 => x < x_1
l : Products I
hl : ↑l ≠ []
hlh : List.head! ↑l = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑(Tail l))
x : ↑(C' C ho)
hi' : ∀ i ∈ ↑(Tail l), ↑x i = SwapTrue o (↑x) i
H : (∀ i ∈ ↑(Tail l), ↑x i = true) = ∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true
⊢ ((if ∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true then
        (e C (term I ho))
          { val := SwapTrue o ↑x,
            property := (_ : SwapTrue o ↑{ val := ↑x, property := (_ : ↑x ∈ π (C1 C ho) fun x => ord I x < o) } ∈ C) }
      else 0) -
      if ∀ i ∈ ↑(Tail l), ↑x i = true then (e C (term I ho)) { val := ↑x, property := (_ : ↑x ∈ C) } else 0) =
    if ∀ i ∈ ↑(Tail { val := term I ho :: ↑(Tail l), property := hlc }), ↑x i = true then 1 else 0

Next tactic:
simp only [H]
theorem Products.max_eq_eval (l : Products I) (hl : l.val ≠ [])
    (hlh : l.val.head! = term I ho) :
    Linear_CC' C hsC ho (l.eval C) = l.Tail.eval (C' C ho) := by
  have hlc : ((term I ho) :: l.Tail.val).Chain' (·>·)
  · rw [← max_eq_o_cons_tail ho l hl hlh]; exact l.prop
  rw [max_eq_o_cons_tail' ho l hl hlh hlc, Products.evalCons]
  ext x
  simp only [Linear_CC', Linear_CC'₀, Linear_CC'₁, LocallyConstant.comapₗ, Subtype.coe_eta,
    LinearMap.sub_apply, LinearMap.coe_mk, AddHom.coe_mk, LocallyConstant.sub_apply,
    continuous_CC'₀, continuous_CC'₁, LocallyConstant.coe_comap, LocallyConstant.coe_mul,
    Function.comp_apply, Pi.mul_apply]
  rw [CC'₁, CC'₀, Products.eval_eq, Products.eval_eq, Products.eval_eq]
  simp only [mul_ite, mul_one, mul_zero]
  have hi' : ∀ i, i ∈ l.Tail.val → (x.val i = SwapTrue o x.val i)
  · intro i hi
    simp only [SwapTrue, @eq_comm _ (x.val i), ite_eq_right_iff, ord_term ho]
    rintro rfl
    exact ((List.Chain.rel hlc hi).ne rfl).elim
  have H :
    (∀ i, i ∈ l.Tail.val → (x.val i = true)) = (∀ i, i ∈ l.Tail.val → (SwapTrue o x.val i = true))
  · apply forall_congr; intro i; apply forall_congr; intro hi; rw [hi' i hi]
  simp only [H]
  

Proof state:
case h
I : Type u
inst✝² : Inhabited I
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
hC : IsClosed C
hsC : contained C (Order.succ o)
ho : o < Ordinal.type fun x x_1 => x < x_1
l : Products I
hl : ↑l ≠ []
hlh : List.head! ↑l = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑(Tail l))
x : ↑(C' C ho)
hi' : ∀ i ∈ ↑(Tail l), ↑x i = SwapTrue o (↑x) i
H : (∀ i ∈ ↑(Tail l), ↑x i = true) = ∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true
⊢ ((if ∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true then
        (e C (term I ho))
          { val := SwapTrue o ↑x,
            property := (_ : SwapTrue o ↑{ val := ↑x, property := (_ : ↑x ∈ π (C1 C ho) fun x => ord I x < o) } ∈ C) }
      else 0) -
      if ∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true then (e C (term I ho)) { val := ↑x, property := (_ : ↑x ∈ C) }
      else 0) =
    if ∀ i ∈ ↑(Tail { val := term I ho :: ↑(Tail l), property := hlc }), ↑x i = true then 1 else 0

Next tactic:
split_ifs with h₁ h₂ h₃
theorem Products.max_eq_eval (l : Products I) (hl : l.val ≠ [])
    (hlh : l.val.head! = term I ho) :
    Linear_CC' C hsC ho (l.eval C) = l.Tail.eval (C' C ho) := by
  have hlc : ((term I ho) :: l.Tail.val).Chain' (·>·)
  · rw [← max_eq_o_cons_tail ho l hl hlh]; exact l.prop
  rw [max_eq_o_cons_tail' ho l hl hlh hlc, Products.evalCons]
  ext x
  simp only [Linear_CC', Linear_CC'₀, Linear_CC'₁, LocallyConstant.comapₗ, Subtype.coe_eta,
    LinearMap.sub_apply, LinearMap.coe_mk, AddHom.coe_mk, LocallyConstant.sub_apply,
    continuous_CC'₀, continuous_CC'₁, LocallyConstant.coe_comap, LocallyConstant.coe_mul,
    Function.comp_apply, Pi.mul_apply]
  rw [CC'₁, CC'₀, Products.eval_eq, Products.eval_eq, Products.eval_eq]
  simp only [mul_ite, mul_one, mul_zero]
  have hi' : ∀ i, i ∈ l.Tail.val → (x.val i = SwapTrue o x.val i)
  · intro i hi
    simp only [SwapTrue, @eq_comm _ (x.val i), ite_eq_right_iff, ord_term ho]
    rintro rfl
    exact ((List.Chain.rel hlc hi).ne rfl).elim
  have H :
    (∀ i, i ∈ l.Tail.val → (x.val i = true)) = (∀ i, i ∈ l.Tail.val → (SwapTrue o x.val i = true))
  · apply forall_congr; intro i; apply forall_congr; intro hi; rw [hi' i hi]
  simp only [H]
  split_ifs with h₁ h₂ h₃ <;> 

Proof state:
case pos
I : Type u
inst✝² : Inhabited I
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
hC : IsClosed C
hsC : contained C (Order.succ o)
ho : o < Ordinal.type fun x x_1 => x < x_1
l : Products I
hl : ↑l ≠ []
hlh : List.head! ↑l = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑(Tail l))
x : ↑(C' C ho)
hi' : ∀ i ∈ ↑(Tail l), ↑x i = SwapTrue o (↑x) i
H : (∀ i ∈ ↑(Tail l), ↑x i = true) = ∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true
h₁ : ∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true
h₂ : ∀ i ∈ ↑(Tail { val := term I ho :: ↑(Tail l), property := hlc }), ↑x i = true
⊢ (e C (term I ho))
        { val := SwapTrue o ↑x,
          property := (_ : SwapTrue o ↑{ val := ↑x, property := (_ : ↑x ∈ π (C1 C ho) fun x => ord I x < o) } ∈ C) } -
      (e C (term I ho)) { val := ↑x, property := (_ : ↑x ∈ C) } =
    1

Next tactic:
try (dsimp [e])
theorem Products.max_eq_eval (l : Products I) (hl : l.val ≠ [])
    (hlh : l.val.head! = term I ho) :
    Linear_CC' C hsC ho (l.eval C) = l.Tail.eval (C' C ho) := by
  have hlc : ((term I ho) :: l.Tail.val).Chain' (·>·)
  · rw [← max_eq_o_cons_tail ho l hl hlh]; exact l.prop
  rw [max_eq_o_cons_tail' ho l hl hlh hlc, Products.evalCons]
  ext x
  simp only [Linear_CC', Linear_CC'₀, Linear_CC'₁, LocallyConstant.comapₗ, Subtype.coe_eta,
    LinearMap.sub_apply, LinearMap.coe_mk, AddHom.coe_mk, LocallyConstant.sub_apply,
    continuous_CC'₀, continuous_CC'₁, LocallyConstant.coe_comap, LocallyConstant.coe_mul,
    Function.comp_apply, Pi.mul_apply]
  rw [CC'₁, CC'₀, Products.eval_eq, Products.eval_eq, Products.eval_eq]
  simp only [mul_ite, mul_one, mul_zero]
  have hi' : ∀ i, i ∈ l.Tail.val → (x.val i = SwapTrue o x.val i)
  · intro i hi
    simp only [SwapTrue, @eq_comm _ (x.val i), ite_eq_right_iff, ord_term ho]
    rintro rfl
    exact ((List.Chain.rel hlc hi).ne rfl).elim
  have H :
    (∀ i, i ∈ l.Tail.val → (x.val i = true)) = (∀ i, i ∈ l.Tail.val → (SwapTrue o x.val i = true))
  · apply forall_congr; intro i; apply forall_congr; intro hi; rw [hi' i hi]
  simp only [H]
  split_ifs with h₁ h₂ h₃ <;> try (

Proof state:
case pos
I : Type u
inst✝² : Inhabited I
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
hC : IsClosed C
hsC : contained C (Order.succ o)
ho : o < Ordinal.type fun x x_1 => x < x_1
l : Products I
hl : ↑l ≠ []
hlh : List.head! ↑l = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑(Tail l))
x : ↑(C' C ho)
hi' : ∀ i ∈ ↑(Tail l), ↑x i = SwapTrue o (↑x) i
H : (∀ i ∈ ↑(Tail l), ↑x i = true) = ∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true
h₁ : ∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true
h₂ : ∀ i ∈ ↑(Tail { val := term I ho :: ↑(Tail l), property := hlc }), ↑x i = true
⊢ (e C (term I ho))
        { val := SwapTrue o ↑x,
          property := (_ : SwapTrue o ↑{ val := ↑x, property := (_ : ↑x ∈ π (C1 C ho) fun x => ord I x < o) } ∈ C) } -
      (e C (term I ho)) { val := ↑x, property := (_ : ↑x ∈ C) } =
    1

Next tactic:
dsimp [e]
theorem Products.max_eq_eval (l : Products I) (hl : l.val ≠ [])
    (hlh : l.val.head! = term I ho) :
    Linear_CC' C hsC ho (l.eval C) = l.Tail.eval (C' C ho) := by
  have hlc : ((term I ho) :: l.Tail.val).Chain' (·>·)
  · rw [← max_eq_o_cons_tail ho l hl hlh]; exact l.prop
  rw [max_eq_o_cons_tail' ho l hl hlh hlc, Products.evalCons]
  ext x
  simp only [Linear_CC', Linear_CC'₀, Linear_CC'₁, LocallyConstant.comapₗ, Subtype.coe_eta,
    LinearMap.sub_apply, LinearMap.coe_mk, AddHom.coe_mk, LocallyConstant.sub_apply,
    continuous_CC'₀, continuous_CC'₁, LocallyConstant.coe_comap, LocallyConstant.coe_mul,
    Function.comp_apply, Pi.mul_apply]
  rw [CC'₁, CC'₀, Products.eval_eq, Products.eval_eq, Products.eval_eq]
  simp only [mul_ite, mul_one, mul_zero]
  have hi' : ∀ i, i ∈ l.Tail.val → (x.val i = SwapTrue o x.val i)
  · intro i hi
    simp only [SwapTrue, @eq_comm _ (x.val i), ite_eq_right_iff, ord_term ho]
    rintro rfl
    exact ((List.Chain.rel hlc hi).ne rfl).elim
  have H :
    (∀ i, i ∈ l.Tail.val → (x.val i = true)) = (∀ i, i ∈ l.Tail.val → (SwapTrue o x.val i = true))
  · apply forall_congr; intro i; apply forall_congr; intro hi; rw [hi' i hi]
  simp only [H]
  split_ifs with h₁ h₂ h₃ <;> 

Proof state:
case neg
I : Type u
inst✝² : Inhabited I
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
hC : IsClosed C
hsC : contained C (Order.succ o)
ho : o < Ordinal.type fun x x_1 => x < x_1
l : Products I
hl : ↑l ≠ []
hlh : List.head! ↑l = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑(Tail l))
x : ↑(C' C ho)
hi' : ∀ i ∈ ↑(Tail l), ↑x i = SwapTrue o (↑x) i
H : (∀ i ∈ ↑(Tail l), ↑x i = true) = ∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true
h₁ : ∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true
h₂ : ¬∀ i ∈ ↑(Tail { val := term I ho :: ↑(Tail l), property := hlc }), ↑x i = true
⊢ (e C (term I ho))
        { val := SwapTrue o ↑x,
          property := (_ : SwapTrue o ↑{ val := ↑x, property := (_ : ↑x ∈ π (C1 C ho) fun x => ord I x < o) } ∈ C) } -
      (e C (term I ho)) { val := ↑x, property := (_ : ↑x ∈ C) } =
    0

Next tactic:
try (dsimp [e])
theorem Products.max_eq_eval (l : Products I) (hl : l.val ≠ [])
    (hlh : l.val.head! = term I ho) :
    Linear_CC' C hsC ho (l.eval C) = l.Tail.eval (C' C ho) := by
  have hlc : ((term I ho) :: l.Tail.val).Chain' (·>·)
  · rw [← max_eq_o_cons_tail ho l hl hlh]; exact l.prop
  rw [max_eq_o_cons_tail' ho l hl hlh hlc, Products.evalCons]
  ext x
  simp only [Linear_CC', Linear_CC'₀, Linear_CC'₁, LocallyConstant.comapₗ, Subtype.coe_eta,
    LinearMap.sub_apply, LinearMap.coe_mk, AddHom.coe_mk, LocallyConstant.sub_apply,
    continuous_CC'₀, continuous_CC'₁, LocallyConstant.coe_comap, LocallyConstant.coe_mul,
    Function.comp_apply, Pi.mul_apply]
  rw [CC'₁, CC'₀, Products.eval_eq, Products.eval_eq, Products.eval_eq]
  simp only [mul_ite, mul_one, mul_zero]
  have hi' : ∀ i, i ∈ l.Tail.val → (x.val i = SwapTrue o x.val i)
  · intro i hi
    simp only [SwapTrue, @eq_comm _ (x.val i), ite_eq_right_iff, ord_term ho]
    rintro rfl
    exact ((List.Chain.rel hlc hi).ne rfl).elim
  have H :
    (∀ i, i ∈ l.Tail.val → (x.val i = true)) = (∀ i, i ∈ l.Tail.val → (SwapTrue o x.val i = true))
  · apply forall_congr; intro i; apply forall_congr; intro hi; rw [hi' i hi]
  simp only [H]
  split_ifs with h₁ h₂ h₃ <;> try (

Proof state:
case neg
I : Type u
inst✝² : Inhabited I
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
hC : IsClosed C
hsC : contained C (Order.succ o)
ho : o < Ordinal.type fun x x_1 => x < x_1
l : Products I
hl : ↑l ≠ []
hlh : List.head! ↑l = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑(Tail l))
x : ↑(C' C ho)
hi' : ∀ i ∈ ↑(Tail l), ↑x i = SwapTrue o (↑x) i
H : (∀ i ∈ ↑(Tail l), ↑x i = true) = ∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true
h₁ : ∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true
h₂ : ¬∀ i ∈ ↑(Tail { val := term I ho :: ↑(Tail l), property := hlc }), ↑x i = true
⊢ (e C (term I ho))
        { val := SwapTrue o ↑x,
          property := (_ : SwapTrue o ↑{ val := ↑x, property := (_ : ↑x ∈ π (C1 C ho) fun x => ord I x < o) } ∈ C) } -
      (e C (term I ho)) { val := ↑x, property := (_ : ↑x ∈ C) } =
    0

Next tactic:
dsimp [e]
theorem Products.max_eq_eval (l : Products I) (hl : l.val ≠ [])
    (hlh : l.val.head! = term I ho) :
    Linear_CC' C hsC ho (l.eval C) = l.Tail.eval (C' C ho) := by
  have hlc : ((term I ho) :: l.Tail.val).Chain' (·>·)
  · rw [← max_eq_o_cons_tail ho l hl hlh]; exact l.prop
  rw [max_eq_o_cons_tail' ho l hl hlh hlc, Products.evalCons]
  ext x
  simp only [Linear_CC', Linear_CC'₀, Linear_CC'₁, LocallyConstant.comapₗ, Subtype.coe_eta,
    LinearMap.sub_apply, LinearMap.coe_mk, AddHom.coe_mk, LocallyConstant.sub_apply,
    continuous_CC'₀, continuous_CC'₁, LocallyConstant.coe_comap, LocallyConstant.coe_mul,
    Function.comp_apply, Pi.mul_apply]
  rw [CC'₁, CC'₀, Products.eval_eq, Products.eval_eq, Products.eval_eq]
  simp only [mul_ite, mul_one, mul_zero]
  have hi' : ∀ i, i ∈ l.Tail.val → (x.val i = SwapTrue o x.val i)
  · intro i hi
    simp only [SwapTrue, @eq_comm _ (x.val i), ite_eq_right_iff, ord_term ho]
    rintro rfl
    exact ((List.Chain.rel hlc hi).ne rfl).elim
  have H :
    (∀ i, i ∈ l.Tail.val → (x.val i = true)) = (∀ i, i ∈ l.Tail.val → (SwapTrue o x.val i = true))
  · apply forall_congr; intro i; apply forall_congr; intro hi; rw [hi' i hi]
  simp only [H]
  split_ifs with h₁ h₂ h₃ <;> 

Proof state:
case pos
I : Type u
inst✝² : Inhabited I
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
hC : IsClosed C
hsC : contained C (Order.succ o)
ho : o < Ordinal.type fun x x_1 => x < x_1
l : Products I
hl : ↑l ≠ []
hlh : List.head! ↑l = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑(Tail l))
x : ↑(C' C ho)
hi' : ∀ i ∈ ↑(Tail l), ↑x i = SwapTrue o (↑x) i
H : (∀ i ∈ ↑(Tail l), ↑x i = true) = ∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true
h₁ : ¬∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true
h₃ : ∀ i ∈ ↑(Tail { val := term I ho :: ↑(Tail l), property := hlc }), ↑x i = true
⊢ 0 - 0 = 1

Next tactic:
try (dsimp [e])
theorem Products.max_eq_eval (l : Products I) (hl : l.val ≠ [])
    (hlh : l.val.head! = term I ho) :
    Linear_CC' C hsC ho (l.eval C) = l.Tail.eval (C' C ho) := by
  have hlc : ((term I ho) :: l.Tail.val).Chain' (·>·)
  · rw [← max_eq_o_cons_tail ho l hl hlh]; exact l.prop
  rw [max_eq_o_cons_tail' ho l hl hlh hlc, Products.evalCons]
  ext x
  simp only [Linear_CC', Linear_CC'₀, Linear_CC'₁, LocallyConstant.comapₗ, Subtype.coe_eta,
    LinearMap.sub_apply, LinearMap.coe_mk, AddHom.coe_mk, LocallyConstant.sub_apply,
    continuous_CC'₀, continuous_CC'₁, LocallyConstant.coe_comap, LocallyConstant.coe_mul,
    Function.comp_apply, Pi.mul_apply]
  rw [CC'₁, CC'₀, Products.eval_eq, Products.eval_eq, Products.eval_eq]
  simp only [mul_ite, mul_one, mul_zero]
  have hi' : ∀ i, i ∈ l.Tail.val → (x.val i = SwapTrue o x.val i)
  · intro i hi
    simp only [SwapTrue, @eq_comm _ (x.val i), ite_eq_right_iff, ord_term ho]
    rintro rfl
    exact ((List.Chain.rel hlc hi).ne rfl).elim
  have H :
    (∀ i, i ∈ l.Tail.val → (x.val i = true)) = (∀ i, i ∈ l.Tail.val → (SwapTrue o x.val i = true))
  · apply forall_congr; intro i; apply forall_congr; intro hi; rw [hi' i hi]
  simp only [H]
  split_ifs with h₁ h₂ h₃ <;> try (

Proof state:
case pos
I : Type u
inst✝² : Inhabited I
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
hC : IsClosed C
hsC : contained C (Order.succ o)
ho : o < Ordinal.type fun x x_1 => x < x_1
l : Products I
hl : ↑l ≠ []
hlh : List.head! ↑l = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑(Tail l))
x : ↑(C' C ho)
hi' : ∀ i ∈ ↑(Tail l), ↑x i = SwapTrue o (↑x) i
H : (∀ i ∈ ↑(Tail l), ↑x i = true) = ∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true
h₁ : ¬∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true
h₃ : ∀ i ∈ ↑(Tail { val := term I ho :: ↑(Tail l), property := hlc }), ↑x i = true
⊢ 0 - 0 = 1

Next tactic:
dsimp [e]
theorem Products.max_eq_eval (l : Products I) (hl : l.val ≠ [])
    (hlh : l.val.head! = term I ho) :
    Linear_CC' C hsC ho (l.eval C) = l.Tail.eval (C' C ho) := by
  have hlc : ((term I ho) :: l.Tail.val).Chain' (·>·)
  · rw [← max_eq_o_cons_tail ho l hl hlh]; exact l.prop
  rw [max_eq_o_cons_tail' ho l hl hlh hlc, Products.evalCons]
  ext x
  simp only [Linear_CC', Linear_CC'₀, Linear_CC'₁, LocallyConstant.comapₗ, Subtype.coe_eta,
    LinearMap.sub_apply, LinearMap.coe_mk, AddHom.coe_mk, LocallyConstant.sub_apply,
    continuous_CC'₀, continuous_CC'₁, LocallyConstant.coe_comap, LocallyConstant.coe_mul,
    Function.comp_apply, Pi.mul_apply]
  rw [CC'₁, CC'₀, Products.eval_eq, Products.eval_eq, Products.eval_eq]
  simp only [mul_ite, mul_one, mul_zero]
  have hi' : ∀ i, i ∈ l.Tail.val → (x.val i = SwapTrue o x.val i)
  · intro i hi
    simp only [SwapTrue, @eq_comm _ (x.val i), ite_eq_right_iff, ord_term ho]
    rintro rfl
    exact ((List.Chain.rel hlc hi).ne rfl).elim
  have H :
    (∀ i, i ∈ l.Tail.val → (x.val i = true)) = (∀ i, i ∈ l.Tail.val → (SwapTrue o x.val i = true))
  · apply forall_congr; intro i; apply forall_congr; intro hi; rw [hi' i hi]
  simp only [H]
  split_ifs with h₁ h₂ h₃ <;> 

Proof state:
case neg
I : Type u
inst✝² : Inhabited I
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
hC : IsClosed C
hsC : contained C (Order.succ o)
ho : o < Ordinal.type fun x x_1 => x < x_1
l : Products I
hl : ↑l ≠ []
hlh : List.head! ↑l = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑(Tail l))
x : ↑(C' C ho)
hi' : ∀ i ∈ ↑(Tail l), ↑x i = SwapTrue o (↑x) i
H : (∀ i ∈ ↑(Tail l), ↑x i = true) = ∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true
h₁ : ¬∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true
h₃ : ¬∀ i ∈ ↑(Tail { val := term I ho :: ↑(Tail l), property := hlc }), ↑x i = true
⊢ 0 - 0 = 0

Next tactic:
try (dsimp [e])
theorem Products.max_eq_eval (l : Products I) (hl : l.val ≠ [])
    (hlh : l.val.head! = term I ho) :
    Linear_CC' C hsC ho (l.eval C) = l.Tail.eval (C' C ho) := by
  have hlc : ((term I ho) :: l.Tail.val).Chain' (·>·)
  · rw [← max_eq_o_cons_tail ho l hl hlh]; exact l.prop
  rw [max_eq_o_cons_tail' ho l hl hlh hlc, Products.evalCons]
  ext x
  simp only [Linear_CC', Linear_CC'₀, Linear_CC'₁, LocallyConstant.comapₗ, Subtype.coe_eta,
    LinearMap.sub_apply, LinearMap.coe_mk, AddHom.coe_mk, LocallyConstant.sub_apply,
    continuous_CC'₀, continuous_CC'₁, LocallyConstant.coe_comap, LocallyConstant.coe_mul,
    Function.comp_apply, Pi.mul_apply]
  rw [CC'₁, CC'₀, Products.eval_eq, Products.eval_eq, Products.eval_eq]
  simp only [mul_ite, mul_one, mul_zero]
  have hi' : ∀ i, i ∈ l.Tail.val → (x.val i = SwapTrue o x.val i)
  · intro i hi
    simp only [SwapTrue, @eq_comm _ (x.val i), ite_eq_right_iff, ord_term ho]
    rintro rfl
    exact ((List.Chain.rel hlc hi).ne rfl).elim
  have H :
    (∀ i, i ∈ l.Tail.val → (x.val i = true)) = (∀ i, i ∈ l.Tail.val → (SwapTrue o x.val i = true))
  · apply forall_congr; intro i; apply forall_congr; intro hi; rw [hi' i hi]
  simp only [H]
  split_ifs with h₁ h₂ h₃ <;> try (

Proof state:
case neg
I : Type u
inst✝² : Inhabited I
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
hC : IsClosed C
hsC : contained C (Order.succ o)
ho : o < Ordinal.type fun x x_1 => x < x_1
l : Products I
hl : ↑l ≠ []
hlh : List.head! ↑l = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑(Tail l))
x : ↑(C' C ho)
hi' : ∀ i ∈ ↑(Tail l), ↑x i = SwapTrue o (↑x) i
H : (∀ i ∈ ↑(Tail l), ↑x i = true) = ∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true
h₁ : ¬∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true
h₃ : ¬∀ i ∈ ↑(Tail { val := term I ho :: ↑(Tail l), property := hlc }), ↑x i = true
⊢ 0 - 0 = 0

Next tactic:
dsimp [e]
theorem Products.max_eq_eval (l : Products I) (hl : l.val ≠ [])
    (hlh : l.val.head! = term I ho) :
    Linear_CC' C hsC ho (l.eval C) = l.Tail.eval (C' C ho) := by
  have hlc : ((term I ho) :: l.Tail.val).Chain' (·>·)
  · rw [← max_eq_o_cons_tail ho l hl hlh]; exact l.prop
  rw [max_eq_o_cons_tail' ho l hl hlh hlc, Products.evalCons]
  ext x
  simp only [Linear_CC', Linear_CC'₀, Linear_CC'₁, LocallyConstant.comapₗ, Subtype.coe_eta,
    LinearMap.sub_apply, LinearMap.coe_mk, AddHom.coe_mk, LocallyConstant.sub_apply,
    continuous_CC'₀, continuous_CC'₁, LocallyConstant.coe_comap, LocallyConstant.coe_mul,
    Function.comp_apply, Pi.mul_apply]
  rw [CC'₁, CC'₀, Products.eval_eq, Products.eval_eq, Products.eval_eq]
  simp only [mul_ite, mul_one, mul_zero]
  have hi' : ∀ i, i ∈ l.Tail.val → (x.val i = SwapTrue o x.val i)
  · intro i hi
    simp only [SwapTrue, @eq_comm _ (x.val i), ite_eq_right_iff, ord_term ho]
    rintro rfl
    exact ((List.Chain.rel hlc hi).ne rfl).elim
  have H :
    (∀ i, i ∈ l.Tail.val → (x.val i = true)) = (∀ i, i ∈ l.Tail.val → (SwapTrue o x.val i = true))
  · apply forall_congr; intro i; apply forall_congr; intro hi; rw [hi' i hi]
  simp only [H]
  split_ifs with h₁ h₂ h₃ <;> try (dsimp [e])
  · 

Proof state:
case pos
I : Type u
inst✝² : Inhabited I
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
hC : IsClosed C
hsC : contained C (Order.succ o)
ho : o < Ordinal.type fun x x_1 => x < x_1
l : Products I
hl : ↑l ≠ []
hlh : List.head! ↑l = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑(Tail l))
x : ↑(C' C ho)
hi' : ∀ i ∈ ↑(Tail l), ↑x i = SwapTrue o (↑x) i
H : (∀ i ∈ ↑(Tail l), ↑x i = true) = ∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true
h₁ : ∀ i ∈ ↑(Tail l), SwapTrue o (↑x) i = true
h₂ : ∀ i ∈ ↑(Tail { val := term I ho :: ↑(Tail l), property := hlc }), ↑x i = true
⊢ ((if SwapTrue o (↑x) (term I ho) = true then 1 else 0) - if ↑x (term I ho) = true then 1 else 0) = 1

Next tactic:
rw [if_pos (swapTrue_eq_true _ _), if_neg]