internlm/Lean-Github huggingface dataset:
Theorem: Lean4Axiomatic.Integer.mul_sqrt1_eqv
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
⊢ a * b ≃ 1 → Sqrt1 b ∧ a ≃ b
Tactic:
case mp =>
  intro (_ : a * b ≃ 1)
  show Sqrt1 b ∧ a ≃ b
  have : (a * b) * (a * b) ≃ 1 := calc
    (a * b) * (a * b) ≃ _ := AA.substL ‹a * b ≃ 1›
    1 * (a * b)       ≃ _ := AA.identL
    a * b             ≃ _ := ‹a * b ≃ 1›
    1                 ≃ _ := Rel.refl
  have : Sqrt1 (a * b) := Sqrt1.mk this
  have (And.intro (_ : Sqrt1 a) (_ : Sqrt1 b)) :=
    sqrt1_factors_if_sqrt1_product this
  have : b ≃ 1 ∨ b ≃ -1 := sqrt1_cases.mp ‹Sqrt1 b›
  have : a ≃ b :=
    match this with
    | Or.inl (_ : b ≃ 1) => calc
      a     ≃ _ := Rel.symm AA.identR
      a * 1 ≃ _ := AA.substR (Rel.symm ‹b ≃ 1›)
      a * b ≃ _ := ‹a * b ≃ 1›
      1     ≃ _ := Rel.symm ‹b ≃ 1›
      b     ≃ _ := Rel.refl
    | Or.inr (_ : b ≃ -1) => calc
      a             ≃ _ := Rel.symm neg_involutive
      (-(-a))       ≃ _ := AA.subst₁ (AA.subst₁ (Rel.symm AA.identR))
      (-(-(a * 1))) ≃ _ := AA.subst₁ AA.scompatR
      (-(a * -1))   ≃ _ := AA.subst₁ (AA.substR (Rel.symm ‹b ≃ -1›))
      (-(a * b))    ≃ _ := AA.subst₁ ‹a * b ≃ 1›
      (-1)          ≃ _ := Rel.symm ‹b ≃ -1›
      b             ≃ _ := Rel.refl
  exact And.intro ‹Sqrt1 b› ‹a ≃ b›
Proof state after:
no goals
Theorem: Lean4Axiomatic.Integer.mul_sqrt1_eqv
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
⊢ Sqrt1 b ∧ a ≃ b → a * b ≃ 1
Tactic:
case mpr =>
  intro (And.intro (_ : Sqrt1 b) (_ : a ≃ b))
  show a * b ≃ 1
  calc
    a * b ≃ _ := AA.substL ‹a ≃ b›
    b * b ≃ _ := ‹Sqrt1 b›.elim
    1     ≃ _ := Rel.refl
Proof state after:
no goals
Theorem: Lean4Axiomatic.Integer.mul_sqrt1_eqv
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
⊢ a * b ≃ 1 → Sqrt1 b ∧ a ≃ b
Tactic:
intro (_ : a * b ≃ 1)
Proof state after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
x✝ : a * b ≃ 1
⊢ Sqrt1 b ∧ a ≃ b
Theorem: Lean4Axiomatic.Integer.mul_sqrt1_eqv
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
x✝ : a * b ≃ 1
⊢ Sqrt1 b ∧ a ≃ b
Tactic:
have : (a * b) * (a * b) ≃ 1 := calc
  (a * b) * (a * b) ≃ _ := AA.substL ‹a * b ≃ 1›
  1 * (a * b)       ≃ _ := AA.identL
  a * b             ≃ _ := ‹a * b ≃ 1›
  1                 ≃ _ := Rel.refl
Proof state after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
x✝ : a * b ≃ 1
this : a * b * (a * b) ≃ 1
⊢ Sqrt1 b ∧ a ≃ b
Theorem: Lean4Axiomatic.Integer.mul_sqrt1_eqv
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
x✝ : a * b ≃ 1
this : a * b * (a * b) ≃ 1
⊢ Sqrt1 b ∧ a ≃ b
Tactic:
have : Sqrt1 (a * b) := Sqrt1.mk this
Proof state after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
x✝ : a * b ≃ 1
this✝ : a * b * (a * b) ≃ 1
this : Sqrt1 (a * b)
⊢ Sqrt1 b ∧ a ≃ b
Theorem: Lean4Axiomatic.Integer.mul_sqrt1_eqv
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
x✝ : a * b ≃ 1
this✝ : a * b * (a * b) ≃ 1
this : Sqrt1 (a * b)
⊢ Sqrt1 b ∧ a ≃ b
Tactic:
have (And.intro (_ : Sqrt1 a) (_ : Sqrt1 b)) :=
  sqrt1_factors_if_sqrt1_product this
