Theorem: Profinite.NobelingProof.GoodProducts.union
File: Mathlib/Topology/Category/Profinite/Nobeling.lean

tactic: ext p
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}
ho : o.IsLimit
hsC : contained C o
⊢ range C = ⋃ e, smaller C ↑e
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}
ho : o.IsLimit
hsC : contained C o
p : LocallyConstant ↑C ℤ
⊢ p ∈ range C ↔ p ∈ ⋃ e, smaller C ↑e

tactic: simp only [smaller, range, Set.mem_iUnion, Set.mem_image, Set.mem_range, Subtype.exists]
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}
ho : o.IsLimit
hsC : contained C o
p : LocallyConstant ↑C ℤ
⊢ p ∈ range C ↔ p ∈ ⋃ e, smaller C ↑e
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}
ho : o.IsLimit
hsC : contained C o
p : LocallyConstant ↑C ℤ
⊢ (∃ a, ∃ (b : Products.isGood C a), eval C ⟨a, b⟩ = p) ↔
    ∃ a,
      ∃ (h : a < o),
        ∃ x,
          (∃ a_1,
              ∃ (h_1 : Products.isGood (π C fun x => ord I x < a) a_1), eval (π C fun x => ord I x < a) ⟨a_1, ⋯⟩ = x) ∧
            (πs C a) x = p

tactic: refine ⟨fun hp ↦ ?_, fun hp ↦ ?_⟩
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}
ho : o.IsLimit
hsC : contained C o
p : LocallyConstant ↑C ℤ
⊢ (∃ a, ∃ (b : Products.isGood C a), eval C ⟨a, b⟩ = p) ↔
    ∃ a,
      ∃ (h : a < o),
        ∃ x,
          (∃ a_1,
              ∃ (h_1 : Products.isGood (π C fun x => ord I x < a) a_1), eval (π C fun x => ord I x < a) ⟨a_1, ⋯⟩ = x) ∧
            (πs C a) x = p
state_after: case h.refine_1
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
ho : o.IsLimit
hsC : contained C o
p : LocallyConstant ↑C ℤ
hp : ∃ a, ∃ (b : Products.isGood C a), eval C ⟨a, b⟩ = p
⊢ ∃ a,
    ∃ (h : a < o),
      ∃ x,
        (∃ a_1,
            ∃ (h_1 : Products.isGood (π C fun x => ord I x < a) a_1), eval (π C fun x => ord I x < a) ⟨a_1, ⋯⟩ = x) ∧
          (πs C a) x = p

case h.refine_2
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
ho : o.IsLimit
hsC : contained C o
p : LocallyConstant ↑C ℤ
hp :
  ∃ a,
    ∃ (h : a < o),
      ∃ x,
        (∃ a_1,
            ∃ (h_1 : Products.isGood (π C fun x => ord I x < a) a_1), eval (π C fun x => ord I x < a) ⟨a_1, ⋯⟩ = x) ∧
          (πs C a) x = p
⊢ ∃ a, ∃ (b : Products.isGood C a), eval C ⟨a, b⟩ = p

tactic: obtain ⟨l, hl, rfl⟩ := hp
state_before: case h.refine_1
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
ho : o.IsLimit
hsC : contained C o
p : LocallyConstant ↑C ℤ
hp : ∃ a, ∃ (b : Products.isGood C a), eval C ⟨a, b⟩ = p
⊢ ∃ a,
    ∃ (h : a < o),
      ∃ x,
        (∃ a_1,
            ∃ (h_1 : Products.isGood (π C fun x => ord I x < a) a_1), eval (π C fun x => ord I x < a) ⟨a_1, ⋯⟩ = x) ∧
          (πs C a) x = p
state_after: case h.refine_1.intro.intro
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
ho : o.IsLimit
hsC : contained C o
l : Products I
hl : Products.isGood C l
⊢ ∃ a,
    ∃ (h : a < o),
      ∃ x,
        (∃ a_1,
            ∃ (h_1 : Products.isGood (π C fun x => ord I x < a) a_1), eval (π C fun x => ord I x < a) ⟨a_1, ⋯⟩ = x) ∧
          (πs C a) x = eval C ⟨l, hl⟩

tactic: rw [contained_eq_proj C o hsC, Products.limitOrdinal C ho] at hl
state_before: case h.refine_1.intro.intro
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
ho : o.IsLimit
hsC : contained C o
l : Products I
hl : Products.isGood C l
⊢ ∃ a,
    ∃ (h : a < o),
      ∃ x,
        (∃ a_1,
            ∃ (h_1 : Products.isGood (π C fun x => ord I x < a) a_1), eval (π C fun x => ord I x < a) ⟨a_1, ⋯⟩ = x) ∧
          (πs C a) x = eval C ⟨l, hl⟩
state_after: case h.refine_1.intro.intro
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
ho : o.IsLimit
hsC : contained C o
l : Products I
hl✝ : Products.isGood C l
hl : ∃ o' < o, Products.isGood (π C fun x => ord I x < o') l
⊢ ∃ a,
    ∃ (h : a < o),
      ∃ x,
        (∃ a_1,
            ∃ (h_1 : Products.isGood (π C fun x => ord I x < a) a_1), eval (π C fun x => ord I x < a) ⟨a_1, ⋯⟩ = x) ∧
          (πs C a) x = eval C ⟨l, hl✝⟩

