Theorem: Profinite.NobelingProof.Products.max_eq_eval
File: Mathlib/Topology/Category/Profinite/Nobeling.lean

Proof steps:
state_before: I : Type u
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
inst✝ : Inhabited I
l : Products I
hl : ↑l ≠ []
hlh : (↑l).head! = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑l.Tail)
⊢ (Linear_CC' C hsC ho) (eval C l) = eval (C' C ho) l.Tail
state_after: I : Type u
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
inst✝ : Inhabited I
l : Products I
hl : ↑l ≠ []
hlh : (↑l).head! = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑l.Tail)
⊢ (Linear_CC' C hsC ho) (e C (term I ho) * eval C ⟨↑l.Tail, ⋯⟩) = eval (C' C ho) (Tail ⟨term I ho :: ↑l.Tail, hlc⟩)
tactic: rw [max_eq_o_cons_tail' ho l hl hlh hlc, Products.evalCons]
state_before: I : Type u
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
inst✝ : Inhabited I
l : Products I
hl : ↑l ≠ []
hlh : (↑l).head! = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑l.Tail)
⊢ (Linear_CC' C hsC ho) (e C (term I ho) * eval C ⟨↑l.Tail, ⋯⟩) = eval (C' C ho) (Tail ⟨term I ho :: ↑l.Tail, hlc⟩)
state_after: case h
I : Type u
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
inst✝ : Inhabited I
l : Products I
hl : ↑l ≠ []
hlh : (↑l).head! = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑l.Tail)
x : ↑(C' C ho)
⊢ ((Linear_CC' C hsC ho) (e C (term I ho) * eval C ⟨↑l.Tail, ⋯⟩)) x =
    (eval (C' C ho) (Tail ⟨term I ho :: ↑l.Tail, hlc⟩)) x
tactic: ext x
state_before: case h
I : Type u
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
inst✝ : Inhabited I
l : Products I
hl : ↑l ≠ []
hlh : (↑l).head! = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑l.Tail)
x : ↑(C' C ho)
⊢ ((Linear_CC' C hsC ho) (e C (term I ho) * eval C ⟨↑l.Tail, ⋯⟩)) x =
    (eval (C' C ho) (Tail ⟨term I ho :: ↑l.Tail, hlc⟩)) x
state_after: case h
I : Type u
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
inst✝ : Inhabited I
l : Products I
hl : ↑l ≠ []
hlh : (↑l).head! = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑l.Tail)
x : ↑(C' C ho)
⊢ (e C (term I ho)) (CC'₁ C hsC ho x) * (eval C l.Tail) (CC'₁ C hsC ho x) -
      (e C (term I ho)) (CC'₀ C ho x) * (eval C l.Tail) (CC'₀ C ho x) =
    (eval (C' C ho) (Tail ⟨term I ho :: ↑l.Tail, hlc⟩)) x
tactic: simp only [Linear_CC', Linear_CC'₁, LocallyConstant.comapₗ, Linear_CC'₀, Subtype.coe_eta,
    LinearMap.sub_apply, LinearMap.coe_mk, AddHom.coe_mk, LocallyConstant.sub_apply,
    LocallyConstant.coe_comap, LocallyConstant.coe_mul, ContinuousMap.coe_mk, Function.comp_apply,
    Pi.mul_apply]
state_before: case h
I : Type u
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
inst✝ : Inhabited I
l : Products I
hl : ↑l ≠ []
hlh : (↑l).head! = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑l.Tail)
x : ↑(C' C ho)
⊢ (e C (term I ho)) (CC'₁ C hsC ho x) * (eval C l.Tail) (CC'₁ C hsC ho x) -
      (e C (term I ho)) (CC'₀ C ho x) * (eval C l.Tail) (CC'₀ C ho x) =
    (eval (C' C ho) (Tail ⟨term I ho :: ↑l.Tail, hlc⟩)) x
state_after: case h
I : Type u
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
inst✝ : Inhabited I
l : Products I
hl : ↑l ≠ []
hlh : (↑l).head! = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑l.Tail)
x : ↑(C' C ho)
⊢ (((e C (term I ho)) ⟨SwapTrue o ↑x, ⋯⟩ * if ∀ i ∈ ↑l.Tail, ↑⟨SwapTrue o ↑x, ⋯⟩ i = true then 1 else 0) -
      (e C (term I ho)) ⟨↑x, ⋯⟩ * if ∀ i ∈ ↑l.Tail, ↑⟨↑x, ⋯⟩ i = true then 1 else 0) =
    if ∀ i ∈ ↑(Tail ⟨term I ho :: ↑l.Tail, hlc⟩), ↑x i = true then 1 else 0
tactic: rw [CC'₁, CC'₀, Products.eval_eq, Products.eval_eq, Products.eval_eq]
state_before: case h
I : Type u
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
inst✝ : Inhabited I
l : Products I
hl : ↑l ≠ []
hlh : (↑l).head! = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑l.Tail)
x : ↑(C' C ho)
⊢ (((e C (term I ho)) ⟨SwapTrue o ↑x, ⋯⟩ * if ∀ i ∈ ↑l.Tail, ↑⟨SwapTrue o ↑x, ⋯⟩ i = true then 1 else 0) -
      (e C (term I ho)) ⟨↑x, ⋯⟩ * if ∀ i ∈ ↑l.Tail, ↑⟨↑x, ⋯⟩ i = true then 1 else 0) =
    if ∀ i ∈ ↑(Tail ⟨term I ho :: ↑l.Tail, hlc⟩), ↑x i = true then 1 else 0
state_after: case h
I : Type u
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
inst✝ : Inhabited I
l : Products I
hl : ↑l ≠ []
hlh : (↑l).head! = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑l.Tail)
x : ↑(C' C ho)
⊢ ((if ∀ i ∈ ↑l.Tail, SwapTrue o (↑x) i = true then (e C (term I ho)) ⟨SwapTrue o ↑x, ⋯⟩ else 0) -
      if ∀ i ∈ ↑l.Tail, ↑x i = true then (e C (term I ho)) ⟨↑x, ⋯⟩ else 0) =
    if ∀ i ∈ ↑(Tail ⟨term I ho :: ↑l.Tail, hlc⟩), ↑x i = true then 1 else 0
tactic: simp only [mul_ite, mul_one, mul_zero]
state_before: case h
I : Type u
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
inst✝ : Inhabited I
l : Products I
hl : ↑l ≠ []
hlh : (↑l).head! = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑l.Tail)
x : ↑(C' C ho)
⊢ ((if ∀ i ∈ ↑l.Tail, SwapTrue o (↑x) i = true then (e C (term I ho)) ⟨SwapTrue o ↑x, ⋯⟩ else 0) -
      if ∀ i ∈ ↑l.Tail, ↑x i = true then (e C (term I ho)) ⟨↑x, ⋯⟩ else 0) =
    if ∀ i ∈ ↑(Tail ⟨term I ho :: ↑l.Tail, hlc⟩), ↑x i = true then 1 else 0
state_after: case h
I : Type u
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
inst✝ : Inhabited I
l : Products I
hl : ↑l ≠ []
hlh : (↑l).head! = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑l.Tail)
x : ↑(C' C ho)
hi' : ∀ i ∈ ↑l.Tail, ↑x i = SwapTrue o (↑x) i
⊢ ((if ∀ i ∈ ↑l.Tail, SwapTrue o (↑x) i = true then (e C (term I ho)) ⟨SwapTrue o ↑x, ⋯⟩ else 0) -
      if ∀ i ∈ ↑l.Tail, ↑x i = true then (e C (term I ho)) ⟨↑x, ⋯⟩ else 0) =
    if ∀ i ∈ ↑(Tail ⟨term I ho :: ↑l.Tail, hlc⟩), ↑x i = true then 1 else 0
tactic: have hi' : ∀ i, i ∈ l.Tail.val → (x.val i = SwapTrue o x.val i) := by
    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
state_before: case h
I : Type u
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
inst✝ : Inhabited I
l : Products I
hl : ↑l ≠ []
hlh : (↑l).head! = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑l.Tail)
x : ↑(C' C ho)
hi' : ∀ i ∈ ↑l.Tail, ↑x i = SwapTrue o (↑x) i
⊢ ((if ∀ i ∈ ↑l.Tail, SwapTrue o (↑x) i = true then (e C (term I ho)) ⟨SwapTrue o ↑x, ⋯⟩ else 0) -
      if ∀ i ∈ ↑l.Tail, ↑x i = true then (e C (term I ho)) ⟨↑x, ⋯⟩ else 0) =
    if ∀ i ∈ ↑(Tail ⟨term I ho :: ↑l.Tail, hlc⟩), ↑x i = true then 1 else 0
state_after: case h
I : Type u
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
inst✝ : Inhabited I
l : Products I
hl : ↑l ≠ []
hlh : (↑l).head! = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑l.Tail)
x : ↑(C' C ho)
hi' : ∀ i ∈ ↑l.Tail, ↑x i = SwapTrue o (↑x) i
H : (∀ i ∈ ↑l.Tail, ↑x i = true) = ∀ i ∈ ↑l.Tail, SwapTrue o (↑x) i = true
⊢ ((if ∀ i ∈ ↑l.Tail, SwapTrue o (↑x) i = true then (e C (term I ho)) ⟨SwapTrue o ↑x, ⋯⟩ else 0) -
      if ∀ i ∈ ↑l.Tail, ↑x i = true then (e C (term I ho)) ⟨↑x, ⋯⟩ else 0) =
    if ∀ i ∈ ↑(Tail ⟨term I ho :: ↑l.Tail, hlc⟩), ↑x i = true then 1 else 0
tactic: have H : (∀ i, i ∈ l.Tail.val → (x.val i = true)) =
      (∀ i, i ∈ l.Tail.val → (SwapTrue o x.val i = true)) := by
    apply forall_congr; intro i; apply forall_congr; intro hi; rw [hi' i hi]
state_before: case h
I : Type u
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
inst✝ : Inhabited I
l : Products I
hl : ↑l ≠ []
hlh : (↑l).head! = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑l.Tail)
x : ↑(C' C ho)
hi' : ∀ i ∈ ↑l.Tail, ↑x i = SwapTrue o (↑x) i
H : (∀ i ∈ ↑l.Tail, ↑x i = true) = ∀ i ∈ ↑l.Tail, SwapTrue o (↑x) i = true
⊢ ((if ∀ i ∈ ↑l.Tail, SwapTrue o (↑x) i = true then (e C (term I ho)) ⟨SwapTrue o ↑x, ⋯⟩ else 0) -
      if ∀ i ∈ ↑l.Tail, ↑x i = true then (e C (term I ho)) ⟨↑x, ⋯⟩ else 0) =
    if ∀ i ∈ ↑(Tail ⟨term I ho :: ↑l.Tail, hlc⟩), ↑x i = true then 1 else 0
state_after: case h
I : Type u
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
inst✝ : Inhabited I
l : Products I
hl : ↑l ≠ []
hlh : (↑l).head! = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑l.Tail)
x : ↑(C' C ho)
hi' : ∀ i ∈ ↑l.Tail, ↑x i = SwapTrue o (↑x) i
H : (∀ i ∈ ↑l.Tail, ↑x i = true) = ∀ i ∈ ↑l.Tail, SwapTrue o (↑x) i = true
⊢ ((if ∀ i ∈ ↑l.Tail, SwapTrue o (↑x) i = true then (e C (term I ho)) ⟨SwapTrue o ↑x, ⋯⟩ else 0) -
      if ∀ i ∈ ↑l.Tail, SwapTrue o (↑x) i = true then (e C (term I ho)) ⟨↑x, ⋯⟩ else 0) =
    if ∀ i ∈ ↑(Tail ⟨term I ho :: ↑l.Tail, hlc⟩), ↑x i = true then 1 else 0
tactic: simp only [H]
state_before: case h
I : Type u
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
inst✝ : Inhabited I
l : Products I
hl : ↑l ≠ []
hlh : (↑l).head! = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑l.Tail)
x : ↑(C' C ho)
hi' : ∀ i ∈ ↑l.Tail, ↑x i = SwapTrue o (↑x) i
H : (∀ i ∈ ↑l.Tail, ↑x i = true) = ∀ i ∈ ↑l.Tail, SwapTrue o (↑x) i = true
⊢ ((if ∀ i ∈ ↑l.Tail, SwapTrue o (↑x) i = true then (e C (term I ho)) ⟨SwapTrue o ↑x, ⋯⟩ else 0) -
      if ∀ i ∈ ↑l.Tail, SwapTrue o (↑x) i = true then (e C (term I ho)) ⟨↑x, ⋯⟩ else 0) =
    if ∀ i ∈ ↑(Tail ⟨term I ho :: ↑l.Tail, hlc⟩), ↑x i = true then 1 else 0
state_after: case pos
I : Type u
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
inst✝ : Inhabited I
l : Products I
hl : ↑l ≠ []
hlh : (↑l).head! = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑l.Tail)
x : ↑(C' C ho)
hi' : ∀ i ∈ ↑l.Tail, ↑x i = SwapTrue o (↑x) i
H : (∀ i ∈ ↑l.Tail, ↑x i = true) = ∀ i ∈ ↑l.Tail, SwapTrue o (↑x) i = true
h₁ : ∀ i ∈ ↑l.Tail, SwapTrue o (↑x) i = true
h₂ : ∀ i ∈ ↑(Tail ⟨term I ho :: ↑l.Tail, 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

case neg
I : Type u
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
inst✝ : Inhabited I
l : Products I
hl : ↑l ≠ []
hlh : (↑l).head! = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑l.Tail)
x : ↑(C' C ho)
hi' : ∀ i ∈ ↑l.Tail, ↑x i = SwapTrue o (↑x) i
H : (∀ i ∈ ↑l.Tail, ↑x i = true) = ∀ i ∈ ↑l.Tail, SwapTrue o (↑x) i = true
h₁ : ∀ i ∈ ↑l.Tail, SwapTrue o (↑x) i = true
h₂ : ¬∀ i ∈ ↑(Tail ⟨term I ho :: ↑l.Tail, 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) = 0

case pos
I : Type u
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
inst✝ : Inhabited I
l : Products I
hl : ↑l ≠ []
hlh : (↑l).head! = term I ho
hlc : List.Chain' (fun x x_1 => x > x_1) (term I ho :: ↑l.Tail)
x : ↑(C' C ho)
hi' : ∀ i ∈ ↑l.Tail, ↑x i = SwapTrue o (↑x) i
H : (∀ i ∈ ↑l.Tail, ↑x i = true) = ∀ i ∈ ↑l.Tail, SwapTrue o (↑x) i = true
h₁ : ¬∀ i ∈ ↑l.Tail, SwapTrue o (↑x) i = true
h₃ : ∀ i ∈ ↑(Tail ⟨term I ho :: ↑l.Tail, hlc⟩), ↑x i = true
⊢ 0 = 1
tactic: split_ifs with h₁ h₂ h₃ <;> try (dsimp [e])