Theorem: affineIndependent_iff_eq_of_fintype_affineCombination_eq
File: Mathlib/LinearAlgebra/AffineSpace/Independent.lean

tactic: rw [affineIndependent_iff_indicator_eq_of_affineCombination_eq]
state_before: k : Type u_2
V : Type u_3
P : Type u_4
inst✝⁴ : Ring k
inst✝³ : AddCommGroup V
inst✝² : Module k V
inst✝¹ : AffineSpace V P
ι : Type u_1
inst✝ : Fintype ι
p : ι → P
⊢ AffineIndependent k p ↔
    ∀ (w1 w2 : ι → k),
      ∑ i : ι, w1 i = 1 →
        ∑ i : ι, w2 i = 1 →
          ↑(Finset.affineCombination k Finset.univ p) w1 = ↑(Finset.affineCombination k Finset.univ p) w2 → w1 = w2

tactic: constructor
state_before: k : Type u_2
V : Type u_3
P : Type u_4
inst✝⁴ : Ring k
inst✝³ : AddCommGroup V
inst✝² : Module k V
inst✝¹ : AffineSpace V P
ι : Type u_1
inst✝ : Fintype ι
p : ι → P
⊢ (∀ (s1 s2 : Finset ι) (w1 w2 : ι → k),
      ∑ i in s1, w1 i = 1 →
        ∑ i in s2, w2 i = 1 →
          ↑(Finset.affineCombination k s1 p) w1 = ↑(Finset.affineCombination k s2 p) w2 →
            Set.indicator (↑s1) w1 = Set.indicator (↑s2) w2) ↔
    ∀ (w1 w2 : ι → k),
      ∑ i : ι, w1 i = 1 →
        ∑ i : ι, w2 i = 1 →
          ↑(Finset.affineCombination k Finset.univ p) w1 = ↑(Finset.affineCombination k Finset.univ p) w2 → w1 = w2

tactic: intro h w1 w2 hw1 hw2 hweq
state_before: case mp
k : Type u_2
V : Type u_3
P : Type u_4
inst✝⁴ : Ring k
inst✝³ : AddCommGroup V
inst✝² : Module k V
inst✝¹ : AffineSpace V P
ι : Type u_1
inst✝ : Fintype ι
p : ι → P
⊢ (∀ (s1 s2 : Finset ι) (w1 w2 : ι → k),
      ∑ i in s1, w1 i = 1 →
        ∑ i in s2, w2 i = 1 →
          ↑(Finset.affineCombination k s1 p) w1 = ↑(Finset.affineCombination k s2 p) w2 →
            Set.indicator (↑s1) w1 = Set.indicator (↑s2) w2) →
    ∀ (w1 w2 : ι → k),
      ∑ i : ι, w1 i = 1 →
        ∑ i : ι, w2 i = 1 →
          ↑(Finset.affineCombination k Finset.univ p) w1 = ↑(Finset.affineCombination k Finset.univ p) w2 → w1 = w2

tactic: simpa only [Set.indicator_univ, Finset.coe_univ] using h _ _ w1 w2 hw1 hw2 hweq
state_before: case mp
k : Type u_2
V : Type u_3
P : Type u_4
inst✝⁴ : Ring k
inst✝³ : AddCommGroup V
inst✝² : Module k V
inst✝¹ : AffineSpace V P
ι : Type u_1
inst✝ : Fintype ι
p : ι → P
h :
  ∀ (s1 s2 : Finset ι) (w1 w2 : ι → k),
    ∑ i in s1, w1 i = 1 →
      ∑ i in s2, w2 i = 1 →
        ↑(Finset.affineCombination k s1 p) w1 = ↑(Finset.affineCombination k s2 p) w2 →
          Set.indicator (↑s1) w1 = Set.indicator (↑s2) w2
w1 w2 : ι → k
hw1 : ∑ i : ι, w1 i = 1
hw2 : ∑ i : ι, w2 i = 1
hweq : ↑(Finset.affineCombination k Finset.univ p) w1 = ↑(Finset.affineCombination k Finset.univ p) w2
⊢ w1 = w2