tactic: obtain ⟨o', ho'⟩ := hl
state_before: case h.refine_1.intro.intro
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
ho : o.IsLimit
hsC : contained C o
l : Products I
hl✝ : Products.isGood C l
hl : ∃ o' < o, Products.isGood (π C fun x => ord I x < o') l
⊢ ∃ a,
    ∃ (h : a < o),
      ∃ x,
        (∃ a_1,
            ∃ (h_1 : Products.isGood (π C fun x => ord I x < a) a_1), eval (π C fun x => ord I x < a) ⟨a_1, ⋯⟩ = x) ∧
          (πs C a) x = eval C ⟨l, hl✝⟩
state_after: case h.refine_1.intro.intro.intro
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
ho : o.IsLimit
hsC : contained C o
l : Products I
hl : Products.isGood C l
o' : Ordinal.{u}
ho' : o' < o ∧ Products.isGood (π C fun x => ord I x < o') l
⊢ ∃ a,
    ∃ (h : a < o),
      ∃ x,
        (∃ a_1,
            ∃ (h_1 : Products.isGood (π C fun x => ord I x < a) a_1), eval (π C fun x => ord I x < a) ⟨a_1, ⋯⟩ = x) ∧
          (πs C a) x = eval C ⟨l, hl⟩

tactic: exact Products.eval_πs C (Products.prop_of_isGood  C _ ho'.2)
state_before: case h.refine_1.intro.intro.intro
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
ho : o.IsLimit
hsC : contained C o
l : Products I
hl : Products.isGood C l
o' : Ordinal.{u}
ho' : o' < o ∧ Products.isGood (π C fun x => ord I x < o') l
⊢ (πs C o') (eval (π C fun x => ord I x < o') ⟨l, ⋯⟩) = eval C ⟨l, hl⟩
state_after: no goals

tactic: obtain ⟨o', h, _, ⟨l, hl, rfl⟩, rfl⟩ := hp
state_before: case h.refine_2
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
ho : o.IsLimit
hsC : contained C o
p : LocallyConstant ↑C ℤ
hp :
  ∃ a,
    ∃ (h : a < o),
      ∃ x,
        (∃ a_1,
            ∃ (h_1 : Products.isGood (π C fun x => ord I x < a) a_1), eval (π C fun x => ord I x < a) ⟨a_1, ⋯⟩ = x) ∧
          (πs C a) x = p
⊢ ∃ a, ∃ (b : Products.isGood C a), eval C ⟨a, b⟩ = p
state_after: case h.refine_2.intro.intro.intro.intro.intro.intro
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
ho : o.IsLimit
hsC : contained C o
o' : Ordinal.{u}
h : o' < o
l : Products I
hl : Products.isGood (π C fun x => ord I x < o') l
⊢ ∃ a, ∃ (b : Products.isGood C a), eval C ⟨a, b⟩ = (πs C o') (eval (π C fun x => ord I x < o') ⟨l, ⋯⟩)

tactic: refine ⟨l, ?_, (Products.eval_πs C (Products.prop_of_isGood  C _ hl)).symm⟩
state_before: case h.refine_2.intro.intro.intro.intro.intro.intro
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
ho : o.IsLimit
hsC : contained C o
o' : Ordinal.{u}
h : o' < o
l : Products I
hl : Products.isGood (π C fun x => ord I x < o') l
⊢ ∃ a, ∃ (b : Products.isGood C a), eval C ⟨a, b⟩ = (πs C o') (eval (π C fun x => ord I x < o') ⟨l, ⋯⟩)
state_after: case h.refine_2.intro.intro.intro.intro.intro.intro
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
ho : o.IsLimit
hsC : contained C o
o' : Ordinal.{u}
h : o' < o
l : Products I
hl : Products.isGood (π C fun x => ord I x < o') l
⊢ Products.isGood C l

tactic: rw [contained_eq_proj C o hsC]
state_before: case h.refine_2.intro.intro.intro.intro.intro.intro
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
ho : o.IsLimit
hsC : contained C o
o' : Ordinal.{u}
h : o' < o
l : Products I
hl : Products.isGood (π C fun x => ord I x < o') l
⊢ Products.isGood C l
state_after: case h.refine_2.intro.intro.intro.intro.intro.intro
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
ho : o.IsLimit
hsC : contained C o
o' : Ordinal.{u}
h : o' < o
l : Products I
hl : Products.isGood (π C fun x => ord I x < o') l
⊢ Products.isGood (π C fun x => ord I x < o) l

tactic: exact Products.isGood_mono C (le_of_lt h) hl
state_before: case h.refine_2.intro.intro.intro.intro.intro.intro
I : Type u
inst✝¹ : LinearOrder I
inst✝ : IsWellOrder I fun x x_1 => x < x_1
C : Set (I → Bool)
o : Ordinal.{u}
ho : o.IsLimit
hsC : contained C o
o' : Ordinal.{u}
h : o' < o
l : Products I
hl : Products.isGood (π C fun x => ord I x < o') l
⊢ Products.isGood (π C fun x => ord I x < o) l
state_after: no goals