[GOAL]
⊢ φ⁻¹ = -ψ
[PROOFSTEP]
have : 1 + Real.sqrt 5 ≠ 0 := ne_of_gt (add_pos (by norm_num) <| Real.sqrt_pos.mpr (by norm_num))
[GOAL]
⊢ 0 < 1
[PROOFSTEP]
norm_num
[GOAL]
⊢ 0 < 5
[PROOFSTEP]
norm_num
[GOAL]
this : 1 + sqrt 5 ≠ 0
⊢ φ⁻¹ = -ψ
[PROOFSTEP]
field_simp [sub_mul, mul_add]
[GOAL]
this : 1 + sqrt 5 ≠ 0
⊢ 2 * 2 = sqrt 5 * sqrt 5 - 1
[PROOFSTEP]
norm_num
[GOAL]
⊢ ψ⁻¹ = -φ
[PROOFSTEP]
rw [inv_eq_iff_eq_inv, ← neg_inv, ← neg_eq_iff_eq_neg]
[GOAL]
⊢ -ψ = φ⁻¹
[PROOFSTEP]
exact inv_gold.symm
[GOAL]
⊢ φ * ψ = -1
[PROOFSTEP]
field_simp
[GOAL]
⊢ (1 + sqrt 5) * (1 - sqrt 5) = -(2 * 2)
[PROOFSTEP]
rw [← sq_sub_sq]
[GOAL]
⊢ 1 ^ 2 - sqrt 5 ^ 2 = -(2 * 2)
[PROOFSTEP]
norm_num
[GOAL]
⊢ ψ * φ = -1
[PROOFSTEP]
rw [mul_comm]
[GOAL]
⊢ φ * ψ = -1
[PROOFSTEP]
exact gold_mul_goldConj
[GOAL]
⊢ φ + ψ = 1
[PROOFSTEP]
rw [goldenRatio, goldenConj]
[GOAL]
⊢ (1 + sqrt 5) / 2 + (1 - sqrt 5) / 2 = 1
[PROOFSTEP]
ring
[GOAL]
⊢ 1 - φ = ψ
[PROOFSTEP]
linarith [gold_add_goldConj]
[GOAL]
⊢ 1 - ψ = φ
[PROOFSTEP]
linarith [gold_add_goldConj]
[GOAL]
⊢ φ - ψ = sqrt 5
[PROOFSTEP]
rw [goldenRatio, goldenConj]
[GOAL]
⊢ (1 + sqrt 5) / 2 - (1 - sqrt 5) / 2 = sqrt 5
[PROOFSTEP]
ring
[GOAL]
⊢ φ ^ 2 = φ + 1
[PROOFSTEP]
rw [goldenRatio, ← sub_eq_zero]
[GOAL]
⊢ ((1 + sqrt 5) / 2) ^ 2 - ((1 + sqrt 5) / 2 + 1) = 0
[PROOFSTEP]
ring_nf
[GOAL]
⊢ sqrt 5 ^ 2 * (↑(Int.ofNat 1) / ↑4) + ↑(Int.negOfNat 5) * (↑(Int.ofNat 1) / ↑4) = 0
[PROOFSTEP]
rw [Real.sq_sqrt]
[GOAL]
⊢ 5 * (↑(Int.ofNat 1) / ↑4) + ↑(Int.negOfNat 5) * (↑(Int.ofNat 1) / ↑4) = 0
[PROOFSTEP]
norm_num
[GOAL]
⊢ 0 ≤ 5
[PROOFSTEP]
norm_num
[GOAL]
⊢ ψ ^ 2 = ψ + 1
[PROOFSTEP]
rw [goldenConj, ← sub_eq_zero]
[GOAL]
⊢ ((1 - sqrt 5) / 2) ^ 2 - ((1 - sqrt 5) / 2 + 1) = 0
[PROOFSTEP]
ring_nf
[GOAL]
⊢ sqrt 5 ^ 2 * (↑(Int.ofNat 1) / ↑4) + ↑(Int.negOfNat 5) * (↑(Int.ofNat 1) / ↑4) = 0
[PROOFSTEP]
rw [Real.sq_sqrt]
[GOAL]
⊢ 5 * (↑(Int.ofNat 1) / ↑4) + ↑(Int.negOfNat 5) * (↑(Int.ofNat 1) / ↑4) = 0
[PROOFSTEP]
norm_num
[GOAL]
⊢ 0 ≤ 5
[PROOFSTEP]
norm_num
[GOAL]
⊢ 0 < 1 + sqrt 5
[PROOFSTEP]
apply add_pos
[GOAL]
case ha
⊢ 0 < 1
[PROOFSTEP]
norm_num
[GOAL]
case hb
⊢ 0 < sqrt 5
[PROOFSTEP]
norm_num
[GOAL]
⊢ 1 < φ
[PROOFSTEP]
refine' lt_of_mul_lt_mul_left _ (le_of_lt gold_pos)
[GOAL]
⊢ φ * 1 < φ * φ
[PROOFSTEP]
simp [← sq, gold_pos, zero_lt_one, -div_pow]
  -- Porting note: Added `- div_pow`