tactic: intro h s1 s2 w1 w2 hw1 hw2 hweq
state_before: case mpr
k : Type u_2
V : Type u_3
P : Type u_4
inst✝⁴ : Ring k
inst✝³ : AddCommGroup V
inst✝² : Module k V
inst✝¹ : AffineSpace V P
ι : Type u_1
inst✝ : Fintype ι
p : ι → P
⊢ (∀ (w1 w2 : ι → k),
      ∑ i : ι, w1 i = 1 →
        ∑ i : ι, w2 i = 1 →
          ↑(Finset.affineCombination k Finset.univ p) w1 = ↑(Finset.affineCombination k Finset.univ p) w2 → w1 = w2) →
    ∀ (s1 s2 : Finset ι) (w1 w2 : ι → k),
      ∑ i in s1, w1 i = 1 →
        ∑ i in s2, w2 i = 1 →
          ↑(Finset.affineCombination k s1 p) w1 = ↑(Finset.affineCombination k s2 p) w2 →
            Set.indicator (↑s1) w1 = Set.indicator (↑s2) w2

tactic: have hw1' : (∑ i, (s1 : Set ι).indicator w1 i) = 1 := by
  rwa [Set.sum_indicator_subset _ (Finset.subset_univ s1)] at hw1
state_before: case mpr
k : Type u_2
V : Type u_3
P : Type u_4
inst✝⁴ : Ring k
inst✝³ : AddCommGroup V
inst✝² : Module k V
inst✝¹ : AffineSpace V P
ι : Type u_1
inst✝ : Fintype ι
p : ι → P
h :
  ∀ (w1 w2 : ι → k),
    ∑ i : ι, w1 i = 1 →
      ∑ i : ι, w2 i = 1 →
        ↑(Finset.affineCombination k Finset.univ p) w1 = ↑(Finset.affineCombination k Finset.univ p) w2 → w1 = w2
s1 s2 : Finset ι
w1 w2 : ι → k
hw1 : ∑ i in s1, w1 i = 1
hw2 : ∑ i in s2, w2 i = 1
hweq : ↑(Finset.affineCombination k s1 p) w1 = ↑(Finset.affineCombination k s2 p) w2
⊢ Set.indicator (↑s1) w1 = Set.indicator (↑s2) w2

tactic: have hw2' : (∑ i, (s2 : Set ι).indicator w2 i) = 1 := by
  rwa [Set.sum_indicator_subset _ (Finset.subset_univ s2)] at hw2
state_before: case mpr
k : Type u_2
V : Type u_3
P : Type u_4
inst✝⁴ : Ring k
inst✝³ : AddCommGroup V
inst✝² : Module k V
inst✝¹ : AffineSpace V P
ι : Type u_1
inst✝ : Fintype ι
p : ι → P
h :
  ∀ (w1 w2 : ι → k),
    ∑ i : ι, w1 i = 1 →
      ∑ i : ι, w2 i = 1 →
        ↑(Finset.affineCombination k Finset.univ p) w1 = ↑(Finset.affineCombination k Finset.univ p) w2 → w1 = w2
s1 s2 : Finset ι
w1 w2 : ι → k
hw1 : ∑ i in s1, w1 i = 1
hw2 : ∑ i in s2, w2 i = 1
hweq : ↑(Finset.affineCombination k s1 p) w1 = ↑(Finset.affineCombination k s2 p) w2
hw1' : ∑ i : ι, Set.indicator (↑s1) w1 i = 1
⊢ Set.indicator (↑s1) w1 = Set.indicator (↑s2) w2

tactic: rw [Finset.affineCombination_indicator_subset w1 p (Finset.subset_univ s1),
  Finset.affineCombination_indicator_subset w2 p (Finset.subset_univ s2)] at hweq
state_before: case mpr
k : Type u_2
V : Type u_3
P : Type u_4
inst✝⁴ : Ring k
inst✝³ : AddCommGroup V
inst✝² : Module k V
inst✝¹ : AffineSpace V P
ι : Type u_1
inst✝ : Fintype ι
p : ι → P
h :
  ∀ (w1 w2 : ι → k),
    ∑ i : ι, w1 i = 1 →
      ∑ i : ι, w2 i = 1 →
        ↑(Finset.affineCombination k Finset.univ p) w1 = ↑(Finset.affineCombination k Finset.univ p) w2 → w1 = w2
