Skip to content

Commit

Permalink
Update chapter3.lean
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine-dSG committed Aug 22, 2024
1 parent 90911a5 commit 8f760e0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions FriezePatterns/chapter3.lean
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ lemma arithFriezePatSetNonEmpty {n : ℕ} (h : n ≠ 0) : (arithFriezePatSet n).
def fHasMax (n : ℕ) (f : ℕ × ℕ → ℚ) [arith_fp f n] : Prop :=
∃ a ∈ Set.univ, ∀ a' ∈ Set.univ, f a ≤ f a' → f a = f a'

-- proof that the maximum of a frieze pattern exists
lemma unf (n : ℕ) (f : ℕ × ℕ → ℚ) [arith_fp f n] : fHasMax n f := by
let domain : Set (ℕ × ℕ) := Set.univ
have h₁ : domain.Nonempty := by apply Set.univ_nonempty
Expand All @@ -150,10 +151,19 @@ lemma unf (n : ℕ) (f : ℕ × ℕ → ℚ) [arith_fp f n] : fHasMax n f := by
exact h
exact Set.Finite.exists_maximal_wrt' f domain h₂ h₁

-- definition to extract the maximum value of a frieze pattern
noncomputable def FriezeToFMax (n : ℕ) (f : ℕ × ℕ → ℚ) [arith_fp f n] : ℚ := by
have h : fHasMax n f := unf n f
unfold fHasMax at h
choose a₁ a₂ a₃ using h
exact f a₁


def FriezeHasMax (n : ℕ) : Prop :=
∃ f ∈ arithFriezePatSet n, ∃ a ∈ Set.univ,
∀ f' ∈ arithFriezePatSet n, ∀ a' ∈ Set.univ, f a ≤ f' a' → f a = f' a'


lemma maxDefined (n : ℕ) (hn : n ≠ 0) : FriezeHasMax n := by sorry


Expand Down

0 comments on commit 8f760e0

Please sign in to comment.