[GOAL]
⊢ ψ < 0
[PROOFSTEP]
linarith [one_sub_goldConj, one_lt_gold]
[GOAL]
⊢ -1 < ψ
[PROOFSTEP]
rw [neg_lt, ← inv_gold]
[GOAL]
⊢ φ⁻¹ < 1
[PROOFSTEP]
exact inv_lt_one one_lt_gold
[GOAL]
⊢ Irrational φ
[PROOFSTEP]
have := Nat.Prime.irrational_sqrt (show Nat.Prime 5 by norm_num)
[GOAL]
⊢ Nat.Prime 5
[PROOFSTEP]
norm_num
[GOAL]
this : Irrational (sqrt ↑5)
⊢ Irrational φ
[PROOFSTEP]
have := this.rat_add 1
[GOAL]
this✝ : Irrational (sqrt ↑5)
this : Irrational (↑1 + sqrt ↑5)
⊢ Irrational φ
[PROOFSTEP]
have := this.rat_mul (show (0.5 : ℚ) ≠ 0 by norm_num)
[GOAL]
this✝ : Irrational (sqrt ↑5)
this : Irrational (↑1 + sqrt ↑5)
⊢ 0.5 ≠ 0
[PROOFSTEP]
norm_num
[GOAL]
this✝¹ : Irrational (sqrt ↑5)
this✝ : Irrational (↑1 + sqrt ↑5)
this : Irrational (↑0.5 * (↑1 + sqrt ↑5))
⊢ Irrational φ
[PROOFSTEP]
convert this
[GOAL]
case h.e'_1
this✝¹ : Irrational (sqrt ↑5)
this✝ : Irrational (↑1 + sqrt ↑5)
this : Irrational (↑0.5 * (↑1 + sqrt ↑5))
⊢ φ = ↑0.5 * (↑1 + sqrt ↑5)
[PROOFSTEP]
norm_num
[GOAL]
case h.e'_1
this✝¹ : Irrational (sqrt ↑5)
this✝ : Irrational (↑1 + sqrt ↑5)
this : Irrational (↑0.5 * (↑1 + sqrt ↑5))
⊢ φ = 1 / 2 * (1 + sqrt 5)
[PROOFSTEP]
field_simp
[GOAL]
⊢ Irrational ψ
[PROOFSTEP]
have := Nat.Prime.irrational_sqrt (show Nat.Prime 5 by norm_num)
[GOAL]
⊢ Nat.Prime 5
[PROOFSTEP]
norm_num
[GOAL]
this : Irrational (sqrt ↑5)
⊢ Irrational ψ
[PROOFSTEP]
have := this.rat_sub 1
[GOAL]
this✝ : Irrational (sqrt ↑5)
this : Irrational (↑1 - sqrt ↑5)
⊢ Irrational ψ
[PROOFSTEP]
have := this.rat_mul (show (0.5 : ℚ) ≠ 0 by norm_num)
[GOAL]
this✝ : Irrational (sqrt ↑5)
this : Irrational (↑1 - sqrt ↑5)
⊢ 0.5 ≠ 0
[PROOFSTEP]
norm_num
[GOAL]
this✝¹ : Irrational (sqrt ↑5)
this✝ : Irrational (↑1 - sqrt ↑5)
this : Irrational (↑0.5 * (↑1 - sqrt ↑5))
⊢ Irrational ψ
[PROOFSTEP]
convert this
[GOAL]
case h.e'_1
this✝¹ : Irrational (sqrt ↑5)
this✝ : Irrational (↑1 - sqrt ↑5)
this : Irrational (↑0.5 * (↑1 - sqrt ↑5))
⊢ ψ = ↑0.5 * (↑1 - sqrt ↑5)
[PROOFSTEP]
norm_num
[GOAL]
case h.e'_1
this✝¹ : Irrational (sqrt ↑5)
this✝ : Irrational (↑1 - sqrt ↑5)
this : Irrational (↑0.5 * (↑1 - sqrt ↑5))
⊢ ψ = 1 / 2 * (1 - sqrt 5)
[PROOFSTEP]
field_simp
[GOAL]
α : Type u_1
inst✝¹ : CommSemiring α
β : Type u_2
inst✝ : CommRing β
⊢ LinearRecurrence.charPoly fibRec = X ^ 2 - (X + 1)
[PROOFSTEP]
rw [fibRec, LinearRecurrence.charPoly]
[GOAL]
α : Type u_1
inst✝¹ : CommSemiring α
β : Type u_2
inst✝ : CommRing β
⊢ (↑(monomial { order := 2, coeffs := ![1, 1] }.order) 1 -
      Finset.sum Finset.univ fun i => ↑(monomial ↑i) (LinearRecurrence.coeffs { order := 2, coeffs := ![1, 1] } i)) =
    X ^ 2 - (X + 1)
