Theorem: Lean4Axiomatic.Integer.sgn_compat_mul (Lean4Axiomatic/Integer/Sign.lean)

State before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
⊢ sgn (a * b) ≃ sgn a * sgn b
Tactic:
have : a * b ≃ 0 ∨ Nonzero (a * b) := (zero? (a * b)).left
State after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
this : a * b ≃ 0 ∨ Nonzero (a * b)
⊢ sgn (a * b) ≃ sgn a * sgn b

State before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
this : a * b ≃ 0 ∨ Nonzero (a * b)
⊢ sgn (a * b) ≃ sgn a * sgn b
Tactic:
match this with
| Or.inl (_ : a * b ≃ 0) =>
  have : a ≃ 0 ∨ b ≃ 0 := mul_split_zero.mp ‹a * b ≃ 0›
  match this with
  | Or.inl (_ : a ≃ 0) =>
    calc
      sgn (a * b)   ≃ _ := sgn_zero.mp ‹a * b ≃ 0›
      0             ≃ _ := Rel.symm AA.absorbL
      0 * sgn b     ≃ _ := AA.substL (Rel.symm (sgn_zero.mp ‹a ≃ 0›))
      sgn a * sgn b ≃ _ := Rel.refl
  | Or.inr (_ : b ≃ 0) =>
    calc
      sgn (a * b)   ≃ _ := sgn_zero.mp ‹a * b ≃ 0›
      0             ≃ _ := Rel.symm AA.absorbR
      sgn a * 0     ≃ _ := AA.substR (Rel.symm (sgn_zero.mp ‹b ≃ 0›))
      sgn a * sgn b ≃ _ := Rel.refl
| Or.inr (_ : Nonzero (a * b)) =>
  have (And.intro (_ : Sqrt1 (sgn a)) (_ : Sqrt1 (sgn b))) :=
    sqrt1_sgn_split_nonzero_mul ‹Nonzero (a * b)›
  have : Positive (a * b) ∨ Negative (a * b) :=
    nonzero_iff_pos_or_neg.mp ‹Nonzero (a * b)›
  match this with
  | Or.inl (_ : Positive (a * b)) =>
    have : sgn a ≃ sgn b := positive_mul_iff_sgn_eqv.mp ‹Positive (a * b)›
    have : Sqrt1 (sgn b) ∧ sgn a ≃ sgn b := And.intro ‹Sqrt1 (sgn b)› this
    calc
      sgn (a * b)   ≃ _ := sgn_positive.mp ‹Positive (a * b)›
      1             ≃ _ := Rel.symm (mul_sqrt1_eqv.mpr this)
      sgn a * sgn b ≃ _ := Rel.refl
  | Or.inr (_ : Negative (a * b)) =>
    have : sgn a ≄ sgn b := negative_mul_iff_sgn_neqv.mp ‹Negative (a * b)›
    calc
      sgn (a * b)   ≃ _ := sgn_negative.mp ‹Negative (a * b)›
      (-1)          ≃ _ := Rel.symm (mul_sqrt1_neqv.mpr ‹sgn a ≄ sgn b›)
      sgn a * sgn b ≃ _ := Rel.refl
State after:
no goals

State before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
this : a * b ≃ 0 ∨ Nonzero (a * b)
h✝ : a * b ≃ 0
⊢ sgn (a * b) ≃ sgn a * sgn b
Tactic:
have : a ≃ 0 ∨ b ≃ 0 := mul_split_zero.mp ‹a * b ≃ 0›
State after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
this✝ : a * b ≃ 0 ∨ Nonzero (a * b)
h✝ : a * b ≃ 0
this : a ≃ 0 ∨ b ≃ 0
⊢ sgn (a * b) ≃ sgn a * sgn b

State before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
this✝ : a * b ≃ 0 ∨ Nonzero (a * b)
h✝ : a * b ≃ 0
this : a ≃ 0 ∨ b ≃ 0
⊢ sgn (a * b) ≃ sgn a * sgn b
Tactic:
match this with
| Or.inl (_ : a ≃ 0) =>
  calc
    sgn (a * b)   ≃ _ := sgn_zero.mp ‹a * b ≃ 0›
    0             ≃ _ := Rel.symm AA.absorbL
    0 * sgn b     ≃ _ := AA.substL (Rel.symm (sgn_zero.mp ‹a ≃ 0›))
    sgn a * sgn b ≃ _ := Rel.refl