Proof state after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
x✝ : a * b ≃ 1
this✝ : a * b * (a * b) ≃ 1
this : Sqrt1 (a * b)
left✝ : Sqrt1 a
right✝ : Sqrt1 b
⊢ Sqrt1 b ∧ a ≃ b
Theorem: Lean4Axiomatic.Integer.mul_sqrt1_eqv
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
x✝ : a * b ≃ 1
this✝ : a * b * (a * b) ≃ 1
this : Sqrt1 (a * b)
left✝ : Sqrt1 a
right✝ : Sqrt1 b
⊢ Sqrt1 b ∧ a ≃ b
Tactic:
have : b ≃ 1 ∨ b ≃ -1 := sqrt1_cases.mp ‹Sqrt1 b›
Proof state after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
x✝ : a * b ≃ 1
this✝¹ : a * b * (a * b) ≃ 1
this✝ : Sqrt1 (a * b)
left✝ : Sqrt1 a
right✝ : Sqrt1 b
this : b ≃ 1 ∨ b ≃ -1
⊢ Sqrt1 b ∧ a ≃ b
Theorem: Lean4Axiomatic.Integer.mul_sqrt1_eqv
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
x✝ : a * b ≃ 1
this✝¹ : a * b * (a * b) ≃ 1
this✝ : Sqrt1 (a * b)
left✝ : Sqrt1 a
right✝ : Sqrt1 b
this : b ≃ 1 ∨ b ≃ -1
⊢ Sqrt1 b ∧ a ≃ b
Tactic:
have : a ≃ b :=
  match this with
  | Or.inl (_ : b ≃ 1) => calc
    a     ≃ _ := Rel.symm AA.identR
    a * 1 ≃ _ := AA.substR (Rel.symm ‹b ≃ 1›)
    a * b ≃ _ := ‹a * b ≃ 1›
    1     ≃ _ := Rel.symm ‹b ≃ 1›
    b     ≃ _ := Rel.refl
  | Or.inr (_ : b ≃ -1) => calc
    a             ≃ _ := Rel.symm neg_involutive
    (-(-a))       ≃ _ := AA.subst₁ (AA.subst₁ (Rel.symm AA.identR))
    (-(-(a * 1))) ≃ _ := AA.subst₁ AA.scompatR
    (-(a * -1))   ≃ _ := AA.subst₁ (AA.substR (Rel.symm ‹b ≃ -1›))
    (-(a * b))    ≃ _ := AA.subst₁ ‹a * b ≃ 1›
    (-1)          ≃ _ := Rel.symm ‹b ≃ -1›
    b             ≃ _ := Rel.refl
Proof state after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
x✝ : a * b ≃ 1
this✝² : a * b * (a * b) ≃ 1
this✝¹ : Sqrt1 (a * b)
left✝ : Sqrt1 a
right✝ : Sqrt1 b
this✝ : b ≃ 1 ∨ b ≃ -1
this : a ≃ b
⊢ Sqrt1 b ∧ a ≃ b
Theorem: Lean4Axiomatic.Integer.mul_sqrt1_eqv
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
x✝ : a * b ≃ 1
this✝² : a * b * (a * b) ≃ 1
this✝¹ : Sqrt1 (a * b)
left✝ : Sqrt1 a
right✝ : Sqrt1 b
this✝ : b ≃ 1 ∨ b ≃ -1
this : a ≃ b
⊢ Sqrt1 b ∧ a ≃ b
Tactic:
exact And.intro ‹Sqrt1 b› ‹a ≃ b›
Proof state after:
no goals
Theorem: Lean4Axiomatic.Integer.mul_sqrt1_eqv
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
⊢ Sqrt1 b ∧ a ≃ b → a * b ≃ 1
Tactic:
intro (And.intro (_ : Sqrt1 b) (_ : a ≃ b))
Proof state after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
left✝ : Sqrt1 b
right✝ : a ≃ b
⊢ a * b ≃ 1
Theorem: Lean4Axiomatic.Integer.mul_sqrt1_eqv
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
left✝ : Sqrt1 b
right✝ : a ≃ b
⊢ a * b ≃ 1
Tactic:
calc
  a * b ≃ _ := AA.substL ‹a ≃ b›
  b * b ≃ _ := ‹Sqrt1 b›.elim
  1     ≃ _ := Rel.refl
