l3lab/ntp-mathlib huggingface dataset:
theorem lineMap_apply_one_sub (p₀ p₁ : P1) (c : k) : lineMap p₀ p₁ (1 - c) = lineMap p₁ p₀ c := by
  

Proof state:
k : Type u_1
V1 : Type u_2
P1 : Type u_3
V2 : Type u_4
P2 : Type u_5
V3 : Type u_6
P3 : Type u_7
V4 : Type u_8
P4 : Type u_9
inst✝¹² : Ring k
inst✝¹¹ : AddCommGroup V1
inst✝¹⁰ : Module k V1
inst✝⁹ : AffineSpace V1 P1
inst✝⁸ : AddCommGroup V2
inst✝⁷ : Module k V2
inst✝⁶ : AffineSpace V2 P2
inst✝⁵ : AddCommGroup V3
inst✝⁴ : Module k V3
inst✝³ : AffineSpace V3 P3
inst✝² : AddCommGroup V4
inst✝¹ : Module k V4
inst✝ : AffineSpace V4 P4
p₀ p₁ : P1
c : k
⊢ (lineMap p₀ p₁) (1 - c) = (lineMap p₁ p₀) c

Next tactic:
rw [lineMap_symm p₀, comp_apply]
theorem lineMap_apply_one_sub (p₀ p₁ : P1) (c : k) : lineMap p₀ p₁ (1 - c) = lineMap p₁ p₀ c := by
  rw [lineMap_symm p₀, comp_apply]
  

Proof state:
k : Type u_1
V1 : Type u_2
P1 : Type u_3
V2 : Type u_4
P2 : Type u_5
V3 : Type u_6
P3 : Type u_7
V4 : Type u_8
P4 : Type u_9
inst✝¹² : Ring k
inst✝¹¹ : AddCommGroup V1
inst✝¹⁰ : Module k V1
inst✝⁹ : AffineSpace V1 P1
inst✝⁸ : AddCommGroup V2
inst✝⁷ : Module k V2
inst✝⁶ : AffineSpace V2 P2
inst✝⁵ : AddCommGroup V3
inst✝⁴ : Module k V3
inst✝³ : AffineSpace V3 P3
inst✝² : AddCommGroup V4
inst✝¹ : Module k V4
inst✝ : AffineSpace V4 P4
p₀ p₁ : P1
c : k
⊢ (lineMap p₁ p₀) ((lineMap 1 0) (1 - c)) = (lineMap p₁ p₀) c

Next tactic:
congr
theorem lineMap_apply_one_sub (p₀ p₁ : P1) (c : k) : lineMap p₀ p₁ (1 - c) = lineMap p₁ p₀ c := by
  rw [lineMap_symm p₀, comp_apply]
  congr
  

Proof state:
case h.e_6.h
k : Type u_1
V1 : Type u_2
P1 : Type u_3
V2 : Type u_4
P2 : Type u_5
V3 : Type u_6
P3 : Type u_7
V4 : Type u_8
P4 : Type u_9
inst✝¹² : Ring k
inst✝¹¹ : AddCommGroup V1
inst✝¹⁰ : Module k V1
inst✝⁹ : AffineSpace V1 P1
inst✝⁸ : AddCommGroup V2
inst✝⁷ : Module k V2
inst✝⁶ : AffineSpace V2 P2
inst✝⁵ : AddCommGroup V3
inst✝⁴ : Module k V3
inst✝³ : AffineSpace V3 P3
inst✝² : AddCommGroup V4
inst✝¹ : Module k V4
inst✝ : AffineSpace V4 P4
p₀ p₁ : P1
c : k
⊢ (lineMap 1 0) (1 - c) = c

Next tactic:
simp [lineMap_apply]
@[simp]
theorem left_vsub_lineMap (p₀ p₁ : P1) (c : k) : p₀ -ᵥ lineMap p₀ p₁ c = c • (p₀ -ᵥ p₁) := by
  

Proof state:
k : Type u_1
V1 : Type u_2
P1 : Type u_3
V2 : Type u_4
P2 : Type u_5
V3 : Type u_6
P3 : Type u_7
V4 : Type u_8
P4 : Type u_9
inst✝¹² : Ring k
inst✝¹¹ : AddCommGroup V1
inst✝¹⁰ : Module k V1
inst✝⁹ : AffineSpace V1 P1
inst✝⁸ : AddCommGroup V2
inst✝⁷ : Module k V2
inst✝⁶ : AffineSpace V2 P2
inst✝⁵ : AddCommGroup V3
inst✝⁴ : Module k V3
inst✝³ : AffineSpace V3 P3
inst✝² : AddCommGroup V4
inst✝¹ : Module k V4
inst✝ : AffineSpace V4 P4
p₀ p₁ : P1
c : k
⊢ p₀ -ᵥ (lineMap p₀ p₁) c = c • (p₀ -ᵥ p₁)

