/-- Given two partial linear maps `f`, `g`, the set of points `x` such that
both `f` and `g` are defined at `x` and `f x = g x` form a submodule. -/
def eqLocus (f g : E →ₗ.[R] F) : Submodule R E where
  carrier := { x | ∃ (hf : x ∈ f.domain) (hg : x ∈ g.domain), f ⟨x, hf⟩ = g ⟨x, hg⟩ }
  zero_mem' := ⟨zero_mem _, zero_mem _, f.map_zero.trans g.map_zero.symm⟩
  add_mem' := fun {x y} ⟨hfx, hgx, hx⟩ ⟨hfy, hgy, hy⟩ =>
    ⟨add_mem hfx hfy, add_mem hgx hgy, by
      erw [f.map_add ⟨x, hfx⟩ ⟨y, hfy⟩, g.map_add ⟨x, hgx⟩ ⟨y, hgy⟩, hx, hy]⟩
  -- Porting note: `by rintro` is required, or error of a free variable happens.
  smul_mem' := by
    

Proof state:
R : Type u_1
inst✝⁶ : Ring R
E : Type u_2
inst✝⁵ : AddCommGroup E
inst✝⁴ : Module R E
F : Type u_3
inst✝³ : AddCommGroup F
inst✝² : Module R F
G : Type u_4
inst✝¹ : AddCommGroup G
inst✝ : Module R G
f g : E →ₗ.[R] F
⊢ ∀ (c : R) {x : E},
    x ∈
        {
              toAddSubsemigroup :=
                {
                  carrier :=
                    {x |
                      ∃ (hf : x ∈ f.domain) (hg : x ∈ g.domain),
                        ↑f { val := x, property := hf } = ↑g { val := x, property := hg }},
                  add_mem' :=
                    (_ :
                      ∀ {x y : E},
                        x ∈
                            {x |
                              ∃ (hf : x ∈ f.domain) (hg : x ∈ g.domain),
                                ↑f { val := x, property := hf } = ↑g { val := x, property := hg }} →
                          y ∈
                              {x |
                                ∃ (hf : x ∈ f.domain) (hg : x ∈ g.domain),
                                  ↑f { val := x, property := hf } = ↑g { val := x, property := hg }} →
                            x + y ∈
                              {x |
                                ∃ (hf : x ∈ f.domain) (hg : x ∈ g.domain),
                                  ↑f { val := x, property := hf } = ↑g { val := x, property := hg }}) },
              zero_mem' :=
                (_ :
                  ∃ (hf : 0 ∈ f.domain) (hg : 0 ∈ g.domain),
                    ↑f { val := 0, property := hf } = ↑g { val := 0, property := hg }) }.toAddSubsemigroup.carrier →
      c • x ∈
        {
              toAddSubsemigroup :=
                {
                  carrier :=
                    {x |
                      ∃ (hf : x ∈ f.domain) (hg : x ∈ g.domain),
                        ↑f { val := x, property := hf } = ↑g { val := x, property := hg }},
                  add_mem' :=
                    (_ :
                      ∀ {x y : E},
                        x ∈
                            {x |
                              ∃ (hf : x ∈ f.domain) (hg : x ∈ g.domain),
                                ↑f { val := x, property := hf } = ↑g { val := x, property := hg }} →
                          y ∈
                              {x |
                                ∃ (hf : x ∈ f.domain) (hg : x ∈ g.domain),
                                  ↑f { val := x, property := hf } = ↑g { val := x, property := hg }} →
                            x + y ∈
                              {x |
                                ∃ (hf : x ∈ f.domain) (hg : x ∈ g.domain),
                                  ↑f { val := x, property := hf } = ↑g { val := x, property := hg }}) },
              zero_mem' :=
                (_ :
                  ∃ (hf : 0 ∈ f.domain) (hg : 0 ∈ g.domain),
                    ↑f { val := 0, property := hf } = ↑g { val := 0, property := hg }) }.toAddSubsemigroup.carrier

Next tactic:
rintro c x ⟨hfx, hgx, hx⟩