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

tactic: classical
  rw [← s.affineCombination_affineCombinationSingleWeights k p h₁, ←
    s.affineCombination_affineCombinationLineMapWeights p h₂ h₃ c] at hs
  refine'
    sign_eq_of_affineCombination_mem_affineSpan_pair h hw
      (s.sum_affineCombinationSingleWeights k h₁)
      (s.sum_affineCombinationLineMapWeights h₂ h₃ c) hs h₂ h₃
      (Finset.affineCombinationSingleWeights_apply_of_ne k h₁₂.symm)
      (Finset.affineCombinationSingleWeights_apply_of_ne k h₁₃.symm) _
  rw [Finset.affineCombinationLineMapWeights_apply_left h₂₃,
    Finset.affineCombinationLineMapWeights_apply_right h₂₃]
  simp_all only [sub_pos, sign_pos]
state_before: k : Type u_1
V : Type u_2
P : Type u_3
inst✝³ : LinearOrderedRing k
inst✝² : AddCommGroup V
inst✝¹ : Module k V
inst✝ : AffineSpace V P
ι : Type u_4
p : ι → P
h : AffineIndependent k p
w : ι → k
s : Finset ι
hw : ∑ i in s, w i = 1
i₁ i₂ i₃ : ι
h₁ : i₁ ∈ s
h₂ : i₂ ∈ s
h₃ : i₃ ∈ s
h₁₂ : i₁ ≠ i₂
h₁₃ : i₁ ≠ i₃
h₂₃ : i₂ ≠ i₃
c : k
hc0 : 0 < c
hc1 : c < 1
hs : ↑(Finset.affineCombination k s p) w ∈ affineSpan k {p i₁, ↑(AffineMap.lineMap (p i₂) (p i₃)) c}
⊢ ↑SignType.sign (w i₂) = ↑SignType.sign (w i₃)

tactic: rw [← s.affineCombination_affineCombinationSingleWeights k p h₁, ←
  s.affineCombination_affineCombinationLineMapWeights p h₂ h₃ c] at hs
state_before: k : Type u_1
V : Type u_2
P : Type u_3
inst✝³ : LinearOrderedRing k
inst✝² : AddCommGroup V
inst✝¹ : Module k V
inst✝ : AffineSpace V P
ι : Type u_4
p : ι → P
h : AffineIndependent k p
w : ι → k
s : Finset ι
hw : ∑ i in s, w i = 1
i₁ i₂ i₃ : ι
h₁ : i₁ ∈ s
h₂ : i₂ ∈ s
h₃ : i₃ ∈ s
h₁₂ : i₁ ≠ i₂
h₁₃ : i₁ ≠ i₃
h₂₃ : i₂ ≠ i₃
c : k
hc0 : 0 < c
hc1 : c < 1
hs : ↑(Finset.affineCombination k s p) w ∈ affineSpan k {p i₁, ↑(AffineMap.lineMap (p i₂) (p i₃)) c}
⊢ ↑SignType.sign (w i₂) = ↑SignType.sign (w i₃)

tactic: refine'
  sign_eq_of_affineCombination_mem_affineSpan_pair h hw
    (s.sum_affineCombinationSingleWeights k h₁)
    (s.sum_affineCombinationLineMapWeights h₂ h₃ c) hs h₂ h₃
    (Finset.affineCombinationSingleWeights_apply_of_ne k h₁₂.symm)
    (Finset.affineCombinationSingleWeights_apply_of_ne k h₁₃.symm) _
state_before: k : Type u_1
V : Type u_2
P : Type u_3
inst✝³ : LinearOrderedRing k
inst✝² : AddCommGroup V
inst✝¹ : Module k V
inst✝ : AffineSpace V P
ι : Type u_4
p : ι → P
h : AffineIndependent k p
w : ι → k
s : Finset ι
hw : ∑ i in s, w i = 1
i₁ i₂ i₃ : ι
h₁ : i₁ ∈ s
h₂ : i₂ ∈ s
h₃ : i₃ ∈ s
h₁₂ : i₁ ≠ i₂
h₁₃ : i₁ ≠ i₃
h₂₃ : i₂ ≠ i₃
c : k
hc0 : 0 < c
hc1 : c < 1
hs :
  ↑(Finset.affineCombination k s p) w ∈
    affineSpan k
      {↑(Finset.affineCombination k s p) (Finset.affineCombinationSingleWeights k i₁),
        ↑(Finset.affineCombination k s p) (Finset.affineCombinationLineMapWeights i₂ i₃ c)}
⊢ ↑SignType.sign (w i₂) = ↑SignType.sign (w i₃)

tactic: rw [Finset.affineCombinationLineMapWeights_apply_left h₂₃,
  Finset.affineCombinationLineMapWeights_apply_right h₂₃]
state_before: k : Type u_1
V : Type u_2
P : Type u_3
inst✝³ : LinearOrderedRing k
inst✝² : AddCommGroup V
inst✝¹ : Module k V
inst✝ : AffineSpace V P
ι : Type u_4
p : ι → P
h : AffineIndependent k p
w : ι → k
s : Finset ι
hw : ∑ i in s, w i = 1
i₁ i₂ i₃ : ι
h₁ : i₁ ∈ s
h₂ : i₂ ∈ s
h₃ : i₃ ∈ s
h₁₂ : i₁ ≠ i₂
h₁₃ : i₁ ≠ i₃
h₂₃ : i₂ ≠ i₃
c : k
hc0 : 0 < c
hc1 : c < 1
hs :
  ↑(Finset.affineCombination k s p) w ∈
    affineSpan k
      {↑(Finset.affineCombination k s p) (Finset.affineCombinationSingleWeights k i₁),
        ↑(Finset.affineCombination k s p) (Finset.affineCombinationLineMapWeights i₂ i₃ c)}
⊢ ↑SignType.sign (Finset.affineCombinationLineMapWeights i₂ i₃ c i₂) =
    ↑SignType.sign (Finset.affineCombinationLineMapWeights i₂ i₃ c i₃)

tactic: simp_all only [sub_pos, sign_pos]
state_before: k : Type u_1
V : Type u_2
P : Type u_3
inst✝³ : LinearOrderedRing k
inst✝² : AddCommGroup V
inst✝¹ : Module k V
inst✝ : AffineSpace V P
ι : Type u_4
p : ι → P
h : AffineIndependent k p
w : ι → k
s : Finset ι
hw : ∑ i in s, w i = 1
i₁ i₂ i₃ : ι
h₁ : i₁ ∈ s
h₂ : i₂ ∈ s
h₃ : i₃ ∈ s
h₁₂ : i₁ ≠ i₂
h₁₃ : i₁ ≠ i₃
h₂₃ : i₂ ≠ i₃
c : k
hc0 : 0 < c
hc1 : c < 1
hs :
  ↑(Finset.affineCombination k s p) w ∈
    affineSpan k
      {↑(Finset.affineCombination k s p) (Finset.affineCombinationSingleWeights k i₁),
        ↑(Finset.affineCombination k s p) (Finset.affineCombinationLineMapWeights i₂ i₃ c)}
⊢ ↑SignType.sign (1 - c) = ↑SignType.sign c