Next tactic:
rw [← neg_vsub_eq_vsub_rev, lineMap_vsub_left, ← smul_neg, neg_vsub_eq_vsub_rev]
@[simp]
theorem lineMap_vsub_right (p₀ p₁ : P1) (c : k) : lineMap p₀ p₁ c -ᵥ p₁ = (1 - c) • (p₀ -ᵥ p₁) := by
  

Proof state:
k : Type u_1
V1 : Type u_2
P1 : Type u_3
V2 : Type u_4
P2 : Type u_5
V3 : Type u_6
P3 : Type u_7
V4 : Type u_8
P4 : Type u_9
inst✝¹² : Ring k
inst✝¹¹ : AddCommGroup V1
inst✝¹⁰ : Module k V1
inst✝⁹ : AffineSpace V1 P1
inst✝⁸ : AddCommGroup V2
inst✝⁷ : Module k V2
inst✝⁶ : AffineSpace V2 P2
inst✝⁵ : AddCommGroup V3
inst✝⁴ : Module k V3
inst✝³ : AffineSpace V3 P3
inst✝² : AddCommGroup V4
inst✝¹ : Module k V4
inst✝ : AffineSpace V4 P4
p₀ p₁ : P1
c : k
⊢ (lineMap p₀ p₁) c -ᵥ p₁ = (1 - c) • (p₀ -ᵥ p₁)

Next tactic:
rw [← lineMap_apply_one_sub, lineMap_vsub_left]
@[simp]
theorem right_vsub_lineMap (p₀ p₁ : P1) (c : k) : p₁ -ᵥ lineMap p₀ p₁ c = (1 - c) • (p₁ -ᵥ p₀) := by
  

Proof state:
k : Type u_1
V1 : Type u_2
P1 : Type u_3
V2 : Type u_4
P2 : Type u_5
V3 : Type u_6
P3 : Type u_7
V4 : Type u_8
P4 : Type u_9
inst✝¹² : Ring k
inst✝¹¹ : AddCommGroup V1
inst✝¹⁰ : Module k V1
inst✝⁹ : AffineSpace V1 P1
inst✝⁸ : AddCommGroup V2
inst✝⁷ : Module k V2
inst✝⁶ : AffineSpace V2 P2
inst✝⁵ : AddCommGroup V3
inst✝⁴ : Module k V3
inst✝³ : AffineSpace V3 P3
inst✝² : AddCommGroup V4
inst✝¹ : Module k V4
inst✝ : AffineSpace V4 P4
p₀ p₁ : P1
c : k
⊢ p₁ -ᵥ (lineMap p₀ p₁) c = (1 - c) • (p₁ -ᵥ p₀)

Next tactic:
rw [← lineMap_apply_one_sub, left_vsub_lineMap]
/-- Decomposition of an affine map in the special case when the point space and vector space
are the same. -/
theorem decomp (f : V1 →ᵃ[k] V2) : (f : V1 → V2) = ⇑f.linear + fun _ => f 0 := by
  

Proof state:
k : Type u_1
V1 : Type u_2
P1 : Type u_3
V2 : Type u_4
P2 : Type u_5
V3 : Type u_6
P3 : Type u_7
V4 : Type u_8
P4 : Type u_9
inst✝¹² : Ring k
inst✝¹¹ : AddCommGroup V1
inst✝¹⁰ : Module k V1
inst✝⁹ : AffineSpace V1 P1
inst✝⁸ : AddCommGroup V2
inst✝⁷ : Module k V2
inst✝⁶ : AffineSpace V2 P2
inst✝⁵ : AddCommGroup V3
inst✝⁴ : Module k V3
inst✝³ : AffineSpace V3 P3
inst✝² : AddCommGroup V4
inst✝¹ : Module k V4
inst✝ : AffineSpace V4 P4
f : V1 →ᵃ[k] V2
⊢ ⇑f = ⇑f.linear + fun x => f 0

Next tactic:
ext x
/-- Decomposition of an affine map in the special case when the point space and vector space
are the same. -/
theorem decomp (f : V1 →ᵃ[k] V2) : (f : V1 → V2) = ⇑f.linear + fun _ => f 0 := by
  ext x
  

Proof state:
case h
k : Type u_1
V1 : Type u_2
P1 : Type u_3
V2 : Type u_4
P2 : Type u_5
V3 : Type u_6
P3 : Type u_7
V4 : Type u_8
P4 : Type u_9
inst✝¹² : Ring k
inst✝¹¹ : AddCommGroup V1
inst✝¹⁰ : Module k V1
inst✝⁹ : AffineSpace V1 P1
inst✝⁸ : AddCommGroup V2
inst✝⁷ : Module k V2
inst✝⁶ : AffineSpace V2 P2
inst✝⁵ : AddCommGroup V3
inst✝⁴ : Module k V3
inst✝³ : AffineSpace V3 P3
inst✝² : AddCommGroup V4
inst✝¹ : Module k V4
inst✝ : AffineSpace V4 P4
f : V1 →ᵃ[k] V2
x : V1
⊢ f x = (⇑f.linear + fun x => f 0) x

