/-- Embeddings from a sum type are equivalent to two separate embeddings with disjoint ranges. -/
def sumEmbeddingEquivProdEmbeddingDisjoint {α β γ : Type*} :
    (Sum α β ↪ γ) ≃ { f : (α ↪ γ) × (β ↪ γ) // Disjoint (Set.range f.1) (Set.range f.2) } where
  toFun f :=
    ⟨(inl.trans f, inr.trans f), by
      rw [Set.disjoint_left]
      rintro _ ⟨a, h⟩ ⟨b, rfl⟩
      simp only [trans_apply, inl_apply, inr_apply] at h
      have : Sum.inl a = Sum.inr b := f.injective h
      simp only at this⟩
  invFun := fun ⟨⟨f, g⟩, disj⟩ =>
    ⟨fun x =>
      match x with
      | Sum.inl a => f a
      | Sum.inr b => g b, by
      rintro (a₁ | b₁) (a₂ | b₂) f_eq <;>
        simp only [Equiv.coe_fn_symm_mk, Sum.elim_inl, Sum.elim_inr] at f_eq
      · rw [f.injective f_eq]
      · exfalso
        refine disj.le_bot ⟨⟨a₁, f_eq⟩, ⟨b₂, by simp [f_eq]⟩⟩
      · exfalso
        exact disj.le_bot ⟨⟨a₂, rfl⟩, ⟨b₁, f_eq⟩⟩
      · rw [g.injective f_eq]⟩
  left_inv f := by
    dsimp only
    ext x
    cases x <;> simp!
  right_inv := fun ⟨⟨f, g⟩, _⟩ => by
    simp only [Prod.mk.inj_iff]
    

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
x✝ : { f // Disjoint (Set.range ⇑f.1) (Set.range ⇑f.2) }
f : α ↪ γ
g : β ↪ γ
property✝ : Disjoint (Set.range ⇑(f, g).1) (Set.range ⇑(f, g).2)
⊢ {
      val :=
        (Function.Embedding.trans inl
            {
              toFun := fun x =>
                match x with
                | Sum.inl a => f a
                | Sum.inr b => g b,
              inj' :=
                (_ :
                  ∀ ⦃a₁ a₂ : α ⊕ β⦄,
                    (fun x =>
                            match x with
                            | Sum.inl a => f a
                            | Sum.inr b => g b)
                          a₁ =
                        (fun x =>
                            match x with
                            | Sum.inl a => f a
                            | Sum.inr b => g b)
                          a₂ →
                      a₁ = a₂) },
          Function.Embedding.trans inr
            {
              toFun := fun x =>
                match x with
                | Sum.inl a => f a
                | Sum.inr b => g b,
              inj' :=
                (_ :
                  ∀ ⦃a₁ a₂ : α ⊕ β⦄,
                    (fun x =>
                            match x with
                            | Sum.inl a => f a
                            | Sum.inr b => g b)
                          a₁ =
                        (fun x =>
                            match x with
                            | Sum.inl a => f a
                            | Sum.inr b => g b)
                          a₂ →
                      a₁ = a₂) }),
      property :=
        (_ :
          Disjoint
            (Set.range
              ⇑(Function.Embedding.trans inl
                      ((fun x =>
                          match x with
                          | { val := (f, g), property := disj } =>
                            {
                              toFun := fun x =>
                                match x with
                                | Sum.inl a => f a
                                | Sum.inr b => g b,
                              inj' :=
                                (_ :
                                  ∀ ⦃a₁ a₂ : α ⊕ β⦄,
                                    (fun x =>
                                            match x with
                                            | Sum.inl a => f a
                                            | Sum.inr b => g b)
                                          a₁ =
                                        (fun x =>
                                            match x with
                                            | Sum.inl a => f a
                                            | Sum.inr b => g b)
                                          a₂ →
                                      a₁ = a₂) })
                        { val := (f, g), property := property✝ }),
                    Function.Embedding.trans inr
                      ((fun x =>
                          match x with
                          | { val := (f, g), property := disj } =>
                            {
                              toFun := fun x =>
                                match x with
                                | Sum.inl a => f a
                                | Sum.inr b => g b,
                              inj' :=
                                (_ :
                                  ∀ ⦃a₁ a₂ : α ⊕ β⦄,
                                    (fun x =>
                                            match x with
                                            | Sum.inl a => f a
                                            | Sum.inr b => g b)
                                          a₁ =
                                        (fun x =>
                                            match x with
                                            | Sum.inl a => f a
                                            | Sum.inr b => g b)
                                          a₂ →
                                      a₁ = a₂) })
                        { val := (f, g), property := property✝ })).1)
            (Set.range
              ⇑(Function.Embedding.trans inl
                      ((fun x =>
                          match x with
                          | { val := (f, g), property := disj } =>
                            {
                              toFun := fun x =>
                                match x with
                                | Sum.inl a => f a
                                | Sum.inr b => g b,
                              inj' :=
                                (_ :
                                  ∀ ⦃a₁ a₂ : α ⊕ β⦄,
                                    (fun x =>
                                            match x with
                                            | Sum.inl a => f a
                                            | Sum.inr b => g b)
                                          a₁ =
                                        (fun x =>
                                            match x with
                                            | Sum.inl a => f a
                                            | Sum.inr b => g b)
                                          a₂ →
                                      a₁ = a₂) })
                        { val := (f, g), property := property✝ }),
                    Function.Embedding.trans inr
                      ((fun x =>
                          match x with
                          | { val := (f, g), property := disj } =>
                            {
                              toFun := fun x =>
                                match x with
                                | Sum.inl a => f a
                                | Sum.inr b => g b,
                              inj' :=
                                (_ :
                                  ∀ ⦃a₁ a₂ : α ⊕ β⦄,
                                    (fun x =>
                                            match x with
                                            | Sum.inl a => f a
                                            | Sum.inr b => g b)
                                          a₁ =
                                        (fun x =>
                                            match x with
                                            | Sum.inl a => f a
                                            | Sum.inr b => g b)
                                          a₂ →
                                      a₁ = a₂) })
                        { val := (f, g), property := property✝ })).2)) } =
    { val := (f, g), property := property✝ }

Next tactic:
constructor