l3lab/ntp-mathlib huggingface dataset:
theorem add_pow_expChar_pow_of_commute [Semiring R] {q : ℕ} [hR : ExpChar R q]
    {n : ℕ} (x y : R) (h : Commute x y) : (x + y) ^ q ^ n = x ^ q ^ n + y ^ q ^ n := by
  

Proof state:
R : Type u
inst✝ : Semiring R
q : ℕ
hR : ExpChar R q
n : ℕ
x y : R
h : Commute x y
⊢ (x + y) ^ q ^ n = x ^ q ^ n + y ^ q ^ n

Next tactic:
cases' hR with _ _ hprime _
theorem add_pow_expChar_pow_of_commute [Semiring R] {q : ℕ} [hR : ExpChar R q]
    {n : ℕ} (x y : R) (h : Commute x y) : (x + y) ^ q ^ n = x ^ q ^ n + y ^ q ^ n := by
  cases' hR with _ _ hprime _
  · 

Proof state:
case zero
R : Type u
inst✝¹ : Semiring R
n : ℕ
x y : R
h : Commute x y
inst✝ : CharZero R
⊢ (x + y) ^ 1 ^ n = x ^ 1 ^ n + y ^ 1 ^ n

Next tactic:
simp only [one_pow, pow_one]
theorem add_pow_expChar_pow_of_commute [Semiring R] {q : ℕ} [hR : ExpChar R q]
    {n : ℕ} (x y : R) (h : Commute x y) : (x + y) ^ q ^ n = x ^ q ^ n + y ^ q ^ n := by
  cases' hR with _ _ hprime _
  · simp only [one_pow, pow_one]
  

Proof state:
case prime
R : Type u
inst✝ : Semiring R
q n : ℕ
x y : R
h : Commute x y
hprime : Nat.Prime q
hchar✝ : CharP R q
⊢ (x + y) ^ q ^ n = x ^ q ^ n + y ^ q ^ n

Next tactic:
haveI := Fact.mk hprime
theorem add_pow_expChar_pow_of_commute [Semiring R] {q : ℕ} [hR : ExpChar R q]
    {n : ℕ} (x y : R) (h : Commute x y) : (x + y) ^ q ^ n = x ^ q ^ n + y ^ q ^ n := by
  cases' hR with _ _ hprime _
  · simp only [one_pow, pow_one]
  haveI := Fact.mk hprime; 

Proof state:
case prime
R : Type u
inst✝ : Semiring R
q n : ℕ
x y : R
h : Commute x y
hprime : Nat.Prime q
hchar✝ : CharP R q
this : Fact (Nat.Prime q)
⊢ (x + y) ^ q ^ n = x ^ q ^ n + y ^ q ^ n

Next tactic:
exact add_pow_char_pow_of_commute R x y h
theorem sub_pow_expChar_of_commute [Ring R] {q : ℕ} [hR : ExpChar R q]
    (x y : R) (h : Commute x y) : (x - y) ^ q = x ^ q - y ^ q := by
  

Proof state:
R : Type u
inst✝ : Ring R
q : ℕ
hR : ExpChar R q
x y : R
h : Commute x y
⊢ (x - y) ^ q = x ^ q - y ^ q

Next tactic:
cases' hR with _ _ hprime _
theorem sub_pow_expChar_of_commute [Ring R] {q : ℕ} [hR : ExpChar R q]
    (x y : R) (h : Commute x y) : (x - y) ^ q = x ^ q - y ^ q := by
  cases' hR with _ _ hprime _
  · 

Proof state:
case zero
R : Type u
inst✝¹ : Ring R
x y : R
h : Commute x y
inst✝ : CharZero R
⊢ (x - y) ^ 1 = x ^ 1 - y ^ 1

Next tactic:
simp only [pow_one]
theorem sub_pow_expChar_of_commute [Ring R] {q : ℕ} [hR : ExpChar R q]
    (x y : R) (h : Commute x y) : (x - y) ^ q = x ^ q - y ^ q := by
  cases' hR with _ _ hprime _
  · simp only [pow_one]
  

Proof state:
case prime
R : Type u
inst✝ : Ring R
q : ℕ
x y : R
h : Commute x y
hprime : Nat.Prime q
hchar✝ : CharP R q
⊢ (x - y) ^ q = x ^ q - y ^ q

Next tactic:
haveI := Fact.mk hprime
theorem sub_pow_expChar_of_commute [Ring R] {q : ℕ} [hR : ExpChar R q]
    (x y : R) (h : Commute x y) : (x - y) ^ q = x ^ q - y ^ q := by
  cases' hR with _ _ hprime _
  · simp only [pow_one]
  haveI := Fact.mk hprime; 