| Or.inr (_ : b ≃ 0) =>
  calc
    sgn (a * b)   ≃ _ := sgn_zero.mp ‹a * b ≃ 0›
    0             ≃ _ := Rel.symm AA.absorbR
    sgn a * 0     ≃ _ := AA.substR (Rel.symm (sgn_zero.mp ‹b ≃ 0›))
    sgn a * sgn b ≃ _ := Rel.refl
State after:
no goals

State before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
this✝ : a * b ≃ 0 ∨ Nonzero (a * b)
h✝¹ : a * b ≃ 0
this : a ≃ 0 ∨ b ≃ 0
h✝ : a ≃ 0
⊢ sgn (a * b) ≃ sgn a * sgn b
Tactic:
calc
  sgn (a * b)   ≃ _ := sgn_zero.mp ‹a * b ≃ 0›
  0             ≃ _ := Rel.symm AA.absorbL
  0 * sgn b     ≃ _ := AA.substL (Rel.symm (sgn_zero.mp ‹a ≃ 0›))
  sgn a * sgn b ≃ _ := Rel.refl
State after:
no goals

State before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
this✝ : a * b ≃ 0 ∨ Nonzero (a * b)
h✝¹ : a * b ≃ 0
this : a ≃ 0 ∨ b ≃ 0
h✝ : b ≃ 0
⊢ sgn (a * b) ≃ sgn a * sgn b
Tactic:
calc
  sgn (a * b)   ≃ _ := sgn_zero.mp ‹a * b ≃ 0›
  0             ≃ _ := Rel.symm AA.absorbR
  sgn a * 0     ≃ _ := AA.substR (Rel.symm (sgn_zero.mp ‹b ≃ 0›))
  sgn a * sgn b ≃ _ := Rel.refl
State after:
no goals

State before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
this : a * b ≃ 0 ∨ Nonzero (a * b)
h✝ : Nonzero (a * b)
⊢ sgn (a * b) ≃ sgn a * sgn b
Tactic:
have (And.intro (_ : Sqrt1 (sgn a)) (_ : Sqrt1 (sgn b))) :=
  sqrt1_sgn_split_nonzero_mul ‹Nonzero (a * b)›
State after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
this : a * b ≃ 0 ∨ Nonzero (a * b)
h✝ : Nonzero (a * b)
left✝ : Sqrt1 (sgn a)
right✝ : Sqrt1 (sgn b)
⊢ sgn (a * b) ≃ sgn a * sgn b

State before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
this : a * b ≃ 0 ∨ Nonzero (a * b)
h✝ : Nonzero (a * b)
left✝ : Sqrt1 (sgn a)
right✝ : Sqrt1 (sgn b)
⊢ sgn (a * b) ≃ sgn a * sgn b
Tactic:
have : Positive (a * b) ∨ Negative (a * b) :=
  nonzero_iff_pos_or_neg.mp ‹Nonzero (a * b)›
State after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
this✝ : a * b ≃ 0 ∨ Nonzero (a * b)
h✝ : Nonzero (a * b)
left✝ : Sqrt1 (sgn a)
right✝ : Sqrt1 (sgn b)
this : Positive (a * b) ∨ Negative (a * b)
⊢ sgn (a * b) ≃ sgn a * sgn b

State before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
this✝ : a * b ≃ 0 ∨ Nonzero (a * b)
h✝ : Nonzero (a * b)
left✝ : Sqrt1 (sgn a)
right✝ : Sqrt1 (sgn b)
this : Positive (a * b) ∨ Negative (a * b)
⊢ sgn (a * b) ≃ sgn a * sgn b
Tactic:
match this with
| Or.inl (_ : Positive (a * b)) =>
  have : sgn a ≃ sgn b := positive_mul_iff_sgn_eqv.mp ‹Positive (a * b)›
  have : Sqrt1 (sgn b) ∧ sgn a ≃ sgn b := And.intro ‹Sqrt1 (sgn b)› this
  calc
    sgn (a * b)   ≃ _ := sgn_positive.mp ‹Positive (a * b)›
    1             ≃ _ := Rel.symm (mul_sqrt1_eqv.mpr this)
    sgn a * sgn b ≃ _ := Rel.refl
| Or.inr (_ : Negative (a * b)) =>
  have : sgn a ≄ sgn b := negative_mul_iff_sgn_neqv.mp ‹Negative (a * b)›
  calc
    sgn (a * b)   ≃ _ := sgn_negative.mp ‹Negative (a * b)›
    (-1)          ≃ _ := Rel.symm (mul_sqrt1_neqv.mpr ‹sgn a ≄ sgn b›)
    sgn a * sgn b ≃ _ := Rel.refl
State after:
no goals

