l3lab/ntp-mathlib huggingface dataset:
/-- If the arguments are linearly dependent then the result is `0`. -/
theorem map_linearDependent {K : Type*} [Ring K] {M : Type*} [AddCommGroup M] [Module K M]
    {N : Type*} [AddCommGroup N] [Module K N] [NoZeroSMulDivisors K N] (f : M [Λ^ι]→ₗ[K] N)
    (v : ι → M) (h : ¬LinearIndependent K v) : f v = 0 := by
  obtain ⟨s, g, h, i, hi, hz⟩ := not_linearIndependent_iff.mp h
  letI := Classical.decEq ι
  suffices f (update v i (g i • v i)) = 0 by
    rw [f.map_smul, Function.update_eq_self, smul_eq_zero] at this
    exact Or.resolve_left this hz
  -- Porting note: Was `conv at h in .. => ..`.
  rw [← (funext fun x => ite_self (c := i = x) (d := Classical.decEq ι i x) (g x • v x))] at h
  rw [Finset.sum_ite, Finset.filter_eq, Finset.filter_ne, if_pos hi, Finset.sum_singleton,
    add_eq_zero_iff_eq_neg] at h
  rw [h, f.map_neg, f.map_update_sum, neg_eq_zero]; apply Finset.sum_eq_zero
  intro j hj
  

Proof state:
case intro.intro.intro.intro.intro.h
R : Type u_1
inst✝²⁰ : Semiring R
M✝ : Type u_2
inst✝¹⁹ : AddCommMonoid M✝
inst✝¹⁸ : Module R M✝
N✝ : Type u_3
inst✝¹⁷ : AddCommMonoid N✝
inst✝¹⁶ : Module R N✝
P : Type u_4
inst✝¹⁵ : AddCommMonoid P
inst✝¹⁴ : Module R P
M' : Type u_5
inst✝¹³ : AddCommGroup M'
inst✝¹² : Module R M'
N' : Type u_6
inst✝¹¹ : AddCommGroup N'
inst✝¹⁰ : Module R N'
ι : Type u_7
ι' : Type u_8
ι'' : Type u_9
M₂ : Type u_10
inst✝⁹ : AddCommMonoid M₂
inst✝⁸ : Module R M₂
M₃ : Type u_11
inst✝⁷ : AddCommMonoid M₃
inst✝⁶ : Module R M₃
f✝ f' : M✝ [Λ^ι]→ₗ[R] N✝
g✝ g₂ : M✝ [Λ^ι]→ₗ[R] N'
g' : M' [Λ^ι]→ₗ[R] N'
v✝ : ι → M✝
v' : ι → M'
K : Type u_12
inst✝⁵ : Ring K
M : Type u_13
inst✝⁴ : AddCommGroup M
inst✝³ : Module K M
N : Type u_14
inst✝² : AddCommGroup N
inst✝¹ : Module K N
inst✝ : NoZeroSMulDivisors K N
f : M [Λ^ι]→ₗ[K] N
v : ι → M
h✝ : ¬LinearIndependent K v
s : Finset ι
g : ι → K
i : ι
hi : i ∈ s
hz : g i ≠ 0
this : DecidableEq ι := Classical.decEq ι
h : g i • v i = -Finset.sum (Finset.erase s i) fun x => g x • v x
j : ι
hj : j ∈ Finset.erase s i
⊢ f (update v i (g j • v j)) = 0

Next tactic:
obtain ⟨hij, _⟩ := Finset.mem_erase.mp hj
/-- If the arguments are linearly dependent then the result is `0`. -/
theorem map_linearDependent {K : Type*} [Ring K] {M : Type*} [AddCommGroup M] [Module K M]
    {N : Type*} [AddCommGroup N] [Module K N] [NoZeroSMulDivisors K N] (f : M [Λ^ι]→ₗ[K] N)
    (v : ι → M) (h : ¬LinearIndependent K v) : f v = 0 := by
  obtain ⟨s, g, h, i, hi, hz⟩ := not_linearIndependent_iff.mp h
  letI := Classical.decEq ι
  suffices f (update v i (g i • v i)) = 0 by
    rw [f.map_smul, Function.update_eq_self, smul_eq_zero] at this
    exact Or.resolve_left this hz
  -- Porting note: Was `conv at h in .. => ..`.
  rw [← (funext fun x => ite_self (c := i = x) (d := Classical.decEq ι i x) (g x • v x))] at h
  rw [Finset.sum_ite, Finset.filter_eq, Finset.filter_ne, if_pos hi, Finset.sum_singleton,
    add_eq_zero_iff_eq_neg] at h
  rw [h, f.map_neg, f.map_update_sum, neg_eq_zero]; apply Finset.sum_eq_zero
  intro j hj
  obtain ⟨hij, _⟩ := Finset.mem_erase.mp hj
  