Proof state:
case prime
R : Type u
inst✝ : Ring R
q : ℕ
x y : R
h : Commute x y
hprime : Nat.Prime q
hchar✝ : CharP R q
this : Fact (Nat.Prime q)
⊢ (x - y) ^ q = x ^ q - y ^ q

Next tactic:
exact sub_pow_char_of_commute R x y h
theorem sub_pow_expChar_pow_of_commute [Ring R] {q : ℕ} [hR : ExpChar R q]
    {n : ℕ} (x y : R) (h : Commute x y) : (x - y) ^ q ^ n = x ^ q ^ n - y ^ q ^ n := by
  

Proof state:
R : Type u
inst✝ : Ring R
q : ℕ
hR : ExpChar R q
n : ℕ
x y : R
h : Commute x y
⊢ (x - y) ^ q ^ n = x ^ q ^ n - y ^ q ^ n

Next tactic:
cases' hR with _ _ hprime _
theorem sub_pow_expChar_pow_of_commute [Ring R] {q : ℕ} [hR : ExpChar R q]
    {n : ℕ} (x y : R) (h : Commute x y) : (x - y) ^ q ^ n = x ^ q ^ n - y ^ q ^ n := by
  cases' hR with _ _ hprime _
  · 

Proof state:
case zero
R : Type u
inst✝¹ : Ring R
n : ℕ
x y : R
h : Commute x y
inst✝ : CharZero R
⊢ (x - y) ^ 1 ^ n = x ^ 1 ^ n - y ^ 1 ^ n

Next tactic:
simp only [one_pow, pow_one]
theorem sub_pow_expChar_pow_of_commute [Ring R] {q : ℕ} [hR : ExpChar R q]
    {n : ℕ} (x y : R) (h : Commute x y) : (x - y) ^ q ^ n = x ^ q ^ n - y ^ q ^ n := by
  cases' hR with _ _ hprime _
  · simp only [one_pow, pow_one]
  

Proof state:
case prime
R : Type u
inst✝ : Ring R
q n : ℕ
x y : R
h : Commute x y
hprime : Nat.Prime q
hchar✝ : CharP R q
⊢ (x - y) ^ q ^ n = x ^ q ^ n - y ^ q ^ n

Next tactic:
haveI := Fact.mk hprime
theorem sub_pow_expChar_pow_of_commute [Ring R] {q : ℕ} [hR : ExpChar R q]
    {n : ℕ} (x y : R) (h : Commute x y) : (x - y) ^ q ^ n = x ^ q ^ n - y ^ q ^ n := by
  cases' hR with _ _ hprime _
  · simp only [one_pow, pow_one]
  haveI := Fact.mk hprime; 

Proof state:
case prime
R : Type u
inst✝ : Ring R
q n : ℕ
x y : R
h : Commute x y
hprime : Nat.Prime q
hchar✝ : CharP R q
this : Fact (Nat.Prime q)
⊢ (x - y) ^ q ^ n = x ^ q ^ n - y ^ q ^ n

Next tactic:
exact sub_pow_char_pow_of_commute R x y h
theorem add_pow_expChar [CommSemiring R] {q : ℕ} [hR : ExpChar R q]
    (x y : R) : (x + y) ^ q = x ^ q + y ^ q := by
  

Proof state:
R : Type u
inst✝ : CommSemiring R
q : ℕ
hR : ExpChar R q
x y : R
⊢ (x + y) ^ q = x ^ q + y ^ q

Next tactic:
cases' hR with _ _ hprime _
theorem add_pow_expChar [CommSemiring R] {q : ℕ} [hR : ExpChar R q]
    (x y : R) : (x + y) ^ q = x ^ q + y ^ q := by
  cases' hR with _ _ hprime _
  · 

Proof state:
case zero
R : Type u
inst✝¹ : CommSemiring R
x y : R
inst✝ : CharZero R
⊢ (x + y) ^ 1 = x ^ 1 + y ^ 1

Next tactic:
simp only [pow_one]
theorem add_pow_expChar [CommSemiring R] {q : ℕ} [hR : ExpChar R q]
    (x y : R) : (x + y) ^ q = x ^ q + y ^ q := by
  cases' hR with _ _ hprime _
  · simp only [pow_one]
  

Proof state:
case prime
R : Type u
inst✝ : CommSemiring R
q : ℕ
x y : R
hprime : Nat.Prime q
hchar✝ : CharP R q
⊢ (x + y) ^ q = x ^ q + y ^ q

Next tactic:
haveI := Fact.mk hprime
theorem add_pow_expChar [CommSemiring R] {q : ℕ} [hR : ExpChar R q]
    (x y : R) : (x + y) ^ q = x ^ q + y ^ q := by
  cases' hR with _ _ hprime _
  · simp only [pow_one]
  haveI := Fact.mk hprime; 

