Theorem: Nat.minSqFacProp_div
File: Mathlib/Data/Nat/Squarefree.lean

tactic: have : ∀ p, Prime p → p * p ∣ n → k * (p * p) ∣ n := fun p pp dp =>
  have :=
    (coprime_primes pk pp).2 fun e => by
      subst e
      contradiction
  (coprime_mul_iff_right.2 ⟨this, this⟩).mul_dvd_of_dvd_of_dvd dk dp
state_before: s : Finset ℕ
m n✝ p n k : ℕ
pk : Prime k
dk : k ∣ n
dkk : ¬k * k ∣ n
o : Option ℕ
H : (n / k).MinSqFacProp o
⊢ n.MinSqFacProp o
state_after: s : Finset ℕ
m n✝ p n k : ℕ
pk : Prime k
dk : k ∣ n
dkk : ¬k * k ∣ n
o : Option ℕ
H : (n / k).MinSqFacProp o
this : ∀ (p : ℕ), Prime p → p * p ∣ n → k * (p * p) ∣ n
⊢ n.MinSqFacProp o

tactic: cases' o with d
state_before: s : Finset ℕ
m n✝ p n k : ℕ
pk : Prime k
dk : k ∣ n
dkk : ¬k * k ∣ n
o : Option ℕ
H : (n / k).MinSqFacProp o
this : ∀ (p : ℕ), Prime p → p * p ∣ n → k * (p * p) ∣ n
⊢ n.MinSqFacProp o
state_after: case none
s : Finset ℕ
m n✝ p n k : ℕ
pk : Prime k
dk : k ∣ n
dkk : ¬k * k ∣ n
this : ∀ (p : ℕ), Prime p → p * p ∣ n → k * (p * p) ∣ n
H : (n / k).MinSqFacProp none
⊢ n.MinSqFacProp none

case some
s : Finset ℕ
m n✝ p n k : ℕ
pk : Prime k
dk : k ∣ n
dkk : ¬k * k ∣ n
this : ∀ (p : ℕ), Prime p → p * p ∣ n → k * (p * p) ∣ n
d : ℕ
H : (n / k).MinSqFacProp (some d)
⊢ n.MinSqFacProp (some d)

tactic: subst e
state_before: s : Finset ℕ
m n✝ p✝ n k : ℕ
pk : Prime k
dk : k ∣ n
dkk : ¬k * k ∣ n
o : Option ℕ
H : (n / k).MinSqFacProp o
p : ℕ
pp : Prime p
dp : p * p ∣ n
e : k = p
⊢ False
state_after: s : Finset ℕ
m n✝ p n k : ℕ
pk : Prime k
dk : k ∣ n
dkk : ¬k * k ∣ n
o : Option ℕ
H : (n / k).MinSqFacProp o
pp : Prime k
dp : k * k ∣ n
⊢ False

tactic: contradiction
state_before: s : Finset ℕ
m n✝ p n k : ℕ
pk : Prime k
dk : k ∣ n
dkk : ¬k * k ∣ n
o : Option ℕ
H : (n / k).MinSqFacProp o
pp : Prime k
dp : k * k ∣ n
⊢ False
state_after: no goals

tactic: rw [MinSqFacProp, squarefree_iff_prime_squarefree] at H ⊢
state_before: case none
s : Finset ℕ
m n✝ p n k : ℕ
pk : Prime k
dk : k ∣ n
dkk : ¬k * k ∣ n
this : ∀ (p : ℕ), Prime p → p * p ∣ n → k * (p * p) ∣ n
H : (n / k).MinSqFacProp none
⊢ n.MinSqFacProp none
state_after: case none
s : Finset ℕ
m n✝ p n k : ℕ
pk : Prime k
dk : k ∣ n
dkk : ¬k * k ∣ n
this : ∀ (p : ℕ), Prime p → p * p ∣ n → k * (p * p) ∣ n
H :
  match none with
  | none => ∀ (x : ℕ), Prime x → ¬x * x ∣ n / k
  | some d => Prime d ∧ d * d ∣ n / k ∧ ∀ (p : ℕ), Prime p → p * p ∣ n / k → d ≤ p