Proof state:
case intro.intro.intro.intro.intro.h.intro
R : Type u_1
inst✝²⁰ : Semiring R
M✝ : Type u_2
inst✝¹⁹ : AddCommMonoid M✝
inst✝¹⁸ : Module R M✝
N✝ : Type u_3
inst✝¹⁷ : AddCommMonoid N✝
inst✝¹⁶ : Module R N✝
P : Type u_4
inst✝¹⁵ : AddCommMonoid P
inst✝¹⁴ : Module R P
M' : Type u_5
inst✝¹³ : AddCommGroup M'
inst✝¹² : Module R M'
N' : Type u_6
inst✝¹¹ : AddCommGroup N'
inst✝¹⁰ : Module R N'
ι : Type u_7
ι' : Type u_8
ι'' : Type u_9
M₂ : Type u_10
inst✝⁹ : AddCommMonoid M₂
inst✝⁸ : Module R M₂
M₃ : Type u_11
inst✝⁷ : AddCommMonoid M₃
inst✝⁶ : Module R M₃
f✝ f' : M✝ [Λ^ι]→ₗ[R] N✝
g✝ g₂ : M✝ [Λ^ι]→ₗ[R] N'
g' : M' [Λ^ι]→ₗ[R] N'
v✝ : ι → M✝
v' : ι → M'
K : Type u_12
inst✝⁵ : Ring K
M : Type u_13
inst✝⁴ : AddCommGroup M
inst✝³ : Module K M
N : Type u_14
inst✝² : AddCommGroup N
inst✝¹ : Module K N
inst✝ : NoZeroSMulDivisors K N
f : M [Λ^ι]→ₗ[K] N
v : ι → M
h✝ : ¬LinearIndependent K v
s : Finset ι
g : ι → K
i : ι
hi : i ∈ s
hz : g i ≠ 0
this : DecidableEq ι := Classical.decEq ι
h : g i • v i = -Finset.sum (Finset.erase s i) fun x => g x • v x
j : ι
hj : j ∈ Finset.erase s i
hij : j ≠ i
right✝ : j ∈ s
⊢ f (update v i (g j • v j)) = 0