Proof state:
case prime
R : Type u
inst✝ : CommSemiring R
q : ℕ
x y : R
hprime : Nat.Prime q
hchar✝ : CharP R q
this : Fact (Nat.Prime q)
⊢ (x + y) ^ q = x ^ q + y ^ q

Next tactic:
exact add_pow_char R x y
theorem add_pow_expChar_pow [CommSemiring R] {q : ℕ} [hR : ExpChar R q]
    {n : ℕ} (x y : R) : (x + y) ^ q ^ n = x ^ q ^ n + y ^ q ^ n := by
  

Proof state:
R : Type u
inst✝ : CommSemiring R
q : ℕ
hR : ExpChar R q
n : ℕ
x y : R
⊢ (x + y) ^ q ^ n = x ^ q ^ n + y ^ q ^ n

Next tactic:
cases' hR with _ _ hprime _
theorem add_pow_expChar_pow [CommSemiring R] {q : ℕ} [hR : ExpChar R q]
    {n : ℕ} (x y : R) : (x + y) ^ q ^ n = x ^ q ^ n + y ^ q ^ n := by
  cases' hR with _ _ hprime _
  · 

Proof state:
case zero
R : Type u
inst✝¹ : CommSemiring R
n : ℕ
x y : R
inst✝ : CharZero R
⊢ (x + y) ^ 1 ^ n = x ^ 1 ^ n + y ^ 1 ^ n

Next tactic:
simp only [one_pow, pow_one]
theorem add_pow_expChar_pow [CommSemiring R] {q : ℕ} [hR : ExpChar R q]
    {n : ℕ} (x y : R) : (x + y) ^ q ^ n = x ^ q ^ n + y ^ q ^ n := by
  cases' hR with _ _ hprime _
  · simp only [one_pow, pow_one]
  

Proof state:
case prime
R : Type u
inst✝ : CommSemiring R
q n : ℕ
x y : R
hprime : Nat.Prime q
hchar✝ : CharP R q
⊢ (x + y) ^ q ^ n = x ^ q ^ n + y ^ q ^ n

Next tactic:
haveI := Fact.mk hprime
theorem add_pow_expChar_pow [CommSemiring R] {q : ℕ} [hR : ExpChar R q]
    {n : ℕ} (x y : R) : (x + y) ^ q ^ n = x ^ q ^ n + y ^ q ^ n := by
  cases' hR with _ _ hprime _
  · simp only [one_pow, pow_one]
  haveI := Fact.mk hprime; 

Proof state:
case prime
R : Type u
inst✝ : CommSemiring R
q n : ℕ
x y : R
hprime : Nat.Prime q
hchar✝ : CharP R q
this : Fact (Nat.Prime q)
⊢ (x + y) ^ q ^ n = x ^ q ^ n + y ^ q ^ n

Next tactic:
exact add_pow_char_pow R x y
theorem sub_pow_expChar [CommRing R] {q : ℕ} [hR : ExpChar R q]
    (x y : R) : (x - y) ^ q = x ^ q - y ^ q := by
  

Proof state:
R : Type u
inst✝ : CommRing R
q : ℕ
hR : ExpChar R q
x y : R
⊢ (x - y) ^ q = x ^ q - y ^ q

Next tactic:
cases' hR with _ _ hprime _
theorem sub_pow_expChar [CommRing R] {q : ℕ} [hR : ExpChar R q]
    (x y : R) : (x - y) ^ q = x ^ q - y ^ q := by
  cases' hR with _ _ hprime _
  · 

Proof state:
case zero
R : Type u
inst✝¹ : CommRing R
x y : R
inst✝ : CharZero R
⊢ (x - y) ^ 1 = x ^ 1 - y ^ 1

Next tactic:
simp only [pow_one]
theorem sub_pow_expChar [CommRing R] {q : ℕ} [hR : ExpChar R q]
    (x y : R) : (x - y) ^ q = x ^ q - y ^ q := by
  cases' hR with _ _ hprime _
  · simp only [pow_one]
  

Proof state:
case prime
R : Type u
inst✝ : CommRing R
q : ℕ
x y : R
hprime : Nat.Prime q
hchar✝ : CharP R q
⊢ (x - y) ^ q = x ^ q - y ^ q

Next tactic:
haveI := Fact.mk hprime
theorem sub_pow_expChar [CommRing R] {q : ℕ} [hR : ExpChar R q]
    (x y : R) : (x - y) ^ q = x ^ q - y ^ q := by
  cases' hR with _ _ hprime _
  · simp only [pow_one]
  haveI := Fact.mk hprime; 

