l3lab/ntp-mathlib huggingface dataset:
/-- `iUnionLift_binary` is useful for proving that `iUnionLift` is a homomorphism
  of algebraic structures when defined on the Union of algebraic subobjects.
  For example, it could be used to prove that the lift of a collection
  of group homomorphisms on a union of subgroups preserves `*`. -/
theorem iUnionLift_binary (dir : Directed (· ≤ ·) S) (op : T → T → T) (opi : ∀ i, S i → S i → S i)
    (hopi :
      ∀ i x y,
        Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) (opi i x y) =
          op (Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) x)
            (Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) y))
    (opβ : β → β → β) (h : ∀ (i) (x y : S i), f i (opi i x y) = opβ (f i x) (f i y)) (x y : T) :
    iUnionLift S f hf T (le_of_eq hT') (op x y) =
      opβ (iUnionLift S f hf T (le_of_eq hT') x) (iUnionLift S f hf T (le_of_eq hT') y) := by
  subst hT'
  cases' Set.mem_iUnion.1 x.prop with i hi
  cases' Set.mem_iUnion.1 y.prop with j hj
  rcases dir i j with ⟨k, hik, hjk⟩
  

Proof state:
case intro.intro.intro.intro
α : Type u_1
ι : Sort u_2
β : Sort u_3
S : ι → Set α
f : (i : ι) → ↑(S i) → β
hf :
  ∀ (i j : ι) (x : α) (hxi : x ∈ S i) (hxj : x ∈ S j),
    f i { val := x, property := hxi } = f j { val := x, property := hxj }
dir : Directed (fun x x_1 => x ≤ x_1) S
opi : (i : ι) → ↑(S i) → ↑(S i) → ↑(S i)
opβ : β → β → β
h : ∀ (i : ι) (x y : ↑(S i)), f i (opi i x y) = opβ (f i x) (f i y)
hT : iUnion S ⊆ iUnion S
op : ↑(iUnion S) → ↑(iUnion S) → ↑(iUnion S)
hopi :
  ∀ (i : ι) (x y : ↑(S i)),
    inclusion (_ : S i ⊆ iUnion S) (opi i x y) =
      op (inclusion (_ : S i ⊆ iUnion S) x) (inclusion (_ : S i ⊆ iUnion S) y)
x y : ↑(iUnion S)
i : ι
hi : ↑x ∈ S i
j : ι
hj : ↑y ∈ S j
k : ι
hik : S i ≤ S k
hjk : S j ≤ S k
⊢ iUnionLift S f hf (iUnion S) (_ : iUnion S ≤ iUnion S) (op x y) =
    opβ (iUnionLift S f hf (iUnion S) (_ : iUnion S ≤ iUnion S) x)
      (iUnionLift S f hf (iUnion S) (_ : iUnion S ≤ iUnion S) y)

Next tactic:
rw [iUnionLift_of_mem x (hik hi), iUnionLift_of_mem y (hjk hj), ← h k]
/-- `iUnionLift_binary` is useful for proving that `iUnionLift` is a homomorphism
  of algebraic structures when defined on the Union of algebraic subobjects.
  For example, it could be used to prove that the lift of a collection
  of group homomorphisms on a union of subgroups preserves `*`. -/
theorem iUnionLift_binary (dir : Directed (· ≤ ·) S) (op : T → T → T) (opi : ∀ i, S i → S i → S i)
    (hopi :
      ∀ i x y,
        Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) (opi i x y) =
          op (Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) x)
            (Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) y))
    (opβ : β → β → β) (h : ∀ (i) (x y : S i), f i (opi i x y) = opβ (f i x) (f i y)) (x y : T) :
    iUnionLift S f hf T (le_of_eq hT') (op x y) =
      opβ (iUnionLift S f hf T (le_of_eq hT') x) (iUnionLift S f hf T (le_of_eq hT') y) := by
  subst hT'
  cases' Set.mem_iUnion.1 x.prop with i hi
  cases' Set.mem_iUnion.1 y.prop with j hj
  rcases dir i j with ⟨k, hik, hjk⟩
  rw [iUnionLift_of_mem x (hik hi), iUnionLift_of_mem y (hjk hj), ← h k]
  

Proof state:
case intro.intro.intro.intro
α : Type u_1
ι : Sort u_2
β : Sort u_3
S : ι → Set α
f : (i : ι) → ↑(S i) → β
hf :
  ∀ (i j : ι) (x : α) (hxi : x ∈ S i) (hxj : x ∈ S j),
    f i { val := x, property := hxi } = f j { val := x, property := hxj }
dir : Directed (fun x x_1 => x ≤ x_1) S
opi : (i : ι) → ↑(S i) → ↑(S i) → ↑(S i)
opβ : β → β → β
h : ∀ (i : ι) (x y : ↑(S i)), f i (opi i x y) = opβ (f i x) (f i y)
hT : iUnion S ⊆ iUnion S
op : ↑(iUnion S) → ↑(iUnion S) → ↑(iUnion S)
hopi :
  ∀ (i : ι) (x y : ↑(S i)),
    inclusion (_ : S i ⊆ iUnion S) (opi i x y) =
      op (inclusion (_ : S i ⊆ iUnion S) x) (inclusion (_ : S i ⊆ iUnion S) y)
x y : ↑(iUnion S)
i : ι
hi : ↑x ∈ S i
j : ι
hj : ↑y ∈ S j
k : ι
hik : S i ≤ S k
hjk : S j ≤ S k
⊢ iUnionLift S f hf (iUnion S) (_ : iUnion S ≤ iUnion S) (op x y) =
    f k (opi k { val := ↑x, property := (_ : ↑x ∈ S k) } { val := ↑y, property := (_ : ↑y ∈ S k) })

Next tactic:
have hx : x = Set.inclusion (Set.subset_iUnion S k) ⟨x, hik hi⟩ := by
    cases x
    rfl
/-- `iUnionLift_binary` is useful for proving that `iUnionLift` is a homomorphism
  of algebraic structures when defined on the Union of algebraic subobjects.
  For example, it could be used to prove that the lift of a collection
  of group homomorphisms on a union of subgroups preserves `*`. -/
theorem iUnionLift_binary (dir : Directed (· ≤ ·) S) (op : T → T → T) (opi : ∀ i, S i → S i → S i)
    (hopi :
      ∀ i x y,
        Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) (opi i x y) =
          op (Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) x)
            (Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) y))
    (opβ : β → β → β) (h : ∀ (i) (x y : S i), f i (opi i x y) = opβ (f i x) (f i y)) (x y : T) :
    iUnionLift S f hf T (le_of_eq hT') (op x y) =
      opβ (iUnionLift S f hf T (le_of_eq hT') x) (iUnionLift S f hf T (le_of_eq hT') y) := by
  subst hT'
  cases' Set.mem_iUnion.1 x.prop with i hi
  cases' Set.mem_iUnion.1 y.prop with j hj
  rcases dir i j with ⟨k, hik, hjk⟩
  rw [iUnionLift_of_mem x (hik hi), iUnionLift_of_mem y (hjk hj), ← h k]
  have hx : x = Set.inclusion (Set.subset_iUnion S k) ⟨x, hik hi⟩ := by
    

Proof state:
α : Type u_1
ι : Sort u_2
β : Sort u_3
S : ι → Set α
f : (i : ι) → ↑(S i) → β
hf :
  ∀ (i j : ι) (x : α) (hxi : x ∈ S i) (hxj : x ∈ S j),
    f i { val := x, property := hxi } = f j { val := x, property := hxj }
dir : Directed (fun x x_1 => x ≤ x_1) S
opi : (i : ι) → ↑(S i) → ↑(S i) → ↑(S i)
opβ : β → β → β
h : ∀ (i : ι) (x y : ↑(S i)), f i (opi i x y) = opβ (f i x) (f i y)
hT : iUnion S ⊆ iUnion S
op : ↑(iUnion S) → ↑(iUnion S) → ↑(iUnion S)
hopi :
  ∀ (i : ι) (x y : ↑(S i)),
    inclusion (_ : S i ⊆ iUnion S) (opi i x y) =
      op (inclusion (_ : S i ⊆ iUnion S) x) (inclusion (_ : S i ⊆ iUnion S) y)
x y : ↑(iUnion S)
i : ι
hi : ↑x ∈ S i
j : ι
hj : ↑y ∈ S j
k : ι
hik : S i ≤ S k
hjk : S j ≤ S k
⊢ x = inclusion (_ : S k ⊆ ⋃ i, S i) { val := ↑x, property := (_ : ↑x ∈ S k) }

Next tactic:
cases x
/-- `iUnionLift_binary` is useful for proving that `iUnionLift` is a homomorphism
  of algebraic structures when defined on the Union of algebraic subobjects.
  For example, it could be used to prove that the lift of a collection
  of group homomorphisms on a union of subgroups preserves `*`. -/
theorem iUnionLift_binary (dir : Directed (· ≤ ·) S) (op : T → T → T) (opi : ∀ i, S i → S i → S i)
    (hopi :
      ∀ i x y,
        Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) (opi i x y) =
          op (Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) x)
            (Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) y))
    (opβ : β → β → β) (h : ∀ (i) (x y : S i), f i (opi i x y) = opβ (f i x) (f i y)) (x y : T) :
    iUnionLift S f hf T (le_of_eq hT') (op x y) =
      opβ (iUnionLift S f hf T (le_of_eq hT') x) (iUnionLift S f hf T (le_of_eq hT') y) := by
  subst hT'
  cases' Set.mem_iUnion.1 x.prop with i hi
  cases' Set.mem_iUnion.1 y.prop with j hj
  rcases dir i j with ⟨k, hik, hjk⟩
  rw [iUnionLift_of_mem x (hik hi), iUnionLift_of_mem y (hjk hj), ← h k]
  have hx : x = Set.inclusion (Set.subset_iUnion S k) ⟨x, hik hi⟩ := by
    cases x
    

Proof state:
case mk
α : Type u_1
ι : Sort u_2
β : Sort u_3
S : ι → Set α
f : (i : ι) → ↑(S i) → β
hf :
  ∀ (i j : ι) (x : α) (hxi : x ∈ S i) (hxj : x ∈ S j),
    f i { val := x, property := hxi } = f j { val := x, property := hxj }
dir : Directed (fun x x_1 => x ≤ x_1) S
opi : (i : ι) → ↑(S i) → ↑(S i) → ↑(S i)
opβ : β → β → β
h : ∀ (i : ι) (x y : ↑(S i)), f i (opi i x y) = opβ (f i x) (f i y)
hT : iUnion S ⊆ iUnion S
op : ↑(iUnion S) → ↑(iUnion S) → ↑(iUnion S)
hopi :
  ∀ (i : ι) (x y : ↑(S i)),
    inclusion (_ : S i ⊆ iUnion S) (opi i x y) =
      op (inclusion (_ : S i ⊆ iUnion S) x) (inclusion (_ : S i ⊆ iUnion S) y)
y : ↑(iUnion S)
i j : ι
hj : ↑y ∈ S j
k : ι
hik : S i ≤ S k
hjk : S j ≤ S k
val✝ : α
property✝ : val✝ ∈ iUnion S
hi : ↑{ val := val✝, property := property✝ } ∈ S i
⊢ { val := val✝, property := property✝ } =
    inclusion (_ : S k ⊆ ⋃ i, S i)
      { val := ↑{ val := val✝, property := property✝ },
        property := (_ : ↑{ val := val✝, property := property✝ } ∈ S k) }

Next tactic:
rfl
/-- `iUnionLift_binary` is useful for proving that `iUnionLift` is a homomorphism
  of algebraic structures when defined on the Union of algebraic subobjects.
  For example, it could be used to prove that the lift of a collection
  of group homomorphisms on a union of subgroups preserves `*`. -/
theorem iUnionLift_binary (dir : Directed (· ≤ ·) S) (op : T → T → T) (opi : ∀ i, S i → S i → S i)
    (hopi :
      ∀ i x y,
        Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) (opi i x y) =
          op (Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) x)
            (Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) y))
    (opβ : β → β → β) (h : ∀ (i) (x y : S i), f i (opi i x y) = opβ (f i x) (f i y)) (x y : T) :
    iUnionLift S f hf T (le_of_eq hT') (op x y) =
      opβ (iUnionLift S f hf T (le_of_eq hT') x) (iUnionLift S f hf T (le_of_eq hT') y) := by
  subst hT'
  cases' Set.mem_iUnion.1 x.prop with i hi
  cases' Set.mem_iUnion.1 y.prop with j hj
  rcases dir i j with ⟨k, hik, hjk⟩
  rw [iUnionLift_of_mem x (hik hi), iUnionLift_of_mem y (hjk hj), ← h k]
  have hx : x = Set.inclusion (Set.subset_iUnion S k) ⟨x, hik hi⟩ := by
    cases x
    rfl
  

Proof state:
case intro.intro.intro.intro
α : Type u_1
ι : Sort u_2
β : Sort u_3
S : ι → Set α
f : (i : ι) → ↑(S i) → β
hf :
  ∀ (i j : ι) (x : α) (hxi : x ∈ S i) (hxj : x ∈ S j),
    f i { val := x, property := hxi } = f j { val := x, property := hxj }
dir : Directed (fun x x_1 => x ≤ x_1) S
opi : (i : ι) → ↑(S i) → ↑(S i) → ↑(S i)
opβ : β → β → β
h : ∀ (i : ι) (x y : ↑(S i)), f i (opi i x y) = opβ (f i x) (f i y)
hT : iUnion S ⊆ iUnion S
op : ↑(iUnion S) → ↑(iUnion S) → ↑(iUnion S)
hopi :
  ∀ (i : ι) (x y : ↑(S i)),
    inclusion (_ : S i ⊆ iUnion S) (opi i x y) =
      op (inclusion (_ : S i ⊆ iUnion S) x) (inclusion (_ : S i ⊆ iUnion S) y)
x y : ↑(iUnion S)
i : ι
hi : ↑x ∈ S i
j : ι
hj : ↑y ∈ S j
k : ι
hik : S i ≤ S k
hjk : S j ≤ S k
hx : x = inclusion (_ : S k ⊆ ⋃ i, S i) { val := ↑x, property := (_ : ↑x ∈ S k) }
⊢ iUnionLift S f hf (iUnion S) (_ : iUnion S ≤ iUnion S) (op x y) =
    f k (opi k { val := ↑x, property := (_ : ↑x ∈ S k) } { val := ↑y, property := (_ : ↑y ∈ S k) })

Next tactic:
have hy : y = Set.inclusion (Set.subset_iUnion S k) ⟨y, hjk hj⟩ := by
    cases y
    rfl
/-- `iUnionLift_binary` is useful for proving that `iUnionLift` is a homomorphism
  of algebraic structures when defined on the Union of algebraic subobjects.
  For example, it could be used to prove that the lift of a collection
  of group homomorphisms on a union of subgroups preserves `*`. -/
theorem iUnionLift_binary (dir : Directed (· ≤ ·) S) (op : T → T → T) (opi : ∀ i, S i → S i → S i)
    (hopi :
      ∀ i x y,
        Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) (opi i x y) =
          op (Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) x)
            (Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) y))
    (opβ : β → β → β) (h : ∀ (i) (x y : S i), f i (opi i x y) = opβ (f i x) (f i y)) (x y : T) :
    iUnionLift S f hf T (le_of_eq hT') (op x y) =
      opβ (iUnionLift S f hf T (le_of_eq hT') x) (iUnionLift S f hf T (le_of_eq hT') y) := by
  subst hT'
  cases' Set.mem_iUnion.1 x.prop with i hi
  cases' Set.mem_iUnion.1 y.prop with j hj
  rcases dir i j with ⟨k, hik, hjk⟩
  rw [iUnionLift_of_mem x (hik hi), iUnionLift_of_mem y (hjk hj), ← h k]
  have hx : x = Set.inclusion (Set.subset_iUnion S k) ⟨x, hik hi⟩ := by
    cases x
    rfl
  have hy : y = Set.inclusion (Set.subset_iUnion S k) ⟨y, hjk hj⟩ := by
    

Proof state:
α : Type u_1
ι : Sort u_2
β : Sort u_3
S : ι → Set α
f : (i : ι) → ↑(S i) → β
hf :
  ∀ (i j : ι) (x : α) (hxi : x ∈ S i) (hxj : x ∈ S j),
    f i { val := x, property := hxi } = f j { val := x, property := hxj }
dir : Directed (fun x x_1 => x ≤ x_1) S
opi : (i : ι) → ↑(S i) → ↑(S i) → ↑(S i)
opβ : β → β → β
h : ∀ (i : ι) (x y : ↑(S i)), f i (opi i x y) = opβ (f i x) (f i y)
hT : iUnion S ⊆ iUnion S
op : ↑(iUnion S) → ↑(iUnion S) → ↑(iUnion S)
hopi :
  ∀ (i : ι) (x y : ↑(S i)),
    inclusion (_ : S i ⊆ iUnion S) (opi i x y) =
      op (inclusion (_ : S i ⊆ iUnion S) x) (inclusion (_ : S i ⊆ iUnion S) y)
x y : ↑(iUnion S)
i : ι
hi : ↑x ∈ S i
j : ι
hj : ↑y ∈ S j
k : ι
hik : S i ≤ S k
hjk : S j ≤ S k
hx : x = inclusion (_ : S k ⊆ ⋃ i, S i) { val := ↑x, property := (_ : ↑x ∈ S k) }
⊢ y = inclusion (_ : S k ⊆ ⋃ i, S i) { val := ↑y, property := (_ : ↑y ∈ S k) }

Next tactic:
cases y
/-- `iUnionLift_binary` is useful for proving that `iUnionLift` is a homomorphism
  of algebraic structures when defined on the Union of algebraic subobjects.
  For example, it could be used to prove that the lift of a collection
  of group homomorphisms on a union of subgroups preserves `*`. -/
theorem iUnionLift_binary (dir : Directed (· ≤ ·) S) (op : T → T → T) (opi : ∀ i, S i → S i → S i)
    (hopi :
      ∀ i x y,
        Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) (opi i x y) =
          op (Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) x)
            (Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) y))
    (opβ : β → β → β) (h : ∀ (i) (x y : S i), f i (opi i x y) = opβ (f i x) (f i y)) (x y : T) :
    iUnionLift S f hf T (le_of_eq hT') (op x y) =
      opβ (iUnionLift S f hf T (le_of_eq hT') x) (iUnionLift S f hf T (le_of_eq hT') y) := by
  subst hT'
  cases' Set.mem_iUnion.1 x.prop with i hi
  cases' Set.mem_iUnion.1 y.prop with j hj
  rcases dir i j with ⟨k, hik, hjk⟩
  rw [iUnionLift_of_mem x (hik hi), iUnionLift_of_mem y (hjk hj), ← h k]
  have hx : x = Set.inclusion (Set.subset_iUnion S k) ⟨x, hik hi⟩ := by
    cases x
    rfl
  have hy : y = Set.inclusion (Set.subset_iUnion S k) ⟨y, hjk hj⟩ := by
    cases y
    

Proof state:
case mk
α : Type u_1
ι : Sort u_2
β : Sort u_3
S : ι → Set α
f : (i : ι) → ↑(S i) → β
hf :
  ∀ (i j : ι) (x : α) (hxi : x ∈ S i) (hxj : x ∈ S j),
    f i { val := x, property := hxi } = f j { val := x, property := hxj }
dir : Directed (fun x x_1 => x ≤ x_1) S
opi : (i : ι) → ↑(S i) → ↑(S i) → ↑(S i)
opβ : β → β → β
h : ∀ (i : ι) (x y : ↑(S i)), f i (opi i x y) = opβ (f i x) (f i y)
hT : iUnion S ⊆ iUnion S
op : ↑(iUnion S) → ↑(iUnion S) → ↑(iUnion S)
hopi :
  ∀ (i : ι) (x y : ↑(S i)),
    inclusion (_ : S i ⊆ iUnion S) (opi i x y) =
      op (inclusion (_ : S i ⊆ iUnion S) x) (inclusion (_ : S i ⊆ iUnion S) y)
x : ↑(iUnion S)
i : ι
hi : ↑x ∈ S i
j k : ι
hik : S i ≤ S k
hjk : S j ≤ S k
hx : x = inclusion (_ : S k ⊆ ⋃ i, S i) { val := ↑x, property := (_ : ↑x ∈ S k) }
val✝ : α
property✝ : val✝ ∈ iUnion S
hj : ↑{ val := val✝, property := property✝ } ∈ S j
⊢ { val := val✝, property := property✝ } =
    inclusion (_ : S k ⊆ ⋃ i, S i)
      { val := ↑{ val := val✝, property := property✝ },
        property := (_ : ↑{ val := val✝, property := property✝ } ∈ S k) }

Next tactic:
rfl
/-- `iUnionLift_binary` is useful for proving that `iUnionLift` is a homomorphism
  of algebraic structures when defined on the Union of algebraic subobjects.
  For example, it could be used to prove that the lift of a collection
  of group homomorphisms on a union of subgroups preserves `*`. -/
theorem iUnionLift_binary (dir : Directed (· ≤ ·) S) (op : T → T → T) (opi : ∀ i, S i → S i → S i)
    (hopi :
      ∀ i x y,
        Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) (opi i x y) =
          op (Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) x)
            (Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) y))
    (opβ : β → β → β) (h : ∀ (i) (x y : S i), f i (opi i x y) = opβ (f i x) (f i y)) (x y : T) :
    iUnionLift S f hf T (le_of_eq hT') (op x y) =
      opβ (iUnionLift S f hf T (le_of_eq hT') x) (iUnionLift S f hf T (le_of_eq hT') y) := by
  subst hT'
  cases' Set.mem_iUnion.1 x.prop with i hi
  cases' Set.mem_iUnion.1 y.prop with j hj
  rcases dir i j with ⟨k, hik, hjk⟩
  rw [iUnionLift_of_mem x (hik hi), iUnionLift_of_mem y (hjk hj), ← h k]
  have hx : x = Set.inclusion (Set.subset_iUnion S k) ⟨x, hik hi⟩ := by
    cases x
    rfl
  have hy : y = Set.inclusion (Set.subset_iUnion S k) ⟨y, hjk hj⟩ := by
    cases y
    rfl
  

Proof state:
case intro.intro.intro.intro
α : Type u_1
ι : Sort u_2
β : Sort u_3
S : ι → Set α
f : (i : ι) → ↑(S i) → β
hf :
  ∀ (i j : ι) (x : α) (hxi : x ∈ S i) (hxj : x ∈ S j),
    f i { val := x, property := hxi } = f j { val := x, property := hxj }
dir : Directed (fun x x_1 => x ≤ x_1) S
opi : (i : ι) → ↑(S i) → ↑(S i) → ↑(S i)
opβ : β → β → β
h : ∀ (i : ι) (x y : ↑(S i)), f i (opi i x y) = opβ (f i x) (f i y)
hT : iUnion S ⊆ iUnion S
op : ↑(iUnion S) → ↑(iUnion S) → ↑(iUnion S)
hopi :
  ∀ (i : ι) (x y : ↑(S i)),
    inclusion (_ : S i ⊆ iUnion S) (opi i x y) =
      op (inclusion (_ : S i ⊆ iUnion S) x) (inclusion (_ : S i ⊆ iUnion S) y)
x y : ↑(iUnion S)
i : ι
hi : ↑x ∈ S i
j : ι
hj : ↑y ∈ S j
k : ι
hik : S i ≤ S k
hjk : S j ≤ S k
hx : x = inclusion (_ : S k ⊆ ⋃ i, S i) { val := ↑x, property := (_ : ↑x ∈ S k) }
hy : y = inclusion (_ : S k ⊆ ⋃ i, S i) { val := ↑y, property := (_ : ↑y ∈ S k) }
⊢ iUnionLift S f hf (iUnion S) (_ : iUnion S ≤ iUnion S) (op x y) =
    f k (opi k { val := ↑x, property := (_ : ↑x ∈ S k) } { val := ↑y, property := (_ : ↑y ∈ S k) })

Next tactic:
have hxy : (Set.inclusion (Set.subset_iUnion S k) (opi k ⟨x, hik hi⟩ ⟨y, hjk hj⟩) : α) ∈ S k :=
    (opi k ⟨x, hik hi⟩ ⟨y, hjk hj⟩).prop
/-- `iUnionLift_binary` is useful for proving that `iUnionLift` is a homomorphism
  of algebraic structures when defined on the Union of algebraic subobjects.
  For example, it could be used to prove that the lift of a collection
  of group homomorphisms on a union of subgroups preserves `*`. -/
theorem iUnionLift_binary (dir : Directed (· ≤ ·) S) (op : T → T → T) (opi : ∀ i, S i → S i → S i)
    (hopi :
      ∀ i x y,
        Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) (opi i x y) =
          op (Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) x)
            (Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) y))
    (opβ : β → β → β) (h : ∀ (i) (x y : S i), f i (opi i x y) = opβ (f i x) (f i y)) (x y : T) :
    iUnionLift S f hf T (le_of_eq hT') (op x y) =
      opβ (iUnionLift S f hf T (le_of_eq hT') x) (iUnionLift S f hf T (le_of_eq hT') y) := by
  subst hT'
  cases' Set.mem_iUnion.1 x.prop with i hi
  cases' Set.mem_iUnion.1 y.prop with j hj
  rcases dir i j with ⟨k, hik, hjk⟩
  rw [iUnionLift_of_mem x (hik hi), iUnionLift_of_mem y (hjk hj), ← h k]
  have hx : x = Set.inclusion (Set.subset_iUnion S k) ⟨x, hik hi⟩ := by
    cases x
    rfl
  have hy : y = Set.inclusion (Set.subset_iUnion S k) ⟨y, hjk hj⟩ := by
    cases y
    rfl
  have hxy : (Set.inclusion (Set.subset_iUnion S k) (opi k ⟨x, hik hi⟩ ⟨y, hjk hj⟩) : α) ∈ S k :=
    (opi k ⟨x, hik hi⟩ ⟨y, hjk hj⟩).prop
  

Proof state:
case intro.intro.intro.intro
α : Type u_1
ι : Sort u_2
β : Sort u_3
S : ι → Set α
f : (i : ι) → ↑(S i) → β
hf :
  ∀ (i j : ι) (x : α) (hxi : x ∈ S i) (hxj : x ∈ S j),
    f i { val := x, property := hxi } = f j { val := x, property := hxj }
dir : Directed (fun x x_1 => x ≤ x_1) S
opi : (i : ι) → ↑(S i) → ↑(S i) → ↑(S i)
opβ : β → β → β
h : ∀ (i : ι) (x y : ↑(S i)), f i (opi i x y) = opβ (f i x) (f i y)
hT : iUnion S ⊆ iUnion S
op : ↑(iUnion S) → ↑(iUnion S) → ↑(iUnion S)
hopi :
  ∀ (i : ι) (x y : ↑(S i)),
    inclusion (_ : S i ⊆ iUnion S) (opi i x y) =
      op (inclusion (_ : S i ⊆ iUnion S) x) (inclusion (_ : S i ⊆ iUnion S) y)
x y : ↑(iUnion S)
i : ι
hi : ↑x ∈ S i
j : ι
hj : ↑y ∈ S j
k : ι
hik : S i ≤ S k
hjk : S j ≤ S k
hx : x = inclusion (_ : S k ⊆ ⋃ i, S i) { val := ↑x, property := (_ : ↑x ∈ S k) }
hy : y = inclusion (_ : S k ⊆ ⋃ i, S i) { val := ↑y, property := (_ : ↑y ∈ S k) }
hxy :
  ↑(inclusion (_ : S k ⊆ ⋃ i, S i)
        (opi k { val := ↑x, property := (_ : ↑x ∈ S k) } { val := ↑y, property := (_ : ↑y ∈ S k) })) ∈
    S k
⊢ iUnionLift S f hf (iUnion S) (_ : iUnion S ≤ iUnion S) (op x y) =
    f k (opi k { val := ↑x, property := (_ : ↑x ∈ S k) } { val := ↑y, property := (_ : ↑y ∈ S k) })

Next tactic:
conv_lhs => rw [hx, hy, ← hopi, iUnionLift_of_mem _ hxy]
/-- `iUnionLift_binary` is useful for proving that `iUnionLift` is a homomorphism
  of algebraic structures when defined on the Union of algebraic subobjects.
  For example, it could be used to prove that the lift of a collection
  of group homomorphisms on a union of subgroups preserves `*`. -/
theorem iUnionLift_binary (dir : Directed (· ≤ ·) S) (op : T → T → T) (opi : ∀ i, S i → S i → S i)
    (hopi :
      ∀ i x y,
        Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) (opi i x y) =
          op (Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) x)
            (Set.inclusion (show S i ⊆ T from hT'.symm ▸ Set.subset_iUnion S i) y))
    (opβ : β → β → β) (h : ∀ (i) (x y : S i), f i (opi i x y) = opβ (f i x) (f i y)) (x y : T) :
    iUnionLift S f hf T (le_of_eq hT') (op x y) =
      opβ (iUnionLift S f hf T (le_of_eq hT') x) (iUnionLift S f hf T (le_of_eq hT') y) := by
  subst hT'
  cases' Set.mem_iUnion.1 x.prop with i hi
  cases' Set.mem_iUnion.1 y.prop with j hj
  rcases dir i j with ⟨k, hik, hjk⟩
  rw [iUnionLift_of_mem x (hik hi), iUnionLift_of_mem y (hjk hj), ← h k]
  have hx : x = Set.inclusion (Set.subset_iUnion S k) ⟨x, hik hi⟩ := by
    cases x
    rfl
  have hy : y = Set.inclusion (Set.subset_iUnion S k) ⟨y, hjk hj⟩ := by
    cases y
    rfl
  have hxy : (Set.inclusion (Set.subset_iUnion S k) (opi k ⟨x, hik hi⟩ ⟨y, hjk hj⟩) : α) ∈ S k :=
    (opi k ⟨x, hik hi⟩ ⟨y, hjk hj⟩).prop
  conv_lhs => 

Proof state:
α : Type u_1
ι : Sort u_2
β : Sort u_3
S : ι → Set α
f : (i : ι) → ↑(S i) → β
hf :
  ∀ (i j : ι) (x : α) (hxi : x ∈ S i) (hxj : x ∈ S j),
    f i { val := x, property := hxi } = f j { val := x, property := hxj }
dir : Directed (fun x x_1 => x ≤ x_1) S
opi : (i : ι) → ↑(S i) → ↑(S i) → ↑(S i)
opβ : β → β → β
h : ∀ (i : ι) (x y : ↑(S i)), f i (opi i x y) = opβ (f i x) (f i y)
hT : iUnion S ⊆ iUnion S
op : ↑(iUnion S) → ↑(iUnion S) → ↑(iUnion S)
hopi :
  ∀ (i : ι) (x y : ↑(S i)),
    inclusion (_ : S i ⊆ iUnion S) (opi i x y) =
      op (inclusion (_ : S i ⊆ iUnion S) x) (inclusion (_ : S i ⊆ iUnion S) y)
x y : ↑(iUnion S)
i : ι
hi : ↑x ∈ S i
j : ι
hj : ↑y ∈ S j
k : ι
hik : S i ≤ S k
hjk : S j ≤ S k
hx : x = inclusion (_ : S k ⊆ ⋃ i, S i) { val := ↑x, property := (_ : ↑x ∈ S k) }
hy : y = inclusion (_ : S k ⊆ ⋃ i, S i) { val := ↑y, property := (_ : ↑y ∈ S k) }
hxy :
  ↑(inclusion (_ : S k ⊆ ⋃ i, S i)
        (opi k { val := ↑x, property := (_ : ↑x ∈ S k) } { val := ↑y, property := (_ : ↑y ∈ S k) })) ∈
    S k
| iUnionLift S f hf (iUnion S) (_ : iUnion S ≤ iUnion S) (op x y)

Next tactic:
rw [hx, hy, ← hopi, iUnionLift_of_mem _ hxy]
theorem preimage_liftCover (t : Set β) : liftCover S f hf hS ⁻¹' t = ⋃ i, (↑) '' (f i ⁻¹' t) := by
  

Proof state:
α : Type u_1
ι : Sort u_3
β : Type u_2
S : ι → Set α
f : (i : ι) → ↑(S i) → β
hf :
  ∀ (i j : ι) (x : α) (hxi : x ∈ S i) (hxj : x ∈ S j),
    f i { val := x, property := hxi } = f j { val := x, property := hxj }
hS : iUnion S = univ
t : Set β
⊢ liftCover S f hf hS ⁻¹' t = ⋃ i, Subtype.val '' (f i ⁻¹' t)

Next tactic:
change (iUnionLift S f hf univ hS.symm.subset ∘ fun a => ⟨a, mem_univ a⟩) ⁻¹' t = _