Next tactic:
rw [f.map_smul, f.map_update_self _ hij.symm, smul_zero]
private theorem alternization_map_eq_zero_of_eq_aux (m : MultilinearMap R (fun _ : ι => M) N')
    (v : ι → M) (i j : ι) (i_ne_j : i ≠ j) (hv : v i = v j) :
    (∑ σ : Perm ι, Equiv.Perm.sign σ • m.domDomCongr σ) v = 0 := by
  

Proof state:
R : Type u_1
inst✝¹² : Semiring R
M : Type u_2
inst✝¹¹ : AddCommMonoid M
inst✝¹⁰ : Module R M
N : Type u_3
inst✝⁹ : AddCommMonoid N
inst✝⁸ : Module R N
P : Type u_4
inst✝⁷ : AddCommMonoid P
inst✝⁶ : Module R P
M' : Type u_5
inst✝⁵ : AddCommGroup M'
inst✝⁴ : Module R M'
N' : Type u_6
inst✝³ : AddCommGroup N'
inst✝² : Module R N'
ι : Type u_7
ι' : Type u_8
ι'' : Type u_9
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
m : MultilinearMap R (fun x => M) N'
v : ι → M
i j : ι
i_ne_j : i ≠ j
hv : v i = v j
⊢ (∑ σ : Perm ι, Perm.sign σ • domDomCongr σ m) v = 0

Next tactic:
rw [sum_apply]
private theorem alternization_map_eq_zero_of_eq_aux (m : MultilinearMap R (fun _ : ι => M) N')
    (v : ι → M) (i j : ι) (i_ne_j : i ≠ j) (hv : v i = v j) :
    (∑ σ : Perm ι, Equiv.Perm.sign σ • m.domDomCongr σ) v = 0 := by
  rw [sum_apply]
  

Proof state:
R : Type u_1
inst✝¹² : Semiring R
M : Type u_2
inst✝¹¹ : AddCommMonoid M
inst✝¹⁰ : Module R M
N : Type u_3
inst✝⁹ : AddCommMonoid N
inst✝⁸ : Module R N
P : Type u_4
inst✝⁷ : AddCommMonoid P
inst✝⁶ : Module R P
M' : Type u_5
inst✝⁵ : AddCommGroup M'
inst✝⁴ : Module R M'
N' : Type u_6
inst✝³ : AddCommGroup N'
inst✝² : Module R N'
ι : Type u_7
ι' : Type u_8
ι'' : Type u_9
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
m : MultilinearMap R (fun x => M) N'
v : ι → M
i j : ι
i_ne_j : i ≠ j
hv : v i = v j
⊢ ∑ a : Perm ι, (Perm.sign a • domDomCongr a m) v = 0

Next tactic:
exact
    Finset.sum_involution (fun σ _ => swap i j * σ)
      -- Porting note: `-Equiv.Perm.sign_swap'` is required.
      (fun σ _ => by simp [Perm.sign_swap i_ne_j, apply_swap_eq_self hv, -Equiv.Perm.sign_swap'])
      (fun σ _ _ => (not_congr swap_mul_eq_iff).mpr i_ne_j) (fun σ _ => Finset.mem_univ _)
      fun σ _ => swap_mul_involutive i j σ
private theorem alternization_map_eq_zero_of_eq_aux (m : MultilinearMap R (fun _ : ι => M) N')
    (v : ι → M) (i j : ι) (i_ne_j : i ≠ j) (hv : v i = v j) :
    (∑ σ : Perm ι, Equiv.Perm.sign σ • m.domDomCongr σ) v = 0 := by
  rw [sum_apply]
  exact
    Finset.sum_involution (fun σ _ => swap i j * σ)
      -- Porting note: `-Equiv.Perm.sign_swap'` is required.
      (fun σ _ => by 

Proof state:
R : Type u_1
inst✝¹² : Semiring R
M : Type u_2
inst✝¹¹ : AddCommMonoid M
inst✝¹⁰ : Module R M
N : Type u_3
inst✝⁹ : AddCommMonoid N
inst✝⁸ : Module R N
P : Type u_4
inst✝⁷ : AddCommMonoid P
inst✝⁶ : Module R P
M' : Type u_5
inst✝⁵ : AddCommGroup M'
inst✝⁴ : Module R M'
N' : Type u_6
inst✝³ : AddCommGroup N'
inst✝² : Module R N'
ι : Type u_7
ι' : Type u_8
ι'' : Type u_9
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
m : MultilinearMap R (fun x => M) N'
v : ι → M
i j : ι
i_ne_j : i ≠ j
hv : v i = v j
σ : Perm ι
x✝ : σ ∈ Finset.univ
⊢ (Perm.sign σ • domDomCongr σ m) v +
      (Perm.sign ((fun σ x => swap i j * σ) σ x✝) • domDomCongr ((fun σ x => swap i j * σ) σ x✝) m) v =
    0

Next tactic:
simp [Perm.sign_swap i_ne_j, apply_swap_eq_self hv, -Equiv.Perm.sign_swap']
/-- Produce an `AlternatingMap` out of a `MultilinearMap`, by summing over all argument
permutations. -/
def alternatization : MultilinearMap R (fun _ : ι => M) N' →+ M [Λ^ι]→ₗ[R] N' where
  toFun m :=
    { ∑ σ : Perm ι, Equiv.Perm.sign σ • m.domDomCongr σ with
      toFun := ⇑(∑ σ : Perm ι, Equiv.Perm.sign σ • m.domDomCongr σ)
      map_eq_zero_of_eq' := fun v i j hvij hij =>
        alternization_map_eq_zero_of_eq_aux m v i j hij hvij }
  map_add' a b := by
    ext
    simp only [mk_coe, AlternatingMap.coe_mk, sum_apply, smul_apply, domDomCongr_apply, add_apply,
      smul_add, Finset.sum_add_distrib, AlternatingMap.add_apply]
  map_zero' := by
    

Proof state:
R : Type u_1
inst✝¹² : Semiring R
M : Type u_2
inst✝¹¹ : AddCommMonoid M
inst✝¹⁰ : Module R M
N : Type u_3
inst✝⁹ : AddCommMonoid N
inst✝⁸ : Module R N
P : Type u_4
inst✝⁷ : AddCommMonoid P
inst✝⁶ : Module R P
M' : Type u_5
inst✝⁵ : AddCommGroup M'
inst✝⁴ : Module R M'
N' : Type u_6
inst✝³ : AddCommGroup N'
inst✝² : Module R N'
ι : Type u_7
ι' : Type u_8
ι'' : Type u_9
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
⊢ (fun m =>
        let src := ∑ σ : Perm ι, Perm.sign σ • domDomCongr σ m;
        {
          toMultilinearMap :=
            { toFun := ⇑(∑ σ : Perm ι, Perm.sign σ • domDomCongr σ m),
              map_add' :=
                (_ :
                  ∀ [inst : DecidableEq ι] (m : ι → M) (i : ι) (x y : M),
                    toFun src (Function.update m i (x + y)) =
                      toFun src (Function.update m i x) + toFun src (Function.update m i y)),
              map_smul' :=
                (_ :
                  ∀ [inst : DecidableEq ι] (m : ι → M) (i : ι) (c : R) (x : M),
                    toFun src (Function.update m i (c • x)) = c • toFun src (Function.update m i x)) },
          map_eq_zero_of_eq' :=
            (_ : ∀ (v : ι → M) (i j : ι), v i = v j → i ≠ j → (∑ σ : Perm ι, Perm.sign σ • domDomCongr σ m) v = 0) })
      0 =
    0

Next tactic:
ext
/-- Produce an `AlternatingMap` out of a `MultilinearMap`, by summing over all argument
permutations. -/
def alternatization : MultilinearMap R (fun _ : ι => M) N' →+ M [Λ^ι]→ₗ[R] N' where
  toFun m :=
    { ∑ σ : Perm ι, Equiv.Perm.sign σ • m.domDomCongr σ with
      toFun := ⇑(∑ σ : Perm ι, Equiv.Perm.sign σ • m.domDomCongr σ)
      map_eq_zero_of_eq' := fun v i j hvij hij =>
        alternization_map_eq_zero_of_eq_aux m v i j hij hvij }
  map_add' a b := by
    ext
    simp only [mk_coe, AlternatingMap.coe_mk, sum_apply, smul_apply, domDomCongr_apply, add_apply,
      smul_add, Finset.sum_add_distrib, AlternatingMap.add_apply]
  map_zero' := by
    ext
    

Proof state:
case H
R : Type u_1
inst✝¹² : Semiring R
M : Type u_2
inst✝¹¹ : AddCommMonoid M
inst✝¹⁰ : Module R M
N : Type u_3
inst✝⁹ : AddCommMonoid N
inst✝⁸ : Module R N
P : Type u_4
inst✝⁷ : AddCommMonoid P
inst✝⁶ : Module R P
M' : Type u_5
inst✝⁵ : AddCommGroup M'
inst✝⁴ : Module R M'
N' : Type u_6
inst✝³ : AddCommGroup N'
inst✝² : Module R N'
ι : Type u_7
ι' : Type u_8
ι'' : Type u_9
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
x✝ : ι → M
⊢ ((fun m =>
          let src := ∑ σ : Perm ι, Perm.sign σ • domDomCongr σ m;
          {
            toMultilinearMap :=
              { toFun := ⇑(∑ σ : Perm ι, Perm.sign σ • domDomCongr σ m),
                map_add' :=
                  (_ :
                    ∀ [inst : DecidableEq ι] (m : ι → M) (i : ι) (x y : M),
                      toFun src (Function.update m i (x + y)) =
                        toFun src (Function.update m i x) + toFun src (Function.update m i y)),
                map_smul' :=
                  (_ :
                    ∀ [inst : DecidableEq ι] (m : ι → M) (i : ι) (c : R) (x : M),
                      toFun src (Function.update m i (c • x)) = c • toFun src (Function.update m i x)) },
            map_eq_zero_of_eq' :=
              (_ : ∀ (v : ι → M) (i j : ι), v i = v j → i ≠ j → (∑ σ : Perm ι, Perm.sign σ • domDomCongr σ m) v = 0) })
        0)
      x✝ =
    0 x✝

Next tactic:
simp only [mk_coe, AlternatingMap.coe_mk, sum_apply, smul_apply, domDomCongr_apply,
      zero_apply, smul_zero, Finset.sum_const_zero, AlternatingMap.zero_apply]
theorem alternatization_apply (m : MultilinearMap R (fun _ : ι => M) N') (v : ι → M) :
    alternatization m v = ∑ σ : Perm ι, Equiv.Perm.sign σ • m.domDomCongr σ v := by
  

Proof state:
R : Type u_1
inst✝¹² : Semiring R
M : Type u_2
inst✝¹¹ : AddCommMonoid M
inst✝¹⁰ : Module R M
N : Type u_3
inst✝⁹ : AddCommMonoid N
inst✝⁸ : Module R N
P : Type u_4
inst✝⁷ : AddCommMonoid P
inst✝⁶ : Module R P
M' : Type u_5
inst✝⁵ : AddCommGroup M'
inst✝⁴ : Module R M'
N' : Type u_6
inst✝³ : AddCommGroup N'
inst✝² : Module R N'
ι : Type u_7
ι' : Type u_8
ι'' : Type u_9
inst✝¹ : Fintype ι
inst✝ : DecidableEq ι
m : MultilinearMap R (fun x => M) N'
v : ι → M
⊢ (alternatization m) v = ∑ σ : Perm ι, Perm.sign σ • (domDomCongr σ m) v

Next tactic:
simp only [alternatization_def, smul_apply, sum_apply]
/-- Alternatizing a multilinear map that is already alternating results in a scale factor of `n!`,
where `n` is the number of inputs. -/
theorem coe_alternatization [DecidableEq ι] [Fintype ι] (a : M [Λ^ι]→ₗ[R] N') :
    MultilinearMap.alternatization (a : MultilinearMap R (fun _ => M) N')
    = Nat.factorial (Fintype.card ι) • a := by
  

Proof state:
R : Type u_1
inst✝¹² : Semiring R
M : Type u_2
inst✝¹¹ : AddCommMonoid M
inst✝¹⁰ : Module R M
N : Type u_3
inst✝⁹ : AddCommMonoid N
inst✝⁸ : Module R N
P : Type u_4
inst✝⁷ : AddCommMonoid P
inst✝⁶ : Module R P
M' : Type u_5
inst✝⁵ : AddCommGroup M'
inst✝⁴ : Module R M'
N' : Type u_6
inst✝³ : AddCommGroup N'
inst✝² : Module R N'
ι : Type u_7
ι' : Type u_8
ι'' : Type u_9
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
a : M [Λ^ι]→ₗ[R] N'
⊢ MultilinearMap.alternatization ↑a = Nat.factorial (Fintype.card ι) • a

Next tactic:
apply AlternatingMap.coe_injective
/-- Alternatizing a multilinear map that is already alternating results in a scale factor of `n!`,
where `n` is the number of inputs. -/
theorem coe_alternatization [DecidableEq ι] [Fintype ι] (a : M [Λ^ι]→ₗ[R] N') :
    MultilinearMap.alternatization (a : MultilinearMap R (fun _ => M) N')
    = Nat.factorial (Fintype.card ι) • a := by
  apply AlternatingMap.coe_injective
  

Proof state:
case a
R : Type u_1
inst✝¹² : Semiring R
M : Type u_2
inst✝¹¹ : AddCommMonoid M
inst✝¹⁰ : Module R M
N : Type u_3
inst✝⁹ : AddCommMonoid N
inst✝⁸ : Module R N
P : Type u_4
inst✝⁷ : AddCommMonoid P
inst✝⁶ : Module R P
M' : Type u_5
inst✝⁵ : AddCommGroup M'
inst✝⁴ : Module R M'
N' : Type u_6
inst✝³ : AddCommGroup N'
inst✝² : Module R N'
ι : Type u_7
ι' : Type u_8
ι'' : Type u_9
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
a : M [Λ^ι]→ₗ[R] N'
⊢ ⇑(MultilinearMap.alternatization ↑a) = ⇑(Nat.factorial (Fintype.card ι) • a)

Next tactic:
simp_rw [MultilinearMap.alternatization_def, ← coe_domDomCongr, domDomCongr_perm, coe_smul,
    smul_smul, Int.units_mul_self, one_smul, Finset.sum_const, Finset.card_univ, Fintype.card_perm,
    ← coe_multilinearMap, coe_smul]
/-- Composition with a linear map before and after alternatization are equivalent. -/
theorem compMultilinearMap_alternatization (g : N' →ₗ[R] N'₂)
    (f : MultilinearMap R (fun _ : ι => M) N') :
    MultilinearMap.alternatization (g.compMultilinearMap f)
      = g.compAlternatingMap (MultilinearMap.alternatization f) := by
  

Proof state:
R : Type u_1
inst✝¹⁴ : Semiring R
M : Type u_2
inst✝¹³ : AddCommMonoid M
inst✝¹² : Module R M
N : Type u_3
inst✝¹¹ : AddCommMonoid N
inst✝¹⁰ : Module R N
P : Type u_4
inst✝⁹ : AddCommMonoid P
inst✝⁸ : Module R P
M' : Type u_5
inst✝⁷ : AddCommGroup M'
inst✝⁶ : Module R M'
N' : Type u_6
inst✝⁵ : AddCommGroup N'
inst✝⁴ : Module R N'
ι : Type u_7
ι' : Type u_8
ι'' : Type u_9
N'₂ : Type u_10
inst✝³ : AddCommGroup N'₂
inst✝² : Module R N'₂
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
g : N' →ₗ[R] N'₂
f : MultilinearMap R (fun x => M) N'
⊢ MultilinearMap.alternatization (compMultilinearMap g f) = (compAlternatingMap g) (MultilinearMap.alternatization f)

Next tactic:
ext
/-- Composition with a linear map before and after alternatization are equivalent. -/
theorem compMultilinearMap_alternatization (g : N' →ₗ[R] N'₂)
    (f : MultilinearMap R (fun _ : ι => M) N') :
    MultilinearMap.alternatization (g.compMultilinearMap f)
      = g.compAlternatingMap (MultilinearMap.alternatization f) := by
  ext
  

Proof state:
case H
R : Type u_1
inst✝¹⁴ : Semiring R
M : Type u_2
inst✝¹³ : AddCommMonoid M
inst✝¹² : Module R M
N : Type u_3
inst✝¹¹ : AddCommMonoid N
inst✝¹⁰ : Module R N
P : Type u_4
inst✝⁹ : AddCommMonoid P
inst✝⁸ : Module R P
M' : Type u_5
inst✝⁷ : AddCommGroup M'
inst✝⁶ : Module R M'
N' : Type u_6
inst✝⁵ : AddCommGroup N'
inst✝⁴ : Module R N'
ι : Type u_7
ι' : Type u_8
ι'' : Type u_9
N'₂ : Type u_10
inst✝³ : AddCommGroup N'₂
inst✝² : Module R N'₂
inst✝¹ : DecidableEq ι
inst✝ : Fintype ι
g : N' →ₗ[R] N'₂
f : MultilinearMap R (fun x => M) N'
x✝ : ι → M
⊢ (MultilinearMap.alternatization (compMultilinearMap g f)) x✝ =
    ((compAlternatingMap g) (MultilinearMap.alternatization f)) x✝

Next tactic:
simp [MultilinearMap.alternatization_def]
/-- Two alternating maps indexed by a `Fintype` are equal if they are equal when all arguments
are distinct basis vectors. -/
theorem Basis.ext_alternating {f g : N₁ [Λ^ι]→ₗ[R'] N₂} (e : Basis ι₁ R' N₁)
    (h : ∀ v : ι → ι₁, Function.Injective v → (f fun i => e (v i)) = g fun i => e (v i)) :
    f = g := by
  

Proof state:
R : Type u_1
inst✝¹⁶ : Semiring R
M : Type u_2
inst✝¹⁵ : AddCommMonoid M
inst✝¹⁴ : Module R M
N : Type u_3
inst✝¹³ : AddCommMonoid N
inst✝¹² : Module R N
P : Type u_4
inst✝¹¹ : AddCommMonoid P
inst✝¹⁰ : Module R P
M' : Type u_5
inst✝⁹ : AddCommGroup M'
inst✝⁸ : Module R M'
N' : Type u_6
inst✝⁷ : AddCommGroup N'
inst✝⁶ : Module R N'
ι : Type u_7
ι' : Type u_8
ι'' : Type u_9
ι₁ : Type u_10
inst✝⁵ : Finite ι
R' : Type u_11
N₁ : Type u_12
N₂ : Type u_13
inst✝⁴ : CommSemiring R'
inst✝³ : AddCommMonoid N₁
inst✝² : AddCommMonoid N₂
inst✝¹ : Module R' N₁
inst✝ : Module R' N₂
f g : N₁ [Λ^ι]→ₗ[R'] N₂
e : Basis ι₁ R' N₁
h : ∀ (v : ι → ι₁), Function.Injective v → (f fun i => e (v i)) = g fun i => e (v i)
⊢ f = g

Next tactic:
classical
    refine' AlternatingMap.coe_multilinearMap_injective (Basis.ext_multilinear e fun v => _)
    by_cases hi : Function.Injective v
    · exact h v hi
    · have : ¬Function.Injective fun i => e (v i) := hi.imp Function.Injective.of_comp
      rw [coe_multilinearMap, coe_multilinearMap, f.map_eq_zero_of_not_injective _ this,
        g.map_eq_zero_of_not_injective _ this]
/-- Two alternating maps indexed by a `Fintype` are equal if they are equal when all arguments
are distinct basis vectors. -/
theorem Basis.ext_alternating {f g : N₁ [Λ^ι]→ₗ[R'] N₂} (e : Basis ι₁ R' N₁)
    (h : ∀ v : ι → ι₁, Function.Injective v → (f fun i => e (v i)) = g fun i => e (v i)) :
    f = g := by
  classical
    

Proof state:
R : Type u_1
inst✝¹⁶ : Semiring R
M : Type u_2
inst✝¹⁵ : AddCommMonoid M
inst✝¹⁴ : Module R M
N : Type u_3
inst✝¹³ : AddCommMonoid N
inst✝¹² : Module R N
P : Type u_4
inst✝¹¹ : AddCommMonoid P
inst✝¹⁰ : Module R P
M' : Type u_5
inst✝⁹ : AddCommGroup M'
inst✝⁸ : Module R M'
N' : Type u_6
inst✝⁷ : AddCommGroup N'
inst✝⁶ : Module R N'
ι : Type u_7
ι' : Type u_8
ι'' : Type u_9
ι₁ : Type u_10
inst✝⁵ : Finite ι
R' : Type u_11
N₁ : Type u_12
N₂ : Type u_13
inst✝⁴ : CommSemiring R'
inst✝³ : AddCommMonoid N₁
inst✝² : AddCommMonoid N₂
inst✝¹ : Module R' N₁
inst✝ : Module R' N₂
f g : N₁ [Λ^ι]→ₗ[R'] N₂
e : Basis ι₁ R' N₁
h : ∀ (v : ι → ι₁), Function.Injective v → (f fun i => e (v i)) = g fun i => e (v i)
⊢ f = g

Next tactic:
refine' AlternatingMap.coe_multilinearMap_injective (Basis.ext_multilinear e fun v => _)
/-- Two alternating maps indexed by a `Fintype` are equal if they are equal when all arguments
are distinct basis vectors. -/
theorem Basis.ext_alternating {f g : N₁ [Λ^ι]→ₗ[R'] N₂} (e : Basis ι₁ R' N₁)
    (h : ∀ v : ι → ι₁, Function.Injective v → (f fun i => e (v i)) = g fun i => e (v i)) :
    f = g := by
  classical
    refine' AlternatingMap.coe_multilinearMap_injective (Basis.ext_multilinear e fun v => _)
    

Proof state:
R : Type u_1
inst✝¹⁶ : Semiring R
M : Type u_2
inst✝¹⁵ : AddCommMonoid M
inst✝¹⁴ : Module R M
N : Type u_3
inst✝¹³ : AddCommMonoid N
inst✝¹² : Module R N
P : Type u_4
inst✝¹¹ : AddCommMonoid P
inst✝¹⁰ : Module R P
M' : Type u_5
inst✝⁹ : AddCommGroup M'
inst✝⁸ : Module R M'
N' : Type u_6
inst✝⁷ : AddCommGroup N'
inst✝⁶ : Module R N'
ι : Type u_7
ι' : Type u_8
ι'' : Type u_9
ι₁ : Type u_10
inst✝⁵ : Finite ι
R' : Type u_11
N₁ : Type u_12
N₂ : Type u_13
inst✝⁴ : CommSemiring R'
inst✝³ : AddCommMonoid N₁
inst✝² : AddCommMonoid N₂
inst✝¹ : Module R' N₁
inst✝ : Module R' N₂
f g : N₁ [Λ^ι]→ₗ[R'] N₂
e : Basis ι₁ R' N₁
h : ∀ (v : ι → ι₁), Function.Injective v → (f fun i => e (v i)) = g fun i => e (v i)
v : ι → ι₁
⊢ (↑f fun i => e (v i)) = ↑g fun i => e (v i)

Next tactic:
by_cases hi : Function.Injective v
/-- Two alternating maps indexed by a `Fintype` are equal if they are equal when all arguments
are distinct basis vectors. -/
theorem Basis.ext_alternating {f g : N₁ [Λ^ι]→ₗ[R'] N₂} (e : Basis ι₁ R' N₁)
    (h : ∀ v : ι → ι₁, Function.Injective v → (f fun i => e (v i)) = g fun i => e (v i)) :
    f = g := by
  classical
    refine' AlternatingMap.coe_multilinearMap_injective (Basis.ext_multilinear e fun v => _)
    by_cases hi : Function.Injective v
    · 

Proof state:
case pos
R : Type u_1
inst✝¹⁶ : Semiring R
M : Type u_2
inst✝¹⁵ : AddCommMonoid M
inst✝¹⁴ : Module R M
N : Type u_3
inst✝¹³ : AddCommMonoid N
inst✝¹² : Module R N
P : Type u_4
inst✝¹¹ : AddCommMonoid P
inst✝¹⁰ : Module R P
M' : Type u_5
inst✝⁹ : AddCommGroup M'
inst✝⁸ : Module R M'
N' : Type u_6
inst✝⁷ : AddCommGroup N'
inst✝⁶ : Module R N'
ι : Type u_7
ι' : Type u_8
ι'' : Type u_9
ι₁ : Type u_10
inst✝⁵ : Finite ι
R' : Type u_11
N₁ : Type u_12
N₂ : Type u_13
inst✝⁴ : CommSemiring R'
inst✝³ : AddCommMonoid N₁
inst✝² : AddCommMonoid N₂
inst✝¹ : Module R' N₁
inst✝ : Module R' N₂
f g : N₁ [Λ^ι]→ₗ[R'] N₂
e : Basis ι₁ R' N₁
h : ∀ (v : ι → ι₁), Function.Injective v → (f fun i => e (v i)) = g fun i => e (v i)
v : ι → ι₁
hi : Function.Injective v
⊢ (↑f fun i => e (v i)) = ↑g fun i => e (v i)

Next tactic:
exact h v hi
/-- Two alternating maps indexed by a `Fintype` are equal if they are equal when all arguments
are distinct basis vectors. -/
theorem Basis.ext_alternating {f g : N₁ [Λ^ι]→ₗ[R'] N₂} (e : Basis ι₁ R' N₁)
    (h : ∀ v : ι → ι₁, Function.Injective v → (f fun i => e (v i)) = g fun i => e (v i)) :
    f = g := by
  classical
    refine' AlternatingMap.coe_multilinearMap_injective (Basis.ext_multilinear e fun v => _)
    by_cases hi : Function.Injective v
    · exact h v hi
    · 

Proof state:
case neg
R : Type u_1
inst✝¹⁶ : Semiring R
M : Type u_2
inst✝¹⁵ : AddCommMonoid M
inst✝¹⁴ : Module R M
N : Type u_3
inst✝¹³ : AddCommMonoid N
inst✝¹² : Module R N
P : Type u_4
inst✝¹¹ : AddCommMonoid P
inst✝¹⁰ : Module R P
M' : Type u_5
inst✝⁹ : AddCommGroup M'
inst✝⁸ : Module R M'
N' : Type u_6
inst✝⁷ : AddCommGroup N'
inst✝⁶ : Module R N'
ι : Type u_7
ι' : Type u_8
ι'' : Type u_9
ι₁ : Type u_10
inst✝⁵ : Finite ι
R' : Type u_11
N₁ : Type u_12
N₂ : Type u_13
inst✝⁴ : CommSemiring R'
inst✝³ : AddCommMonoid N₁
inst✝² : AddCommMonoid N₂
inst✝¹ : Module R' N₁
inst✝ : Module R' N₂
f g : N₁ [Λ^ι]→ₗ[R'] N₂
e : Basis ι₁ R' N₁
h : ∀ (v : ι → ι₁), Function.Injective v → (f fun i => e (v i)) = g fun i => e (v i)
v : ι → ι₁
hi : ¬Function.Injective v
⊢ (↑f fun i => e (v i)) = ↑g fun i => e (v i)

Next tactic:
have : ¬Function.Injective fun i => e (v i) := hi.imp Function.Injective.of_comp