-- Mathlib/Topology/Category/Profinite/Nobeling.lean
theorem eval_πs_image {l : Products I} {o : Ordinal}
    (hl : ∀ i ∈ l.val, ord I i < o) : eval C '' { m | m < l } =
    (πs C o) '' (eval (π C (ord I · < o)) '' { m | m < l })

Proof state:
case h.h
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
l : Products I
o : Ordinal.{u}
hl : ∀ i ∈ ↑l, ord I i < o
f : LocallyConstant ↑C ℤ
m : Products I
⊢ m < l ∧ eval C m = f ↔ m < l ∧ (πs C o) (eval (π C fun x => ord I x < o) m) = f

Tactic:
apply and_congr_right

Result:
case h.h.h
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
l : Products I
o : Ordinal.{u}
hl : ∀ i ∈ ↑l, ord I i < o
f : LocallyConstant ↑C ℤ
m : Products I
⊢ m < l → (eval C m = f ↔ (πs C o) (eval (π C fun x => ord I x < o) m) = f)

Proof state:
case h
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
l : Products I
o : Ordinal.{u}
hl : ∀ i ∈ ↑l, ord I i < o
f : LocallyConstant ↑C ℤ
⊢ f ∈ eval C '' {m | m < l} ↔ f ∈ ⇑(πs C o) '' (eval (π C fun x => ord I x < o) '' {m | m < l})

Tactic:
simp only [Set.mem_image, Set.mem_setOf_eq, exists_exists_and_eq_and]

Result:
case h
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
l : Products I
o : Ordinal.{u}
hl : ∀ i ∈ ↑l, ord I i < o
f : LocallyConstant ↑C ℤ
⊢ (∃ x < l, eval C x = f) ↔ ∃ a < l, (πs C o) (eval (π C fun x => ord I x < o) a) = f

Proof state:
case h.h.h
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
l : Products I
o : Ordinal.{u}
hl : ∀ i ∈ ↑l, ord I i < o
f : LocallyConstant ↑C ℤ
m : Products I
hm : m < l
⊢ eval C m = f ↔ (πs C o) (eval (π C fun x => ord I x < o) m) = f

Tactic:
rw [eval_πs C (lt_ord_of_lt hm hl)]

Result:
no goals

Proof state:
case h.h.h
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
l : Products I
o : Ordinal.{u}
hl : ∀ i ∈ ↑l, ord I i < o
f : LocallyConstant ↑C ℤ
m : Products I
⊢ m < l → (eval C m = f ↔ (πs C o) (eval (π C fun x => ord I x < o) m) = f)

Tactic:
intro hm

Result:
case h.h.h
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
l : Products I
o : Ordinal.{u}
hl : ∀ i ∈ ↑l, ord I i < o
f : LocallyConstant ↑C ℤ
m : Products I
hm : m < l
⊢ eval C m = f ↔ (πs C o) (eval (π C fun x => ord I x < o) m) = f

Proof state:
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
l : Products I
o : Ordinal.{u}
hl : ∀ i ∈ ↑l, ord I i < o
⊢ eval C '' {m | m < l} = ⇑(πs C o) '' (eval (π C fun x => ord I x < o) '' {m | m < l})

Tactic:
ext f

Result:
case h
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
l : Products I
o : Ordinal.{u}
hl : ∀ i ∈ ↑l, ord I i < o
f : LocallyConstant ↑C ℤ
⊢ f ∈ eval C '' {m | m < l} ↔ f ∈ ⇑(πs C o) '' (eval (π C fun x => ord I x < o) '' {m | m < l})

Proof state:
case h.h
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
l : Products I
o : Ordinal.{u}
hl : ∀ i ∈ ↑l, ord I i < o
f : LocallyConstant ↑C ℤ
⊢ ∀ (a : Products I), a < l ∧ eval C a = f ↔ a < l ∧ (πs C o) (eval (π C fun x => ord I x < o) a) = f

Tactic:
intro m

Result:
case h.h
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
l : Products I
o : Ordinal.{u}
hl : ∀ i ∈ ↑l, ord I i < o
f : LocallyConstant ↑C ℤ
m : Products I
⊢ m < l ∧ eval C m = f ↔ m < l ∧ (πs C o) (eval (π C fun x => ord I x < o) m) = f

Proof state:
case h
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
l : Products I
o : Ordinal.{u}
hl : ∀ i ∈ ↑l, ord I i < o
f : LocallyConstant ↑C ℤ
⊢ (∃ x < l, eval C x = f) ↔ ∃ a < l, (πs C o) (eval (π C fun x => ord I x < o) a) = f

Tactic:
apply exists_congr

Result:
case h.h
I : Type u
C : Set (I → Bool)
inst✝¹ : LinearOrder I
inst✝ : WellFoundedLT I
l : Products I
o : Ordinal.{u}
hl : ∀ i ∈ ↑l, ord I i < o
f : LocallyConstant ↑C ℤ
⊢ ∀ (a : Products I), a < l ∧ eval C a = f ↔ a < l ∧ (πs C o) (eval (π C fun x => ord I x < o) a) = f