Proof state after:
no goals
Theorem: Lean4Axiomatic.Integer.positive_mul_iff_same_sign
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
⊢ Positive (a * b) ↔ SameSign a b
Tactic:
let ab := a * b
Proof state after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
⊢ Positive (a * b) ↔ SameSign a b
Theorem: Lean4Axiomatic.Integer.positive_mul_iff_same_sign
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
⊢ Positive (a * b) ↔ SameSign a b
Tactic:
apply Iff.intro
Proof state after:
case mp
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
⊢ Positive (a * b) → SameSign a b

case mpr
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
⊢ SameSign a b → Positive (a * b)
Theorem: Lean4Axiomatic.Integer.positive_mul_iff_same_sign
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
⊢ Positive (a * b) → SameSign a b
Tactic:
case mp =>
  intro (_ : Positive ab)
  show SameSign a b
  have : Nonzero ab := nonzero_iff_pos_or_neg.mpr (Or.inl ‹Positive ab›)
  have (And.intro (_ : Nonzero a) (_ : Nonzero b)) :=
    nonzero_factors_if_nonzero_product ‹Nonzero ab›
  have (Nonzero.intro (sa : ℤ) (_ : Sqrt1 sa) nwsa) := ‹Nonzero a›
  have (Nonzero.intro (sb : ℤ) (_ : Sqrt1 sb) nwsb) := ‹Nonzero b›
  have : NonzeroWithSign a sa := nwsa
  have : NonzeroWithSign b sb := nwsb
  have nwsac : NonzeroWithSign a 1 ∨ NonzeroWithSign a (-1)
    := nonzeroWithSign_cases ‹NonzeroWithSign a sa›
  have nwsbc : NonzeroWithSign b 1 ∨ NonzeroWithSign b (-1)
    := nonzeroWithSign_cases ‹NonzeroWithSign b sb›
  have : SameSign a b ∨ NonzeroWithSign ab (-1) := match nwsac with
  | Or.inl (nwsa : NonzeroWithSign a 1) =>
    match nwsbc with
    | Or.inl (nwsb : NonzeroWithSign b 1) =>
      Or.inl (SameSign.mk nwsa nwsb)
    | Or.inr (nwsb : NonzeroWithSign b (-1)) =>
      have : NonzeroWithSign ab (1 * -1) :=
        mul_preserves_nonzeroWithSign nwsa nwsb
      have : NonzeroWithSign ab (-1) :=
        NonzeroWithSign.subst_sign AA.identL ‹NonzeroWithSign ab (1 * -1)›
      Or.inr ‹NonzeroWithSign ab (-1)›
  | Or.inr (nwsa : NonzeroWithSign a (-1)) =>
    match nwsbc with
    | Or.inl (nwsb : NonzeroWithSign b 1) =>
      have : NonzeroWithSign ab (-1 * 1) :=
        mul_preserves_nonzeroWithSign nwsa nwsb
      have : NonzeroWithSign ab (-1) :=
        NonzeroWithSign.subst_sign AA.identR ‹NonzeroWithSign ab (-1 * 1)›
      Or.inr ‹NonzeroWithSign ab (-1)›
    | Or.inr (nwsb : NonzeroWithSign b (-1)) =>
      Or.inl (SameSign.mk nwsa nwsb)
  match ‹SameSign a b ∨ NonzeroWithSign ab (-1)› with
  | Or.inl (_ : SameSign a b) =>
    exact ‹SameSign a b›
  | Or.inr (_ : NonzeroWithSign ab (-1)) =>
    have : Negative ab :=
      negative_iff_sign_neg1.mpr ‹NonzeroWithSign ab (-1)›
    have positive_and_negative : Positive ab ∧ Negative ab :=
      And.intro ‹Positive ab› ‹Negative ab›
    exact absurd positive_and_negative not_positive_and_negative
Proof state after:
no goals
Theorem: Lean4Axiomatic.Integer.positive_mul_iff_same_sign
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
⊢ SameSign a b → Positive (a * b)
Tactic:
case mpr =>
  intro (_ : SameSign a b)
  show Positive ab
  have (SameSign.intro (s : ℤ) (_ : Sqrt1 s) nwsa nwsb) := ‹SameSign a b›
  have : NonzeroWithSign a s := nwsa
  have : NonzeroWithSign b s := nwsb
  have : s * s ≃ 1 := ‹Sqrt1 s›.elim
  have : NonzeroWithSign ab (s * s) :=
    mul_preserves_nonzeroWithSign nwsa nwsb
  have : NonzeroWithSign ab 1 :=
    NonzeroWithSign.subst_sign ‹s * s ≃ 1› ‹NonzeroWithSign ab (s * s)›
  have : Positive ab := positive_iff_sign_pos1.mpr ‹NonzeroWithSign ab 1›
  exact this
