l3lab/ntp-mathlib huggingface dataset:
theorem lt_size_self (n : ℕ) : n < 2 ^ size n := by
  rw [← one_shiftLeft]
  have : ∀ {n}, n = 0 → n < 1 <<< (size n) := by simp
  apply binaryRec _ _ n
  · apply this rfl
  intro b n IH
  by_cases h : bit b n = 0
  · apply this h
  rw [size_bit h, shiftLeft_succ, shiftLeft_eq, one_mul, ← bit0_val]
  

Proof state:
case neg
n✝ : ℕ
this : ∀ {n : ℕ}, n = 0 → n < 1 <<< size n
b : Bool
n : ℕ
IH : n < 1 <<< size n
h : ¬bit b n = 0
⊢ bit b n < bit0 (2 ^ size n)

Next tactic:
exact bit_lt_bit0 _ (by simpa [shiftLeft_eq, shiftRight_eq_div_pow] using IH)
theorem lt_size_self (n : ℕ) : n < 2 ^ size n := by
  rw [← one_shiftLeft]
  have : ∀ {n}, n = 0 → n < 1 <<< (size n) := by simp
  apply binaryRec _ _ n
  · apply this rfl
  intro b n IH
  by_cases h : bit b n = 0
  · apply this h
  rw [size_bit h, shiftLeft_succ, shiftLeft_eq, one_mul, ← bit0_val]
  exact bit_lt_bit0 _ (by 

Proof state:
n✝ : ℕ
this : ∀ {n : ℕ}, n = 0 → n < 1 <<< size n
b : Bool
n : ℕ
IH : n < 1 <<< size n
h : ¬bit b n = 0
⊢ n < 2 ^ size n

Next tactic:
simpa [shiftLeft_eq, shiftRight_eq_div_pow] using IH
theorem size_le {m n : ℕ} : size m ≤ n ↔ m < 2 ^ n :=
  ⟨fun h => lt_of_lt_of_le (lt_size_self _) (pow_le_pow_of_le_right (by 

Proof state:
m n : ℕ
h : size m ≤ n
⊢ 2 > 0

Next tactic:
decide
theorem size_le {m n : ℕ} : size m ≤ n ↔ m < 2 ^ n :=
  ⟨fun h => lt_of_lt_of_le (lt_size_self _) (pow_le_pow_of_le_right (by decide) h), by
    

Proof state:
m n : ℕ
⊢ m < 2 ^ n → size m ≤ n

Next tactic:
rw [← one_shiftLeft]
theorem size_le {m n : ℕ} : size m ≤ n ↔ m < 2 ^ n :=
  ⟨fun h => lt_of_lt_of_le (lt_size_self _) (pow_le_pow_of_le_right (by decide) h), by
    rw [← one_shiftLeft]; 

Proof state:
m n : ℕ
⊢ m < 1 <<< n → size m ≤ n

Next tactic:
revert n
theorem size_le {m n : ℕ} : size m ≤ n ↔ m < 2 ^ n :=
  ⟨fun h => lt_of_lt_of_le (lt_size_self _) (pow_le_pow_of_le_right (by decide) h), by
    rw [← one_shiftLeft]; revert n
    

Proof state:
m : ℕ
⊢ ∀ {n : ℕ}, m < 1 <<< n → size m ≤ n

Next tactic:
apply binaryRec _ _ m
theorem size_le {m n : ℕ} : size m ≤ n ↔ m < 2 ^ n :=
  ⟨fun h => lt_of_lt_of_le (lt_size_self _) (pow_le_pow_of_le_right (by decide) h), by
    rw [← one_shiftLeft]; revert n
    apply binaryRec _ _ m
    · 

Proof state:
m : ℕ
⊢ ∀ {n : ℕ}, 0 < 1 <<< n → size 0 ≤ n

Next tactic:
intro n
theorem size_le {m n : ℕ} : size m ≤ n ↔ m < 2 ^ n :=
  ⟨fun h => lt_of_lt_of_le (lt_size_self _) (pow_le_pow_of_le_right (by decide) h), by
    rw [← one_shiftLeft]; revert n
    apply binaryRec _ _ m
    · intro n
      

Proof state:
m n : ℕ
⊢ 0 < 1 <<< n → size 0 ≤ n

Next tactic:
simp
theorem size_le {m n : ℕ} : size m ≤ n ↔ m < 2 ^ n :=
  ⟨fun h => lt_of_lt_of_le (lt_size_self _) (pow_le_pow_of_le_right (by decide) h), by
    rw [← one_shiftLeft]; revert n
    apply binaryRec _ _ m
    · intro n
      simp
    · 

Proof state:
m : ℕ
⊢ ∀ (b : Bool) (n : ℕ),
    (∀ {n_1 : ℕ}, n < 1 <<< n_1 → size n ≤ n_1) → ∀ {n_1 : ℕ}, bit b n < 1 <<< n_1 → size (bit b n) ≤ n_1

Next tactic:
intro b m IH n h
theorem size_le {m n : ℕ} : size m ≤ n ↔ m < 2 ^ n :=
  ⟨fun h => lt_of_lt_of_le (lt_size_self _) (pow_le_pow_of_le_right (by decide) h), by
    rw [← one_shiftLeft]; revert n
    apply binaryRec _ _ m
    · intro n
      simp
    · intro b m IH n h
      

Proof state:
m✝ : ℕ
b : Bool
m : ℕ
IH : ∀ {n : ℕ}, m < 1 <<< n → size m ≤ n
n : ℕ
h : bit b m < 1 <<< n
⊢ size (bit b m) ≤ n

Next tactic:
by_cases e : bit b m = 0
theorem size_le {m n : ℕ} : size m ≤ n ↔ m < 2 ^ n :=
  ⟨fun h => lt_of_lt_of_le (lt_size_self _) (pow_le_pow_of_le_right (by decide) h), by
    rw [← one_shiftLeft]; revert n
    apply binaryRec _ _ m
    · intro n
      simp
    · intro b m IH n h
      by_cases e : bit b m = 0
      · 

Proof state:
case pos
m✝ : ℕ
b : Bool
m : ℕ
IH : ∀ {n : ℕ}, m < 1 <<< n → size m ≤ n
n : ℕ
h : bit b m < 1 <<< n
e : bit b m = 0
⊢ size (bit b m) ≤ n

Next tactic:
simp [e]
theorem size_le {m n : ℕ} : size m ≤ n ↔ m < 2 ^ n :=
  ⟨fun h => lt_of_lt_of_le (lt_size_self _) (pow_le_pow_of_le_right (by decide) h), by
    rw [← one_shiftLeft]; revert n
    apply binaryRec _ _ m
    · intro n
      simp
    · intro b m IH n h
      by_cases e : bit b m = 0
      · simp [e]
      

Proof state:
case neg
m✝ : ℕ
b : Bool
m : ℕ
IH : ∀ {n : ℕ}, m < 1 <<< n → size m ≤ n
n : ℕ
h : bit b m < 1 <<< n
e : ¬bit b m = 0
⊢ size (bit b m) ≤ n

Next tactic:
rw [size_bit e]
theorem size_le {m n : ℕ} : size m ≤ n ↔ m < 2 ^ n :=
  ⟨fun h => lt_of_lt_of_le (lt_size_self _) (pow_le_pow_of_le_right (by decide) h), by
    rw [← one_shiftLeft]; revert n
    apply binaryRec _ _ m
    · intro n
      simp
    · intro b m IH n h
      by_cases e : bit b m = 0
      · simp [e]
      rw [size_bit e]
      

Proof state:
case neg
m✝ : ℕ
b : Bool
m : ℕ
IH : ∀ {n : ℕ}, m < 1 <<< n → size m ≤ n
n : ℕ
h : bit b m < 1 <<< n
e : ¬bit b m = 0
⊢ succ (size m) ≤ n

Next tactic:
cases' n with n
theorem size_le {m n : ℕ} : size m ≤ n ↔ m < 2 ^ n :=
  ⟨fun h => lt_of_lt_of_le (lt_size_self _) (pow_le_pow_of_le_right (by decide) h), by
    rw [← one_shiftLeft]; revert n
    apply binaryRec _ _ m
    · intro n
      simp
    · intro b m IH n h
      by_cases e : bit b m = 0
      · simp [e]
      rw [size_bit e]
      cases' n with n
      · 

Proof state:
case neg.zero
m✝ : ℕ
b : Bool
m : ℕ
IH : ∀ {n : ℕ}, m < 1 <<< n → size m ≤ n
e : ¬bit b m = 0
h : bit b m < 1 <<< zero
⊢ succ (size m) ≤ zero

Next tactic:
exact e.elim (Nat.eq_zero_of_le_zero (le_of_lt_succ h))
theorem size_le {m n : ℕ} : size m ≤ n ↔ m < 2 ^ n :=
  ⟨fun h => lt_of_lt_of_le (lt_size_self _) (pow_le_pow_of_le_right (by decide) h), by
    rw [← one_shiftLeft]; revert n
    apply binaryRec _ _ m
    · intro n
      simp
    · intro b m IH n h
      by_cases e : bit b m = 0
      · simp [e]
      rw [size_bit e]
      cases' n with n
      · exact e.elim (Nat.eq_zero_of_le_zero (le_of_lt_succ h))
      · 

Proof state:
case neg.succ
m✝ : ℕ
b : Bool
m : ℕ
IH : ∀ {n : ℕ}, m < 1 <<< n → size m ≤ n
e : ¬bit b m = 0
n : ℕ
h : bit b m < 1 <<< succ n
⊢ succ (size m) ≤ succ n

Next tactic:
apply succ_le_succ (IH _)
theorem size_le {m n : ℕ} : size m ≤ n ↔ m < 2 ^ n :=
  ⟨fun h => lt_of_lt_of_le (lt_size_self _) (pow_le_pow_of_le_right (by decide) h), by
    rw [← one_shiftLeft]; revert n
    apply binaryRec _ _ m
    · intro n
      simp
    · intro b m IH n h
      by_cases e : bit b m = 0
      · simp [e]
      rw [size_bit e]
      cases' n with n
      · exact e.elim (Nat.eq_zero_of_le_zero (le_of_lt_succ h))
      · apply succ_le_succ (IH _)
        

Proof state:
m✝ : ℕ
b : Bool
m : ℕ
IH : ∀ {n : ℕ}, m < 1 <<< n → size m ≤ n
e : ¬bit b m = 0
n : ℕ
h : bit b m < 1 <<< succ n
⊢ m < 1 <<< n

Next tactic:
apply lt_of_mul_lt_mul_left _ (zero_le 2)
theorem size_le {m n : ℕ} : size m ≤ n ↔ m < 2 ^ n :=
  ⟨fun h => lt_of_lt_of_le (lt_size_self _) (pow_le_pow_of_le_right (by decide) h), by
    rw [← one_shiftLeft]; revert n
    apply binaryRec _ _ m
    · intro n
      simp
    · intro b m IH n h
      by_cases e : bit b m = 0
      · simp [e]
      rw [size_bit e]
      cases' n with n
      · exact e.elim (Nat.eq_zero_of_le_zero (le_of_lt_succ h))
      · apply succ_le_succ (IH _)
        apply lt_of_mul_lt_mul_left _ (zero_le 2)
        

Proof state:
m✝ : ℕ
b : Bool
m : ℕ
IH : ∀ {n : ℕ}, m < 1 <<< n → size m ≤ n
e : ¬bit b m = 0
n : ℕ
h : bit b m < 1 <<< succ n
⊢ 2 * m < 2 * 1 <<< n

Next tactic:
simp only [← bit0_val, shiftLeft_succ] at *
theorem size_le {m n : ℕ} : size m ≤ n ↔ m < 2 ^ n :=
  ⟨fun h => lt_of_lt_of_le (lt_size_self _) (pow_le_pow_of_le_right (by decide) h), by
    rw [← one_shiftLeft]; revert n
    apply binaryRec _ _ m
    · intro n
      simp
    · intro b m IH n h
      by_cases e : bit b m = 0
      · simp [e]
      rw [size_bit e]
      cases' n with n
      · exact e.elim (Nat.eq_zero_of_le_zero (le_of_lt_succ h))
      · apply succ_le_succ (IH _)
        apply lt_of_mul_lt_mul_left _ (zero_le 2)
        simp only [← bit0_val, shiftLeft_succ] at *
        

Proof state:
m✝ : ℕ
b : Bool
m : ℕ
IH : ∀ {n : ℕ}, m < 1 <<< n → size m ≤ n
e : ¬bit b m = 0
n : ℕ
h : bit b m < bit0 (1 <<< n)
⊢ bit0 m < bit0 (1 <<< n)

Next tactic:
exact lt_of_le_of_lt (bit0_le_bit b rfl.le) h
theorem lt_size {m n : ℕ} : m < size n ↔ 2 ^ m ≤ n := by
  

Proof state:
m n : ℕ
⊢ m < size n ↔ 2 ^ m ≤ n

Next tactic:
rw [← not_lt, Decidable.iff_not_comm, not_lt, size_le]
theorem size_pos {n : ℕ} : 0 < size n ↔ 0 < n := by 

Proof state:
n : ℕ
⊢ 0 < size n ↔ 0 < n

Next tactic:
rw [lt_size]
theorem size_pos {n : ℕ} : 0 < size n ↔ 0 < n := by rw [lt_size]; 

Proof state:
n : ℕ
⊢ 2 ^ 0 ≤ n ↔ 0 < n

Next tactic:
rfl
theorem size_eq_zero {n : ℕ} : size n = 0 ↔ n = 0 := by
  

Proof state:
n : ℕ
⊢ size n = 0 ↔ n = 0

Next tactic:
have := @size_pos n
theorem size_eq_zero {n : ℕ} : size n = 0 ↔ n = 0 := by
  have := @size_pos n; 

Proof state:
n : ℕ
this : 0 < size n ↔ 0 < n
⊢ size n = 0 ↔ n = 0

Next tactic:
simp [pos_iff_ne_zero] at this
theorem size_eq_zero {n : ℕ} : size n = 0 ↔ n = 0 := by
  have := @size_pos n; simp [pos_iff_ne_zero] at this; 

Proof state:
n : ℕ
this : ¬size n = 0 ↔ ¬n = 0
⊢ size n = 0 ↔ n = 0

Next tactic:
exact Decidable.not_iff_not.1 this
theorem size_pow {n : ℕ} : size (2 ^ n) = n + 1 :=
  le_antisymm (size_le.2 <| pow_lt_pow_right (by 

Proof state:
n : ℕ
⊢ 1 < 2

Next tactic:
decide
theorem size_eq_bits_len (n : ℕ) : n.bits.length = n.size := by
  

Proof state:
n : ℕ
⊢ List.length (bits n) = size n

Next tactic:
induction' n using Nat.binaryRec' with b n h ih
theorem size_eq_bits_len (n : ℕ) : n.bits.length = n.size := by
  induction' n using Nat.binaryRec' with b n h ih; · 

Proof state:
case z
⊢ List.length (bits 0) = size 0

Next tactic:
simp
theorem size_eq_bits_len (n : ℕ) : n.bits.length = n.size := by
  induction' n using Nat.binaryRec' with b n h ih; · simp
  

Proof state:
case f
b : Bool
n : ℕ
h : n = 0 → b = true
ih : List.length (bits n) = size n
⊢ List.length (bits (bit b n)) = size (bit b n)

Next tactic:
rw [size_bit, bits_append_bit _ _ h]
theorem size_eq_bits_len (n : ℕ) : n.bits.length = n.size := by
  induction' n using Nat.binaryRec' with b n h ih; · simp
  rw [size_bit, bits_append_bit _ _ h]
  · 

Proof state:
case f
b : Bool
n : ℕ
h : n = 0 → b = true
ih : List.length (bits n) = size n
⊢ List.length (b :: bits n) = succ (size n)

Next tactic:
simp [ih]
theorem size_eq_bits_len (n : ℕ) : n.bits.length = n.size := by
  induction' n using Nat.binaryRec' with b n h ih; · simp
  rw [size_bit, bits_append_bit _ _ h]
  · simp [ih]
  · 

Proof state:
case f
b : Bool
n : ℕ
h : n = 0 → b = true
ih : List.length (bits n) = size n
⊢ bit b n ≠ 0

Next tactic:
simpa [bit_eq_zero_iff]
@[simp]
theorem algebraicIndependent_empty_type_iff [IsEmpty ι] :
    AlgebraicIndependent R x ↔ Injective (algebraMap R A) := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
R : Type u_3
K : Type u_4
A : Type u_5
A' : Type u_6
A'' : Type u_7
V : Type u
V' : Type u_8
x : ι → A
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : CommRing A'
inst✝⁴ : CommRing A''
inst✝³ : Algebra R A
inst✝² : Algebra R A'
inst✝¹ : Algebra R A''
a b : R
inst✝ : IsEmpty ι
⊢ AlgebraicIndependent R x ↔ Injective ⇑(algebraMap R A)

Next tactic:
have : aeval x = (Algebra.ofId R A).comp (@isEmptyAlgEquiv R ι _ _).toAlgHom := by
    ext i
    exact IsEmpty.elim' ‹IsEmpty ι› i
@[simp]
theorem algebraicIndependent_empty_type_iff [IsEmpty ι] :
    AlgebraicIndependent R x ↔ Injective (algebraMap R A) := by
  have : aeval x = (Algebra.ofId R A).comp (@isEmptyAlgEquiv R ι _ _).toAlgHom := by
    

Proof state:
ι : Type u_1
ι' : Type u_2
R : Type u_3
K : Type u_4
A : Type u_5
A' : Type u_6
A'' : Type u_7
V : Type u
V' : Type u_8
x : ι → A
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : CommRing A'
inst✝⁴ : CommRing A''
inst✝³ : Algebra R A
inst✝² : Algebra R A'
inst✝¹ : Algebra R A''
a b : R
inst✝ : IsEmpty ι
⊢ aeval x = AlgHom.comp (ofId R A) ↑(isEmptyAlgEquiv R ι)

Next tactic:
ext i
@[simp]
theorem algebraicIndependent_empty_type_iff [IsEmpty ι] :
    AlgebraicIndependent R x ↔ Injective (algebraMap R A) := by
  have : aeval x = (Algebra.ofId R A).comp (@isEmptyAlgEquiv R ι _ _).toAlgHom := by
    ext i
    

Proof state:
case hf
ι : Type u_1
ι' : Type u_2
R : Type u_3
K : Type u_4
A : Type u_5
A' : Type u_6
A'' : Type u_7
V : Type u
V' : Type u_8
x : ι → A
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : CommRing A'
inst✝⁴ : CommRing A''
inst✝³ : Algebra R A
inst✝² : Algebra R A'
inst✝¹ : Algebra R A''
a b : R
inst✝ : IsEmpty ι
i : ι
⊢ (aeval x) (X i) = (AlgHom.comp (ofId R A) ↑(isEmptyAlgEquiv R ι)) (X i)

Next tactic:
exact IsEmpty.elim' ‹IsEmpty ι› i
@[simp]
theorem algebraicIndependent_empty_type_iff [IsEmpty ι] :
    AlgebraicIndependent R x ↔ Injective (algebraMap R A) := by
  have : aeval x = (Algebra.ofId R A).comp (@isEmptyAlgEquiv R ι _ _).toAlgHom := by
    ext i
    exact IsEmpty.elim' ‹IsEmpty ι› i
  

Proof state:
ι : Type u_1
ι' : Type u_2
R : Type u_3
K : Type u_4
A : Type u_5
A' : Type u_6
A'' : Type u_7
V : Type u
V' : Type u_8
x : ι → A
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : CommRing A'
inst✝⁴ : CommRing A''
inst✝³ : Algebra R A
inst✝² : Algebra R A'
inst✝¹ : Algebra R A''
a b : R
inst✝ : IsEmpty ι
this : aeval x = AlgHom.comp (ofId R A) ↑(isEmptyAlgEquiv R ι)
⊢ AlgebraicIndependent R x ↔ Injective ⇑(algebraMap R A)

Next tactic:
rw [AlgebraicIndependent, this, ← Injective.of_comp_iff' _ (@isEmptyAlgEquiv R ι _ _).bijective]
@[simp]
theorem algebraicIndependent_empty_type_iff [IsEmpty ι] :
    AlgebraicIndependent R x ↔ Injective (algebraMap R A) := by
  have : aeval x = (Algebra.ofId R A).comp (@isEmptyAlgEquiv R ι _ _).toAlgHom := by
    ext i
    exact IsEmpty.elim' ‹IsEmpty ι› i
  rw [AlgebraicIndependent, this, ← Injective.of_comp_iff' _ (@isEmptyAlgEquiv R ι _ _).bijective]
  

Proof state:
ι : Type u_1
ι' : Type u_2
R : Type u_3
K : Type u_4
A : Type u_5
A' : Type u_6
A'' : Type u_7
V : Type u
V' : Type u_8
x : ι → A
inst✝⁷ : CommRing R
inst✝⁶ : CommRing A
inst✝⁵ : CommRing A'
inst✝⁴ : CommRing A''
inst✝³ : Algebra R A
inst✝² : Algebra R A'
inst✝¹ : Algebra R A''
a b : R
inst✝ : IsEmpty ι
this : aeval x = AlgHom.comp (ofId R A) ↑(isEmptyAlgEquiv R ι)
⊢ Injective ⇑(AlgHom.comp (ofId R A) ↑(isEmptyAlgEquiv R ι)) ↔ Injective (⇑(algebraMap R A) ∘ ⇑(isEmptyAlgEquiv R ι))

Next tactic:
rfl
theorem algebraMap_injective : Injective (algebraMap R A) := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
R : Type u_3
K : Type u_4
A : Type u_5
A' : Type u_6
A'' : Type u_7
V : Type u
V' : Type u_8
x : ι → A
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing A'
inst✝³ : CommRing A''
inst✝² : Algebra R A
inst✝¹ : Algebra R A'
inst✝ : Algebra R A''
a b : R
hx : AlgebraicIndependent R x
⊢ Injective ⇑(algebraMap R A)

Next tactic:
simpa [← MvPolynomial.algebraMap_eq, Function.comp] using
    (Injective.of_comp_iff (algebraicIndependent_iff_injective_aeval.1 hx) MvPolynomial.C).2
      (MvPolynomial.C_injective _ _)
theorem linearIndependent : LinearIndependent R x := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
R : Type u_3
K : Type u_4
A : Type u_5
A' : Type u_6
A'' : Type u_7
V : Type u
V' : Type u_8
x : ι → A
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing A'
inst✝³ : CommRing A''
inst✝² : Algebra R A
inst✝¹ : Algebra R A'
inst✝ : Algebra R A''
a b : R
hx : AlgebraicIndependent R x
⊢ LinearIndependent R x

Next tactic:
rw [linearIndependent_iff_injective_total]
theorem linearIndependent : LinearIndependent R x := by
  rw [linearIndependent_iff_injective_total]
  

Proof state:
ι : Type u_1
ι' : Type u_2
R : Type u_3
K : Type u_4
A : Type u_5
A' : Type u_6
A'' : Type u_7
V : Type u
V' : Type u_8
x : ι → A
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing A'
inst✝³ : CommRing A''
inst✝² : Algebra R A
inst✝¹ : Algebra R A'
inst✝ : Algebra R A''
a b : R
hx : AlgebraicIndependent R x
⊢ Injective ⇑(Finsupp.total ι A R x)

Next tactic:
have : Finsupp.total ι A R x =
      (MvPolynomial.aeval x).toLinearMap.comp (Finsupp.total ι _ R X) := by
    ext
    simp
theorem linearIndependent : LinearIndependent R x := by
  rw [linearIndependent_iff_injective_total]
  have : Finsupp.total ι A R x =
      (MvPolynomial.aeval x).toLinearMap.comp (Finsupp.total ι _ R X) := by
    

Proof state:
ι : Type u_1
ι' : Type u_2
R : Type u_3
K : Type u_4
A : Type u_5
A' : Type u_6
A'' : Type u_7
V : Type u
V' : Type u_8
x : ι → A
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing A'
inst✝³ : CommRing A''
inst✝² : Algebra R A
inst✝¹ : Algebra R A'
inst✝ : Algebra R A''
a b : R
hx : AlgebraicIndependent R x
⊢ Finsupp.total ι A R x = AlgHom.toLinearMap (aeval x) ∘ₗ Finsupp.total ι (MvPolynomial ι R) R X

Next tactic:
ext
theorem linearIndependent : LinearIndependent R x := by
  rw [linearIndependent_iff_injective_total]
  have : Finsupp.total ι A R x =
      (MvPolynomial.aeval x).toLinearMap.comp (Finsupp.total ι _ R X) := by
    ext
    

Proof state:
case h.h
ι : Type u_1
ι' : Type u_2
R : Type u_3
K : Type u_4
A : Type u_5
A' : Type u_6
A'' : Type u_7
V : Type u
V' : Type u_8
x : ι → A
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing A'
inst✝³ : CommRing A''
inst✝² : Algebra R A
inst✝¹ : Algebra R A'
inst✝ : Algebra R A''
a b : R
hx : AlgebraicIndependent R x
a✝ : ι
⊢ (Finsupp.total ι A R x ∘ₗ Finsupp.lsingle a✝) 1 =
    ((AlgHom.toLinearMap (aeval x) ∘ₗ Finsupp.total ι (MvPolynomial ι R) R X) ∘ₗ Finsupp.lsingle a✝) 1

Next tactic:
simp
theorem linearIndependent : LinearIndependent R x := by
  rw [linearIndependent_iff_injective_total]
  have : Finsupp.total ι A R x =
      (MvPolynomial.aeval x).toLinearMap.comp (Finsupp.total ι _ R X) := by
    ext
    simp
  

Proof state:
ι : Type u_1
ι' : Type u_2
R : Type u_3
K : Type u_4
A : Type u_5
A' : Type u_6
A'' : Type u_7
V : Type u
V' : Type u_8
x : ι → A
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing A'
inst✝³ : CommRing A''
inst✝² : Algebra R A
inst✝¹ : Algebra R A'
inst✝ : Algebra R A''
a b : R
hx : AlgebraicIndependent R x
this : Finsupp.total ι A R x = AlgHom.toLinearMap (aeval x) ∘ₗ Finsupp.total ι (MvPolynomial ι R) R X
⊢ Injective ⇑(Finsupp.total ι A R x)

Next tactic:
rw [this]
theorem linearIndependent : LinearIndependent R x := by
  rw [linearIndependent_iff_injective_total]
  have : Finsupp.total ι A R x =
      (MvPolynomial.aeval x).toLinearMap.comp (Finsupp.total ι _ R X) := by
    ext
    simp
  rw [this]
  

Proof state:
ι : Type u_1
ι' : Type u_2
R : Type u_3
K : Type u_4
A : Type u_5
A' : Type u_6
A'' : Type u_7
V : Type u
V' : Type u_8
x : ι → A
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing A'
inst✝³ : CommRing A''
inst✝² : Algebra R A
inst✝¹ : Algebra R A'
inst✝ : Algebra R A''
a b : R
hx : AlgebraicIndependent R x
this : Finsupp.total ι A R x = AlgHom.toLinearMap (aeval x) ∘ₗ Finsupp.total ι (MvPolynomial ι R) R X
⊢ Injective ⇑(AlgHom.toLinearMap (aeval x) ∘ₗ Finsupp.total ι (MvPolynomial ι R) R X)

Next tactic:
refine' hx.comp _
theorem linearIndependent : LinearIndependent R x := by
  rw [linearIndependent_iff_injective_total]
  have : Finsupp.total ι A R x =
      (MvPolynomial.aeval x).toLinearMap.comp (Finsupp.total ι _ R X) := by
    ext
    simp
  rw [this]
  refine' hx.comp _
  

Proof state:
ι : Type u_1
ι' : Type u_2
R : Type u_3
K : Type u_4
A : Type u_5
A' : Type u_6
A'' : Type u_7
V : Type u
V' : Type u_8
x : ι → A
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing A'
inst✝³ : CommRing A''
inst✝² : Algebra R A
inst✝¹ : Algebra R A'
inst✝ : Algebra R A''
a b : R
hx : AlgebraicIndependent R x
this : Finsupp.total ι A R x = AlgHom.toLinearMap (aeval x) ∘ₗ Finsupp.total ι (MvPolynomial ι R) R X
⊢ Injective fun x => (Finsupp.total ι (MvPolynomial ι R) R X) x

Next tactic:
rw [← linearIndependent_iff_injective_total]
theorem linearIndependent : LinearIndependent R x := by
  rw [linearIndependent_iff_injective_total]
  have : Finsupp.total ι A R x =
      (MvPolynomial.aeval x).toLinearMap.comp (Finsupp.total ι _ R X) := by
    ext
    simp
  rw [this]
  refine' hx.comp _
  rw [← linearIndependent_iff_injective_total]
  

Proof state:
ι : Type u_1
ι' : Type u_2
R : Type u_3
K : Type u_4
A : Type u_5
A' : Type u_6
A'' : Type u_7
V : Type u
V' : Type u_8
x : ι → A
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing A'
inst✝³ : CommRing A''
inst✝² : Algebra R A
inst✝¹ : Algebra R A'
inst✝ : Algebra R A''
a b : R
hx : AlgebraicIndependent R x
this : Finsupp.total ι A R x = AlgHom.toLinearMap (aeval x) ∘ₗ Finsupp.total ι (MvPolynomial ι R) R X
⊢ LinearIndependent R X

Next tactic:
exact linearIndependent_X _ _
theorem comp (f : ι' → ι) (hf : Function.Injective f) : AlgebraicIndependent R (x ∘ f) := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
R : Type u_3
K : Type u_4
A : Type u_5
A' : Type u_6
A'' : Type u_7
V : Type u
V' : Type u_8
x : ι → A
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing A'
inst✝³ : CommRing A''
inst✝² : Algebra R A
inst✝¹ : Algebra R A'
inst✝ : Algebra R A''
a b : R
hx : AlgebraicIndependent R x
f : ι' → ι
hf : Injective f
⊢ AlgebraicIndependent R (x ∘ f)

Next tactic:
intro p q
theorem comp (f : ι' → ι) (hf : Function.Injective f) : AlgebraicIndependent R (x ∘ f) := by
  intro p q
  

Proof state:
ι : Type u_1
ι' : Type u_2
R : Type u_3
K : Type u_4
A : Type u_5
A' : Type u_6
A'' : Type u_7
V : Type u
V' : Type u_8
x : ι → A
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing A'
inst✝³ : CommRing A''
inst✝² : Algebra R A
inst✝¹ : Algebra R A'
inst✝ : Algebra R A''
a b : R
hx : AlgebraicIndependent R x
f : ι' → ι
hf : Injective f
p q : MvPolynomial ι' R
⊢ (aeval (x ∘ f)) p = (aeval (x ∘ f)) q → p = q

Next tactic:
simpa [aeval_rename, (rename_injective f hf).eq_iff] using @hx (rename f p) (rename f q)
theorem coe_range : AlgebraicIndependent R ((↑) : range x → A) := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
R : Type u_3
K : Type u_4
A : Type u_5
A' : Type u_6
A'' : Type u_7
V : Type u
V' : Type u_8
x : ι → A
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing A'
inst✝³ : CommRing A''
inst✝² : Algebra R A
inst✝¹ : Algebra R A'
inst✝ : Algebra R A''
a b : R
hx : AlgebraicIndependent R x
⊢ AlgebraicIndependent R Subtype.val

Next tactic:
simpa using hx.comp _ (rangeSplitting_injective x)
theorem map {f : A →ₐ[R] A'} (hf_inj : Set.InjOn f (adjoin R (range x))) :
    AlgebraicIndependent R (f ∘ x) := by
  

Proof state:
ι : Type u_1
ι' : Type u_2
R : Type u_3
K : Type u_4
A : Type u_5
A' : Type u_6
A'' : Type u_7
V : Type u
V' : Type u_8
x : ι → A
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing A'
inst✝³ : CommRing A''
inst✝² : Algebra R A
inst✝¹ : Algebra R A'
inst✝ : Algebra R A''
a b : R
hx : AlgebraicIndependent R x
f : A →ₐ[R] A'
hf_inj : InjOn ⇑f ↑(adjoin R (range x))
⊢ AlgebraicIndependent R (⇑f ∘ x)

Next tactic:
have : aeval (f ∘ x) = f.comp (aeval x) := by ext; simp
theorem map {f : A →ₐ[R] A'} (hf_inj : Set.InjOn f (adjoin R (range x))) :
    AlgebraicIndependent R (f ∘ x) := by
  have : aeval (f ∘ x) = f.comp (aeval x) := by 

Proof state:
ι : Type u_1
ι' : Type u_2
R : Type u_3
K : Type u_4
A : Type u_5
A' : Type u_6
A'' : Type u_7
V : Type u
V' : Type u_8
x : ι → A
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing A'
inst✝³ : CommRing A''
inst✝² : Algebra R A
inst✝¹ : Algebra R A'
inst✝ : Algebra R A''
a b : R
hx : AlgebraicIndependent R x
f : A →ₐ[R] A'
hf_inj : InjOn ⇑f ↑(adjoin R (range x))
⊢ aeval (⇑f ∘ x) = AlgHom.comp f (aeval x)

Next tactic:
ext
theorem map {f : A →ₐ[R] A'} (hf_inj : Set.InjOn f (adjoin R (range x))) :
    AlgebraicIndependent R (f ∘ x) := by
  have : aeval (f ∘ x) = f.comp (aeval x) := by ext; 

Proof state:
case hf
ι : Type u_1
ι' : Type u_2
R : Type u_3
K : Type u_4
A : Type u_5
A' : Type u_6
A'' : Type u_7
V : Type u
V' : Type u_8
x : ι → A
inst✝⁶ : CommRing R
inst✝⁵ : CommRing A
inst✝⁴ : CommRing A'
inst✝³ : CommRing A''
inst✝² : Algebra R A
inst✝¹ : Algebra R A'
inst✝ : Algebra R A''
a b : R
hx : AlgebraicIndependent R x
f : A →ₐ[R] A'
hf_inj : InjOn ⇑f ↑(adjoin R (range x))
i✝ : ι
⊢ (aeval (⇑f ∘ x)) (X i✝) = (AlgHom.comp f (aeval x)) (X i✝)

Next tactic:
simp