-- Mathlib/Topology/Category/Profinite/Nobeling.lean
theorem maxTail_isGood (l : MaxProducts C ho)
    (h₁ : ⊤ ≤ Submodule.span ℤ (Set.range (eval (π C (ord I · < o))))) :
    l.val.Tail.isGood (C' C ho)

Proof state:
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
o : Ordinal.{u}
hC : IsClosed C
hsC : contained C (Order.succ o)
ho : o < Ordinal.type fun x1 x2 => x1 < x2
l : ↑(MaxProducts C ho)
h₁ : ⊤ ≤ Submodule.span ℤ (Set.range (eval (π C fun x => ord I x < o)))
⊢ Products.isGood (C' C ho) (↑l).Tail

Tactic:
have : Inhabited I := ⟨term I ho⟩

Result:
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
o : Ordinal.{u}
hC : IsClosed C
hsC : contained C (Order.succ o)
ho : o < Ordinal.type fun x1 x2 => x1 < x2
l : ↑(MaxProducts C ho)
h₁ : ⊤ ≤ Submodule.span ℤ (Set.range (eval (π C fun x => ord I x < o)))
this : Inhabited I
⊢ Products.isGood (C' C ho) (↑l).Tail

Proof state:
case intro.intro.intro
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
o : Ordinal.{u}
hC : IsClosed C
hsC : contained C (Order.succ o)
ho : o < Ordinal.type fun x1 x2 => x1 < x2
l : ↑(MaxProducts C ho)
h₁ : ⊤ ≤ Submodule.span ℤ (Set.range (eval (π C fun x => ord I x < o)))
this : Inhabited I
m : Products I →₀ ℤ
hmmem : m ∈ Finsupp.supported ℤ ℤ {m | m < (↑l).Tail}
hmsum : (m.sum fun i a => a • Products.eval (C' C ho) i) = (Linear_CC' C hsC ho) (Products.eval C ↑l)
hse : LinearMap.range (πs C o) = LinearMap.ker (Linear_CC' C hsC ho)
n : LocallyConstant ↑(π C fun x => ord I x < o) ℤ
hn : ((πs C o) n + m.sum fun i a => a • (List.map (e C) (term I ho :: ↑i)).prod) = Products.eval C ↑l
hn' : ∃ c, (c.sum fun i a => a • eval (π C fun x => ord I x < o) i) = n
⊢ False

Tactic:
obtain ⟨w,hc⟩ := hn'

Result:
case intro.intro.intro.intro
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
o : Ordinal.{u}
hC : IsClosed C
hsC : contained C (Order.succ o)
ho : o < Ordinal.type fun x1 x2 => x1 < x2
l : ↑(MaxProducts C ho)
h₁ : ⊤ ≤ Submodule.span ℤ (Set.range (eval (π C fun x => ord I x < o)))
this : Inhabited I
m : Products I →₀ ℤ
hmmem : m ∈ Finsupp.supported ℤ ℤ {m | m < (↑l).Tail}
hmsum : (m.sum fun i a => a • Products.eval (C' C ho) i) = (Linear_CC' C hsC ho) (Products.eval C ↑l)
hse : LinearMap.range (πs C o) = LinearMap.ker (Linear_CC' C hsC ho)
n : LocallyConstant ↑(π C fun x => ord I x < o) ℤ
hn : ((πs C o) n + m.sum fun i a => a • (List.map (e C) (term I ho :: ↑i)).prod) = Products.eval C ↑l
w : { l // Products.isGood (π C fun x => ord I x < o) l } →₀ ℤ
hc : (w.sum fun i a => a • eval (π C fun x => ord I x < o) i) = n
⊢ False

Proof state:
case intro.intro.intro.intro
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
o : Ordinal.{u}
hC : IsClosed C
hsC : contained C (Order.succ o)
ho : o < Ordinal.type fun x1 x2 => x1 < x2
l : ↑(MaxProducts C ho)
h₁ : ⊤ ≤ Submodule.span ℤ (Set.range (eval (π C fun x => ord I x < o)))
this : Inhabited I
m : Products I →₀ ℤ
hmmem : m ∈ Finsupp.supported ℤ ℤ {m | m < (↑l).Tail}
hmsum : (m.sum fun i a => a • Products.eval (C' C ho) i) = (Linear_CC' C hsC ho) (Products.eval C ↑l)
hse : LinearMap.range (πs C o) = LinearMap.ker (Linear_CC' C hsC ho)
n : LocallyConstant ↑(π C fun x => ord I x < o) ℤ
w : { l // Products.isGood (π C fun x => ord I x < o) l } →₀ ℤ
hn :
  ((w.sum fun a b => (πs C o) (b • eval (π C fun x => ord I x < o) a)) +
      m.sum fun i a => a • (List.map (e C) (term I ho :: ↑i)).prod) =
    Products.eval C ↑l
hc : (w.sum fun i a => a • eval (π C fun x => ord I x < o) i) = n
⊢ False

Tactic:
apply l.prop.1

Result:
case intro.intro.intro.intro
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
o : Ordinal.{u}
hC : IsClosed C
hsC : contained C (Order.succ o)
ho : o < Ordinal.type fun x1 x2 => x1 < x2
l : ↑(MaxProducts C ho)
h₁ : ⊤ ≤ Submodule.span ℤ (Set.range (eval (π C fun x => ord I x < o)))
this : Inhabited I
m : Products I →₀ ℤ
hmmem : m ∈ Finsupp.supported ℤ ℤ {m | m < (↑l).Tail}
hmsum : (m.sum fun i a => a • Products.eval (C' C ho) i) = (Linear_CC' C hsC ho) (Products.eval C ↑l)
hse : LinearMap.range (πs C o) = LinearMap.ker (Linear_CC' C hsC ho)
n : LocallyConstant ↑(π C fun x => ord I x < o) ℤ
w : { l // Products.isGood (π C fun x => ord I x < o) l } →₀ ℤ
hn :
  ((w.sum fun a b => (πs C o) (b • eval (π C fun x => ord I x < o) a)) +
      m.sum fun i a => a • (List.map (e C) (term I ho :: ↑i)).prod) =
    Products.eval C ↑l
hc : (w.sum fun i a => a • eval (π C fun x => ord I x < o) i) = n
⊢ Products.eval C ↑l ∈ Submodule.span ℤ (Products.eval C '' {m | m < ↑l})

Proof state:
case intro.intro.intro.intro.h₂.h.h.a
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
o : Ordinal.{u}
hC : IsClosed C
hsC : contained C (Order.succ o)
ho : o < Ordinal.type fun x1 x2 => x1 < x2
l : ↑(MaxProducts C ho)
h₁ : ⊤ ≤ Submodule.span ℤ (Set.range (eval (π C fun x => ord I x < o)))
this : Inhabited I
m : Products I →₀ ℤ
hmmem : ↑m.support ⊆ {m | m < (↑l).Tail}
hmsum : (m.sum fun i a => a • Products.eval (C' C ho) i) = (Linear_CC' C hsC ho) (Products.eval C ↑l)
hse : LinearMap.range (πs C o) = LinearMap.ker (Linear_CC' C hsC ho)
n : LocallyConstant ↑(π C fun x => ord I x < o) ℤ
w : { l // Products.isGood (π C fun x => ord I x < o) l } →₀ ℤ
hn :
  ((w.sum fun a b => (πs C o) (b • eval (π C fun x => ord I x < o) a)) +
      m.sum fun i a => a • (List.map (e C) (term I ho :: ↑i)).prod) =
    Products.eval C ↑l
hc : (w.sum fun i a => a • eval (π C fun x => ord I x < o) i) = n
q : Products I
hq : q ∈ m.support
⊢ List.Lex (fun x1 x2 => x1 < x2) (term I ho :: ↑q) ↑↑l

Tactic:
rw [max_eq_o_cons_tail C hsC ho l]

Result:
case intro.intro.intro.intro.h₂.h.h.a
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
o : Ordinal.{u}
hC : IsClosed C
hsC : contained C (Order.succ o)
ho : o < Ordinal.type fun x1 x2 => x1 < x2
l : ↑(MaxProducts C ho)
h₁ : ⊤ ≤ Submodule.span ℤ (Set.range (eval (π C fun x => ord I x < o)))
this : Inhabited I
m : Products I →₀ ℤ
hmmem : ↑m.support ⊆ {m | m < (↑l).Tail}
hmsum : (m.sum fun i a => a • Products.eval (C' C ho) i) = (Linear_CC' C hsC ho) (Products.eval C ↑l)
hse : LinearMap.range (πs C o) = LinearMap.ker (Linear_CC' C hsC ho)
n : LocallyConstant ↑(π C fun x => ord I x < o) ℤ
w : { l // Products.isGood (π C fun x => ord I x < o) l } →₀ ℤ
hn :
  ((w.sum fun a b => (πs C o) (b • eval (π C fun x => ord I x < o) a)) +
      m.sum fun i a => a • (List.map (e C) (term I ho :: ↑i)).prod) =
    Products.eval C ↑l
hc : (w.sum fun i a => a • eval (π C fun x => ord I x < o) i) = n
q : Products I
hq : q ∈ m.support
⊢ List.Lex (fun x1 x2 => x1 < x2) (term I ho :: ↑q) (term I ho :: ↑(↑l).Tail)

Proof state:
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
o : Ordinal.{u}
hC : IsClosed C
hsC : contained C (Order.succ o)
ho : o < Ordinal.type fun x1 x2 => x1 < x2
l : ↑(MaxProducts C ho)
h₁ : ⊤ ≤ Submodule.span ℤ (Set.range (eval (π C fun x => ord I x < o)))
this : Inhabited I
⊢ Products.isGood (C' C ho) (↑l).Tail

Tactic:
intro h

Result:
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
o : Ordinal.{u}
hC : IsClosed C
hsC : contained C (Order.succ o)
ho : o < Ordinal.type fun x1 x2 => x1 < x2
l : ↑(MaxProducts C ho)
h₁ : ⊤ ≤ Submodule.span ℤ (Set.range (eval (π C fun x => ord I x < o)))
this : Inhabited I
h : Products.eval (C' C ho) (↑l).Tail ∈ Submodule.span ℤ (Products.eval (C' C ho) '' {m | m < (↑l).Tail})
⊢ False