Next tactic:
calc
    f x = f.linear x +ᵥ f 0 := by rw [← f.map_vadd, vadd_eq_add, add_zero]
    _ = (f.linear + fun _ : V1 => f 0) x := rfl
/-- Decomposition of an affine map in the special case when the point space and vector space
are the same. -/
theorem decomp (f : V1 →ᵃ[k] V2) : (f : V1 → V2) = ⇑f.linear + fun _ => f 0 := by
  ext x
  calc
    f x = f.linear x +ᵥ f 0 := by 

Proof state:
k : Type u_1
V1 : Type u_2
P1 : Type u_3
V2 : Type u_4
P2 : Type u_5
V3 : Type u_6
P3 : Type u_7
V4 : Type u_8
P4 : Type u_9
inst✝¹² : Ring k
inst✝¹¹ : AddCommGroup V1
inst✝¹⁰ : Module k V1
inst✝⁹ : AffineSpace V1 P1
inst✝⁸ : AddCommGroup V2
inst✝⁷ : Module k V2
inst✝⁶ : AffineSpace V2 P2
inst✝⁵ : AddCommGroup V3
inst✝⁴ : Module k V3
inst✝³ : AffineSpace V3 P3
inst✝² : AddCommGroup V4
inst✝¹ : Module k V4
inst✝ : AffineSpace V4 P4
f : V1 →ᵃ[k] V2
x : V1
⊢ f x = f.linear x +ᵥ f 0

Next tactic:
rw [← f.map_vadd, vadd_eq_add, add_zero]
/-- Decomposition of an affine map in the special case when the point space and vector space
are the same. -/
theorem decomp' (f : V1 →ᵃ[k] V2) : (f.linear : V1 → V2) = ⇑f - fun _ => f 0 := by
  

Proof state:
k : Type u_1
V1 : Type u_2
P1 : Type u_3
V2 : Type u_4
P2 : Type u_5
V3 : Type u_6
P3 : Type u_7
V4 : Type u_8
P4 : Type u_9
inst✝¹² : Ring k
inst✝¹¹ : AddCommGroup V1
inst✝¹⁰ : Module k V1
inst✝⁹ : AffineSpace V1 P1
inst✝⁸ : AddCommGroup V2
inst✝⁷ : Module k V2
inst✝⁶ : AffineSpace V2 P2
inst✝⁵ : AddCommGroup V3
inst✝⁴ : Module k V3
inst✝³ : AffineSpace V3 P3
inst✝² : AddCommGroup V4
inst✝¹ : Module k V4
inst✝ : AffineSpace V4 P4
f : V1 →ᵃ[k] V2
⊢ ⇑f.linear = ⇑f - fun x => f 0

Next tactic:
rw [decomp]
/-- Decomposition of an affine map in the special case when the point space and vector space
are the same. -/
theorem decomp' (f : V1 →ᵃ[k] V2) : (f.linear : V1 → V2) = ⇑f - fun _ => f 0 := by
  rw [decomp]
  

Proof state:
k : Type u_1
V1 : Type u_2
P1 : Type u_3
V2 : Type u_4
P2 : Type u_5
V3 : Type u_6
P3 : Type u_7
V4 : Type u_8
P4 : Type u_9
inst✝¹² : Ring k
inst✝¹¹ : AddCommGroup V1
inst✝¹⁰ : Module k V1
inst✝⁹ : AffineSpace V1 P1
inst✝⁸ : AddCommGroup V2
inst✝⁷ : Module k V2
inst✝⁶ : AffineSpace V2 P2
inst✝⁵ : AddCommGroup V3
inst✝⁴ : Module k V3
inst✝³ : AffineSpace V3 P3
inst✝² : AddCommGroup V4
inst✝¹ : Module k V4
inst✝ : AffineSpace V4 P4
f : V1 →ᵃ[k] V2
⊢ ⇑f.linear = (⇑f.linear + fun x => f 0) - fun x => (⇑f.linear + fun x => f 0) 0

Next tactic:
simp only [LinearMap.map_zero, Pi.add_apply, add_sub_cancel, zero_add]
theorem image_uIcc {k : Type*} [LinearOrderedField k] (f : k →ᵃ[k] k) (a b : k) :
    f '' Set.uIcc a b = Set.uIcc (f a) (f b) := by
  

