l3lab/ntp-mathlib huggingface dataset:
/-- 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
    · have : ¬Function.Injective fun i => e (v i) := hi.imp Function.Injective.of_comp
      

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
this : ¬Function.Injective fun i => e (v i)
⊢ (↑f fun i => e (v i)) = ↑g fun i => e (v i)

Next tactic:
rw [coe_multilinearMap, coe_multilinearMap, f.map_eq_zero_of_not_injective _ this,
        g.map_eq_zero_of_not_injective _ this]
/-- Given an alternating map `f` in `n+1` variables, split the first variable to obtain
a linear map into alternating maps in `n` variables, given by `x ↦ (m ↦ f (Matrix.vecCons x m))`.
It can be thought of as a map $Hom(\bigwedge^{n+1} M, N) \to Hom(M, Hom(\bigwedge^n M, N))$.

This is `MultilinearMap.curryLeft` for `AlternatingMap`. See also
`AlternatingMap.curryLeftLinearMap`. -/
@[simps]
def curryLeft {n : ℕ} (f : M'' [Λ^Fin n.succ]→ₗ[R'] N'') :
    M'' →ₗ[R'] M'' [Λ^Fin n]→ₗ[R'] N'' where
  toFun m :=
    { f.toMultilinearMap.curryLeft m with
      toFun := fun v => f (Matrix.vecCons m v)
      map_eq_zero_of_eq' := fun v i j hv hij =>
        f.map_eq_zero_of_eq _ (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
R' : Type u_10
M'' : Type u_11
M₂'' : Type u_12
N'' : Type u_13
N₂'' : Type u_14
inst✝⁸ : CommSemiring R'
inst✝⁷ : AddCommMonoid M''
inst✝⁶ : AddCommMonoid M₂''
inst✝⁵ : AddCommMonoid N''
inst✝⁴ : AddCommMonoid N₂''
inst✝³ : Module R' M''
inst✝² : Module R' M₂''
inst✝¹ : Module R' N''
inst✝ : Module R' N₂''
n : ℕ
f : M'' [Λ^Fin (Nat.succ n)]→ₗ[R'] N''
m : M''
src✝ : MultilinearMap R' (fun i => M'') N'' := (MultilinearMap.curryLeft ↑f) m
v : Fin n → M''
i j : Fin n
hv : v i = v j
hij : i ≠ j
⊢ Matrix.vecCons m v (Fin.succ i) = Matrix.vecCons m v (Fin.succ j)

Next tactic:
rwa [Matrix.cons_val_succ, Matrix.cons_val_succ]
/-- Currying with the same element twice gives the zero map. -/
@[simp]
theorem curryLeft_same {n : ℕ} (f : M'' [Λ^Fin n.succ.succ]→ₗ[R'] N'') (m : M'') :
    (f.curryLeft m).curryLeft m = 0 :=
  ext fun x => f.map_eq_zero_of_eq _ (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
R' : Type u_10
M'' : Type u_11
M₂'' : Type u_12
N'' : Type u_13
N₂'' : Type u_14
inst✝⁸ : CommSemiring R'
inst✝⁷ : AddCommMonoid M''
inst✝⁶ : AddCommMonoid M₂''
inst✝⁵ : AddCommMonoid N''
inst✝⁴ : AddCommMonoid N₂''
inst✝³ : Module R' M''
inst✝² : Module R' M₂''
inst✝¹ : Module R' N''
inst✝ : Module R' N₂''
n : ℕ
f : M'' [Λ^Fin (Nat.succ (Nat.succ n))]→ₗ[R'] N''
m : M''
x : Fin n → M''
⊢ Matrix.vecCons m (Matrix.vecCons m x) 0 = Matrix.vecCons m (Matrix.vecCons m x) 1

Next tactic:
simp
@[simp]
theorem curryLeft_compLinearMap {n : ℕ} (g : M₂'' →ₗ[R'] M'')
    (f : M'' [Λ^Fin n.succ]→ₗ[R'] N'') (m : M₂'') :
    (f.compLinearMap g).curryLeft m = (f.curryLeft (g m)).compLinearMap g :=
  ext fun v => congr_arg f <| funext <| 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
R' : Type u_10
M'' : Type u_11
M₂'' : Type u_12
N'' : Type u_13
N₂'' : Type u_14
inst✝⁸ : CommSemiring R'
inst✝⁷ : AddCommMonoid M''
inst✝⁶ : AddCommMonoid M₂''
inst✝⁵ : AddCommMonoid N''
inst✝⁴ : AddCommMonoid N₂''
inst✝³ : Module R' M''
inst✝² : Module R' M₂''
inst✝¹ : Module R' N''
inst✝ : Module R' N₂''
n : ℕ
g : M₂'' →ₗ[R'] M''
f : M'' [Λ^Fin (Nat.succ n)]→ₗ[R'] N''
m : M₂''
v : Fin n → M₂''
⊢ ∀ (x : Fin (Nat.succ n)),
    ((fun x => g) x) (Matrix.vecCons m v x) = Matrix.vecCons (g m) (fun i => ((fun x => g) i) (v i)) x

Next tactic:
refine' Fin.cases _ _
@[simp]
theorem curryLeft_compLinearMap {n : ℕ} (g : M₂'' →ₗ[R'] M'')
    (f : M'' [Λ^Fin n.succ]→ₗ[R'] N'') (m : M₂'') :
    (f.compLinearMap g).curryLeft m = (f.curryLeft (g m)).compLinearMap g :=
  ext fun v => congr_arg f <| funext <| by
    refine' Fin.cases _ _
    · 

Proof state:
case refine'_1
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
R' : Type u_10
M'' : Type u_11
M₂'' : Type u_12
N'' : Type u_13
N₂'' : Type u_14
inst✝⁸ : CommSemiring R'
inst✝⁷ : AddCommMonoid M''
inst✝⁶ : AddCommMonoid M₂''
inst✝⁵ : AddCommMonoid N''
inst✝⁴ : AddCommMonoid N₂''
inst✝³ : Module R' M''
inst✝² : Module R' M₂''
inst✝¹ : Module R' N''
inst✝ : Module R' N₂''
n : ℕ
g : M₂'' →ₗ[R'] M''
f : M'' [Λ^Fin (Nat.succ n)]→ₗ[R'] N''
m : M₂''
v : Fin n → M₂''
⊢ ((fun x => g) 0) (Matrix.vecCons m v 0) = Matrix.vecCons (g m) (fun i => ((fun x => g) i) (v i)) 0

Next tactic:
rfl
@[simp]
theorem curryLeft_compLinearMap {n : ℕ} (g : M₂'' →ₗ[R'] M'')
    (f : M'' [Λ^Fin n.succ]→ₗ[R'] N'') (m : M₂'') :
    (f.compLinearMap g).curryLeft m = (f.curryLeft (g m)).compLinearMap g :=
  ext fun v => congr_arg f <| funext <| by
    refine' Fin.cases _ _
    · rfl
    · 

Proof state:
case refine'_2
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
R' : Type u_10
M'' : Type u_11
M₂'' : Type u_12
N'' : Type u_13
N₂'' : Type u_14
inst✝⁸ : CommSemiring R'
inst✝⁷ : AddCommMonoid M''
inst✝⁶ : AddCommMonoid M₂''
inst✝⁵ : AddCommMonoid N''
inst✝⁴ : AddCommMonoid N₂''
inst✝³ : Module R' M''
inst✝² : Module R' M₂''
inst✝¹ : Module R' N''
inst✝ : Module R' N₂''
n : ℕ
g : M₂'' →ₗ[R'] M''
f : M'' [Λ^Fin (Nat.succ n)]→ₗ[R'] N''
m : M₂''
v : Fin n → M₂''
⊢ ∀ (i : Fin n),
    ((fun x => g) (Fin.succ i)) (Matrix.vecCons m v (Fin.succ i)) =
      Matrix.vecCons (g m) (fun i => ((fun x => g) i) (v i)) (Fin.succ i)

Next tactic:
simp
theorem lineMap_mono_left (ha : a ≤ a') (hr : r ≤ 1) : lineMap a b r ≤ lineMap a' b r := by
  

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
a a' b b' : E
r r' : k
ha : a ≤ a'
hr : r ≤ 1
⊢ (lineMap a b) r ≤ (lineMap a' b) r

Next tactic:
simp only [lineMap_apply_module]
theorem lineMap_mono_left (ha : a ≤ a') (hr : r ≤ 1) : lineMap a b r ≤ lineMap a' b r := by
  simp only [lineMap_apply_module]
  

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
a a' b b' : E
r r' : k
ha : a ≤ a'
hr : r ≤ 1
⊢ (1 - r) • a + r • b ≤ (1 - r) • a' + r • b

Next tactic:
exact add_le_add_right (smul_le_smul_of_nonneg ha (sub_nonneg.2 hr)) _
theorem lineMap_strict_mono_left (ha : a < a') (hr : r < 1) : lineMap a b r < lineMap a' b r := by
  

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
a a' b b' : E
r r' : k
ha : a < a'
hr : r < 1
⊢ (lineMap a b) r < (lineMap a' b) r

Next tactic:
simp only [lineMap_apply_module]
theorem lineMap_strict_mono_left (ha : a < a') (hr : r < 1) : lineMap a b r < lineMap a' b r := by
  simp only [lineMap_apply_module]
  

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
a a' b b' : E
r r' : k
ha : a < a'
hr : r < 1
⊢ (1 - r) • a + r • b < (1 - r) • a' + r • b

Next tactic:
exact add_lt_add_right (smul_lt_smul_of_pos ha (sub_pos.2 hr)) _
theorem lineMap_mono_right (hb : b ≤ b') (hr : 0 ≤ r) : lineMap a b r ≤ lineMap a b' r := by
  

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
a a' b b' : E
r r' : k
hb : b ≤ b'
hr : 0 ≤ r
⊢ (lineMap a b) r ≤ (lineMap a b') r

Next tactic:
simp only [lineMap_apply_module]
theorem lineMap_mono_right (hb : b ≤ b') (hr : 0 ≤ r) : lineMap a b r ≤ lineMap a b' r := by
  simp only [lineMap_apply_module]
  

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
a a' b b' : E
r r' : k
hb : b ≤ b'
hr : 0 ≤ r
⊢ (1 - r) • a + r • b ≤ (1 - r) • a + r • b'

Next tactic:
exact add_le_add_left (smul_le_smul_of_nonneg hb hr) _
theorem lineMap_strict_mono_right (hb : b < b') (hr : 0 < r) : lineMap a b r < lineMap a b' r := by
  

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
a a' b b' : E
r r' : k
hb : b < b'
hr : 0 < r
⊢ (lineMap a b) r < (lineMap a b') r

Next tactic:
simp only [lineMap_apply_module]
theorem lineMap_strict_mono_right (hb : b < b') (hr : 0 < r) : lineMap a b r < lineMap a b' r := by
  simp only [lineMap_apply_module]
  

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
a a' b b' : E
r r' : k
hb : b < b'
hr : 0 < r
⊢ (1 - r) • a + r • b < (1 - r) • a + r • b'

Next tactic:
exact add_lt_add_left (smul_lt_smul_of_pos hb hr) _
theorem lineMap_strict_mono_endpoints (ha : a < a') (hb : b < b') (h₀ : 0 ≤ r) (h₁ : r ≤ 1) :
    lineMap a b r < lineMap a' b' r := by
  

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
a a' b b' : E
r r' : k
ha : a < a'
hb : b < b'
h₀ : 0 ≤ r
h₁ : r ≤ 1
⊢ (lineMap a b) r < (lineMap a' b') r

Next tactic:
rcases h₀.eq_or_lt with (rfl | h₀)
theorem lineMap_strict_mono_endpoints (ha : a < a') (hb : b < b') (h₀ : 0 ≤ r) (h₁ : r ≤ 1) :
    lineMap a b r < lineMap a' b' r := by
  rcases h₀.eq_or_lt with (rfl | h₀); · 

Proof state:
case inl
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
a a' b b' : E
r' : k
ha : a < a'
hb : b < b'
h₀ : 0 ≤ 0
h₁ : 0 ≤ 1
⊢ (lineMap a b) 0 < (lineMap a' b') 0

Next tactic:
simpa
theorem lineMap_strict_mono_endpoints (ha : a < a') (hb : b < b') (h₀ : 0 ≤ r) (h₁ : r ≤ 1) :
    lineMap a b r < lineMap a' b' r := by
  rcases h₀.eq_or_lt with (rfl | h₀); · simpa
  

Proof state:
case inr
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
a a' b b' : E
r r' : k
ha : a < a'
hb : b < b'
h₀✝ : 0 ≤ r
h₁ : r ≤ 1
h₀ : 0 < r
⊢ (lineMap a b) r < (lineMap a' b') r

Next tactic:
exact (lineMap_mono_left ha.le h₁).trans_lt (lineMap_strict_mono_right hb h₀)
theorem lineMap_lt_lineMap_iff_of_lt (h : r < r') : lineMap a b r < lineMap a b r' ↔ a < b := by
  

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
a a' b b' : E
r r' : k
h : r < r'
⊢ (lineMap a b) r < (lineMap a b) r' ↔ a < b

Next tactic:
simp only [lineMap_apply_module]
theorem lineMap_lt_lineMap_iff_of_lt (h : r < r') : lineMap a b r < lineMap a b r' ↔ a < b := by
  simp only [lineMap_apply_module]
  

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
a a' b b' : E
r r' : k
h : r < r'
⊢ (1 - r) • a + r • b < (1 - r') • a + r' • b ↔ a < b

Next tactic:
rw [← lt_sub_iff_add_lt, add_sub_assoc, ← sub_lt_iff_lt_add', ← sub_smul, ← sub_smul,
    sub_sub_sub_cancel_left, smul_lt_smul_iff_of_pos (sub_pos.2 h)]
theorem left_lt_lineMap_iff_lt (h : 0 < r) : a < lineMap a b r ↔ a < b :=
  Iff.trans (by 

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
a a' b b' : E
r r' : k
h : 0 < r
⊢ a < (lineMap a b) r ↔ (lineMap a b) 0 < (lineMap a b) r

Next tactic:
rw [lineMap_apply_zero]
theorem lineMap_lt_right_iff_lt (h : r < 1) : lineMap a b r < b ↔ a < b :=
  Iff.trans (by 

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : OrderedRing k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
a a' b b' : E
r r' : k
h : r < 1
⊢ (lineMap a b) r < b ↔ (lineMap a b) r < (lineMap a b) 1

Next tactic:
rw [lineMap_apply_one]
theorem lineMap_le_lineMap_iff_of_lt (h : r < r') : lineMap a b r ≤ lineMap a b r' ↔ a ≤ b := by
  

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : LinearOrderedField k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
a b : E
r r' : k
h : r < r'
⊢ (lineMap a b) r ≤ (lineMap a b) r' ↔ a ≤ b

Next tactic:
simp only [lineMap_apply_module]
theorem lineMap_le_lineMap_iff_of_lt (h : r < r') : lineMap a b r ≤ lineMap a b r' ↔ a ≤ b := by
  simp only [lineMap_apply_module]
  

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : LinearOrderedField k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
a b : E
r r' : k
h : r < r'
⊢ (1 - r) • a + r • b ≤ (1 - r') • a + r' • b ↔ a ≤ b

Next tactic:
rw [← le_sub_iff_add_le, add_sub_assoc, ← sub_le_iff_le_add', ← sub_smul, ← sub_smul,
    sub_sub_sub_cancel_left, smul_le_smul_iff_of_pos (sub_pos.2 h)]
theorem left_le_lineMap_iff_le (h : 0 < r) : a ≤ lineMap a b r ↔ a ≤ b :=
  Iff.trans (by 

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : LinearOrderedField k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
a b : E
r r' : k
h : 0 < r
⊢ a ≤ (lineMap a b) r ↔ (lineMap a b) 0 ≤ (lineMap a b) r

Next tactic:
rw [lineMap_apply_zero]
theorem lineMap_le_right_iff_le (h : r < 1) : lineMap a b r ≤ b ↔ a ≤ b :=
  Iff.trans (by 

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : LinearOrderedField k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
a b : E
r r' : k
h : r < 1
⊢ (lineMap a b) r ≤ b ↔ (lineMap a b) r ≤ (lineMap a b) 1

Next tactic:
rw [lineMap_apply_one]
/-- Given `c = lineMap a b r`, `a < c`, the point `(c, f c)` is non-strictly below the
segment `[(a, f a), (b, f b)]` if and only if `slope f a c ≤ slope f a b`. -/
theorem map_le_lineMap_iff_slope_le_slope_left (h : 0 < r * (b - a)) :
    f c ≤ lineMap (f a) (f b) r ↔ slope f a c ≤ slope f a b := by
  

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : LinearOrderedField k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
f : k → E
a b r : k
h : 0 < r * (b - a)
⊢ f ((lineMap a b) r) ≤ (lineMap (f a) (f b)) r ↔ slope f a ((lineMap a b) r) ≤ slope f a b

Next tactic:
rw [lineMap_apply, lineMap_apply, slope, slope, vsub_eq_sub, vsub_eq_sub, vsub_eq_sub,
    vadd_eq_add, vadd_eq_add, smul_eq_mul, add_sub_cancel, smul_sub, smul_sub, smul_sub,
    sub_le_iff_le_add, mul_inv_rev, mul_smul, mul_smul, ← smul_sub, ← smul_sub, ← smul_add,
    smul_smul, ← mul_inv_rev, inv_smul_le_iff h, smul_smul,
    mul_inv_cancel_right₀ (right_ne_zero_of_mul h.ne'), smul_add,
    smul_inv_smul₀ (left_ne_zero_of_mul h.ne')]
/-- Given `c = lineMap a b r`, `c < b`, the point `(c, f c)` is non-strictly below the
segment `[(a, f a), (b, f b)]` if and only if `slope f a b ≤ slope f c b`. -/
theorem map_le_lineMap_iff_slope_le_slope_right (h : 0 < (1 - r) * (b - a)) :
    f c ≤ lineMap (f a) (f b) r ↔ slope f a b ≤ slope f c b := by
  

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : LinearOrderedField k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
f : k → E
a b r : k
h : 0 < (1 - r) * (b - a)
⊢ f ((lineMap a b) r) ≤ (lineMap (f a) (f b)) r ↔ slope f a b ≤ slope f ((lineMap a b) r) b

Next tactic:
rw [← lineMap_apply_one_sub, ← lineMap_apply_one_sub _ _ r]
/-- Given `c = lineMap a b r`, `c < b`, the point `(c, f c)` is non-strictly below the
segment `[(a, f a), (b, f b)]` if and only if `slope f a b ≤ slope f c b`. -/
theorem map_le_lineMap_iff_slope_le_slope_right (h : 0 < (1 - r) * (b - a)) :
    f c ≤ lineMap (f a) (f b) r ↔ slope f a b ≤ slope f c b := by
  rw [← lineMap_apply_one_sub, ← lineMap_apply_one_sub _ _ r]
  

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : LinearOrderedField k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
f : k → E
a b r : k
h : 0 < (1 - r) * (b - a)
⊢ f ((lineMap b a) (1 - r)) ≤ (lineMap (f b) (f a)) (1 - r) ↔ slope f a b ≤ slope f ((lineMap b a) (1 - r)) b

Next tactic:
revert h
/-- Given `c = lineMap a b r`, `c < b`, the point `(c, f c)` is non-strictly below the
segment `[(a, f a), (b, f b)]` if and only if `slope f a b ≤ slope f c b`. -/
theorem map_le_lineMap_iff_slope_le_slope_right (h : 0 < (1 - r) * (b - a)) :
    f c ≤ lineMap (f a) (f b) r ↔ slope f a b ≤ slope f c b := by
  rw [← lineMap_apply_one_sub, ← lineMap_apply_one_sub _ _ r]
  revert h; 

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : LinearOrderedField k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
f : k → E
a b r : k
⊢ 0 < (1 - r) * (b - a) →
    (f ((lineMap b a) (1 - r)) ≤ (lineMap (f b) (f a)) (1 - r) ↔ slope f a b ≤ slope f ((lineMap b a) (1 - r)) b)

Next tactic:
generalize 1 - r = r'
/-- Given `c = lineMap a b r`, `c < b`, the point `(c, f c)` is non-strictly below the
segment `[(a, f a), (b, f b)]` if and only if `slope f a b ≤ slope f c b`. -/
theorem map_le_lineMap_iff_slope_le_slope_right (h : 0 < (1 - r) * (b - a)) :
    f c ≤ lineMap (f a) (f b) r ↔ slope f a b ≤ slope f c b := by
  rw [← lineMap_apply_one_sub, ← lineMap_apply_one_sub _ _ r]
  revert h; generalize 1 - r = r'; 

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : LinearOrderedField k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
f : k → E
a b r r' : k
⊢ 0 < r' * (b - a) → (f ((lineMap b a) r') ≤ (lineMap (f b) (f a)) r' ↔ slope f a b ≤ slope f ((lineMap b a) r') b)

Next tactic:
clear! r
/-- Given `c = lineMap a b r`, `c < b`, the point `(c, f c)` is non-strictly below the
segment `[(a, f a), (b, f b)]` if and only if `slope f a b ≤ slope f c b`. -/
theorem map_le_lineMap_iff_slope_le_slope_right (h : 0 < (1 - r) * (b - a)) :
    f c ≤ lineMap (f a) (f b) r ↔ slope f a b ≤ slope f c b := by
  rw [← lineMap_apply_one_sub, ← lineMap_apply_one_sub _ _ r]
  revert h; generalize 1 - r = r'; clear! r; 

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : LinearOrderedField k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
f : k → E
a b r' : k
⊢ 0 < r' * (b - a) → (f ((lineMap b a) r') ≤ (lineMap (f b) (f a)) r' ↔ slope f a b ≤ slope f ((lineMap b a) r') b)

Next tactic:
intro h
/-- Given `c = lineMap a b r`, `c < b`, the point `(c, f c)` is non-strictly below the
segment `[(a, f a), (b, f b)]` if and only if `slope f a b ≤ slope f c b`. -/
theorem map_le_lineMap_iff_slope_le_slope_right (h : 0 < (1 - r) * (b - a)) :
    f c ≤ lineMap (f a) (f b) r ↔ slope f a b ≤ slope f c b := by
  rw [← lineMap_apply_one_sub, ← lineMap_apply_one_sub _ _ r]
  revert h; generalize 1 - r = r'; clear! r; intro h
  

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : LinearOrderedField k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
f : k → E
a b r' : k
h : 0 < r' * (b - a)
⊢ f ((lineMap b a) r') ≤ (lineMap (f b) (f a)) r' ↔ slope f a b ≤ slope f ((lineMap b a) r') b

Next tactic:
simp_rw [lineMap_apply, slope, vsub_eq_sub, vadd_eq_add, smul_eq_mul]
/-- Given `c = lineMap a b r`, `c < b`, the point `(c, f c)` is non-strictly below the
segment `[(a, f a), (b, f b)]` if and only if `slope f a b ≤ slope f c b`. -/
theorem map_le_lineMap_iff_slope_le_slope_right (h : 0 < (1 - r) * (b - a)) :
    f c ≤ lineMap (f a) (f b) r ↔ slope f a b ≤ slope f c b := by
  rw [← lineMap_apply_one_sub, ← lineMap_apply_one_sub _ _ r]
  revert h; generalize 1 - r = r'; clear! r; intro h
  simp_rw [lineMap_apply, slope, vsub_eq_sub, vadd_eq_add, smul_eq_mul]
  

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : LinearOrderedField k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
f : k → E
a b r' : k
h : 0 < r' * (b - a)
⊢ f (r' * (a - b) + b) ≤ r' • (f a - f b) + f b ↔
    (b - a)⁻¹ • (f b - f a) ≤ (b - (r' * (a - b) + b))⁻¹ • (f b - f (r' * (a - b) + b))

Next tactic:
rw [sub_add_eq_sub_sub_swap, sub_self, zero_sub, neg_mul_eq_mul_neg, neg_sub, le_inv_smul_iff h,
    smul_smul, mul_inv_cancel_right₀, le_sub_comm, ← neg_sub (f b), smul_neg, neg_add_eq_sub]
/-- Given `c = lineMap a b r`, `c < b`, the point `(c, f c)` is non-strictly below the
segment `[(a, f a), (b, f b)]` if and only if `slope f a b ≤ slope f c b`. -/
theorem map_le_lineMap_iff_slope_le_slope_right (h : 0 < (1 - r) * (b - a)) :
    f c ≤ lineMap (f a) (f b) r ↔ slope f a b ≤ slope f c b := by
  rw [← lineMap_apply_one_sub, ← lineMap_apply_one_sub _ _ r]
  revert h; generalize 1 - r = r'; clear! r; intro h
  simp_rw [lineMap_apply, slope, vsub_eq_sub, vadd_eq_add, smul_eq_mul]
  rw [sub_add_eq_sub_sub_swap, sub_self, zero_sub, neg_mul_eq_mul_neg, neg_sub, le_inv_smul_iff h,
    smul_smul, mul_inv_cancel_right₀, le_sub_comm, ← neg_sub (f b), smul_neg, neg_add_eq_sub]
  · 

Proof state:
case h
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : LinearOrderedField k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
f : k → E
a b r' : k
h : 0 < r' * (b - a)
⊢ b - a ≠ 0

Next tactic:
exact right_ne_zero_of_mul h.ne'
/-- Given `c = lineMap a b r`, `a < c < b`, the point `(c, f c)` is non-strictly below the
segment `[(a, f a), (b, f b)]` if and only if `slope f a c ≤ slope f c b`. -/
theorem map_le_lineMap_iff_slope_le_slope (hab : a < b) (h₀ : 0 < r) (h₁ : r < 1) :
    f c ≤ lineMap (f a) (f b) r ↔ slope f a c ≤ slope f c b := by
  

Proof state:
k : Type u_1
E : Type u_2
PE : Type u_3
inst✝³ : LinearOrderedField k
inst✝² : OrderedAddCommGroup E
inst✝¹ : Module k E
inst✝ : OrderedSMul k E
f : k → E
a b r : k
hab : a < b
h₀ : 0 < r
h₁ : r < 1
⊢ f ((lineMap a b) r) ≤ (lineMap (f a) (f b)) r ↔ slope f a ((lineMap a b) r) ≤ slope f ((lineMap a b) r) b

Next tactic:
rw [map_le_lineMap_iff_slope_le_slope_left (mul_pos h₀ (sub_pos.2 hab)), ←
    lineMap_slope_lineMap_slope_lineMap f a b r, right_le_lineMap_iff_le h₁]