[PROOFSTEP]
simp [Finset.sum_fin_eq_sum_range, Finset.sum_range_succ', ← smul_X_eq_monomial]
[GOAL]
α : Type u_1
inst✝ : CommSemiring α
⊢ LinearRecurrence.IsSolution fibRec fun x => ↑(Nat.fib x)
[PROOFSTEP]
rw [fibRec]
[GOAL]
α : Type u_1
inst✝ : CommSemiring α
⊢ LinearRecurrence.IsSolution { order := 2, coeffs := ![1, 1] } fun x => ↑(Nat.fib x)
[PROOFSTEP]
intro n
[GOAL]
α : Type u_1
inst✝ : CommSemiring α
n : ℕ
⊢ (fun x => ↑(Nat.fib x)) (n + { order := 2, coeffs := ![1, 1] }.order) =
    Finset.sum Finset.univ fun i =>
      LinearRecurrence.coeffs { order := 2, coeffs := ![1, 1] } i * (fun x => ↑(Nat.fib x)) (n + ↑i)
[PROOFSTEP]
simp only
[GOAL]
α : Type u_1
inst✝ : CommSemiring α
n : ℕ
⊢ ↑(Nat.fib (n + 2)) = Finset.sum Finset.univ fun x => Matrix.vecCons 1 ![1] x * ↑(Nat.fib (n + ↑x))
[PROOFSTEP]
rw [Nat.fib_add_two, add_comm]
[GOAL]
α : Type u_1
inst✝ : CommSemiring α
n : ℕ
⊢ ↑(Nat.fib (n + 1) + Nat.fib n) = Finset.sum Finset.univ fun x => Matrix.vecCons 1 ![1] x * ↑(Nat.fib (n + ↑x))
[PROOFSTEP]
simp [Finset.sum_fin_eq_sum_range, Finset.sum_range_succ']
[GOAL]
α : Type u_1
inst✝ : CommSemiring α
⊢ LinearRecurrence.IsSolution fibRec fun x => φ ^ x
[PROOFSTEP]
rw [fibRec.geom_sol_iff_root_charPoly, fibRec_charPoly_eq]
[GOAL]
α : Type u_1
inst✝ : CommSemiring α
⊢ IsRoot (X ^ 2 - (X + 1)) φ
[PROOFSTEP]
simp [sub_eq_zero, -div_pow]
  -- Porting note: Added `- div_pow`
[GOAL]
α : Type u_1
inst✝ : CommSemiring α
⊢ LinearRecurrence.IsSolution fibRec fun x => ψ ^ x
[PROOFSTEP]
rw [fibRec.geom_sol_iff_root_charPoly, fibRec_charPoly_eq]
[GOAL]
α : Type u_1
inst✝ : CommSemiring α
⊢ IsRoot (X ^ 2 - (X + 1)) ψ
[PROOFSTEP]
simp [sub_eq_zero, -div_pow]
  -- Porting note: Added `- div_pow`
[GOAL]
⊢ (fun n => ↑(Nat.fib n)) = fun n => (φ ^ n - ψ ^ n) / sqrt 5
[PROOFSTEP]
rw [fibRec.sol_eq_of_eq_init]
[GOAL]
⊢ Set.EqOn (fun n => ↑(Nat.fib n)) (fun n => (φ ^ n - ψ ^ n) / sqrt 5) ↑(Finset.range fibRec.order)
[PROOFSTEP]
intro i hi
[GOAL]
i : ℕ
hi : i ∈ ↑(Finset.range fibRec.order)
⊢ (fun n => ↑(Nat.fib n)) i = (fun n => (φ ^ n - ψ ^ n) / sqrt 5) i
[PROOFSTEP]
norm_cast at hi
[GOAL]
i : ℕ
hi : i ∈ Finset.range fibRec.order
⊢ (fun n => ↑(Nat.fib n)) i = (fun n => (φ ^ n - ψ ^ n) / sqrt 5) i
[PROOFSTEP]
fin_cases hi
[GOAL]
case head
⊢ (fun n => ↑(Nat.fib n)) 0 = (fun n => (φ ^ n - ψ ^ n) / sqrt 5) 0
[PROOFSTEP]
simp
[GOAL]
case tail.head
⊢ (fun n => ↑(Nat.fib n)) 1 = (fun n => (φ ^ n - ψ ^ n) / sqrt 5) 1
[PROOFSTEP]
simp only [goldenRatio, goldenConj]
[GOAL]
case tail.head
⊢ ↑(Nat.fib 1) = (((1 + sqrt 5) / 2) ^ 1 - ((1 - sqrt 5) / 2) ^ 1) / sqrt 5
[PROOFSTEP]
ring_nf
[GOAL]
case tail.head
⊢ 1 = sqrt 5 * (sqrt 5)⁻¹
[PROOFSTEP]
rw [mul_inv_cancel]
[GOAL]
case tail.head
⊢ sqrt 5 ≠ 0
[PROOFSTEP]
norm_num
[GOAL]
case hu
⊢ LinearRecurrence.IsSolution fibRec fun n => ↑(Nat.fib n)
[PROOFSTEP]
exact fib_isSol_fibRec
[GOAL]
case hv
⊢ LinearRecurrence.IsSolution fibRec fun n => (φ ^ n - ψ ^ n) / sqrt 5
[PROOFSTEP]
suffices LinearRecurrence.IsSolution fibRec ((fun n ↦ (sqrt 5)⁻¹ * φ ^ n) - (fun n ↦ (sqrt 5)⁻¹ * ψ ^ n))
  by
  convert this
  rw [Pi.sub_apply]
  ring
[GOAL]
this : LinearRecurrence.IsSolution fibRec ((fun n => (sqrt 5)⁻¹ * φ ^ n) - fun n => (sqrt 5)⁻¹ * ψ ^ n)
⊢ LinearRecurrence.IsSolution fibRec fun n => (φ ^ n - ψ ^ n) / sqrt 5
[PROOFSTEP]
convert this
[GOAL]
case h.e'_4.h
this : LinearRecurrence.IsSolution fibRec ((fun n => (sqrt 5)⁻¹ * φ ^ n) - fun n => (sqrt 5)⁻¹ * ψ ^ n)
x✝ : ℕ
⊢ (φ ^ x✝ - ψ ^ x✝) / sqrt 5 = ((fun n => (sqrt 5)⁻¹ * φ ^ n) - fun n => (sqrt 5)⁻¹ * ψ ^ n) x✝
[PROOFSTEP]
rw [Pi.sub_apply]
[GOAL]
case h.e'_4.h
this : LinearRecurrence.IsSolution fibRec ((fun n => (sqrt 5)⁻¹ * φ ^ n) - fun n => (sqrt 5)⁻¹ * ψ ^ n)
x✝ : ℕ
⊢ (φ ^ x✝ - ψ ^ x✝) / sqrt 5 = (sqrt 5)⁻¹ * φ ^ x✝ - (sqrt 5)⁻¹ * ψ ^ x✝
[PROOFSTEP]
ring
[GOAL]
case hv
⊢ LinearRecurrence.IsSolution fibRec ((fun n => (sqrt 5)⁻¹ * φ ^ n) - fun n => (sqrt 5)⁻¹ * ψ ^ n)
[PROOFSTEP]
apply (@fibRec ℝ _).solSpace.sub_mem
[GOAL]
case hv.a
⊢ (fun n => (sqrt 5)⁻¹ * φ ^ n) ∈ LinearRecurrence.solSpace fibRec
[PROOFSTEP]
exact Submodule.smul_mem fibRec.solSpace (Real.sqrt 5)⁻¹ geom_gold_isSol_fibRec
[GOAL]
case hv.a
⊢ (fun n => (sqrt 5)⁻¹ * ψ ^ n) ∈ LinearRecurrence.solSpace fibRec
[PROOFSTEP]
exact Submodule.smul_mem fibRec.solSpace (Real.sqrt 5)⁻¹ geom_goldConj_isSol_fibRec
[GOAL]
⊢ ∀ (n : ℕ), ↑(Nat.fib n) = (φ ^ n - ψ ^ n) / sqrt 5
[PROOFSTEP]
rw [← Function.funext_iff, Real.coe_fib_eq']


[GOAL]
ι : Type u_1
β : ι → Type u_2
r✝ : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : (i : ι) → PartialOrder (β i)
r : ι → ι → Prop
hwf : WellFounded r
x y : (i : ι) → β i
hlt : x < y
⊢ Pi.Lex r (fun i x x_1 => x < x_1) x y
[PROOFSTEP]
simp_rw [Pi.Lex, le_antisymm_iff]
[GOAL]
ι : Type u_1
β : ι → Type u_2
r✝ : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : (i : ι) → PartialOrder (β i)
r : ι → ι → Prop
hwf : WellFounded r
x y : (i : ι) → β i
hlt : x < y
⊢ ∃ i, (∀ (j : ι), r j i → x j ≤ y j ∧ y j ≤ x j) ∧ x i < y i
[PROOFSTEP]
exact lex_lt_of_lt_of_preorder hwf hlt
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
⊢ Pi.Lex r s a b ∨ a = b ∨ Pi.Lex r s b a
[PROOFSTEP]
cases' eq_or_ne a b with hab hab
[GOAL]
case inl
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : a = b
⊢ Pi.Lex r s a b ∨ a = b ∨ Pi.Lex r s b a
[PROOFSTEP]
exact Or.inr (Or.inl hab)
[GOAL]
case inr
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : a ≠ b
⊢ Pi.Lex r s a b ∨ a = b ∨ Pi.Lex r s b a
[PROOFSTEP]
rw [Function.ne_iff] at hab
[GOAL]
case inr
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : ∃ a_1, a a_1 ≠ b a_1
⊢ Pi.Lex r s a b ∨ a = b ∨ Pi.Lex r s b a
[PROOFSTEP]
let i := wf.min _ hab
[GOAL]
case inr
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : ∃ a_1, a a_1 ≠ b a_1
i : ι := WellFounded.min wf (fun x => a x = b x → False) hab
⊢ Pi.Lex r s a b ∨ a = b ∨ Pi.Lex r s b a
[PROOFSTEP]
have hri : ∀ j, r j i → a j = b j := by
  intro j
  rw [← not_imp_not]
  exact fun h' => wf.not_lt_min _ _ h'
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : ∃ a_1, a a_1 ≠ b a_1
i : ι := WellFounded.min wf (fun x => a x = b x → False) hab
⊢ ∀ (j : ι), r j i → a j = b j
[PROOFSTEP]
intro j
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : ∃ a_1, a a_1 ≠ b a_1
i : ι := WellFounded.min wf (fun x => a x = b x → False) hab
j : ι
⊢ r j i → a j = b j
[PROOFSTEP]
rw [← not_imp_not]
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : ∃ a_1, a a_1 ≠ b a_1
i : ι := WellFounded.min wf (fun x => a x = b x → False) hab
j : ι
⊢ ¬a j = b j → ¬r j i
[PROOFSTEP]
exact fun h' => wf.not_lt_min _ _ h'
[GOAL]
case inr
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : ∃ a_1, a a_1 ≠ b a_1
i : ι := WellFounded.min wf (fun x => a x = b x → False) hab
hri : ∀ (j : ι), r j i → a j = b j
⊢ Pi.Lex r s a b ∨ a = b ∨ Pi.Lex r s b a
[PROOFSTEP]
have hne : a i ≠ b i := wf.min_mem _ hab
[GOAL]
case inr
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : ∃ a_1, a a_1 ≠ b a_1
i : ι := WellFounded.min wf (fun x => a x = b x → False) hab
hri : ∀ (j : ι), r j i → a j = b j
hne : a i ≠ b i
⊢ Pi.Lex r s a b ∨ a = b ∨ Pi.Lex r s b a
[PROOFSTEP]
cases' trichotomous_of s (a i) (b i) with hi hi
[GOAL]
case inr.inl
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : ∃ a_1, a a_1 ≠ b a_1
i : ι := WellFounded.min wf (fun x => a x = b x → False) hab
hri : ∀ (j : ι), r j i → a j = b j
hne : a i ≠ b i
hi : s (a i) (b i)
⊢ Pi.Lex r s a b ∨ a = b ∨ Pi.Lex r s b a
case inr.inr
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝ : ∀ (i : ι), IsTrichotomous (β i) s
wf : WellFounded r
a b : (i : ι) → β i
hab : ∃ a_1, a a_1 ≠ b a_1
i : ι := WellFounded.min wf (fun x => a x = b x → False) hab
hri : ∀ (j : ι), r j i → a j = b j
hne : a i ≠ b i
hi : a i = b i ∨ s (b i) (a i)
⊢ Pi.Lex r s a b ∨ a = b ∨ Pi.Lex r s b a
[PROOFSTEP]
exacts [Or.inl ⟨i, hri, hi⟩, Or.inr <| Or.inr <| ⟨i, fun j hj => (hri j hj).symm, hi.resolve_left hne⟩]
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝¹ : LinearOrder ι
inst✝ : (a : ι) → PartialOrder (β a)
⊢ ∀ (a b c : Lex ((i : ι) → β i)), a < b → b < c → a < c
[PROOFSTEP]
rintro a b c ⟨N₁, lt_N₁, a_lt_b⟩ ⟨N₂, lt_N₂, b_lt_c⟩
[GOAL]
case intro.intro.intro.intro
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝¹ : LinearOrder ι
inst✝ : (a : ι) → PartialOrder (β a)
a b c : Lex ((i : ι) → β i)
N₁ : ι
lt_N₁ : ∀ (j : ι), (fun x x_1 => x < x_1) j N₁ → a j = b j
a_lt_b : a N₁ < b N₁
N₂ : ι
lt_N₂ : ∀ (j : ι), (fun x x_1 => x < x_1) j N₂ → b j = c j
b_lt_c : b N₂ < c N₂
⊢ a < c
[PROOFSTEP]
rcases lt_trichotomy N₁ N₂ with (H | rfl | H)
[GOAL]
case intro.intro.intro.intro.inl
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝¹ : LinearOrder ι
inst✝ : (a : ι) → PartialOrder (β a)
a b c : Lex ((i : ι) → β i)
N₁ : ι
lt_N₁ : ∀ (j : ι), (fun x x_1 => x < x_1) j N₁ → a j = b j
a_lt_b : a N₁ < b N₁
N₂ : ι
lt_N₂ : ∀ (j : ι), (fun x x_1 => x < x_1) j N₂ → b j = c j
b_lt_c : b N₂ < c N₂
H : N₁ < N₂
⊢ a < c
case intro.intro.intro.intro.inr.inl
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝¹ : LinearOrder ι
inst✝ : (a : ι) → PartialOrder (β a)
a b c : Lex ((i : ι) → β i)
N₁ : ι
lt_N₁ : ∀ (j : ι), (fun x x_1 => x < x_1) j N₁ → a j = b j
a_lt_b : a N₁ < b N₁
lt_N₂ : ∀ (j : ι), (fun x x_1 => x < x_1) j N₁ → b j = c j
b_lt_c : b N₁ < c N₁
⊢ a < c
case intro.intro.intro.intro.inr.inr
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝¹ : LinearOrder ι
inst✝ : (a : ι) → PartialOrder (β a)
a b c : Lex ((i : ι) → β i)
N₁ : ι
lt_N₁ : ∀ (j : ι), (fun x x_1 => x < x_1) j N₁ → a j = b j
a_lt_b : a N₁ < b N₁
N₂ : ι
lt_N₂ : ∀ (j : ι), (fun x x_1 => x < x_1) j N₂ → b j = c j
b_lt_c : b N₂ < c N₂
H : N₂ < N₁
⊢ a < c
[PROOFSTEP]
exacts [⟨N₁, fun j hj => (lt_N₁ _ hj).trans (lt_N₂ _ <| hj.trans H), lt_N₂ _ H ▸ a_lt_b⟩,
  ⟨N₁, fun j hj => (lt_N₁ _ hj).trans (lt_N₂ _ hj), a_lt_b.trans b_lt_c⟩,
  ⟨N₂, fun j hj => (lt_N₁ _ (hj.trans H)).trans (lt_N₂ _ hj), (lt_N₁ _ H).symm ▸ b_lt_c⟩]
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
i✝ : ι
a✝ : β i✝
a b : (i : ι) → β i
h : a ≤ b
hne : ¬↑toLex a = ↑toLex b
i : ι
hi : i ∈ {i | a i ≠ b i}
hl : ∀ (x : ι), x ∈ {i | a i ≠ b i} → ¬x < i
j : ι
hj : (fun x x_1 => x < x_1) j i
⊢ ↑toLex a j = ↑toLex b j
[PROOFSTEP]
contrapose! hl
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
i✝ : ι
a✝ : β i✝
a b : (i : ι) → β i
h : a ≤ b
hne : ¬↑toLex a = ↑toLex b
i : ι
hi : i ∈ {i | a i ≠ b i}
j : ι
hj : (fun x x_1 => x < x_1) j i
hl : ↑toLex a j ≠ ↑toLex b j
⊢ ∃ x, x ∈ {i | a i ≠ b i} ∧ x < i
[PROOFSTEP]
exact ⟨j, hl, hj⟩
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
i✝ : ι
a✝ : β i✝
a b : (i : ι) → β i
h : a < b
i : ι
hi : i ∈ {i | a i ≠ b i}
hl : ∀ (x : ι), x ∈ {i | a i ≠ b i} → ¬x < i
j : ι
hj : (fun x x_1 => x < x_1) j i
⊢ ↑toLex a j = ↑toLex b j
[PROOFSTEP]
contrapose! hl
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
i✝ : ι
a✝ : β i✝
a b : (i : ι) → β i
h : a < b
i : ι
hi : i ∈ {i | a i ≠ b i}
j : ι
hj : (fun x x_1 => x < x_1) j i
hl : ↑toLex a j ≠ ↑toLex b j
⊢ ∃ x, x ∈ {i | a i ≠ b i} ∧ x < i
[PROOFSTEP]
exact ⟨j, hl, hj⟩
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
i : ι
a : β i
⊢ ↑toLex x < ↑toLex (update x i a) ↔ x i < a
[PROOFSTEP]
refine' ⟨_, fun h => toLex_strictMono <| lt_update_self_iff.2 h⟩
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
i : ι
a : β i
⊢ ↑toLex x < ↑toLex (update x i a) → x i < a
[PROOFSTEP]
rintro ⟨j, hj, h⟩
[GOAL]
case intro.intro
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
i : ι
a : β i
j : ι
hj : ∀ (j_1 : ι), (fun x x_1 => x < x_1) j_1 j → ↑toLex x j_1 = ↑toLex (update x i a) j_1
h : ↑toLex x j < ↑toLex (update x i a) j
⊢ x i < a
[PROOFSTEP]
dsimp at h
[GOAL]
case intro.intro
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
i : ι
a : β i
j : ι
hj : ∀ (j_1 : ι), (fun x x_1 => x < x_1) j_1 j → ↑toLex x j_1 = ↑toLex (update x i a) j_1
h : x j < update x i a j
⊢ x i < a
[PROOFSTEP]
obtain rfl : j = i := by
  by_contra H
  rw [update_noteq H] at h
  exact h.false
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
i : ι
a : β i
j : ι
hj : ∀ (j_1 : ι), (fun x x_1 => x < x_1) j_1 j → ↑toLex x j_1 = ↑toLex (update x i a) j_1
h : x j < update x i a j
⊢ j = i
[PROOFSTEP]
by_contra H
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
i : ι
a : β i
j : ι
hj : ∀ (j_1 : ι), (fun x x_1 => x < x_1) j_1 j → ↑toLex x j_1 = ↑toLex (update x i a) j_1
h : x j < update x i a j
H : ¬j = i
⊢ False
[PROOFSTEP]
rw [update_noteq H] at h
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
i : ι
a : β i
j : ι
hj : ∀ (j_1 : ι), (fun x x_1 => x < x_1) j_1 j → ↑toLex x j_1 = ↑toLex (update x i a) j_1
h : x j < x j
H : ¬j = i
⊢ False
[PROOFSTEP]
exact h.false
[GOAL]
case intro.intro
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
j : ι
a : β j
hj : ∀ (j_1 : ι), (fun x x_1 => x < x_1) j_1 j → ↑toLex x j_1 = ↑toLex (update x j a) j_1
h : x j < update x j a j
⊢ x j < a
[PROOFSTEP]
rwa [update_same] at h
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
i : ι
a : β i
⊢ ↑toLex (update x i a) < ↑toLex x ↔ a < x i
[PROOFSTEP]
refine' ⟨_, fun h => toLex_strictMono <| update_lt_self_iff.2 h⟩
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
i : ι
a : β i
⊢ ↑toLex (update x i a) < ↑toLex x → a < x i
[PROOFSTEP]
rintro ⟨j, hj, h⟩
[GOAL]
case intro.intro
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
i : ι
a : β i
j : ι
hj : ∀ (j_1 : ι), (fun x x_1 => x < x_1) j_1 j → ↑toLex (update x i a) j_1 = ↑toLex x j_1
h : ↑toLex (update x i a) j < ↑toLex x j
⊢ a < x i
[PROOFSTEP]
dsimp at h
[GOAL]
case intro.intro
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
i : ι
a : β i
j : ι
hj : ∀ (j_1 : ι), (fun x x_1 => x < x_1) j_1 j → ↑toLex (update x i a) j_1 = ↑toLex x j_1
h : update x i a j < x j
⊢ a < x i
[PROOFSTEP]
obtain rfl : j = i := by
  by_contra H
  rw [update_noteq H] at h
  exact h.false
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
i : ι
a : β i
j : ι
hj : ∀ (j_1 : ι), (fun x x_1 => x < x_1) j_1 j → ↑toLex (update x i a) j_1 = ↑toLex x j_1
h : update x i a j < x j
⊢ j = i
[PROOFSTEP]
by_contra H
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
i : ι
a : β i
j : ι
hj : ∀ (j_1 : ι), (fun x x_1 => x < x_1) j_1 j → ↑toLex (update x i a) j_1 = ↑toLex x j_1
h : update x i a j < x j
H : ¬j = i
⊢ False
[PROOFSTEP]
rw [update_noteq H] at h
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
i : ι
a : β i
j : ι
hj : ∀ (j_1 : ι), (fun x x_1 => x < x_1) j_1 j → ↑toLex (update x i a) j_1 = ↑toLex x j_1
h : x j < x j
H : ¬j = i
⊢ False
[PROOFSTEP]
exact h.false
[GOAL]
case intro.intro
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
j : ι
a : β j
hj : ∀ (j_1 : ι), (fun x x_1 => x < x_1) j_1 j → ↑toLex (update x j a) j_1 = ↑toLex x j_1
h : update x j a j < x j
⊢ a < x j
[PROOFSTEP]
rwa [update_same] at h
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
i : ι
a : β i
⊢ ↑toLex x ≤ ↑toLex (update x i a) ↔ x i ≤ a
[PROOFSTEP]
simp_rw [le_iff_lt_or_eq, lt_toLex_update_self_iff, toLex_inj, eq_update_self_iff]
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : LinearOrder ι
inst✝¹ : IsWellOrder ι fun x x_1 => x < x_1
inst✝ : (i : ι) → PartialOrder (β i)
x y : (i : ι) → β i
i : ι
a : β i
⊢ ↑toLex (update x i a) ≤ ↑toLex x ↔ a ≤ x i
[PROOFSTEP]
simp_rw [le_iff_lt_or_eq, toLex_update_lt_self_iff, toLex_inj, update_eq_self_iff]
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : Preorder ι
inst✝¹ : (i : ι) → LT (β i)
inst✝ : ∀ (i : ι), DenselyOrdered (β i)
⊢ ∀ (a₁ a₂ : Lex ((i : ι) → β i)), a₁ < a₂ → ∃ a, a₁ < a ∧ a < a₂
[PROOFSTEP]
rintro _ a₂ ⟨i, h, hi⟩
[GOAL]
case intro.intro
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : Preorder ι
inst✝¹ : (i : ι) → LT (β i)
inst✝ : ∀ (i : ι), DenselyOrdered (β i)
a₁✝ a₂ : Lex ((i : ι) → β i)
i : ι
h : ∀ (j : ι), (fun x x_1 => x < x_1) j i → a₁✝ j = a₂ j
hi : a₁✝ i < a₂ i
⊢ ∃ a, a₁✝ < a ∧ a < a₂
[PROOFSTEP]
obtain ⟨a, ha₁, ha₂⟩ := exists_between hi
[GOAL]
case intro.intro.intro.intro
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : Preorder ι
inst✝¹ : (i : ι) → LT (β i)
inst✝ : ∀ (i : ι), DenselyOrdered (β i)
a₁✝ a₂ : Lex ((i : ι) → β i)
i : ι
h : ∀ (j : ι), (fun x x_1 => x < x_1) j i → a₁✝ j = a₂ j
hi : a₁✝ i < a₂ i
a : β i
ha₁ : a₁✝ i < a
ha₂ : a < a₂ i
⊢ ∃ a, a₁✝ < a ∧ a < a₂
[PROOFSTEP]
classical
refine' ⟨Function.update a₂ _ a, ⟨i, fun j hj => _, _⟩, i, fun j hj => _, _⟩
rw [h j hj]
dsimp only at hj
· rw [Function.update_noteq hj.ne a]
· rwa [Function.update_same i a]
· rw [Function.update_noteq hj.ne a]
· rwa [Function.update_same i a]
[GOAL]
case intro.intro.intro.intro
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : Preorder ι
inst✝¹ : (i : ι) → LT (β i)
inst✝ : ∀ (i : ι), DenselyOrdered (β i)
a₁✝ a₂ : Lex ((i : ι) → β i)
i : ι
h : ∀ (j : ι), (fun x x_1 => x < x_1) j i → a₁✝ j = a₂ j
hi : a₁✝ i < a₂ i
a : β i
ha₁ : a₁✝ i < a
ha₂ : a < a₂ i
⊢ ∃ a, a₁✝ < a ∧ a < a₂
[PROOFSTEP]
refine' ⟨Function.update a₂ _ a, ⟨i, fun j hj => _, _⟩, i, fun j hj => _, _⟩
[GOAL]
case intro.intro.intro.intro.refine'_1
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : Preorder ι
inst✝¹ : (i : ι) → LT (β i)
inst✝ : ∀ (i : ι), DenselyOrdered (β i)
a₁✝ a₂ : Lex ((i : ι) → β i)
i : ι
h : ∀ (j : ι), (fun x x_1 => x < x_1) j i → a₁✝ j = a₂ j
hi : a₁✝ i < a₂ i
a : β i
ha₁ : a₁✝ i < a
ha₂ : a < a₂ i
j : ι
hj : (fun x x_1 => x < x_1) j i
⊢ a₁✝ j = Function.update a₂ i a j
case intro.intro.intro.intro.refine'_2
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : Preorder ι
inst✝¹ : (i : ι) → LT (β i)
inst✝ : ∀ (i : ι), DenselyOrdered (β i)
a₁✝ a₂ : Lex ((i : ι) → β i)
i : ι
h : ∀ (j : ι), (fun x x_1 => x < x_1) j i → a₁✝ j = a₂ j
hi : a₁✝ i < a₂ i
a : β i
ha₁ : a₁✝ i < a
ha₂ : a < a₂ i
⊢ (fun x x_1 x_2 => x_1 < x_2) i (a₁✝ i) (Function.update a₂ i a i)
case intro.intro.intro.intro.refine'_3
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : Preorder ι
inst✝¹ : (i : ι) → LT (β i)
inst✝ : ∀ (i : ι), DenselyOrdered (β i)
a₁✝ a₂ : Lex ((i : ι) → β i)
i : ι
h : ∀ (j : ι), (fun x x_1 => x < x_1) j i → a₁✝ j = a₂ j
hi : a₁✝ i < a₂ i
a : β i
ha₁ : a₁✝ i < a
ha₂ : a < a₂ i
j : ι
hj : (fun x x_1 => x < x_1) j i
⊢ Function.update a₂ i a j = a₂ j
case intro.intro.intro.intro.refine'_4
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : Preorder ι
inst✝¹ : (i : ι) → LT (β i)
inst✝ : ∀ (i : ι), DenselyOrdered (β i)
a₁✝ a₂ : Lex ((i : ι) → β i)
i : ι
h : ∀ (j : ι), (fun x x_1 => x < x_1) j i → a₁✝ j = a₂ j
hi : a₁✝ i < a₂ i
a : β i
ha₁ : a₁✝ i < a
ha₂ : a < a₂ i
⊢ (fun x x_1 x_2 => x_1 < x_2) i (Function.update a₂ i a i) (a₂ i)
[PROOFSTEP]
rw [h j hj]
[GOAL]
case intro.intro.intro.intro.refine'_1
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : Preorder ι
inst✝¹ : (i : ι) → LT (β i)
inst✝ : ∀ (i : ι), DenselyOrdered (β i)
a₁✝ a₂ : Lex ((i : ι) → β i)
i : ι
h : ∀ (j : ι), (fun x x_1 => x < x_1) j i → a₁✝ j = a₂ j
hi : a₁✝ i < a₂ i
a : β i
ha₁ : a₁✝ i < a
ha₂ : a < a₂ i
j : ι
hj : (fun x x_1 => x < x_1) j i
⊢ a₂ j = Function.update a₂ i a j
case intro.intro.intro.intro.refine'_2
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : Preorder ι
inst✝¹ : (i : ι) → LT (β i)
inst✝ : ∀ (i : ι), DenselyOrdered (β i)
a₁✝ a₂ : Lex ((i : ι) → β i)
i : ι
h : ∀ (j : ι), (fun x x_1 => x < x_1) j i → a₁✝ j = a₂ j
hi : a₁✝ i < a₂ i
a : β i
ha₁ : a₁✝ i < a
ha₂ : a < a₂ i
⊢ (fun x x_1 x_2 => x_1 < x_2) i (a₁✝ i) (Function.update a₂ i a i)
case intro.intro.intro.intro.refine'_3
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : Preorder ι
inst✝¹ : (i : ι) → LT (β i)
inst✝ : ∀ (i : ι), DenselyOrdered (β i)
a₁✝ a₂ : Lex ((i : ι) → β i)
i : ι
h : ∀ (j : ι), (fun x x_1 => x < x_1) j i → a₁✝ j = a₂ j
hi : a₁✝ i < a₂ i
a : β i
ha₁ : a₁✝ i < a
ha₂ : a < a₂ i
j : ι
hj : (fun x x_1 => x < x_1) j i
⊢ Function.update a₂ i a j = a₂ j
case intro.intro.intro.intro.refine'_4
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : Preorder ι
inst✝¹ : (i : ι) → LT (β i)
inst✝ : ∀ (i : ι), DenselyOrdered (β i)
a₁✝ a₂ : Lex ((i : ι) → β i)
i : ι
h : ∀ (j : ι), (fun x x_1 => x < x_1) j i → a₁✝ j = a₂ j
hi : a₁✝ i < a₂ i
a : β i
ha₁ : a₁✝ i < a
ha₂ : a < a₂ i
⊢ (fun x x_1 x_2 => x_1 < x_2) i (Function.update a₂ i a i) (a₂ i)
[PROOFSTEP]
dsimp only at hj
[GOAL]
case intro.intro.intro.intro.refine'_1
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : Preorder ι
inst✝¹ : (i : ι) → LT (β i)
inst✝ : ∀ (i : ι), DenselyOrdered (β i)
a₁✝ a₂ : Lex ((i : ι) → β i)
i : ι
h : ∀ (j : ι), (fun x x_1 => x < x_1) j i → a₁✝ j = a₂ j
hi : a₁✝ i < a₂ i
a : β i
ha₁ : a₁✝ i < a
ha₂ : a < a₂ i
j : ι
hj : j < i
⊢ a₂ j = Function.update a₂ i a j
[PROOFSTEP]
rw [Function.update_noteq hj.ne a]
[GOAL]
case intro.intro.intro.intro.refine'_2
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : Preorder ι
inst✝¹ : (i : ι) → LT (β i)
inst✝ : ∀ (i : ι), DenselyOrdered (β i)
a₁✝ a₂ : Lex ((i : ι) → β i)
i : ι
h : ∀ (j : ι), (fun x x_1 => x < x_1) j i → a₁✝ j = a₂ j
hi : a₁✝ i < a₂ i
a : β i
ha₁ : a₁✝ i < a
ha₂ : a < a₂ i
⊢ (fun x x_1 x_2 => x_1 < x_2) i (a₁✝ i) (Function.update a₂ i a i)
[PROOFSTEP]
rwa [Function.update_same i a]
[GOAL]
case intro.intro.intro.intro.refine'_3
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : Preorder ι
inst✝¹ : (i : ι) → LT (β i)
inst✝ : ∀ (i : ι), DenselyOrdered (β i)
a₁✝ a₂ : Lex ((i : ι) → β i)
i : ι
h : ∀ (j : ι), (fun x x_1 => x < x_1) j i → a₁✝ j = a₂ j
hi : a₁✝ i < a₂ i
a : β i
ha₁ : a₁✝ i < a
ha₂ : a < a₂ i
j : ι
hj : (fun x x_1 => x < x_1) j i
⊢ Function.update a₂ i a j = a₂ j
[PROOFSTEP]
rw [Function.update_noteq hj.ne a]
[GOAL]
case intro.intro.intro.intro.refine'_4
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : Preorder ι
inst✝¹ : (i : ι) → LT (β i)
inst✝ : ∀ (i : ι), DenselyOrdered (β i)
a₁✝ a₂ : Lex ((i : ι) → β i)
i : ι
h : ∀ (j : ι), (fun x x_1 => x < x_1) j i → a₁✝ j = a₂ j
hi : a₁✝ i < a₂ i
a : β i
ha₁ : a₁✝ i < a
ha₂ : a < a₂ i
⊢ (fun x x_1 x_2 => x_1 < x_2) i (Function.update a₂ i a i) (a₂ i)
[PROOFSTEP]
rwa [Function.update_same i a]
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : Preorder ι
inst✝¹ : (i : ι) → LT (β i)
i : ι
inst✝ : NoMaxOrder (β i)
a : Lex ((i : ι) → β i)
⊢ ∃ b, a < b
[PROOFSTEP]
let ⟨b, hb⟩ := exists_gt (a i)
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : Preorder ι
inst✝¹ : (i : ι) → LT (β i)
i : ι
inst✝ : NoMaxOrder (β i)
a : Lex ((i : ι) → β i)
b : β i
hb : a i < b
⊢ ∃ b, a < b
[PROOFSTEP]
classical exact
  ⟨Function.update a i b, i, fun j hj => (Function.update_noteq hj.ne b a).symm, by rwa [Function.update_same i b]⟩
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : Preorder ι
inst✝¹ : (i : ι) → LT (β i)
i : ι
inst✝ : NoMaxOrder (β i)
a : Lex ((i : ι) → β i)
b : β i
hb : a i < b
⊢ ∃ b, a < b
[PROOFSTEP]
exact ⟨Function.update a i b, i, fun j hj => (Function.update_noteq hj.ne b a).symm, by rwa [Function.update_same i b]⟩
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
inst✝² : Preorder ι
inst✝¹ : (i : ι) → LT (β i)
i : ι
inst✝ : NoMaxOrder (β i)
a : Lex ((i : ι) → β i)
b : β i
hb : a i < b
⊢ (fun x x_1 x_2 => x_1 < x_2) i (a i) (Function.update a i b i)
[PROOFSTEP]
rwa [Function.update_same i b]
[GOAL]
ι : Type u_1
β : ι → Type u_2
r : ι → ι → Prop
s : {i : ι} → β i → β i → Prop
α : Type u_3
inst✝² : Preorder ι
inst✝¹ : DecidableEq ι
inst✝ : Preorder α
f : ι → α
i j : ι
h₁ : i ≤ j
h₂ : f j < f i
⊢ (fun x x_1 x_2 => x_1 < x_2) i (↑toLex (f ∘ ↑(Equiv.swap i j)) i) (↑toLex f i)
[PROOFSTEP]
simpa only [Pi.toLex_apply, Function.comp_apply, Equiv.swap_apply_left] using h₂