⊢ match none with
  | none => ∀ (x : ℕ), Prime x → ¬x * x ∣ n
  | some d => Prime d ∧ d * d ∣ n ∧ ∀ (p : ℕ), Prime p → p * p ∣ n → d ≤ p

tactic: exact fun p pp dp => H p pp ((dvd_div_iff_mul_dvd dk).2 (this _ pp dp))
state_before: case none
s : Finset ℕ
m n✝ p n k : ℕ
pk : Prime k
dk : k ∣ n
dkk : ¬k * k ∣ n
this : ∀ (p : ℕ), Prime p → p * p ∣ n → k * (p * p) ∣ n
H :
  match none with
  | none => ∀ (x : ℕ), Prime x → ¬x * x ∣ n / k
  | some d => Prime d ∧ d * d ∣ n / k ∧ ∀ (p : ℕ), Prime p → p * p ∣ n / k → d ≤ p
⊢ match none with
  | none => ∀ (x : ℕ), Prime x → ¬x * x ∣ n
  | some d => Prime d ∧ d * d ∣ n ∧ ∀ (p : ℕ), Prime p → p * p ∣ n → d ≤ p
state_after: no goals

tactic: obtain ⟨H1, H2, H3⟩ := H
state_before: case some
s : Finset ℕ
m n✝ p n k : ℕ
pk : Prime k
dk : k ∣ n
dkk : ¬k * k ∣ n
this : ∀ (p : ℕ), Prime p → p * p ∣ n → k * (p * p) ∣ n
d : ℕ
H : (n / k).MinSqFacProp (some d)
⊢ n.MinSqFacProp (some d)
state_after: case some.intro.intro
s : Finset ℕ
m n✝ p n k : ℕ
pk : Prime k
dk : k ∣ n
dkk : ¬k * k ∣ n
this : ∀ (p : ℕ), Prime p → p * p ∣ n → k * (p * p) ∣ n
d : ℕ
H1 : Prime d
H2 : d * d ∣ n / k
H3 : ∀ (p : ℕ), Prime p → p * p ∣ n / k → d ≤ p
⊢ n.MinSqFacProp (some d)

tactic: simp only [dvd_div_iff_mul_dvd dk] at H2 H3
state_before: case some.intro.intro
s : Finset ℕ
m n✝ p n k : ℕ
pk : Prime k
dk : k ∣ n
dkk : ¬k * k ∣ n
this : ∀ (p : ℕ), Prime p → p * p ∣ n → k * (p * p) ∣ n
d : ℕ
H1 : Prime d
H2 : d * d ∣ n / k
H3 : ∀ (p : ℕ), Prime p → p * p ∣ n / k → d ≤ p
⊢ n.MinSqFacProp (some d)
state_after: case some.intro.intro
s : Finset ℕ
m n✝ p n k : ℕ
pk : Prime k
dk : k ∣ n
dkk : ¬k * k ∣ n
this : ∀ (p : ℕ), Prime p → p * p ∣ n → k * (p * p) ∣ n
d : ℕ
H1 : Prime d
H2 : k * (d * d) ∣ n
H3 : ∀ (p : ℕ), Prime p → k * (p * p) ∣ n → d ≤ p
⊢ n.MinSqFacProp (some d)

tactic: exact ⟨H1, dvd_trans (dvd_mul_left _ _) H2, fun p pp dp => H3 _ pp (this _ pp dp)⟩
state_before: case some.intro.intro
s : Finset ℕ
m n✝ p n k : ℕ
pk : Prime k
dk : k ∣ n
dkk : ¬k * k ∣ n
this : ∀ (p : ℕ), Prime p → p * p ∣ n → k * (p * p) ∣ n
d : ℕ
H1 : Prime d
H2 : k * (d * d) ∣ n
H3 : ∀ (p : ℕ), Prime p → k * (p * p) ∣ n → d ≤ p
⊢ n.MinSqFacProp (some d)
state_after: no goals