Proof state:
k✝ : Type u_1
V1 : Type u_2
P1 : Type u_3
V2 : Type u_4
P2 : Type u_5
V3 : Type u_6
P3 : Type u_7
V4 : Type u_8
P4 : Type u_9
inst✝¹³ : Ring k✝
inst✝¹² : AddCommGroup V1
inst✝¹¹ : Module k✝ V1
inst✝¹⁰ : AffineSpace V1 P1
inst✝⁹ : AddCommGroup V2
inst✝⁸ : Module k✝ V2
inst✝⁷ : AffineSpace V2 P2
inst✝⁶ : AddCommGroup V3
inst✝⁵ : Module k✝ V3
inst✝⁴ : AffineSpace V3 P3
inst✝³ : AddCommGroup V4
inst✝² : Module k✝ V4
inst✝¹ : AffineSpace V4 P4
k : Type u_10
inst✝ : LinearOrderedField k
f : k →ᵃ[k] k
a b : k
⊢ ⇑f '' Set.uIcc a b = Set.uIcc (f a) (f b)

Next tactic:
have : ⇑f = (fun x => x + f 0) ∘ fun x => x * (f 1 - f 0) := by
    ext x
    change f x = x • (f 1 -ᵥ f 0) +ᵥ f 0
    rw [← f.linearMap_vsub, ← f.linear.map_smul, ← f.map_vadd]
    simp only [vsub_eq_sub, add_zero, mul_one, vadd_eq_add, sub_zero, smul_eq_mul]
theorem image_uIcc {k : Type*} [LinearOrderedField k] (f : k →ᵃ[k] k) (a b : k) :
    f '' Set.uIcc a b = Set.uIcc (f a) (f b) := by
  have : ⇑f = (fun x => x + f 0) ∘ fun x => x * (f 1 - f 0) := by
    

Proof state:
k✝ : Type u_1
V1 : Type u_2
P1 : Type u_3
V2 : Type u_4
P2 : Type u_5
V3 : Type u_6
P3 : Type u_7
V4 : Type u_8
P4 : Type u_9
inst✝¹³ : Ring k✝
inst✝¹² : AddCommGroup V1
inst✝¹¹ : Module k✝ V1
inst✝¹⁰ : AffineSpace V1 P1
inst✝⁹ : AddCommGroup V2
inst✝⁸ : Module k✝ V2
inst✝⁷ : AffineSpace V2 P2
inst✝⁶ : AddCommGroup V3
inst✝⁵ : Module k✝ V3
inst✝⁴ : AffineSpace V3 P3
inst✝³ : AddCommGroup V4
inst✝² : Module k✝ V4
inst✝¹ : AffineSpace V4 P4
k : Type u_10
inst✝ : LinearOrderedField k
f : k →ᵃ[k] k
a b : k
⊢ ⇑f = (fun x => x + f 0) ∘ fun x => x * (f 1 - f 0)

Next tactic:
ext x
theorem image_uIcc {k : Type*} [LinearOrderedField k] (f : k →ᵃ[k] k) (a b : k) :
    f '' Set.uIcc a b = Set.uIcc (f a) (f b) := by
  have : ⇑f = (fun x => x + f 0) ∘ fun x => x * (f 1 - f 0) := by
    ext x
    

Proof state:
case h
k✝ : Type u_1
V1 : Type u_2
P1 : Type u_3
V2 : Type u_4
P2 : Type u_5
V3 : Type u_6
P3 : Type u_7
V4 : Type u_8
P4 : Type u_9
inst✝¹³ : Ring k✝
inst✝¹² : AddCommGroup V1
inst✝¹¹ : Module k✝ V1
inst✝¹⁰ : AffineSpace V1 P1
inst✝⁹ : AddCommGroup V2
inst✝⁸ : Module k✝ V2
inst✝⁷ : AffineSpace V2 P2
inst✝⁶ : AddCommGroup V3
inst✝⁵ : Module k✝ V3
inst✝⁴ : AffineSpace V3 P3
inst✝³ : AddCommGroup V4
inst✝² : Module k✝ V4
inst✝¹ : AffineSpace V4 P4
k : Type u_10
inst✝ : LinearOrderedField k
f : k →ᵃ[k] k
a b x : k
⊢ f x = ((fun x => x + f 0) ∘ fun x => x * (f 1 - f 0)) x

Next tactic:
change f x = x • (f 1 -ᵥ f 0) +ᵥ f 0
theorem image_uIcc {k : Type*} [LinearOrderedField k] (f : k →ᵃ[k] k) (a b : k) :
    f '' Set.uIcc a b = Set.uIcc (f a) (f b) := by
  have : ⇑f = (fun x => x + f 0) ∘ fun x => x * (f 1 - f 0) := by
    ext x
    change f x = x • (f 1 -ᵥ f 0) +ᵥ f 0
    