State before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
this✝ : a * b ≃ 0 ∨ Nonzero (a * b)
h✝¹ : Nonzero (a * b)
left✝ : Sqrt1 (sgn a)
right✝ : Sqrt1 (sgn b)
this : Positive (a * b) ∨ Negative (a * b)
h✝ : Positive (a * b)
⊢ sgn (a * b) ≃ sgn a * sgn b
Tactic:
have : sgn a ≃ sgn b := positive_mul_iff_sgn_eqv.mp ‹Positive (a * b)›
State after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
this✝¹ : a * b ≃ 0 ∨ Nonzero (a * b)
h✝¹ : Nonzero (a * b)
left✝ : Sqrt1 (sgn a)
right✝ : Sqrt1 (sgn b)
this✝ : Positive (a * b) ∨ Negative (a * b)
h✝ : Positive (a * b)
this : sgn a ≃ sgn b
⊢ sgn (a * b) ≃ sgn a * sgn b

State before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
this✝¹ : a * b ≃ 0 ∨ Nonzero (a * b)
h✝¹ : Nonzero (a * b)
left✝ : Sqrt1 (sgn a)
right✝ : Sqrt1 (sgn b)
this✝ : Positive (a * b) ∨ Negative (a * b)
h✝ : Positive (a * b)
this : sgn a ≃ sgn b
⊢ sgn (a * b) ≃ sgn a * sgn b
Tactic:
have : Sqrt1 (sgn b) ∧ sgn a ≃ sgn b := And.intro ‹Sqrt1 (sgn b)› this
State after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
this✝² : a * b ≃ 0 ∨ Nonzero (a * b)
h✝¹ : Nonzero (a * b)
left✝ : Sqrt1 (sgn a)
right✝ : Sqrt1 (sgn b)
this✝¹ : Positive (a * b) ∨ Negative (a * b)
h✝ : Positive (a * b)
this✝ : sgn a ≃ sgn b
this : Sqrt1 (sgn b) ∧ sgn a ≃ sgn b
⊢ sgn (a * b) ≃ sgn a * sgn b

State before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
this✝² : a * b ≃ 0 ∨ Nonzero (a * b)
h✝¹ : Nonzero (a * b)
left✝ : Sqrt1 (sgn a)
right✝ : Sqrt1 (sgn b)
this✝¹ : Positive (a * b) ∨ Negative (a * b)
h✝ : Positive (a * b)
this✝ : sgn a ≃ sgn b
this : Sqrt1 (sgn b) ∧ sgn a ≃ sgn b
⊢ sgn (a * b) ≃ sgn a * sgn b
Tactic:
calc
  sgn (a * b)   ≃ _ := sgn_positive.mp ‹Positive (a * b)›
  1             ≃ _ := Rel.symm (mul_sqrt1_eqv.mpr this)
  sgn a * sgn b ≃ _ := Rel.refl
State after:
no goals

State before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
this✝ : a * b ≃ 0 ∨ Nonzero (a * b)
h✝¹ : Nonzero (a * b)
left✝ : Sqrt1 (sgn a)
right✝ : Sqrt1 (sgn b)
this : Positive (a * b) ∨ Negative (a * b)
h✝ : Negative (a * b)
⊢ sgn (a * b) ≃ sgn a * sgn b
Tactic:
have : sgn a ≄ sgn b := negative_mul_iff_sgn_neqv.mp ‹Negative (a * b)›
State after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
this✝¹ : a * b ≃ 0 ∨ Nonzero (a * b)
h✝¹ : Nonzero (a * b)
left✝ : Sqrt1 (sgn a)
right✝ : Sqrt1 (sgn b)
this✝ : Positive (a * b) ∨ Negative (a * b)
h✝ : Negative (a * b)
this : sgn a ≄ sgn b
⊢ sgn (a * b) ≃ sgn a * sgn b

State before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
this✝¹ : a * b ≃ 0 ∨ Nonzero (a * b)
h✝¹ : Nonzero (a * b)
left✝ : Sqrt1 (sgn a)
right✝ : Sqrt1 (sgn b)
this✝ : Positive (a * b) ∨ Negative (a * b)
h✝ : Negative (a * b)
this : sgn a ≄ sgn b
⊢ sgn (a * b) ≃ sgn a * sgn b
Tactic:
calc
  sgn (a * b)   ≃ _ := sgn_negative.mp ‹Negative (a * b)›
  (-1)          ≃ _ := Rel.symm (mul_sqrt1_neqv.mpr ‹sgn a ≄ sgn b›)
  sgn a * sgn b ≃ _ := Rel.refl
State after:
no goals