Proof state:
case prime
R : Type u
inst✝ : CommRing R
q : ℕ
x y : R
hprime : Nat.Prime q
hchar✝ : CharP R q
this : Fact (Nat.Prime q)
⊢ (x - y) ^ q = x ^ q - y ^ q

Next tactic:
exact sub_pow_char R x y
theorem sub_pow_expChar_pow [CommRing R] {q : ℕ} [hR : ExpChar R q]
    {n : ℕ} (x y : R) : (x - y) ^ q ^ n = x ^ q ^ n - y ^ q ^ n := by
  

Proof state:
R : Type u
inst✝ : CommRing R
q : ℕ
hR : ExpChar R q
n : ℕ
x y : R
⊢ (x - y) ^ q ^ n = x ^ q ^ n - y ^ q ^ n

Next tactic:
cases' hR with _ _ hprime _
theorem sub_pow_expChar_pow [CommRing R] {q : ℕ} [hR : ExpChar R q]
    {n : ℕ} (x y : R) : (x - y) ^ q ^ n = x ^ q ^ n - y ^ q ^ n := by
  cases' hR with _ _ hprime _
  · 

Proof state:
case zero
R : Type u
inst✝¹ : CommRing R
n : ℕ
x y : R
inst✝ : CharZero R
⊢ (x - y) ^ 1 ^ n = x ^ 1 ^ n - y ^ 1 ^ n

Next tactic:
simp only [one_pow, pow_one]
theorem sub_pow_expChar_pow [CommRing R] {q : ℕ} [hR : ExpChar R q]
    {n : ℕ} (x y : R) : (x - y) ^ q ^ n = x ^ q ^ n - y ^ q ^ n := by
  cases' hR with _ _ hprime _
  · simp only [one_pow, pow_one]
  

Proof state:
case prime
R : Type u
inst✝ : CommRing R
q n : ℕ
x y : R
hprime : Nat.Prime q
hchar✝ : CharP R q
⊢ (x - y) ^ q ^ n = x ^ q ^ n - y ^ q ^ n

Next tactic:
haveI := Fact.mk hprime
theorem sub_pow_expChar_pow [CommRing R] {q : ℕ} [hR : ExpChar R q]
    {n : ℕ} (x y : R) : (x - y) ^ q ^ n = x ^ q ^ n - y ^ q ^ n := by
  cases' hR with _ _ hprime _
  · simp only [one_pow, pow_one]
  haveI := Fact.mk hprime; 

Proof state:
case prime
R : Type u
inst✝ : CommRing R
q n : ℕ
x y : R
hprime : Nat.Prime q
hchar✝ : CharP R q
this : Fact (Nat.Prime q)
⊢ (x - y) ^ q ^ n = x ^ q ^ n - y ^ q ^ n

Next tactic:
exact sub_pow_char_pow R x y
theorem ExpChar.neg_one_pow_expChar [Ring R] (q : ℕ) [hR : ExpChar R q] :
    (-1 : R) ^ q = -1 := by
  

Proof state:
R : Type u
inst✝ : Ring R
q : ℕ
hR : ExpChar R q
⊢ (-1) ^ q = -1

Next tactic:
cases' hR with _ _ hprime _
theorem ExpChar.neg_one_pow_expChar [Ring R] (q : ℕ) [hR : ExpChar R q] :
    (-1 : R) ^ q = -1 := by
  cases' hR with _ _ hprime _
  · 

Proof state:
case zero
R : Type u
inst✝¹ : Ring R
inst✝ : CharZero R
⊢ (-1) ^ 1 = -1

Next tactic:
simp only [pow_one]
theorem ExpChar.neg_one_pow_expChar [Ring R] (q : ℕ) [hR : ExpChar R q] :
    (-1 : R) ^ q = -1 := by
  cases' hR with _ _ hprime _
  · simp only [pow_one]
  

Proof state:
case prime
R : Type u
inst✝ : Ring R
q : ℕ
hprime : Nat.Prime q
hchar✝ : CharP R q
⊢ (-1) ^ q = -1

Next tactic:
haveI := Fact.mk hprime
theorem ExpChar.neg_one_pow_expChar [Ring R] (q : ℕ) [hR : ExpChar R q] :
    (-1 : R) ^ q = -1 := by
  cases' hR with _ _ hprime _
  · simp only [pow_one]
  haveI := Fact.mk hprime; 

Proof state:
case prime
R : Type u
inst✝ : Ring R
q : ℕ
hprime : Nat.Prime q
hchar✝ : CharP R q
this : Fact (Nat.Prime q)
⊢ (-1) ^ q = -1

Next tactic:
exact CharP.neg_one_pow_char R q
theorem ExpChar.neg_one_pow_expChar_pow [Ring R] (q n : ℕ) [hR : ExpChar R q] :
    (-1 : R) ^ q ^ n = -1 := by
  