Proof state after:
no goals
Theorem: Lean4Axiomatic.Integer.positive_mul_iff_same_sign
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
⊢ Positive (a * b) → SameSign a b
Tactic:
intro (_ : Positive ab)
Proof state after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
x✝ : Positive ab
⊢ SameSign a b
Theorem: Lean4Axiomatic.Integer.positive_mul_iff_same_sign
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
x✝ : Positive ab
⊢ SameSign a b
Tactic:
have : Nonzero ab := nonzero_iff_pos_or_neg.mpr (Or.inl ‹Positive ab›)
Proof state after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
x✝ : Positive ab
this : Nonzero ab
⊢ SameSign a b
Theorem: Lean4Axiomatic.Integer.positive_mul_iff_same_sign
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
x✝ : Positive ab
this : Nonzero ab
⊢ SameSign a b
Tactic:
have (And.intro (_ : Nonzero a) (_ : Nonzero b)) :=
  nonzero_factors_if_nonzero_product ‹Nonzero ab›
Proof state after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
x✝ : Positive ab
this : Nonzero ab
left✝ : Nonzero a
right✝ : Nonzero b
⊢ SameSign a b
Theorem: Lean4Axiomatic.Integer.positive_mul_iff_same_sign
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
x✝ : Positive ab
this : Nonzero ab
left✝ : Nonzero a
right✝ : Nonzero b
⊢ SameSign a b
Tactic:
have (Nonzero.intro (sa : ℤ) (_ : Sqrt1 sa) nwsa) := ‹Nonzero a›
Proof state after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
x✝ : Positive ab
this : Nonzero ab
left✝ : Nonzero a
right✝ : Nonzero b
sa : ℤ
sqrt1✝ : Sqrt1 sa
nwsa : NonzeroWithSign a sa
⊢ SameSign a b
Theorem: Lean4Axiomatic.Integer.positive_mul_iff_same_sign
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
x✝ : Positive ab
this : Nonzero ab
left✝ : Nonzero a
right✝ : Nonzero b
sa : ℤ
sqrt1✝ : Sqrt1 sa
nwsa : NonzeroWithSign a sa
⊢ SameSign a b
Tactic:
have (Nonzero.intro (sb : ℤ) (_ : Sqrt1 sb) nwsb) := ‹Nonzero b›
Proof state after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
x✝ : Positive ab
this : Nonzero ab
left✝ : Nonzero a
right✝ : Nonzero b
sa : ℤ
sqrt1✝¹ : Sqrt1 sa
nwsa : NonzeroWithSign a sa
sb : ℤ
sqrt1✝ : Sqrt1 sb
nwsb : NonzeroWithSign b sb
⊢ SameSign a b
Theorem: Lean4Axiomatic.Integer.positive_mul_iff_same_sign
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
x✝ : Positive ab
this : Nonzero ab
left✝ : Nonzero a
right✝ : Nonzero b
sa : ℤ
sqrt1✝¹ : Sqrt1 sa
nwsa : NonzeroWithSign a sa
sb : ℤ
sqrt1✝ : Sqrt1 sb
nwsb : NonzeroWithSign b sb
⊢ SameSign a b
Tactic:
have : NonzeroWithSign a sa := nwsa
Proof state after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
x✝ : Positive ab
this✝ : Nonzero ab
left✝ : Nonzero a
right✝ : Nonzero b
sa : ℤ
sqrt1✝¹ : Sqrt1 sa
nwsa : NonzeroWithSign a sa
sb : ℤ
sqrt1✝ : Sqrt1 sb
nwsb : NonzeroWithSign b sb
this : NonzeroWithSign a sa
⊢ SameSign a b
Theorem: Lean4Axiomatic.Integer.positive_mul_iff_same_sign
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
x✝ : Positive ab
this✝ : Nonzero ab
left✝ : Nonzero a
right✝ : Nonzero b
sa : ℤ
sqrt1✝¹ : Sqrt1 sa
nwsa : NonzeroWithSign a sa
sb : ℤ
sqrt1✝ : Sqrt1 sb
nwsb : NonzeroWithSign b sb
this : NonzeroWithSign a sa
⊢ SameSign a b
Tactic:
have : NonzeroWithSign b sb := nwsb
Proof state after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
x✝ : Positive ab
this✝¹ : Nonzero ab
left✝ : Nonzero a
right✝ : Nonzero b
sa : ℤ
sqrt1✝¹ : Sqrt1 sa
nwsa : NonzeroWithSign a sa
sb : ℤ
sqrt1✝ : Sqrt1 sb
nwsb : NonzeroWithSign b sb
this✝ : NonzeroWithSign a sa
this : NonzeroWithSign b sb
⊢ SameSign a b
Theorem: Lean4Axiomatic.Integer.positive_mul_iff_same_sign
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
x✝ : Positive ab
this✝¹ : Nonzero ab
left✝ : Nonzero a
right✝ : Nonzero b
sa : ℤ
sqrt1✝¹ : Sqrt1 sa
nwsa : NonzeroWithSign a sa
sb : ℤ
sqrt1✝ : Sqrt1 sb
nwsb : NonzeroWithSign b sb
this✝ : NonzeroWithSign a sa
this : NonzeroWithSign b sb
⊢ SameSign a b
Tactic:
have nwsac : NonzeroWithSign a 1 ∨ NonzeroWithSign a (-1)
  := nonzeroWithSign_cases ‹NonzeroWithSign a sa›