s1 s2 : Finset ι
w1 w2 : ι → k
hw1 : ∑ i in s1, w1 i = 1
hw2 : ∑ i in s2, w2 i = 1
hweq : ↑(Finset.affineCombination k s1 p) w1 = ↑(Finset.affineCombination k s2 p) w2
hw1' : ∑ i : ι, Set.indicator (↑s1) w1 i = 1
hw2' : ∑ i : ι, Set.indicator (↑s2) w2 i = 1
⊢ Set.indicator (↑s1) w1 = Set.indicator (↑s2) w2

tactic: exact h _ _ hw1' hw2' hweq
state_before: case mpr
k : Type u_2
V : Type u_3
P : Type u_4
inst✝⁴ : Ring k
inst✝³ : AddCommGroup V
inst✝² : Module k V
inst✝¹ : AffineSpace V P
ι : Type u_1
inst✝ : Fintype ι
p : ι → P
h :
  ∀ (w1 w2 : ι → k),
    ∑ i : ι, w1 i = 1 →
      ∑ i : ι, w2 i = 1 →
        ↑(Finset.affineCombination k Finset.univ p) w1 = ↑(Finset.affineCombination k Finset.univ p) w2 → w1 = w2
s1 s2 : Finset ι
w1 w2 : ι → k
hw1 : ∑ i in s1, w1 i = 1
hw2 : ∑ i in s2, w2 i = 1
hweq :
  ↑(Finset.affineCombination k Finset.univ p) (Set.indicator (↑s1) w1) =
    ↑(Finset.affineCombination k Finset.univ p) (Set.indicator (↑s2) w2)
hw1' : ∑ i : ι, Set.indicator (↑s1) w1 i = 1
hw2' : ∑ i : ι, Set.indicator (↑s2) w2 i = 1
⊢ Set.indicator (↑s1) w1 = Set.indicator (↑s2) w2

tactic: rwa [Set.sum_indicator_subset _ (Finset.subset_univ s1)] at hw1
state_before: k : Type u_2
V : Type u_3
P : Type u_4
inst✝⁴ : Ring k
inst✝³ : AddCommGroup V
inst✝² : Module k V
inst✝¹ : AffineSpace V P
ι : Type u_1
inst✝ : Fintype ι
p : ι → P
h :
  ∀ (w1 w2 : ι → k),
    ∑ i : ι, w1 i = 1 →
      ∑ i : ι, w2 i = 1 →
        ↑(Finset.affineCombination k Finset.univ p) w1 = ↑(Finset.affineCombination k Finset.univ p) w2 → w1 = w2
s1 s2 : Finset ι
w1 w2 : ι → k
hw1 : ∑ i in s1, w1 i = 1
hw2 : ∑ i in s2, w2 i = 1
hweq : ↑(Finset.affineCombination k s1 p) w1 = ↑(Finset.affineCombination k s2 p) w2
⊢ ∑ i : ι, Set.indicator (↑s1) w1 i = 1

tactic: rwa [Set.sum_indicator_subset _ (Finset.subset_univ s2)] at hw2
state_before: k : Type u_2
V : Type u_3
P : Type u_4
inst✝⁴ : Ring k
inst✝³ : AddCommGroup V
inst✝² : Module k V
inst✝¹ : AffineSpace V P
ι : Type u_1
inst✝ : Fintype ι
p : ι → P
h :
  ∀ (w1 w2 : ι → k),
    ∑ i : ι, w1 i = 1 →
      ∑ i : ι, w2 i = 1 →
        ↑(Finset.affineCombination k Finset.univ p) w1 = ↑(Finset.affineCombination k Finset.univ p) w2 → w1 = w2
s1 s2 : Finset ι
w1 w2 : ι → k
hw1 : ∑ i in s1, w1 i = 1
hw2 : ∑ i in s2, w2 i = 1
hweq : ↑(Finset.affineCombination k s1 p) w1 = ↑(Finset.affineCombination k s2 p) w2
hw1' : ∑ i : ι, Set.indicator (↑s1) w1 i = 1
⊢ ∑ i : ι, Set.indicator (↑s2) w2 i = 1