Proof state:
R : Type u
inst✝ : Ring R
q n : ℕ
hR : ExpChar R q
⊢ (-1) ^ q ^ n = -1

Next tactic:
cases' hR with _ _ hprime _
theorem ExpChar.neg_one_pow_expChar_pow [Ring R] (q n : ℕ) [hR : ExpChar R q] :
    (-1 : R) ^ q ^ n = -1 := by
  cases' hR with _ _ hprime _
  · 

Proof state:
case zero
R : Type u
inst✝¹ : Ring R
n : ℕ
inst✝ : CharZero R
⊢ (-1) ^ 1 ^ n = -1

Next tactic:
simp only [one_pow, pow_one]
theorem ExpChar.neg_one_pow_expChar_pow [Ring R] (q n : ℕ) [hR : ExpChar R q] :
    (-1 : R) ^ q ^ n = -1 := by
  cases' hR with _ _ hprime _
  · simp only [one_pow, pow_one]
  

Proof state:
case prime
R : Type u
inst✝ : Ring R
q n : ℕ
hprime : Nat.Prime q
hchar✝ : CharP R q
⊢ (-1) ^ q ^ n = -1

Next tactic:
haveI := Fact.mk hprime
theorem ExpChar.neg_one_pow_expChar_pow [Ring R] (q n : ℕ) [hR : ExpChar R q] :
    (-1 : R) ^ q ^ n = -1 := by
  cases' hR with _ _ hprime _
  · simp only [one_pow, pow_one]
  haveI := Fact.mk hprime; 

Proof state:
case prime
R : Type u
inst✝ : Ring R
q n : ℕ
hprime : Nat.Prime q
hchar✝ : CharP R q
this : Fact (Nat.Prime q)
⊢ (-1) ^ q ^ n = -1

Next tactic:
exact CharP.neg_one_pow_char_pow R q n
instance zeroHomClass : ZeroHomClass (AbsoluteValue R S) R S where
  coe f := f.toFun
  coe_injective' f g h := by 

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : Semiring R
inst✝ : OrderedSemiring S
abv f g : AbsoluteValue R S
h : (fun f => f.toFun) f = (fun f => f.toFun) g
⊢ f = g

Next tactic:
obtain ⟨⟨_, _⟩, _⟩ := f
instance zeroHomClass : ZeroHomClass (AbsoluteValue R S) R S where
  coe f := f.toFun
  coe_injective' f g h := by obtain ⟨⟨_, _⟩, _⟩ := f; 

Proof state:
case mk.mk
R : Type u_1
S : Type u_2
inst✝¹ : Semiring R
inst✝ : OrderedSemiring S
abv g : AbsoluteValue R S
toFun✝ : R → S
map_mul'✝ : ∀ (x y : R), toFun✝ (x * y) = toFun✝ x * toFun✝ y
nonneg'✝ : ∀ (x : R), 0 ≤ MulHom.toFun { toFun := toFun✝, map_mul' := map_mul'✝ } x
eq_zero'✝ : ∀ (x : R), MulHom.toFun { toFun := toFun✝, map_mul' := map_mul'✝ } x = 0 ↔ x = 0
add_le'✝ :
  ∀ (x y : R),
    MulHom.toFun { toFun := toFun✝, map_mul' := map_mul'✝ } (x + y) ≤
      MulHom.toFun { toFun := toFun✝, map_mul' := map_mul'✝ } x +
        MulHom.toFun { toFun := toFun✝, map_mul' := map_mul'✝ } y
h :
  (fun f => f.toFun)
      { toMulHom := { toFun := toFun✝, map_mul' := map_mul'✝ }, nonneg' := nonneg'✝, eq_zero' := eq_zero'✝,
        add_le' := add_le'✝ } =
    (fun f => f.toFun) g
⊢ { toMulHom := { toFun := toFun✝, map_mul' := map_mul'✝ }, nonneg' := nonneg'✝, eq_zero' := eq_zero'✝,
      add_le' := add_le'✝ } =
    g

Next tactic:
obtain ⟨⟨_, _⟩, _⟩ := g
instance zeroHomClass : ZeroHomClass (AbsoluteValue R S) R S where
  coe f := f.toFun
  coe_injective' f g h := by obtain ⟨⟨_, _⟩, _⟩ := f; obtain ⟨⟨_, _⟩, _⟩ := g; 