Proof state:
case h
k✝ : Type u_1
V1 : Type u_2
P1 : Type u_3
V2 : Type u_4
P2 : Type u_5
V3 : Type u_6
P3 : Type u_7
V4 : Type u_8
P4 : Type u_9
inst✝¹³ : Ring k✝
inst✝¹² : AddCommGroup V1
inst✝¹¹ : Module k✝ V1
inst✝¹⁰ : AffineSpace V1 P1
inst✝⁹ : AddCommGroup V2
inst✝⁸ : Module k✝ V2
inst✝⁷ : AffineSpace V2 P2
inst✝⁶ : AddCommGroup V3
inst✝⁵ : Module k✝ V3
inst✝⁴ : AffineSpace V3 P3
inst✝³ : AddCommGroup V4
inst✝² : Module k✝ V4
inst✝¹ : AffineSpace V4 P4
k : Type u_10
inst✝ : LinearOrderedField k
f : k →ᵃ[k] k
a b x : k
⊢ f x = x • (f 1 -ᵥ f 0) +ᵥ f 0

Next tactic:
rw [← f.linearMap_vsub, ← f.linear.map_smul, ← f.map_vadd]
theorem image_uIcc {k : Type*} [LinearOrderedField k] (f : k →ᵃ[k] k) (a b : k) :
    f '' Set.uIcc a b = Set.uIcc (f a) (f b) := by
  have : ⇑f = (fun x => x + f 0) ∘ fun x => x * (f 1 - f 0) := by
    ext x
    change f x = x • (f 1 -ᵥ f 0) +ᵥ f 0
    rw [← f.linearMap_vsub, ← f.linear.map_smul, ← f.map_vadd]
    

Proof state:
case h
k✝ : Type u_1
V1 : Type u_2
P1 : Type u_3
V2 : Type u_4
P2 : Type u_5
V3 : Type u_6
P3 : Type u_7
V4 : Type u_8
P4 : Type u_9
inst✝¹³ : Ring k✝
inst✝¹² : AddCommGroup V1
inst✝¹¹ : Module k✝ V1
inst✝¹⁰ : AffineSpace V1 P1
inst✝⁹ : AddCommGroup V2
inst✝⁸ : Module k✝ V2
inst✝⁷ : AffineSpace V2 P2
inst✝⁶ : AddCommGroup V3
inst✝⁵ : Module k✝ V3
inst✝⁴ : AffineSpace V3 P3
inst✝³ : AddCommGroup V4
inst✝² : Module k✝ V4
inst✝¹ : AffineSpace V4 P4
k : Type u_10
inst✝ : LinearOrderedField k
f : k →ᵃ[k] k
a b x : k
⊢ f x = f (x • (1 -ᵥ 0) +ᵥ 0)

Next tactic:
simp only [vsub_eq_sub, add_zero, mul_one, vadd_eq_add, sub_zero, smul_eq_mul]
theorem image_uIcc {k : Type*} [LinearOrderedField k] (f : k →ᵃ[k] k) (a b : k) :
    f '' Set.uIcc a b = Set.uIcc (f a) (f b) := by
  have : ⇑f = (fun x => x + f 0) ∘ fun x => x * (f 1 - f 0) := by
    ext x
    change f x = x • (f 1 -ᵥ f 0) +ᵥ f 0
    rw [← f.linearMap_vsub, ← f.linear.map_smul, ← f.map_vadd]
    simp only [vsub_eq_sub, add_zero, mul_one, vadd_eq_add, sub_zero, smul_eq_mul]
  

Proof state:
k✝ : Type u_1
V1 : Type u_2
P1 : Type u_3
V2 : Type u_4
P2 : Type u_5
V3 : Type u_6
P3 : Type u_7
V4 : Type u_8
P4 : Type u_9
inst✝¹³ : Ring k✝
inst✝¹² : AddCommGroup V1
inst✝¹¹ : Module k✝ V1
inst✝¹⁰ : AffineSpace V1 P1
inst✝⁹ : AddCommGroup V2
inst✝⁸ : Module k✝ V2
inst✝⁷ : AffineSpace V2 P2
inst✝⁶ : AddCommGroup V3
inst✝⁵ : Module k✝ V3
inst✝⁴ : AffineSpace V3 P3
inst✝³ : AddCommGroup V4
inst✝² : Module k✝ V4
inst✝¹ : AffineSpace V4 P4
k : Type u_10
inst✝ : LinearOrderedField k
f : k →ᵃ[k] k
a b : k
this : ⇑f = (fun x => x + f 0) ∘ fun x => x * (f 1 - f 0)
⊢ ⇑f '' Set.uIcc a b = Set.uIcc (f a) (f b)

Next tactic:
rw [this, Set.image_comp]
theorem image_uIcc {k : Type*} [LinearOrderedField k] (f : k →ᵃ[k] k) (a b : k) :
    f '' Set.uIcc a b = Set.uIcc (f a) (f b) := by
  have : ⇑f = (fun x => x + f 0) ∘ fun x => x * (f 1 - f 0) := by
    ext x
    change f x = x • (f 1 -ᵥ f 0) +ᵥ f 0
    rw [← f.linearMap_vsub, ← f.linear.map_smul, ← f.map_vadd]
    simp only [vsub_eq_sub, add_zero, mul_one, vadd_eq_add, sub_zero, smul_eq_mul]
  rw [this, Set.image_comp]
  