Proof state after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
x✝ : Positive ab
this✝¹ : Nonzero ab
left✝ : Nonzero a
right✝ : Nonzero b
sa : ℤ
sqrt1✝¹ : Sqrt1 sa
nwsa : NonzeroWithSign a sa
sb : ℤ
sqrt1✝ : Sqrt1 sb
nwsb : NonzeroWithSign b sb
this✝ : NonzeroWithSign a sa
this : NonzeroWithSign b sb
nwsac : NonzeroWithSign a 1 ∨ NonzeroWithSign a (-1)
⊢ SameSign a b
Theorem: Lean4Axiomatic.Integer.positive_mul_iff_same_sign
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
x✝ : Positive ab
this✝¹ : Nonzero ab
left✝ : Nonzero a
right✝ : Nonzero b
sa : ℤ
sqrt1✝¹ : Sqrt1 sa
nwsa : NonzeroWithSign a sa
sb : ℤ
sqrt1✝ : Sqrt1 sb
nwsb : NonzeroWithSign b sb
this✝ : NonzeroWithSign a sa
this : NonzeroWithSign b sb
nwsac : NonzeroWithSign a 1 ∨ NonzeroWithSign a (-1)
⊢ SameSign a b
Tactic:
have nwsbc : NonzeroWithSign b 1 ∨ NonzeroWithSign b (-1)
  := nonzeroWithSign_cases ‹NonzeroWithSign b sb›
Proof state after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
x✝ : Positive ab
this✝¹ : Nonzero ab
left✝ : Nonzero a
right✝ : Nonzero b
sa : ℤ
sqrt1✝¹ : Sqrt1 sa
nwsa : NonzeroWithSign a sa
sb : ℤ
sqrt1✝ : Sqrt1 sb
nwsb : NonzeroWithSign b sb
this✝ : NonzeroWithSign a sa
this : NonzeroWithSign b sb
nwsac : NonzeroWithSign a 1 ∨ NonzeroWithSign a (-1)
nwsbc : NonzeroWithSign b 1 ∨ NonzeroWithSign b (-1)
⊢ SameSign a b
Theorem: Lean4Axiomatic.Integer.positive_mul_iff_same_sign
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
x✝ : Positive ab
this✝¹ : Nonzero ab
left✝ : Nonzero a
right✝ : Nonzero b
sa : ℤ
sqrt1✝¹ : Sqrt1 sa
nwsa : NonzeroWithSign a sa
sb : ℤ
sqrt1✝ : Sqrt1 sb
nwsb : NonzeroWithSign b sb
this✝ : NonzeroWithSign a sa
this : NonzeroWithSign b sb
nwsac : NonzeroWithSign a 1 ∨ NonzeroWithSign a (-1)
nwsbc : NonzeroWithSign b 1 ∨ NonzeroWithSign b (-1)
⊢ SameSign a b
Tactic:
have : SameSign a b ∨ NonzeroWithSign ab (-1) := match nwsac with
| Or.inl (nwsa : NonzeroWithSign a 1) =>
  match nwsbc with
  | Or.inl (nwsb : NonzeroWithSign b 1) =>
    Or.inl (SameSign.mk nwsa nwsb)
  | Or.inr (nwsb : NonzeroWithSign b (-1)) =>
    have : NonzeroWithSign ab (1 * -1) :=
      mul_preserves_nonzeroWithSign nwsa nwsb
    have : NonzeroWithSign ab (-1) :=
      NonzeroWithSign.subst_sign AA.identL ‹NonzeroWithSign ab (1 * -1)›
    Or.inr ‹NonzeroWithSign ab (-1)›