Proof state:
case mk.mk.mk.mk
R : Type u_1
S : Type u_2
inst✝¹ : Semiring R
inst✝ : OrderedSemiring S
abv : AbsoluteValue R S
toFun✝¹ : R → S
map_mul'✝¹ : ∀ (x y : R), toFun✝¹ (x * y) = toFun✝¹ x * toFun✝¹ y
nonneg'✝¹ : ∀ (x : R), 0 ≤ MulHom.toFun { toFun := toFun✝¹, map_mul' := map_mul'✝¹ } x
eq_zero'✝¹ : ∀ (x : R), MulHom.toFun { toFun := toFun✝¹, map_mul' := map_mul'✝¹ } x = 0 ↔ x = 0
add_le'✝¹ :
  ∀ (x y : R),
    MulHom.toFun { toFun := toFun✝¹, map_mul' := map_mul'✝¹ } (x + y) ≤
      MulHom.toFun { toFun := toFun✝¹, map_mul' := map_mul'✝¹ } x +
        MulHom.toFun { toFun := toFun✝¹, map_mul' := map_mul'✝¹ } y
toFun✝ : R → S
map_mul'✝ : ∀ (x y : R), toFun✝ (x * y) = toFun✝ x * toFun✝ y
nonneg'✝ : ∀ (x : R), 0 ≤ MulHom.toFun { toFun := toFun✝, map_mul' := map_mul'✝ } x
eq_zero'✝ : ∀ (x : R), MulHom.toFun { toFun := toFun✝, map_mul' := map_mul'✝ } x = 0 ↔ x = 0
add_le'✝ :
  ∀ (x y : R),
    MulHom.toFun { toFun := toFun✝, map_mul' := map_mul'✝ } (x + y) ≤
      MulHom.toFun { toFun := toFun✝, map_mul' := map_mul'✝ } x +
        MulHom.toFun { toFun := toFun✝, map_mul' := map_mul'✝ } y
h :
  (fun f => f.toFun)
      { toMulHom := { toFun := toFun✝¹, map_mul' := map_mul'✝¹ }, nonneg' := nonneg'✝¹, eq_zero' := eq_zero'✝¹,
        add_le' := add_le'✝¹ } =
    (fun f => f.toFun)
      { toMulHom := { toFun := toFun✝, map_mul' := map_mul'✝ }, nonneg' := nonneg'✝, eq_zero' := eq_zero'✝,
        add_le' := add_le'✝ }
⊢ { toMulHom := { toFun := toFun✝¹, map_mul' := map_mul'✝¹ }, nonneg' := nonneg'✝¹, eq_zero' := eq_zero'✝¹,
      add_le' := add_le'✝¹ } =
    { toMulHom := { toFun := toFun✝, map_mul' := map_mul'✝ }, nonneg' := nonneg'✝, eq_zero' := eq_zero'✝,
      add_le' := add_le'✝ }

Next tactic:
congr
theorem map_one_of_isLeftRegular (h : IsLeftRegular (abv 1)) : abv 1 = 1 :=
  h <| by 

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : Semiring R
inst✝ : OrderedSemiring S
abv : AbsoluteValue R S
h : IsLeftRegular (abv 1)
⊢ (fun x => abv 1 * x) (abv 1) = (fun x => abv 1 * x) 1

Next tactic:
simp [← abv.map_mul]
protected theorem sub_le (a b c : R) : abv (a - c) ≤ abv (a - b) + abv (b - c) := by
  

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : Ring R
inst✝ : OrderedSemiring S
abv : AbsoluteValue R S
a b c : R
⊢ abv (a - c) ≤ abv (a - b) + abv (b - c)

Next tactic:
simpa [sub_eq_add_neg, add_assoc] using abv.add_le (a - b) (b - c)
protected theorem le_sub (a b : R) : abv a - abv b ≤ abv (a - b) :=
  sub_le_iff_le_add.2 <| by 

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : Ring R
inst✝ : OrderedRing S
abv : AbsoluteValue R S
a b : R
⊢ abv a ≤ abv (a - b) + abv b

Next tactic:
simpa using abv.add_le (a - b) b
@[simp]
protected theorem map_neg (a : R) : abv (-a) = abv a := by
  

Proof state:
R : Type u_1
S : Type u_2
inst✝² : Ring R
inst✝¹ : OrderedCommRing S
abv : AbsoluteValue R S
inst✝ : NoZeroDivisors S
a : R
⊢ abv (-a) = abv a

Next tactic:
by_cases ha : a = 0
@[simp]
protected theorem map_neg (a : R) : abv (-a) = abv a := by
  by_cases ha : a = 0; · 

Proof state:
case pos
R : Type u_1
S : Type u_2
inst✝² : Ring R
inst✝¹ : OrderedCommRing S
abv : AbsoluteValue R S
inst✝ : NoZeroDivisors S
a : R
ha : a = 0
⊢ abv (-a) = abv a

Next tactic:
simp [ha]
@[simp]
protected theorem map_neg (a : R) : abv (-a) = abv a := by
  by_cases ha : a = 0; · simp [ha]
  