Proof state:
k✝ : Type u_1
V1 : Type u_2
P1 : Type u_3
V2 : Type u_4
P2 : Type u_5
V3 : Type u_6
P3 : Type u_7
V4 : Type u_8
P4 : Type u_9
inst✝¹³ : Ring k✝
inst✝¹² : AddCommGroup V1
inst✝¹¹ : Module k✝ V1
inst✝¹⁰ : AffineSpace V1 P1
inst✝⁹ : AddCommGroup V2
inst✝⁸ : Module k✝ V2
inst✝⁷ : AffineSpace V2 P2
inst✝⁶ : AddCommGroup V3
inst✝⁵ : Module k✝ V3
inst✝⁴ : AffineSpace V3 P3
inst✝³ : AddCommGroup V4
inst✝² : Module k✝ V4
inst✝¹ : AffineSpace V4 P4
k : Type u_10
inst✝ : LinearOrderedField k
f : k →ᵃ[k] k
a b : k
this : ⇑f = (fun x => x + f 0) ∘ fun x => x * (f 1 - f 0)
⊢ (fun x => x + f 0) '' ((fun x => x * (f 1 - f 0)) '' Set.uIcc a b) =
    Set.uIcc (((fun x => x + f 0) ∘ fun x => x * (f 1 - f 0)) a) (((fun x => x + f 0) ∘ fun x => x * (f 1 - f 0)) b)

Next tactic:
simp only [Set.image_add_const_uIcc, Set.image_mul_const_uIcc, Function.comp_apply]
/-- The space of affine maps between two modules is linearly equivalent to the product of the
domain with the space of linear maps, by taking the value of the affine map at `(0 : V1)` and the
linear part.

See note [bundled maps over different rings]-/
@[simps]
def toConstProdLinearMap : (V1 →ᵃ[k] V2) ≃ₗ[R] V2 × (V1 →ₗ[k] V2) where
  toFun f := ⟨f 0, f.linear⟩
  invFun p := p.2.toAffineMap + const k V1 p.1
  left_inv f := by
    ext
    rw [f.decomp]
    simp [const_apply _ _]  -- porting note: `simp` needs `_`s to use this lemma
  right_inv := by
    rintro ⟨v, f⟩
    ext <;> simp [const_apply _ _, const_linear _ _]  -- porting note: `simp` needs `_`s
  map_add' := by 

Proof state:
R : Type u_1
k : Type u_2
V1 : Type u_3
P1 : Type u_4
V2 : Type u_5
inst✝⁸ : Ring k
inst✝⁷ : AddCommGroup V1
inst✝⁶ : AffineSpace V1 P1
inst✝⁵ : AddCommGroup V2
inst✝⁴ : Module k V1
inst✝³ : Module k V2
inst✝² : Semiring R
inst✝¹ : Module R V2
inst✝ : SMulCommClass k R V2
⊢ ∀ (x y : V1 →ᵃ[k] V2),
    (fun f => (f 0, f.linear)) (x + y) = (fun f => (f 0, f.linear)) x + (fun f => (f 0, f.linear)) y

Next tactic:
simp
/-- The space of affine maps between two modules is linearly equivalent to the product of the
domain with the space of linear maps, by taking the value of the affine map at `(0 : V1)` and the
linear part.

See note [bundled maps over different rings]-/
@[simps]
def toConstProdLinearMap : (V1 →ᵃ[k] V2) ≃ₗ[R] V2 × (V1 →ₗ[k] V2) where
  toFun f := ⟨f 0, f.linear⟩
  invFun p := p.2.toAffineMap + const k V1 p.1
  left_inv f := by
    ext
    rw [f.decomp]
    simp [const_apply _ _]  -- porting note: `simp` needs `_`s to use this lemma
  right_inv := by
    rintro ⟨v, f⟩
    ext <;> simp [const_apply _ _, const_linear _ _]  -- porting note: `simp` needs `_`s
  map_add' := by simp
  map_smul' := by 

Proof state:
R : Type u_1
k : Type u_2
V1 : Type u_3
P1 : Type u_4
V2 : Type u_5
inst✝⁸ : Ring k
inst✝⁷ : AddCommGroup V1
inst✝⁶ : AffineSpace V1 P1
inst✝⁵ : AddCommGroup V2
inst✝⁴ : Module k V1
inst✝³ : Module k V2
inst✝² : Semiring R
inst✝¹ : Module R V2
inst✝ : SMulCommClass k R V2
⊢ ∀ (r : R) (x : V1 →ᵃ[k] V2),
    AddHom.toFun
        { toFun := fun f => (f 0, f.linear),
          map_add' :=
            (_ : ∀ (a a_1 : V1 →ᵃ[k] V2), (a 0 + a_1 0, a.linear + a_1.linear) = (a 0 + a_1 0, a.linear + a_1.linear)) }
        (r • x) =
      (RingHom.id R) r •
        AddHom.toFun
          { toFun := fun f => (f 0, f.linear),
            map_add' :=
              (_ :
                ∀ (a a_1 : V1 →ᵃ[k] V2), (a 0 + a_1 0, a.linear + a_1.linear) = (a 0 + a_1 0, a.linear + a_1.linear)) }
          x