| Or.inr (nwsa : NonzeroWithSign a (-1)) =>
  match nwsbc with
  | Or.inl (nwsb : NonzeroWithSign b 1) =>
    have : NonzeroWithSign ab (-1 * 1) :=
      mul_preserves_nonzeroWithSign nwsa nwsb
    have : NonzeroWithSign ab (-1) :=
      NonzeroWithSign.subst_sign AA.identR ‹NonzeroWithSign ab (-1 * 1)›
    Or.inr ‹NonzeroWithSign ab (-1)›
  | Or.inr (nwsb : NonzeroWithSign b (-1)) =>
    Or.inl (SameSign.mk nwsa nwsb)
Proof state after:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
x✝ : Positive ab
this✝² : Nonzero ab
left✝ : Nonzero a
right✝ : Nonzero b
sa : ℤ
sqrt1✝¹ : Sqrt1 sa
nwsa : NonzeroWithSign a sa
sb : ℤ
sqrt1✝ : Sqrt1 sb
nwsb : NonzeroWithSign b sb
this✝¹ : NonzeroWithSign a sa
this✝ : NonzeroWithSign b sb
nwsac : NonzeroWithSign a 1 ∨ NonzeroWithSign a (-1)
nwsbc : NonzeroWithSign b 1 ∨ NonzeroWithSign b (-1)
this : SameSign a b ∨ NonzeroWithSign ab (-1)
⊢ SameSign a b
Theorem: Lean4Axiomatic.Integer.positive_mul_iff_same_sign
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
x✝ : Positive ab
this✝² : Nonzero ab
left✝ : Nonzero a
right✝ : Nonzero b
sa : ℤ
sqrt1✝¹ : Sqrt1 sa
nwsa : NonzeroWithSign a sa
sb : ℤ
sqrt1✝ : Sqrt1 sb
nwsb : NonzeroWithSign b sb
this✝¹ : NonzeroWithSign a sa
this✝ : NonzeroWithSign b sb
nwsac : NonzeroWithSign a 1 ∨ NonzeroWithSign a (-1)
nwsbc : NonzeroWithSign b 1 ∨ NonzeroWithSign b (-1)
this : SameSign a b ∨ NonzeroWithSign ab (-1)
⊢ SameSign a b
Tactic:
match ‹SameSign a b ∨ NonzeroWithSign ab (-1)› with
| Or.inl (_ : SameSign a b) =>
  exact ‹SameSign a b›
| Or.inr (_ : NonzeroWithSign ab (-1)) =>
  have : Negative ab :=
    negative_iff_sign_neg1.mpr ‹NonzeroWithSign ab (-1)›
  have positive_and_negative : Positive ab ∧ Negative ab :=
    And.intro ‹Positive ab› ‹Negative ab›
  exact absurd positive_and_negative not_positive_and_negative
Proof state after:
no goals
Theorem: Lean4Axiomatic.Integer.positive_mul_iff_same_sign
Proof state before:
ℕ : Type
inst✝⁵ : Natural ℕ
ℤ : Type
inst✝⁴ : Core ℤ
inst✝³ : Addition ℤ
inst✝² : Multiplication ℤ
inst✝¹ : Negation ℤ
inst✝ : Sign ℤ
a b : ℤ
ab : ℤ := a * b
x✝ : Positive ab
this✝² : Nonzero ab
left✝ : Nonzero a
right✝ : Nonzero b
sa : ℤ
sqrt1✝¹ : Sqrt1 sa
nwsa : NonzeroWithSign a sa
sb : ℤ
sqrt1✝ : Sqrt1 sb
nwsb : NonzeroWithSign b sb
this✝¹ : NonzeroWithSign a sa
this✝ : NonzeroWithSign b sb
nwsac : NonzeroWithSign a 1 ∨ NonzeroWithSign a (-1)
nwsbc : NonzeroWithSign b 1 ∨ NonzeroWithSign b (-1)
this : SameSign a b ∨ NonzeroWithSign ab (-1)
h✝ : SameSign a b
⊢ SameSign a b
Tactic:
exact ‹SameSign a b›
Proof state after:
no goals