Proof state:
case neg
R : Type u_1
S : Type u_2
inst✝² : Ring R
inst✝¹ : OrderedCommRing S
abv : AbsoluteValue R S
inst✝ : NoZeroDivisors S
a : R
ha : ¬a = 0
⊢ abv (-a) = abv a

Next tactic:
refine'
    (mul_self_eq_mul_self_iff.mp (by rw [← abv.map_mul, neg_mul_neg, abv.map_mul])).resolve_right _
@[simp]
protected theorem map_neg (a : R) : abv (-a) = abv a := by
  by_cases ha : a = 0; · simp [ha]
  refine'
    (mul_self_eq_mul_self_iff.mp (by 

Proof state:
R : Type u_1
S : Type u_2
inst✝² : Ring R
inst✝¹ : OrderedCommRing S
abv : AbsoluteValue R S
inst✝ : NoZeroDivisors S
a : R
ha : ¬a = 0
⊢ abv (-a) * abv (-a) = abv a * abv a

Next tactic:
rw [← abv.map_mul, neg_mul_neg, abv.map_mul]
@[simp]
protected theorem map_neg (a : R) : abv (-a) = abv a := by
  by_cases ha : a = 0; · simp [ha]
  refine'
    (mul_self_eq_mul_self_iff.mp (by rw [← abv.map_mul, neg_mul_neg, abv.map_mul])).resolve_right _
  

Proof state:
case neg
R : Type u_1
S : Type u_2
inst✝² : Ring R
inst✝¹ : OrderedCommRing S
abv : AbsoluteValue R S
inst✝ : NoZeroDivisors S
a : R
ha : ¬a = 0
⊢ ¬abv (-a) = -abv a

Next tactic:
exact ((neg_lt_zero.mpr (abv.pos ha)).trans (abv.pos (neg_ne_zero.mpr ha))).ne'
protected theorem map_sub (a b : R) : abv (a - b) = abv (b - a) := by 

Proof state:
R : Type u_1
S : Type u_2
inst✝² : Ring R
inst✝¹ : OrderedCommRing S
abv : AbsoluteValue R S
inst✝ : NoZeroDivisors S
a b : R
⊢ abv (a - b) = abv (b - a)

Next tactic:
rw [← neg_sub, abv.map_neg]
theorem abs_abv_sub_le_abv_sub (a b : R) : abs (abv a - abv b) ≤ abv (a - b) :=
  abs_sub_le_iff.2 ⟨abv.le_sub _ _, by 

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : Ring R
inst✝ : LinearOrderedCommRing S
abv : AbsoluteValue R S
a b : R
⊢ abv b - abv a ≤ abv (a - b)

Next tactic:
rw [abv.map_sub]
theorem abs_abv_sub_le_abv_sub (a b : R) : abs (abv a - abv b) ≤ abv (a - b) :=
  abs_sub_le_iff.2 ⟨abv.le_sub _ _, by rw [abv.map_sub]; 

Proof state:
R : Type u_1
S : Type u_2
inst✝¹ : Ring R
inst✝ : LinearOrderedCommRing S
abv : AbsoluteValue R S
a b : R
⊢ abv b - abv a ≤ abv (b - a)

Next tactic:
apply abv.le_sub
theorem abv_sub_le (a b c : R) : abv (a - c) ≤ abv (a - b) + abv (b - c) := by
  

Proof state:
S : Type u_1
inst✝² : OrderedRing S
R : Type u_2
inst✝¹ : Ring R
abv : R → S
inst✝ : IsAbsoluteValue abv
a b c : R
⊢ abv (a - c) ≤ abv (a - b) + abv (b - c)

Next tactic:
simpa [sub_eq_add_neg, add_assoc] using abv_add abv (a - b) (b - c)
@[ext]
lemma hom_ext {X Y : GradedObject β C} (f g : X ⟶ Y) (h : ∀ x, f x = g x) : f = g := by
  

Proof state:
C : Type u
inst✝ : Category.{v, u} C
β : Type u_1
X Y : GradedObject β C
f g : X ⟶ Y
h : ∀ (x : β), f x = g x
⊢ f = g

Next tactic:
funext
@[ext]
lemma hom_ext {X Y : GradedObject β C} (f g : X ⟶ Y) (h : ∀ x, f x = g x) : f = g := by
  funext
  

Proof state:
case h
C : Type u
inst✝ : Category.{v, u} C
β : Type u_1
X Y : GradedObject β C
f g : X ⟶ Y
h : ∀ (x : β), f x = g x
x✝ : β
⊢ f x✝ = g x✝

Next tactic:
apply h
lemma isIso_of_isIso_apply (f : X ⟶ Y) [hf : ∀ i, IsIso (f i)] :
    IsIso f := by
  

Proof state:
C : Type u
inst✝ : Category.{v, u} C
β : Type u_1
X Y : GradedObject β C
f : X ⟶ Y
hf : ∀ (i : β), IsIso (f i)
⊢ IsIso f

Next tactic:
change IsIso (isoMk X Y (fun i => asIso (f i))).hom
lemma isIso_of_isIso_apply (f : X ⟶ Y) [hf : ∀ i, IsIso (f i)] :
    IsIso f := by
  change IsIso (isoMk X Y (fun i => asIso (f i))).hom
  

Proof state:
C : Type u
inst✝ : Category.{v, u} C
β : Type u_1
X Y : GradedObject β C
f : X ⟶ Y
hf : ∀ (i : β), IsIso (f i)
⊢ IsIso (isoMk X Y fun i => asIso (f i)).hom

Next tactic:
infer_instance
instance isIso_apply_of_isIso (f : X ⟶ Y) [IsIso f] (i : β) : IsIso (f i) := by
  

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
β : Type u_1
X Y : GradedObject β C
f : X ⟶ Y
inst✝ : IsIso f
i : β
⊢ IsIso (f i)

Next tactic:
change IsIso ((eval i).map f)
instance isIso_apply_of_isIso (f : X ⟶ Y) [IsIso f] (i : β) : IsIso (f i) := by
  change IsIso ((eval i).map f)
  

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
β : Type u_1
X Y : GradedObject β C
f : X ⟶ Y
inst✝ : IsIso f
i : β
⊢ IsIso ((eval i).map f)

Next tactic:
infer_instance
@[simp]
theorem eqToHom_proj {x x' : GradedObject I C} (h : x = x') (i : I) :
    (eqToHom h : x ⟶ x') i = eqToHom (Function.funext_iff.mp h i) := by
  

Proof state:
C : Type u
inst✝ : Category.{v, u} C
I : Type u_1
x x' : GradedObject I C
h : x = x'
i : I
⊢ eqToHom h i = eqToHom (_ : x i = x' i)

Next tactic:
subst h
@[simp]
theorem eqToHom_proj {x x' : GradedObject I C} (h : x = x') (i : I) :
    (eqToHom h : x ⟶ x') i = eqToHom (Function.funext_iff.mp h i) := by
  subst h
  

Proof state:
C : Type u
inst✝ : Category.{v, u} C
I : Type u_1
x : GradedObject I C
i : I
⊢ eqToHom (_ : x = x) i = eqToHom (_ : x i = x i)

Next tactic:
rfl
/-- The natural isomorphism comparing between
pulling back along two propositionally equal functions.
-/
@[simps]
def comapEq {β γ : Type w} {f g : β → γ} (h : f = g) : comap C f ≅ comap C g where
  hom := { app := fun X b => eqToHom (by 

Proof state:
C : Type u
inst✝ : Category.{v, u} C
β γ : Type w
f g : β → γ
h : f = g
X : GradedObject γ C
b : β
⊢ (comap C f).obj X b = (comap C g).obj X b

Next tactic:
dsimp
/-- The natural isomorphism comparing between
pulling back along two propositionally equal functions.
-/
@[simps]
def comapEq {β γ : Type w} {f g : β → γ} (h : f = g) : comap C f ≅ comap C g where
  hom := { app := fun X b => eqToHom (by dsimp; 

Proof state:
C : Type u
inst✝ : Category.{v, u} C
β γ : Type w
f g : β → γ
h : f = g
X : GradedObject γ C
b : β
⊢ X (f b) = X (g b)

Next tactic:
simp only [h]
/-- The natural isomorphism comparing between
pulling back along two propositionally equal functions.
-/
@[simps]
def comapEq {β γ : Type w} {f g : β → γ} (h : f = g) : comap C f ≅ comap C g where
  hom := { app := fun X b => eqToHom (by dsimp; simp only [h]) }
  inv := { app := fun X b => eqToHom (by 

Proof state:
C : Type u
inst✝ : Category.{v, u} C
β γ : Type w
f g : β → γ
h : f = g
X : GradedObject γ C
b : β
⊢ (comap C g).obj X b = (comap C f).obj X b

Next tactic:
dsimp
/-- The natural isomorphism comparing between
pulling back along two propositionally equal functions.
-/
@[simps]
def comapEq {β γ : Type w} {f g : β → γ} (h : f = g) : comap C f ≅ comap C g where
  hom := { app := fun X b => eqToHom (by dsimp; simp only [h]) }
  inv := { app := fun X b => eqToHom (by dsimp; 

Proof state:
C : Type u
inst✝ : Category.{v, u} C
β γ : Type w
f g : β → γ
h : f = g
X : GradedObject γ C
b : β
⊢ X (g b) = X (f b)

Next tactic:
simp only [h]