Next tactic:
simp
/-- The space of affine maps between two modules is linearly equivalent to the product of the
domain with the space of linear maps, by taking the value of the affine map at `(0 : V1)` and the
linear part.

See note [bundled maps over different rings]-/
@[simps]
def toConstProdLinearMap : (V1 →ᵃ[k] V2) ≃ₗ[R] V2 × (V1 →ₗ[k] V2) where
  toFun f := ⟨f 0, f.linear⟩
  invFun p := p.2.toAffineMap + const k V1 p.1
  left_inv f := by
    

Proof state:
R : Type u_1
k : Type u_2
V1 : Type u_3
P1 : Type u_4
V2 : Type u_5
inst✝⁸ : Ring k
inst✝⁷ : AddCommGroup V1
inst✝⁶ : AffineSpace V1 P1
inst✝⁵ : AddCommGroup V2
inst✝⁴ : Module k V1
inst✝³ : Module k V2
inst✝² : Semiring R
inst✝¹ : Module R V2
inst✝ : SMulCommClass k R V2
f : V1 →ᵃ[k] V2
⊢ (fun p => LinearMap.toAffineMap p.2 + const k V1 p.1)
      (AddHom.toFun
        {
            toAddHom :=
              { toFun := fun f => (f 0, f.linear),
                map_add' :=
                  (_ :
                    ∀ (a a_1 : V1 →ᵃ[k] V2),
                      (a 0 + a_1 0, a.linear + a_1.linear) = (a 0 + a_1 0, a.linear + a_1.linear)) },
            map_smul' :=
              (_ : ∀ (a : R) (a_1 : V1 →ᵃ[k] V2), (a • a_1 0, a • a_1.linear) = (a • a_1 0, a • a_1.linear)) }.toAddHom
        f) =
    f

Next tactic:
ext
/-- The space of affine maps between two modules is linearly equivalent to the product of the
domain with the space of linear maps, by taking the value of the affine map at `(0 : V1)` and the
linear part.

See note [bundled maps over different rings]-/
@[simps]
def toConstProdLinearMap : (V1 →ᵃ[k] V2) ≃ₗ[R] V2 × (V1 →ₗ[k] V2) where
  toFun f := ⟨f 0, f.linear⟩
  invFun p := p.2.toAffineMap + const k V1 p.1
  left_inv f := by
    ext
    

Proof state:
case h
R : Type u_1
k : Type u_2
V1 : Type u_3
P1 : Type u_4
V2 : Type u_5
inst✝⁸ : Ring k
inst✝⁷ : AddCommGroup V1
inst✝⁶ : AffineSpace V1 P1
inst✝⁵ : AddCommGroup V2
inst✝⁴ : Module k V1
inst✝³ : Module k V2
inst✝² : Semiring R
inst✝¹ : Module R V2
inst✝ : SMulCommClass k R V2
f : V1 →ᵃ[k] V2
p✝ : V1
⊢ ((fun p => LinearMap.toAffineMap p.2 + const k V1 p.1)
        (AddHom.toFun
          {
              toAddHom :=
                { toFun := fun f => (f 0, f.linear),
                  map_add' :=
                    (_ :
                      ∀ (a a_1 : V1 →ᵃ[k] V2),
                        (a 0 + a_1 0, a.linear + a_1.linear) = (a 0 + a_1 0, a.linear + a_1.linear)) },
              map_smul' :=
                (_ :
                  ∀ (a : R) (a_1 : V1 →ᵃ[k] V2), (a • a_1 0, a • a_1.linear) = (a • a_1 0, a • a_1.linear)) }.toAddHom
          f))
      p✝ =
    f p✝

Next tactic:
rw [f.decomp]
/-- The space of affine maps between two modules is linearly equivalent to the product of the
domain with the space of linear maps, by taking the value of the affine map at `(0 : V1)` and the
linear part.

See note [bundled maps over different rings]-/
@[simps]
def toConstProdLinearMap : (V1 →ᵃ[k] V2) ≃ₗ[R] V2 × (V1 →ₗ[k] V2) where
  toFun f := ⟨f 0, f.linear⟩
  invFun p := p.2.toAffineMap + const k V1 p.1
  left_inv f := by
    ext
    rw [f.decomp]
    

Proof state:
case h
R : Type u_1
k : Type u_2
V1 : Type u_3
P1 : Type u_4
V2 : Type u_5
inst✝⁸ : Ring k
inst✝⁷ : AddCommGroup V1
inst✝⁶ : AffineSpace V1 P1
inst✝⁵ : AddCommGroup V2
inst✝⁴ : Module k V1
inst✝³ : Module k V2
inst✝² : Semiring R
inst✝¹ : Module R V2
inst✝ : SMulCommClass k R V2
f : V1 →ᵃ[k] V2
p✝ : V1
⊢ ((fun p => LinearMap.toAffineMap p.2 + const k V1 p.1)
        (AddHom.toFun
          {
              toAddHom :=
                { toFun := fun f => (f 0, f.linear),
                  map_add' :=
                    (_ :
                      ∀ (a a_1 : V1 →ᵃ[k] V2),
                        (a 0 + a_1 0, a.linear + a_1.linear) = (a 0 + a_1 0, a.linear + a_1.linear)) },
              map_smul' :=
                (_ :
                  ∀ (a : R) (a_1 : V1 →ᵃ[k] V2), (a • a_1 0, a • a_1.linear) = (a • a_1 0, a • a_1.linear)) }.toAddHom
          f))
      p✝ =
    (⇑f.linear + fun x => f 0) p✝

Next tactic:
simp [const_apply _ _]
/-- The space of affine maps between two modules is linearly equivalent to the product of the
domain with the space of linear maps, by taking the value of the affine map at `(0 : V1)` and the
linear part.

See note [bundled maps over different rings]-/
@[simps]
def toConstProdLinearMap : (V1 →ᵃ[k] V2) ≃ₗ[R] V2 × (V1 →ₗ[k] V2) where
  toFun f := ⟨f 0, f.linear⟩
  invFun p := p.2.toAffineMap + const k V1 p.1
  left_inv f := by
    ext
    rw [f.decomp]
    simp [const_apply _ _]  -- porting note: `simp` needs `_`s to use this lemma
  right_inv := by
    

Proof state:
R : Type u_1
k : Type u_2
V1 : Type u_3
P1 : Type u_4
V2 : Type u_5
inst✝⁸ : Ring k
inst✝⁷ : AddCommGroup V1
inst✝⁶ : AffineSpace V1 P1
inst✝⁵ : AddCommGroup V2
inst✝⁴ : Module k V1
inst✝³ : Module k V2
inst✝² : Semiring R
inst✝¹ : Module R V2
inst✝ : SMulCommClass k R V2
⊢ Function.RightInverse (fun p => LinearMap.toAffineMap p.2 + const k V1 p.1)
    {
          toAddHom :=
            { toFun := fun f => (f 0, f.linear),
              map_add' :=
                (_ :
                  ∀ (a a_1 : V1 →ᵃ[k] V2),
                    (a 0 + a_1 0, a.linear + a_1.linear) = (a 0 + a_1 0, a.linear + a_1.linear)) },
          map_smul' :=
            (_ :
              ∀ (a : R) (a_1 : V1 →ᵃ[k] V2), (a • a_1 0, a • a_1.linear) = (a • a_1 0, a • a_1.linear)) }.toAddHom.toFun

Next tactic:
rintro ⟨v, f⟩
/-- The space of affine maps between two modules is linearly equivalent to the product of the
domain with the space of linear maps, by taking the value of the affine map at `(0 : V1)` and the
linear part.

See note [bundled maps over different rings]-/
@[simps]
def toConstProdLinearMap : (V1 →ᵃ[k] V2) ≃ₗ[R] V2 × (V1 →ₗ[k] V2) where
  toFun f := ⟨f 0, f.linear⟩
  invFun p := p.2.toAffineMap + const k V1 p.1
  left_inv f := by
    ext
    rw [f.decomp]
    simp [const_apply _ _]  -- porting note: `simp` needs `_`s to use this lemma
  right_inv := by
    rintro ⟨v, f⟩
    

Proof state:
case mk
R : Type u_1
k : Type u_2
V1 : Type u_3
P1 : Type u_4
V2 : Type u_5
inst✝⁸ : Ring k
inst✝⁷ : AddCommGroup V1
inst✝⁶ : AffineSpace V1 P1
inst✝⁵ : AddCommGroup V2
inst✝⁴ : Module k V1
inst✝³ : Module k V2
inst✝² : Semiring R
inst✝¹ : Module R V2
inst✝ : SMulCommClass k R V2
v : V2
f : V1 →ₗ[k] V2
⊢ AddHom.toFun
      {
          toAddHom :=
            { toFun := fun f => (f 0, f.linear),
              map_add' :=
                (_ :
                  ∀ (a a_1 : V1 →ᵃ[k] V2),
                    (a 0 + a_1 0, a.linear + a_1.linear) = (a 0 + a_1 0, a.linear + a_1.linear)) },
          map_smul' :=
            (_ : ∀ (a : R) (a_1 : V1 →ᵃ[k] V2), (a • a_1 0, a • a_1.linear) = (a • a_1 0, a • a_1.linear)) }.toAddHom
      ((fun p => LinearMap.toAffineMap p.2 + const k V1 p.1) (v, f)) =
    (v, f)

Next tactic:
ext