From 9e20d01515198b9e2b908e151d6998e4c78df894 Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.cn> Date: Mon, 17 Feb 2025 19:17:26 +0800 Subject: [PATCH 01/27] base --- .gitignore | 1 + CACHEDIR.TAG | 4 + bin/activate | 87 ++++++++++++++ bin/activate.csh | 55 +++++++++ bin/activate.fish | 103 ++++++++++++++++ bin/activate.nu | 96 +++++++++++++++ bin/activate.ps1 | 61 ++++++++++ bin/activate_this.py | 38 ++++++ bin/cmark | 8 ++ bin/estimator_ckpt_converter | 8 ++ bin/f2py | 8 ++ bin/f2py3 | 8 ++ bin/f2py3.10 | 8 ++ bin/fonttools | 8 ++ bin/futurize | 8 ++ bin/gdown | 8 ++ bin/gin | 225 +++++++++++++++++++++++++++++++++++ bin/google-oauthlib-tool | 8 ++ bin/huggingface-cli | 8 ++ bin/import_pb_to_tensorboard | 8 ++ bin/markdown_py | 8 ++ bin/nltk | 8 ++ bin/normalizer | 8 ++ bin/pasteurize | 8 ++ bin/pip | 8 ++ bin/pip-3.10 | 8 ++ bin/pip3 | 8 ++ bin/pip3.10 | 8 ++ bin/pybabel | 8 ++ bin/pyftmerge | 8 ++ bin/pyftsubset | 8 ++ bin/pygmentize | 8 ++ bin/pyrsa-decrypt | 8 ++ bin/pyrsa-encrypt | 8 ++ bin/pyrsa-keygen | 8 ++ bin/pyrsa-priv2pub | 8 ++ bin/pyrsa-sign | 8 ++ bin/pyrsa-verify | 8 ++ bin/python | 1 + bin/python3 | 1 + bin/python3.10 | 1 + bin/sacrebleu | 8 ++ bin/saved_model_cli | 8 ++ bin/seqio_cache_tasks | 8 ++ bin/t5_cache_tasks | 8 ++ bin/t5_inspect_tasks | 8 ++ bin/t5_mesh_transformer | 8 ++ bin/tabulate | 8 ++ bin/tensorboard | 8 ++ bin/tf_upgrade_v2 | 8 ++ bin/tfds | 8 ++ bin/tflite_convert | 8 ++ bin/toco | 8 ++ bin/toco_from_protos | 8 ++ bin/tqdm | 8 ++ bin/transformers-cli | 8 ++ bin/ttx | 8 ++ bin/wheel | 8 ++ meliad_lib/meliad | 1 + numericals.py | 2 +- pyvenv.cfg | 8 ++ run.sh | 3 - run_tests.sh | 22 ++-- share/man/man1/ttx.1 | 225 +++++++++++++++++++++++++++++++++++ 64 files changed, 1288 insertions(+), 14 deletions(-) create mode 100644 CACHEDIR.TAG create mode 100644 bin/activate create mode 100644 bin/activate.csh create mode 100644 bin/activate.fish create mode 100644 bin/activate.nu create mode 100644 bin/activate.ps1 create mode 100644 bin/activate_this.py create mode 100755 bin/cmark create mode 100755 bin/estimator_ckpt_converter create mode 100755 bin/f2py create mode 100755 bin/f2py3 create mode 100755 bin/f2py3.10 create mode 100755 bin/fonttools create mode 100755 bin/futurize create mode 100755 bin/gdown create mode 100755 bin/gin create mode 100755 bin/google-oauthlib-tool create mode 100755 bin/huggingface-cli create mode 100755 bin/import_pb_to_tensorboard create mode 100755 bin/markdown_py create mode 100755 bin/nltk create mode 100755 bin/normalizer create mode 100755 bin/pasteurize create mode 100755 bin/pip create mode 100755 bin/pip-3.10 create mode 100755 bin/pip3 create mode 100755 bin/pip3.10 create mode 100755 bin/pybabel create mode 100755 bin/pyftmerge create mode 100755 bin/pyftsubset create mode 100755 bin/pygmentize create mode 100755 bin/pyrsa-decrypt create mode 100755 bin/pyrsa-encrypt create mode 100755 bin/pyrsa-keygen create mode 100755 bin/pyrsa-priv2pub create mode 100755 bin/pyrsa-sign create mode 100755 bin/pyrsa-verify create mode 120000 bin/python create mode 120000 bin/python3 create mode 120000 bin/python3.10 create mode 100755 bin/sacrebleu create mode 100755 bin/saved_model_cli create mode 100755 bin/seqio_cache_tasks create mode 100755 bin/t5_cache_tasks create mode 100755 bin/t5_inspect_tasks create mode 100755 bin/t5_mesh_transformer create mode 100755 bin/tabulate create mode 100755 bin/tensorboard create mode 100755 bin/tf_upgrade_v2 create mode 100755 bin/tfds create mode 100755 bin/tflite_convert create mode 100755 bin/toco create mode 100755 bin/toco_from_protos create mode 100755 bin/tqdm create mode 100755 bin/transformers-cli create mode 100755 bin/ttx create mode 100755 bin/wheel create mode 160000 meliad_lib/meliad create mode 100644 pyvenv.cfg create mode 100644 share/man/man1/ttx.1 diff --git a/.gitignore b/.gitignore index 87df5a1..cd8f7fb 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ share/python-wheels/ .installed.cfg *.egg MANIFEST +ag_ckpt_vocab/ \ No newline at end of file diff --git a/CACHEDIR.TAG b/CACHEDIR.TAG new file mode 100644 index 0000000..837feef --- /dev/null +++ b/CACHEDIR.TAG @@ -0,0 +1,4 @@ +Signature: 8a477f597d28d172789f06886806bc55 +# This file is a cache directory tag created by Python virtualenv. +# For information about cache directory tags, see: +# https://bford.info/cachedir/ \ No newline at end of file diff --git a/bin/activate b/bin/activate new file mode 100644 index 0000000..33ab5d2 --- /dev/null +++ b/bin/activate @@ -0,0 +1,87 @@ +# This file must be used with "source bin/activate" *from bash* +# you cannot run it directly + + +if [ "${BASH_SOURCE-}" = "$0" ]; then + echo "You must source this script: \$ source $0" >&2 + exit 33 +fi + +deactivate () { + unset -f pydoc >/dev/null 2>&1 || true + + # reset old environment variables + # ! [ -z ${VAR+_} ] returns true if VAR is declared at all + if ! [ -z "${_OLD_VIRTUAL_PATH:+_}" ] ; then + PATH="$_OLD_VIRTUAL_PATH" + export PATH + unset _OLD_VIRTUAL_PATH + fi + if ! [ -z "${_OLD_VIRTUAL_PYTHONHOME+_}" ] ; then + PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME" + export PYTHONHOME + unset _OLD_VIRTUAL_PYTHONHOME + fi + + # The hash command must be called to get it to forget past + # commands. Without forgetting past commands the $PATH changes + # we made may not be respected + hash -r 2>/dev/null + + if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then + PS1="$_OLD_VIRTUAL_PS1" + export PS1 + unset _OLD_VIRTUAL_PS1 + fi + + unset VIRTUAL_ENV + unset VIRTUAL_ENV_PROMPT + if [ ! "${1-}" = "nondestructive" ] ; then + # Self destruct! + unset -f deactivate + fi +} + +# unset irrelevant variables +deactivate nondestructive + +VIRTUAL_ENV=/home/featurize/work/alphageometry +if ([ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ]) && $(command -v cygpath &> /dev/null) ; then + VIRTUAL_ENV=$(cygpath -u "$VIRTUAL_ENV") +fi +export VIRTUAL_ENV + +_OLD_VIRTUAL_PATH="$PATH" +PATH="$VIRTUAL_ENV/"bin":$PATH" +export PATH + +if [ "x"'' != x ] ; then + VIRTUAL_ENV_PROMPT='' +else + VIRTUAL_ENV_PROMPT=$(basename "$VIRTUAL_ENV") +fi +export VIRTUAL_ENV_PROMPT + +# unset PYTHONHOME if set +if ! [ -z "${PYTHONHOME+_}" ] ; then + _OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME" + unset PYTHONHOME +fi + +if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then + _OLD_VIRTUAL_PS1="${PS1-}" + PS1="(${VIRTUAL_ENV_PROMPT}) ${PS1-}" + export PS1 +fi + +# Make sure to unalias pydoc if it's already there +alias pydoc 2>/dev/null >/dev/null && unalias pydoc || true + +pydoc () { + python -m pydoc "$@" +} + +# The hash command must be called to get it to forget past +# commands. Without forgetting past commands the $PATH changes +# we made may not be respected +hash -r 2>/dev/null || true diff --git a/bin/activate.csh b/bin/activate.csh new file mode 100644 index 0000000..f0dbb15 --- /dev/null +++ b/bin/activate.csh @@ -0,0 +1,55 @@ +# This file must be used with "source bin/activate.csh" *from csh*. +# You cannot run it directly. +# Created by Davide Di Blasi . + +set newline='\ +' + +alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH:q" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT:q" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; unsetenv VIRTUAL_ENV_PROMPT; test "\!:*" != "nondestructive" && unalias deactivate && unalias pydoc' + +# Unset irrelevant variables. +deactivate nondestructive + +setenv VIRTUAL_ENV /home/featurize/work/alphageometry + +set _OLD_VIRTUAL_PATH="$PATH:q" +setenv PATH "$VIRTUAL_ENV:q/"bin":$PATH:q" + + + +if ('' != "") then + setenv VIRTUAL_ENV_PROMPT '' +else + setenv VIRTUAL_ENV_PROMPT "$VIRTUAL_ENV:t:q" +endif + +if ( $?VIRTUAL_ENV_DISABLE_PROMPT ) then + if ( $VIRTUAL_ENV_DISABLE_PROMPT == "" ) then + set do_prompt = "1" + else + set do_prompt = "0" + endif +else + set do_prompt = "1" +endif + +if ( $do_prompt == "1" ) then + # Could be in a non-interactive environment, + # in which case, $prompt is undefined and we wouldn't + # care about the prompt anyway. + if ( $?prompt ) then + set _OLD_VIRTUAL_PROMPT="$prompt:q" + if ( "$prompt:q" =~ *"$newline:q"* ) then + : + else + set prompt = '('"$VIRTUAL_ENV_PROMPT:q"') '"$prompt:q" + endif + endif +endif + +unset env_name +unset do_prompt + +alias pydoc python -m pydoc + +rehash diff --git a/bin/activate.fish b/bin/activate.fish new file mode 100644 index 0000000..903de66 --- /dev/null +++ b/bin/activate.fish @@ -0,0 +1,103 @@ +# This file must be used using `source bin/activate.fish` *within a running fish ( http://fishshell.com ) session*. +# Do not run it directly. + +function _bashify_path -d "Converts a fish path to something bash can recognize" + set fishy_path $argv + set bashy_path $fishy_path[1] + for path_part in $fishy_path[2..-1] + set bashy_path "$bashy_path:$path_part" + end + echo $bashy_path +end + +function _fishify_path -d "Converts a bash path to something fish can recognize" + echo $argv | tr ':' '\n' +end + +function deactivate -d 'Exit virtualenv mode and return to the normal environment.' + # reset old environment variables + if test -n "$_OLD_VIRTUAL_PATH" + # https://github.com/fish-shell/fish-shell/issues/436 altered PATH handling + if test (echo $FISH_VERSION | head -c 1) -lt 3 + set -gx PATH (_fishify_path "$_OLD_VIRTUAL_PATH") + else + set -gx PATH $_OLD_VIRTUAL_PATH + end + set -e _OLD_VIRTUAL_PATH + end + + if test -n "$_OLD_VIRTUAL_PYTHONHOME" + set -gx PYTHONHOME "$_OLD_VIRTUAL_PYTHONHOME" + set -e _OLD_VIRTUAL_PYTHONHOME + end + + if test -n "$_OLD_FISH_PROMPT_OVERRIDE" + and functions -q _old_fish_prompt + # Set an empty local `$fish_function_path` to allow the removal of `fish_prompt` using `functions -e`. + set -l fish_function_path + + # Erase virtualenv's `fish_prompt` and restore the original. + functions -e fish_prompt + functions -c _old_fish_prompt fish_prompt + functions -e _old_fish_prompt + set -e _OLD_FISH_PROMPT_OVERRIDE + end + + set -e VIRTUAL_ENV + set -e VIRTUAL_ENV_PROMPT + + if test "$argv[1]" != 'nondestructive' + # Self-destruct! + functions -e pydoc + functions -e deactivate + functions -e _bashify_path + functions -e _fishify_path + end +end + +# Unset irrelevant variables. +deactivate nondestructive + +set -gx VIRTUAL_ENV /home/featurize/work/alphageometry + +# https://github.com/fish-shell/fish-shell/issues/436 altered PATH handling +if test (echo $FISH_VERSION | head -c 1) -lt 3 + set -gx _OLD_VIRTUAL_PATH (_bashify_path $PATH) +else + set -gx _OLD_VIRTUAL_PATH $PATH +end +set -gx PATH "$VIRTUAL_ENV"'/'bin $PATH + +# Prompt override provided? +# If not, just use the environment name. +if test -n '' + set -gx VIRTUAL_ENV_PROMPT '' +else + set -gx VIRTUAL_ENV_PROMPT (basename "$VIRTUAL_ENV") +end + +# Unset `$PYTHONHOME` if set. +if set -q PYTHONHOME + set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME + set -e PYTHONHOME +end + +function pydoc + python -m pydoc $argv +end + +if test -z "$VIRTUAL_ENV_DISABLE_PROMPT" + # Copy the current `fish_prompt` function as `_old_fish_prompt`. + functions -c fish_prompt _old_fish_prompt + + function fish_prompt + # Run the user's prompt first; it might depend on (pipe)status. + set -l prompt (_old_fish_prompt) + + printf '(%s) ' $VIRTUAL_ENV_PROMPT + + string join -- \n $prompt # handle multi-line prompts + end + + set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV" +end diff --git a/bin/activate.nu b/bin/activate.nu new file mode 100644 index 0000000..df25455 --- /dev/null +++ b/bin/activate.nu @@ -0,0 +1,96 @@ +# virtualenv activation module +# Activate with `overlay use activate.nu` +# Deactivate with `deactivate`, as usual +# +# To customize the overlay name, you can call `overlay use activate.nu as foo`, +# but then simply `deactivate` won't work because it is just an alias to hide +# the "activate" overlay. You'd need to call `overlay hide foo` manually. + +export-env { + def is-string [x] { + ($x | describe) == 'string' + } + + def has-env [...names] { + $names | each {|n| + $n in $env + } | all {|i| $i == true} + } + + # Emulates a `test -z`, but better as it handles e.g 'false' + def is-env-true [name: string] { + if (has-env $name) { + # Try to parse 'true', '0', '1', and fail if not convertible + let parsed = (do -i { $env | get $name | into bool }) + if ($parsed | describe) == 'bool' { + $parsed + } else { + not ($env | get -i $name | is-empty) + } + } else { + false + } + } + + let virtual_env = r#'/home/featurize/work/alphageometry'# + let bin = r#'bin'# + + let is_windows = ($nu.os-info.family) == 'windows' + let path_name = (if (has-env 'Path') { + 'Path' + } else { + 'PATH' + } + ) + + let venv_path = ([$virtual_env $bin] | path join) + let new_path = ($env | get $path_name | prepend $venv_path) + + # If there is no default prompt, then use the env name instead + let virtual_env_prompt = (if (r#''# | is-empty) { + ($virtual_env | path basename) + } else { + r#''# + }) + + let new_env = { + $path_name : $new_path + VIRTUAL_ENV : $virtual_env + VIRTUAL_ENV_PROMPT : $virtual_env_prompt + } + + let new_env = (if (is-env-true 'VIRTUAL_ENV_DISABLE_PROMPT') { + $new_env + } else { + # Creating the new prompt for the session + let virtual_prefix = $'(char lparen)($virtual_env_prompt)(char rparen) ' + + # Back up the old prompt builder + let old_prompt_command = (if (has-env 'PROMPT_COMMAND') { + $env.PROMPT_COMMAND + } else { + '' + }) + + let new_prompt = (if (has-env 'PROMPT_COMMAND') { + if 'closure' in ($old_prompt_command | describe) { + {|| $'($virtual_prefix)(do $old_prompt_command)' } + } else { + {|| $'($virtual_prefix)($old_prompt_command)' } + } + } else { + {|| $'($virtual_prefix)' } + }) + + $new_env | merge { + PROMPT_COMMAND : $new_prompt + VIRTUAL_PREFIX : $virtual_prefix + } + }) + + # Environment variables that will be loaded as the virtual env + load-env $new_env +} + +export alias pydoc = python -m pydoc +export alias deactivate = overlay hide activate diff --git a/bin/activate.ps1 b/bin/activate.ps1 new file mode 100644 index 0000000..3333e2b --- /dev/null +++ b/bin/activate.ps1 @@ -0,0 +1,61 @@ +$script:THIS_PATH = $myinvocation.mycommand.path +$script:BASE_DIR = Split-Path (Resolve-Path "$THIS_PATH/..") -Parent + +function global:deactivate([switch] $NonDestructive) { + if (Test-Path variable:_OLD_VIRTUAL_PATH) { + $env:PATH = $variable:_OLD_VIRTUAL_PATH + Remove-Variable "_OLD_VIRTUAL_PATH" -Scope global + } + + if (Test-Path function:_old_virtual_prompt) { + $function:prompt = $function:_old_virtual_prompt + Remove-Item function:\_old_virtual_prompt + } + + if ($env:VIRTUAL_ENV) { + Remove-Item env:VIRTUAL_ENV -ErrorAction SilentlyContinue + } + + if ($env:VIRTUAL_ENV_PROMPT) { + Remove-Item env:VIRTUAL_ENV_PROMPT -ErrorAction SilentlyContinue + } + + if (!$NonDestructive) { + # Self destruct! + Remove-Item function:deactivate + Remove-Item function:pydoc + } +} + +function global:pydoc { + python -m pydoc $args +} + +# unset irrelevant variables +deactivate -nondestructive + +$VIRTUAL_ENV = $BASE_DIR +$env:VIRTUAL_ENV = $VIRTUAL_ENV + +if ('' -ne "") { + $env:VIRTUAL_ENV_PROMPT = '' +} +else { + $env:VIRTUAL_ENV_PROMPT = $( Split-Path $env:VIRTUAL_ENV -Leaf ) +} + +New-Variable -Scope global -Name _OLD_VIRTUAL_PATH -Value $env:PATH + +$env:PATH = "$env:VIRTUAL_ENV/" + 'bin' + ':' + $env:PATH +if (!$env:VIRTUAL_ENV_DISABLE_PROMPT) { + function global:_old_virtual_prompt { + "" + } + $function:_old_virtual_prompt = $function:prompt + + function global:prompt { + # Add the custom prefix to the existing prompt + $previous_prompt_value = & $function:_old_virtual_prompt + ("(" + $env:VIRTUAL_ENV_PROMPT + ") " + $previous_prompt_value) + } +} diff --git a/bin/activate_this.py b/bin/activate_this.py new file mode 100644 index 0000000..cdd1106 --- /dev/null +++ b/bin/activate_this.py @@ -0,0 +1,38 @@ +""" +Activate virtualenv for current interpreter: + +import runpy +runpy.run_path(this_file) + +This can be used when you must use an existing Python interpreter, not the virtualenv bin/python. +""" # noqa: D415 + +from __future__ import annotations + +import os +import site +import sys + +try: + abs_file = os.path.abspath(__file__) +except NameError as exc: + msg = "You must use import runpy; runpy.run_path(this_file)" + raise AssertionError(msg) from exc + +bin_dir = os.path.dirname(abs_file) +base = bin_dir[: -len('bin') - 1] # strip away the bin part from the __file__, plus the path separator + +# prepend bin to PATH (this file is inside the bin directory) +os.environ["PATH"] = os.pathsep.join([bin_dir, *os.environ.get("PATH", "").split(os.pathsep)]) +os.environ["VIRTUAL_ENV"] = base # virtual env is right above bin directory +os.environ["VIRTUAL_ENV_PROMPT"] = '' or os.path.basename(base) + +# add the virtual environments libraries to the host python import mechanism +prev_length = len(sys.path) +for lib in '../lib/python3.10/site-packages'.split(os.pathsep): + path = os.path.realpath(os.path.join(bin_dir, lib)) + site.addsitedir(path.decode("utf-8") if '' else path) +sys.path[:] = sys.path[prev_length:] + sys.path[0:prev_length] + +sys.real_prefix = sys.prefix +sys.prefix = base diff --git a/bin/cmark b/bin/cmark new file mode 100755 index 0000000..3d7dd2f --- /dev/null +++ b/bin/cmark @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from commonmark.cmark import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/estimator_ckpt_converter b/bin/estimator_ckpt_converter new file mode 100755 index 0000000..0f5aa0d --- /dev/null +++ b/bin/estimator_ckpt_converter @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from tensorflow_estimator.python.estimator.tools.checkpoint_converter import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/f2py b/bin/f2py new file mode 100755 index 0000000..e1d3c77 --- /dev/null +++ b/bin/f2py @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from numpy.f2py.f2py2e import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/f2py3 b/bin/f2py3 new file mode 100755 index 0000000..e1d3c77 --- /dev/null +++ b/bin/f2py3 @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from numpy.f2py.f2py2e import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/f2py3.10 b/bin/f2py3.10 new file mode 100755 index 0000000..e1d3c77 --- /dev/null +++ b/bin/f2py3.10 @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from numpy.f2py.f2py2e import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/fonttools b/bin/fonttools new file mode 100755 index 0000000..a6b63d5 --- /dev/null +++ b/bin/fonttools @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from fontTools.__main__ import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/futurize b/bin/futurize new file mode 100755 index 0000000..d4df95b --- /dev/null +++ b/bin/futurize @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from libfuturize.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/gdown b/bin/gdown new file mode 100755 index 0000000..80af0ed --- /dev/null +++ b/bin/gdown @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from gdown.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/gin b/bin/gin new file mode 100755 index 0000000..4c77d4d --- /dev/null +++ b/bin/gin @@ -0,0 +1,225 @@ +#!/home/featurize/work/alphageometry/bin/python +"gin - a Git index file parser" +version = "0.1.006" + +# https://github.com/git/git/blob/master/Documentation/technical/index-format.txt + +import binascii +import collections +import json +import mmap +import struct + +def check(boolean, message): + if not boolean: + import sys + print("error: " + message, file=sys.stderr) + sys.exit(1) + +def parse(filename, pretty=True): + with open(filename, "rb") as o: + f = mmap.mmap(o.fileno(), 0, prot=mmap.PROT_READ) + + def read(format): + # "All binary numbers are in network byte order." + # Hence "!" = network order, big endian + format = "! " + format + bytes = f.read(struct.calcsize(format)) + return struct.unpack(format, bytes)[0] + + index = collections.OrderedDict() + + # 4-byte signature, b"DIRC" + index["signature"] = f.read(4).decode("ascii") + check(index["signature"] == "DIRC", "Not a Git index file") + + # 4-byte version number + index["version"] = read("I") + check(index["version"] in {2, 3}, + "Unsupported version: %s" % index["version"]) + + # 32-bit number of index entries, i.e. 4-byte + index["entries"] = read("I") + + yield index + + for n in range(index["entries"]): + entry = collections.OrderedDict() + + entry["entry"] = n + 1 + + entry["ctime_seconds"] = read("I") + entry["ctime_nanoseconds"] = read("I") + if pretty: + entry["ctime"] = entry["ctime_seconds"] + entry["ctime"] += entry["ctime_nanoseconds"] / 1000000000 + del entry["ctime_seconds"] + del entry["ctime_nanoseconds"] + + entry["mtime_seconds"] = read("I") + entry["mtime_nanoseconds"] = read("I") + if pretty: + entry["mtime"] = entry["mtime_seconds"] + entry["mtime"] += entry["mtime_nanoseconds"] / 1000000000 + del entry["mtime_seconds"] + del entry["mtime_nanoseconds"] + + entry["dev"] = read("I") + entry["ino"] = read("I") + + # 4-bit object type, 3-bit unused, 9-bit unix permission + entry["mode"] = read("I") + if pretty: + entry["mode"] = "%06o" % entry["mode"] + + entry["uid"] = read("I") + entry["gid"] = read("I") + entry["size"] = read("I") + + entry["sha1"] = binascii.hexlify(f.read(20)).decode("ascii") + entry["flags"] = read("H") + + # 1-bit assume-valid + entry["assume-valid"] = bool(entry["flags"] & (0b10000000 << 8)) + # 1-bit extended, must be 0 in version 2 + entry["extended"] = bool(entry["flags"] & (0b01000000 << 8)) + # 2-bit stage (?) + stage_one = bool(entry["flags"] & (0b00100000 << 8)) + stage_two = bool(entry["flags"] & (0b00010000 << 8)) + entry["stage"] = stage_one, stage_two + # 12-bit name length, if the length is less than 0xFFF (else, 0xFFF) + namelen = entry["flags"] & 0xFFF + + # 62 bytes so far + entrylen = 62 + + if entry["extended"] and (index["version"] == 3): + entry["extra-flags"] = read("H") + # 1-bit reserved + entry["reserved"] = bool(entry["extra-flags"] & (0b10000000 << 8)) + # 1-bit skip-worktree + entry["skip-worktree"] = bool(entry["extra-flags"] & (0b01000000 << 8)) + # 1-bit intent-to-add + entry["intent-to-add"] = bool(entry["extra-flags"] & (0b00100000 << 8)) + # 13-bits unused + # used = entry["extra-flags"] & (0b11100000 << 8) + # check(not used, "Expected unused bits in extra-flags") + entrylen += 2 + + if namelen < 0xFFF: + entry["name"] = f.read(namelen).decode("utf-8", "replace") + entrylen += namelen + else: + # Do it the hard way + name = [] + while True: + byte = f.read(1) + if byte == "\x00": + break + name.append(byte) + entry["name"] = b"".join(name).decode("utf-8", "replace") + entrylen += 1 + + padlen = (8 - (entrylen % 8)) or 8 + nuls = f.read(padlen) + check(set(nuls) == {0}, "padding contained non-NUL") + + yield entry + + indexlen = len(f) + extnumber = 1 + + while f.tell() < (indexlen - 20): + extension = collections.OrderedDict() + extension["extension"] = extnumber + extension["signature"] = f.read(4).decode("ascii") + extension["size"] = read("I") + + # Seems to exclude the above: + # "src_offset += 8; src_offset += extsize;" + extension["data"] = f.read(extension["size"]) + extension["data"] = extension["data"].decode("iso-8859-1") + if pretty: + extension["data"] = json.dumps(extension["data"]) + + yield extension + extnumber += 1 + + checksum = collections.OrderedDict() + checksum["checksum"] = True + checksum["sha1"] = binascii.hexlify(f.read(20)).decode("ascii") + yield checksum + + f.close() + +def parse_file(arg, pretty=True): + if pretty: + properties = { + "version": "[header]", + "entry": "[entry]", + "extension": "[extension]", + "checksum": "[checksum]" + } + else: + print("[") + + for item in parse(arg, pretty=pretty): + if pretty: + for key, value in properties.items(): + if key in item: + print(value) + break + else: + print("[?]") + + if pretty: + for key, value in item.items(): + print(" ", key, "=", value) + else: + print(json.dumps(item)) + + last = "checksum" in item + if not last: + if pretty: + print() + else: + print(",") + + if not pretty: + print("]") + +def main(): + import argparse + import os.path + import sys + + parser = argparse.ArgumentParser(description="parse a Git index file") + parser.add_argument("-j", "--json", action="store_true", + help="output JSON") + parser.add_argument("-v", "--version", action="store_true", + help="show script version number") + parser.add_argument("path", nargs="?", default=".", + help="path to a Git repository or index file") + args = parser.parse_args() + + if args.version: + print("gin " + version) + sys.exit() + + if os.path.isdir(args.path): + path = os.path.join(args.path, ".git", "index") + if os.path.isfile(path): + args.path = path + else: + print("error: couldn't find a .git/index file to use", file=sys.stderr) + print("use -h or --help for some documentation", file=sys.stderr) + sys.exit(1) + + if not args.path: + parser.print_usage() + sys.exit(2) + + parse_file(args.path, pretty=not args.json) + +if __name__ == "__main__": + main() diff --git a/bin/google-oauthlib-tool b/bin/google-oauthlib-tool new file mode 100755 index 0000000..013a7cf --- /dev/null +++ b/bin/google-oauthlib-tool @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from google_auth_oauthlib.tool.__main__ import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/huggingface-cli b/bin/huggingface-cli new file mode 100755 index 0000000..e65189e --- /dev/null +++ b/bin/huggingface-cli @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from huggingface_hub.commands.huggingface_cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/import_pb_to_tensorboard b/bin/import_pb_to_tensorboard new file mode 100755 index 0000000..30ce73d --- /dev/null +++ b/bin/import_pb_to_tensorboard @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from tensorflow.python.tools.import_pb_to_tensorboard import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/markdown_py b/bin/markdown_py new file mode 100755 index 0000000..b280004 --- /dev/null +++ b/bin/markdown_py @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from markdown.__main__ import run +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(run()) diff --git a/bin/nltk b/bin/nltk new file mode 100755 index 0000000..d7d29ba --- /dev/null +++ b/bin/nltk @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from nltk.cli import cli +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(cli()) diff --git a/bin/normalizer b/bin/normalizer new file mode 100755 index 0000000..08c2aa4 --- /dev/null +++ b/bin/normalizer @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from charset_normalizer.cli import cli_detect +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(cli_detect()) diff --git a/bin/pasteurize b/bin/pasteurize new file mode 100755 index 0000000..c51dc5e --- /dev/null +++ b/bin/pasteurize @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from libpasteurize.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/pip b/bin/pip new file mode 100755 index 0000000..23311c6 --- /dev/null +++ b/bin/pip @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/pip-3.10 b/bin/pip-3.10 new file mode 100755 index 0000000..23311c6 --- /dev/null +++ b/bin/pip-3.10 @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/pip3 b/bin/pip3 new file mode 100755 index 0000000..23311c6 --- /dev/null +++ b/bin/pip3 @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/pip3.10 b/bin/pip3.10 new file mode 100755 index 0000000..23311c6 --- /dev/null +++ b/bin/pip3.10 @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from pip._internal.cli.main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/pybabel b/bin/pybabel new file mode 100755 index 0000000..a58a105 --- /dev/null +++ b/bin/pybabel @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from babel.messages.frontend import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/pyftmerge b/bin/pyftmerge new file mode 100755 index 0000000..9a2ace5 --- /dev/null +++ b/bin/pyftmerge @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from fontTools.merge import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/pyftsubset b/bin/pyftsubset new file mode 100755 index 0000000..3872489 --- /dev/null +++ b/bin/pyftsubset @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from fontTools.subset import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/pygmentize b/bin/pygmentize new file mode 100755 index 0000000..ab50b42 --- /dev/null +++ b/bin/pygmentize @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from pygments.cmdline import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/pyrsa-decrypt b/bin/pyrsa-decrypt new file mode 100755 index 0000000..99cc427 --- /dev/null +++ b/bin/pyrsa-decrypt @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from rsa.cli import decrypt +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(decrypt()) diff --git a/bin/pyrsa-encrypt b/bin/pyrsa-encrypt new file mode 100755 index 0000000..d5e9f18 --- /dev/null +++ b/bin/pyrsa-encrypt @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from rsa.cli import encrypt +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(encrypt()) diff --git a/bin/pyrsa-keygen b/bin/pyrsa-keygen new file mode 100755 index 0000000..fbe3c52 --- /dev/null +++ b/bin/pyrsa-keygen @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from rsa.cli import keygen +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(keygen()) diff --git a/bin/pyrsa-priv2pub b/bin/pyrsa-priv2pub new file mode 100755 index 0000000..da6f72f --- /dev/null +++ b/bin/pyrsa-priv2pub @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from rsa.util import private_to_public +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(private_to_public()) diff --git a/bin/pyrsa-sign b/bin/pyrsa-sign new file mode 100755 index 0000000..8274800 --- /dev/null +++ b/bin/pyrsa-sign @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from rsa.cli import sign +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(sign()) diff --git a/bin/pyrsa-verify b/bin/pyrsa-verify new file mode 100755 index 0000000..3d8f0d1 --- /dev/null +++ b/bin/pyrsa-verify @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from rsa.cli import verify +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(verify()) diff --git a/bin/python b/bin/python new file mode 120000 index 0000000..ec7dcb9 --- /dev/null +++ b/bin/python @@ -0,0 +1 @@ +/environment/miniconda3/bin/python \ No newline at end of file diff --git a/bin/python3 b/bin/python3 new file mode 120000 index 0000000..d8654aa --- /dev/null +++ b/bin/python3 @@ -0,0 +1 @@ +python \ No newline at end of file diff --git a/bin/python3.10 b/bin/python3.10 new file mode 120000 index 0000000..d8654aa --- /dev/null +++ b/bin/python3.10 @@ -0,0 +1 @@ +python \ No newline at end of file diff --git a/bin/sacrebleu b/bin/sacrebleu new file mode 100755 index 0000000..a35e5a1 --- /dev/null +++ b/bin/sacrebleu @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from sacrebleu.sacrebleu import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/saved_model_cli b/bin/saved_model_cli new file mode 100755 index 0000000..b045532 --- /dev/null +++ b/bin/saved_model_cli @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from tensorflow.python.tools.saved_model_cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/seqio_cache_tasks b/bin/seqio_cache_tasks new file mode 100755 index 0000000..9aed395 --- /dev/null +++ b/bin/seqio_cache_tasks @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from seqio.scripts.cache_tasks_main import console_entry_point +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(console_entry_point()) diff --git a/bin/t5_cache_tasks b/bin/t5_cache_tasks new file mode 100755 index 0000000..9aed395 --- /dev/null +++ b/bin/t5_cache_tasks @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from seqio.scripts.cache_tasks_main import console_entry_point +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(console_entry_point()) diff --git a/bin/t5_inspect_tasks b/bin/t5_inspect_tasks new file mode 100755 index 0000000..3cf5e75 --- /dev/null +++ b/bin/t5_inspect_tasks @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from seqio.scripts.inspect_tasks_main import console_entry_point +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(console_entry_point()) diff --git a/bin/t5_mesh_transformer b/bin/t5_mesh_transformer new file mode 100755 index 0000000..d72e2c6 --- /dev/null +++ b/bin/t5_mesh_transformer @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from t5.models.mesh_transformer_main import console_entry_point +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(console_entry_point()) diff --git a/bin/tabulate b/bin/tabulate new file mode 100755 index 0000000..dba254d --- /dev/null +++ b/bin/tabulate @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from tabulate import _main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(_main()) diff --git a/bin/tensorboard b/bin/tensorboard new file mode 100755 index 0000000..ff9e467 --- /dev/null +++ b/bin/tensorboard @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from tensorboard.main import run_main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(run_main()) diff --git a/bin/tf_upgrade_v2 b/bin/tf_upgrade_v2 new file mode 100755 index 0000000..97fa08a --- /dev/null +++ b/bin/tf_upgrade_v2 @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from tensorflow.tools.compatibility.tf_upgrade_v2_main import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/tfds b/bin/tfds new file mode 100755 index 0000000..cc6bb04 --- /dev/null +++ b/bin/tfds @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from tensorflow_datasets.scripts.cli.main import launch_cli +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(launch_cli()) diff --git a/bin/tflite_convert b/bin/tflite_convert new file mode 100755 index 0000000..2926286 --- /dev/null +++ b/bin/tflite_convert @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from tensorflow.lite.python.tflite_convert import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/toco b/bin/toco new file mode 100755 index 0000000..2926286 --- /dev/null +++ b/bin/toco @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from tensorflow.lite.python.tflite_convert import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/toco_from_protos b/bin/toco_from_protos new file mode 100755 index 0000000..45922d0 --- /dev/null +++ b/bin/toco_from_protos @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from tensorflow.lite.toco.python.toco_from_protos import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/tqdm b/bin/tqdm new file mode 100755 index 0000000..c780036 --- /dev/null +++ b/bin/tqdm @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from tqdm.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/transformers-cli b/bin/transformers-cli new file mode 100755 index 0000000..1a047de --- /dev/null +++ b/bin/transformers-cli @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from transformers.commands.transformers_cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/ttx b/bin/ttx new file mode 100755 index 0000000..d807cab --- /dev/null +++ b/bin/ttx @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from fontTools.ttx import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/wheel b/bin/wheel new file mode 100755 index 0000000..81aab92 --- /dev/null +++ b/bin/wheel @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from wheel.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/meliad_lib/meliad b/meliad_lib/meliad new file mode 160000 index 0000000..e8af054 --- /dev/null +++ b/meliad_lib/meliad @@ -0,0 +1 @@ +Subproject commit e8af0543441222c1c4c60d58803511f7cf92908b diff --git a/numericals.py b/numericals.py index e9c092d..2f63532 100644 --- a/numericals.py +++ b/numericals.py @@ -27,7 +27,7 @@ from numpy.random import uniform as unif # pylint: disable=g-importing-member -matplotlib.use('TkAgg') +matplotlib.use('Agg') ATOM = 1e-12 diff --git a/pyvenv.cfg b/pyvenv.cfg new file mode 100644 index 0000000..ff7177d --- /dev/null +++ b/pyvenv.cfg @@ -0,0 +1,8 @@ +home = /environment/miniconda3/bin +implementation = CPython +version_info = 3.10.12.final.0 +virtualenv = 20.29.2 +include-system-site-packages = false +base-prefix = /environment/miniconda3 +base-exec-prefix = /environment/miniconda3 +base-executable = /environment/miniconda3/bin/python3.10 diff --git a/run.sh b/run.sh index 330d1fe..3cb4c00 100644 --- a/run.sh +++ b/run.sh @@ -22,12 +22,9 @@ source ./bin/activate pip install --require-hashes -r requirements.txt -gdown --folder https://bit.ly/alphageometry DATA=ag_ckpt_vocab MELIAD_PATH=meliad_lib/meliad -mkdir -p $MELIAD_PATH -git clone https://github.com/google-research/meliad $MELIAD_PATH export PYTHONPATH=$PYTHONPATH:$MELIAD_PATH DDAR_ARGS=( diff --git a/run_tests.sh b/run_tests.sh index 7005644..7faf661 100644 --- a/run_tests.sh +++ b/run_tests.sh @@ -13,18 +13,20 @@ # limitations under the License. # ============================================================================== +source ./bin/activate + DATA=ag_ckpt_vocab MELIAD_PATH=meliad_lib/meliad export PYTHONPATH=$PYTHONPATH:$MELIAD_PATH -python problem_test.py -python geometry_test.py -python graph_utils_test.py -python numericals_test.py -python graph_test.py -python dd_test.py -python ar_test.py -python ddar_test.py -python trace_back_test.py -python alphageometry_test.py +# python problem_test.py +# python geometry_test.py +# python graph_utils_test.py +# python numericals_test.py +# python graph_test.py +# python dd_test.py +# python ar_test.py +# python ddar_test.py +# python trace_back_test.py +# python alphageometry_test.py python lm_inference_test.py --meliad_path=$MELIAD_PATH --data_path=$DATA diff --git a/share/man/man1/ttx.1 b/share/man/man1/ttx.1 new file mode 100644 index 0000000..bba23b5 --- /dev/null +++ b/share/man/man1/ttx.1 @@ -0,0 +1,225 @@ +.Dd May 18, 2004 +.\" ttx is not specific to any OS, but contrary to what groff_mdoc(7) +.\" seems to imply, entirely omitting the .Os macro causes 'BSD' to +.\" be used, so I give a zero-width space as its argument. +.Os \& +.\" The "FontTools Manual" argument apparently has no effect in +.\" groff 1.18.1. I think it is a bug in the -mdoc groff package. +.Dt TTX 1 "FontTools Manual" +.Sh NAME +.Nm ttx +.Nd tool for manipulating TrueType and OpenType fonts +.Sh SYNOPSIS +.Nm +.Bk +.Op Ar option ... +.Ek +.Bk +.Ar file ... +.Ek +.Sh DESCRIPTION +.Nm +is a tool for manipulating TrueType and OpenType fonts. It can convert +TrueType and OpenType fonts to and from an +.Tn XML Ns -based format called +.Tn TTX . +.Tn TTX +files have a +.Ql .ttx +extension. +.Pp +For each +.Ar file +argument it is given, +.Nm +detects whether it is a +.Ql .ttf , +.Ql .otf +or +.Ql .ttx +file and acts accordingly: if it is a +.Ql .ttf +or +.Ql .otf +file, it generates a +.Ql .ttx +file; if it is a +.Ql .ttx +file, it generates a +.Ql .ttf +or +.Ql .otf +file. +.Pp +By default, every output file is created in the same directory as the +corresponding input file and with the same name except for the +extension, which is substituted appropriately. +.Nm +never overwrites existing files; if necessary, it appends a suffix to +the output file name before the extension, as in +.Pa Arial#1.ttf . +.Ss "General options" +.Bl -tag -width ".Fl t Ar table" +.It Fl h +Display usage information. +.It Fl d Ar dir +Write the output files to directory +.Ar dir +instead of writing every output file to the same directory as the +corresponding input file. +.It Fl o Ar file +Write the output to +.Ar file +instead of writing it to the same directory as the +corresponding input file. +.It Fl v +Be verbose. Write more messages to the standard output describing what +is being done. +.It Fl a +Allow virtual glyphs ID's on compile or decompile. +.El +.Ss "Dump options" +The following options control the process of dumping font files +(TrueType or OpenType) to +.Tn TTX +files. +.Bl -tag -width ".Fl t Ar table" +.It Fl l +List table information. Instead of dumping the font to a +.Tn TTX +file, display minimal information about each table. +.It Fl t Ar table +Dump table +.Ar table . +This option may be given multiple times to dump several tables at +once. When not specified, all tables are dumped. +.It Fl x Ar table +Exclude table +.Ar table +from the list of tables to dump. This option may be given multiple +times to exclude several tables from the dump. The +.Fl t +and +.Fl x +options are mutually exclusive. +.It Fl s +Split tables. Dump each table to a separate +.Tn TTX +file and write (under the name that would have been used for the output +file if the +.Fl s +option had not been given) one small +.Tn TTX +file containing references to the individual table dump files. This +file can be used as input to +.Nm +as long as the referenced files can be found in the same directory. +.It Fl i +.\" XXX: I suppose OpenType programs (exist and) are also affected. +Don't disassemble TrueType instructions. When this option is specified, +all TrueType programs (glyph programs, the font program and the +pre-program) are written to the +.Tn TTX +file as hexadecimal data instead of +assembly. This saves some time and results in smaller +.Tn TTX +files. +.It Fl y Ar n +When decompiling a TrueType Collection (TTC) file, +decompile font number +.Ar n , +starting from 0. +.El +.Ss "Compilation options" +The following options control the process of compiling +.Tn TTX +files into font files (TrueType or OpenType): +.Bl -tag -width ".Fl t Ar table" +.It Fl m Ar fontfile +Merge the input +.Tn TTX +file +.Ar file +with +.Ar fontfile . +No more than one +.Ar file +argument can be specified when this option is used. +.It Fl b +Don't recalculate glyph bounding boxes. Use the values in the +.Tn TTX +file as is. +.El +.Sh "THE TTX FILE FORMAT" +You can find some information about the +.Tn TTX +file format in +.Pa documentation.html . +In particular, you will find in that file the list of tables understood by +.Nm +and the relations between TrueType GlyphIDs and the glyph names used in +.Tn TTX +files. +.Sh EXAMPLES +In the following examples, all files are read from and written to the +current directory. Additionally, the name given for the output file +assumes in every case that it did not exist before +.Nm +was invoked. +.Pp +Dump the TrueType font contained in +.Pa FreeSans.ttf +to +.Pa FreeSans.ttx : +.Pp +.Dl ttx FreeSans.ttf +.Pp +Compile +.Pa MyFont.ttx +into a TrueType or OpenType font file: +.Pp +.Dl ttx MyFont.ttx +.Pp +List the tables in +.Pa FreeSans.ttf +along with some information: +.Pp +.Dl ttx -l FreeSans.ttf +.Pp +Dump the +.Sq cmap +table from +.Pa FreeSans.ttf +to +.Pa FreeSans.ttx : +.Pp +.Dl ttx -t cmap FreeSans.ttf +.Sh NOTES +On MS\-Windows and MacOS, +.Nm +is available as a graphical application to which files can be dropped. +.Sh SEE ALSO +.Pa documentation.html +.Pp +.Xr fontforge 1 , +.Xr ftinfo 1 , +.Xr gfontview 1 , +.Xr xmbdfed 1 , +.Xr Font::TTF 3pm +.Sh AUTHORS +.Nm +was written by +.An -nosplit +.An "Just van Rossum" Aq just@letterror.com . +.Pp +This manual page was written by +.An "Florent Rougon" Aq f.rougon@free.fr +for the Debian GNU/Linux system based on the existing FontTools +documentation. It may be freely used, modified and distributed without +restrictions. +.\" For Emacs: +.\" Local Variables: +.\" fill-column: 72 +.\" sentence-end: "[.?!][]\"')}]*\\($\\| $\\| \\| \\)[ \n]*" +.\" sentence-end-double-space: t +.\" End: \ No newline at end of file From 0dbcec1777782f2659d9eb2fd6aa0e3bbdb1d4ac Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.cn> Date: Fri, 21 Feb 2025 11:05:25 +0800 Subject: [PATCH 02/27] circle1 --- alphageometry.py | 1 + bin/wheel-3.10 | 8 ++++++++ bin/wheel3 | 8 ++++++++ bin/wheel3.10 | 8 ++++++++ chiaya.sh | 46 ++++++++++++++++++++++++++++++++++++++++++++++ circle.txt | 18 ++++++++++++++++++ draw.py | 16 ++++++++++++++++ kirine.txt | 23 +++++++++++++++++++++++ numericals.py | 3 ++- rules.txt | 3 +++ rules1.txt | 3 +++ run.sh | 4 ++-- run_tests.sh | 20 ++++++++++---------- test.py | 2 ++ test.sh | 7 +++++++ 15 files changed, 157 insertions(+), 13 deletions(-) create mode 100755 bin/wheel-3.10 create mode 100755 bin/wheel3 create mode 100755 bin/wheel3.10 create mode 100644 chiaya.sh create mode 100644 circle.txt create mode 100644 draw.py create mode 100644 kirine.txt create mode 100644 rules1.txt create mode 100644 test.py create mode 100644 test.sh diff --git a/alphageometry.py b/alphageometry.py index f6a3aa8..80a299a 100644 --- a/alphageometry.py +++ b/alphageometry.py @@ -189,6 +189,7 @@ def write_solution(g: gh.Graph, p: pr.Problem, out_file: str) -> None: solution += '==========================\n' logging.info(solution) + print(solution) if out_file: with open(out_file, 'w') as f: f.write(solution) diff --git a/bin/wheel-3.10 b/bin/wheel-3.10 new file mode 100755 index 0000000..81aab92 --- /dev/null +++ b/bin/wheel-3.10 @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from wheel.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/wheel3 b/bin/wheel3 new file mode 100755 index 0000000..81aab92 --- /dev/null +++ b/bin/wheel3 @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from wheel.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/bin/wheel3.10 b/bin/wheel3.10 new file mode 100755 index 0000000..81aab92 --- /dev/null +++ b/bin/wheel3.10 @@ -0,0 +1,8 @@ +#!/home/featurize/work/alphageometry/bin/python +# -*- coding: utf-8 -*- +import re +import sys +from wheel.cli import main +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) + sys.exit(main()) diff --git a/chiaya.sh b/chiaya.sh new file mode 100644 index 0000000..e9904c0 --- /dev/null +++ b/chiaya.sh @@ -0,0 +1,46 @@ +source ./bin/activate + +DATA=ag_ckpt_vocab +MELIAD_PATH=meliad_lib/meliad +export PYTHONPATH=$PYTHONPATH:$MELIAD_PATH + +DDAR_ARGS=( + --defs_file=$(pwd)/defs.txt \ + --rules_file=$(pwd)/rules1.txt \ +); + +BATCH_SIZE=2 +BEAM_SIZE=2 +DEPTH=2 + +SEARCH_ARGS=( + --beam_size=$BEAM_SIZE + --search_depth=$DEPTH +) + +LM_ARGS=( + --ckpt_path=$DATA \ + --vocab_path=$DATA/geometry.757.model \ + --gin_search_paths=$MELIAD_PATH/transformer/configs \ + --gin_file=base_htrans.gin \ + --gin_file=size/medium_150M.gin \ + --gin_file=options/positions_t5.gin \ + --gin_file=options/lr_cosine_decay.gin \ + --gin_file=options/seq_1024_nocache.gin \ + --gin_file=geometry_150M_generate.gin \ + --gin_param=DecoderOnlyLanguageModelGenerate.output_token_losses=True \ + --gin_param=TransformerTaskConfig.batch_size=$BATCH_SIZE \ + --gin_param=TransformerTaskConfig.sequence_length=128 \ + --gin_param=Trainer.restore_state_variables=False +); + + +python -m alphageometry \ +--alsologtostderr \ +--problems_file=$(pwd)/circle.txt \ +--problem_name=radical_axis3 \ +--mode=alphageometry \ +"${DDAR_ARGS[@]}" \ +"${SEARCH_ARGS[@]}" \ +"${LM_ARGS[@]}" \ +--out_file="kirine.txt" \ No newline at end of file diff --git a/circle.txt b/circle.txt new file mode 100644 index 0000000..b601b14 --- /dev/null +++ b/circle.txt @@ -0,0 +1,18 @@ +cyclic2power +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; p = on_line p a b, on_line p c d ? eqratio p a p c p d p b +radical_axis +a b = segment a b; o1 = on_bline o1 a b; o2 = on_bline o2 a b; o3 = free; c = on_circle c o1 a; d = on_circle d o1 a, on_circle d o3 c; e = on_circle e o2 a, on_circle e o3 c; f = on_circle f o2 a, on_circle f o3 c; g = on_line g c d, on_line g e f ? coll g a b +radical_axis2 +a b c = triangle a b c; e = free; o1 = circle o1 a b c; o2 = circle o2 a b e; o3 = on_bline o3 c e; d = on_circle d o1 a, on_circle d o3 c; f = on_circle f o2 a, on_circle f o3 c; g = on_line g c d, on_line g e f ? coll g a b +radical_axis3 +a b c = triangle a b c; d = on_line a b; o1 = circle o1 a b c; e = on_line e c d, on_circle e o1 a; o2 = on_bline o2 c e; f = on_circle f o2 c; g = on_circle g o2 c, on_line g d f ? cyclic a b f g +gcenter +a b c = triangle a b c; d = midpoint d b c; e = midpoint e c a; f = midpoint f a b; g = on_line g b e, on_line g c f ? coll a g d +hcenter +a b c = triangle a b c; d = foot d a b c; e = foot e b c a; f = foot f c a b; g = on_line g b e, on_line g c f ? coll a g d +icenter +a b c = triangle a b c; d = angle_bisector d a b c, angle_bisector d a c b ? eqangle a b a d a d a c +ocenter +a b c = triangle a b c; d = on_bline d a b, on_bline d a c ? cong d b d c +example7_1 +b c = segment b c; a = on_bline a b c; d = on_line d a b; e = on_line e a c; f = on_line f b c, on_line f d e; o1 = circle o1 a b c; o2 = circle o2 b d f; g = on_circle g o1 b, on_circle g o2 b ? perp g f d e \ No newline at end of file diff --git a/draw.py b/draw.py new file mode 100644 index 0000000..0fa8087 --- /dev/null +++ b/draw.py @@ -0,0 +1,16 @@ +import unittest +from absl.testing import absltest +import dd +import graph as gh +import problem as pr + +txt = 'f g h i j = pentagon f g h i j; a = intersection_ll a f j g h; b = intersection_ll b f g h i; c = intersection_ll c g h i j; d = intersection_ll d h i f j; e = intersection_ll e f g i j; o1 = circle o1 a f g; o2 = circle o2 b g h; o3 = circle o3 c h i; o4 = circle o4 d j i; o5 = circle o5 e j f; k = intersection_cc k o5 o1 f; l = intersection_cc l o1 o2 g; m = intersection_cc m o2 o3 h; n = intersection_cc n o3 o4 i; o = intersection_cc o o4 o5 j; ox = circle k l m ? cyclic k l m n' +defs = pr.Definition.from_txt_file('defs.txt', to_dict=True) +p = pr.Problem.from_txt(txt,translate=False) +g, _ = gh.Graph.build_problem(p, defs) +goal_args = g.names2nodes(p.goal.args) +gh.nm.draw( + g.type2nodes[gh.Point], + g.type2nodes[gh.Line], + g.type2nodes[gh.Circle], + g.type2nodes[gh.Segment]) \ No newline at end of file diff --git a/kirine.txt b/kirine.txt new file mode 100644 index 0000000..2f9d5e7 --- /dev/null +++ b/kirine.txt @@ -0,0 +1,23 @@ + +========================== + * From theorem premises: +A B C D E F G H I : Points +A,D,B are collinear [00] +EB = EC [01] +EA = EB [02] +EF = EA [03] +C,F,D are collinear [04] +GC = GF [05] +GH = GC [06] +GI = GC [07] +D,H,I are collinear [08] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. EB = EC [01] & EA = EB [02] & EF = EA [03] ⇒ C,F,A,B are concyclic [09] +002. GC = GF [05] & GI = GC [07] & GH = GC [06] ⇒ C,F,I,H are concyclic [10] +003. C,F,A,B are concyclic [09] & C,F,I,H are concyclic [10] & C,F,D are collinear [04] & A,D,B are collinear [00] & D,H,I are collinear [08] ⇒ H,A,I,B are concyclic +========================== diff --git a/numericals.py b/numericals.py index 2f63532..9d539cc 100644 --- a/numericals.py +++ b/numericals.py @@ -702,7 +702,8 @@ def check_perp(points: list[Point]) -> bool: def check_cyclic(points: list[Point]) -> bool: points = list(set(points)) - (a, b, c), *ps = points + # fixed bug + (a, b, c, *ps) = points circle = Circle(p1=a, p2=b, p3=c) for d in ps: if not close_enough(d.distance(circle.center), circle.radius): diff --git a/rules.txt b/rules.txt index f329f76..7ce1664 100644 --- a/rules.txt +++ b/rules.txt @@ -41,3 +41,6 @@ eqratio6 B A B C Q P Q R, eqangle6 B A B C Q P Q R, ncoll A B C => simtri* A B C eqratio6 B A B C Q P Q R, eqratio6 C A C B R P R Q, ncoll A B C, cong A B P Q => contri* A B C P Q R para a b c d, coll m a d, coll n b c, eqratio6 m a m d n b n c, sameside m a d n b c => para m n a b para a b c d, coll m a d, coll n b c, para m n a b => eqratio6 m a m d n b n c +cyclic A B C D, coll P A B, coll P C D => eqratio P A P C P D P B +coll P A B, coll P C D, ncoll A B C D, eqratio P A P C P D P B => cyclic A B C D +cyclic A B C D, cyclic A B E F, cyclic C D E F, coll P A B, coll P C D => coll P E F \ No newline at end of file diff --git a/rules1.txt b/rules1.txt new file mode 100644 index 0000000..beded28 --- /dev/null +++ b/rules1.txt @@ -0,0 +1,3 @@ +cyclic A B C D, coll P A B, coll P C D => eqratio P A P C P D P B +cyclic A B C D, cyclic A B E F, cyclic C D E F, coll P A B, coll P C D => coll P E F +cyclic A B C D, cyclic A B E F, coll P A B, coll P C D, coll P E F => cyclic C D E F \ No newline at end of file diff --git a/run.sh b/run.sh index 3cb4c00..83f9561 100644 --- a/run.sh +++ b/run.sh @@ -14,8 +14,6 @@ # ============================================================================== # !/bin/bash -set -e -set -x virtualenv -p python3 . source ./bin/activate @@ -67,3 +65,5 @@ python -m alphageometry \ "${DDAR_ARGS[@]}" \ "${SEARCH_ARGS[@]}" \ "${LM_ARGS[@]}" +set -e +set -x diff --git a/run_tests.sh b/run_tests.sh index 7faf661..04095e5 100644 --- a/run_tests.sh +++ b/run_tests.sh @@ -19,14 +19,14 @@ DATA=ag_ckpt_vocab MELIAD_PATH=meliad_lib/meliad export PYTHONPATH=$PYTHONPATH:$MELIAD_PATH -# python problem_test.py -# python geometry_test.py -# python graph_utils_test.py -# python numericals_test.py -# python graph_test.py -# python dd_test.py -# python ar_test.py -# python ddar_test.py -# python trace_back_test.py -# python alphageometry_test.py +python problem_test.py +python geometry_test.py +python graph_utils_test.py +python numericals_test.py +python graph_test.py +python dd_test.py +python ar_test.py +python ddar_test.py +python trace_back_test.py +python alphageometry_test.py python lm_inference_test.py --meliad_path=$MELIAD_PATH --data_path=$DATA diff --git a/test.py b/test.py new file mode 100644 index 0000000..a6b76de --- /dev/null +++ b/test.py @@ -0,0 +1,2 @@ +import tensorflow as tf +print("TensorFlow GPU available:", tf.test.is_gpu_available()) \ No newline at end of file diff --git a/test.sh b/test.sh new file mode 100644 index 0000000..00e0165 --- /dev/null +++ b/test.sh @@ -0,0 +1,7 @@ +# !/bin/bash +virtualenv -p python3 . +source ./bin/activate + +export TF_CPP_MIN_LOG_LEVEL=0 + +python test.py \ No newline at end of file From d912e932bc985365366ad4c80d2ce725f10703f0 Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.com> Date: Sat, 22 Feb 2025 11:51:40 +0800 Subject: [PATCH 03/27] chapter7 --- circle.txt | 22 +++++++++++++++++++++- rules1.txt | 4 +++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/circle.txt b/circle.txt index b601b14..ee44a7d 100644 --- a/circle.txt +++ b/circle.txt @@ -15,4 +15,24 @@ a b c = triangle a b c; d = angle_bisector d a b c, angle_bisector d a c b ? eqa ocenter a b c = triangle a b c; d = on_bline d a b, on_bline d a c ? cong d b d c example7_1 -b c = segment b c; a = on_bline a b c; d = on_line d a b; e = on_line e a c; f = on_line f b c, on_line f d e; o1 = circle o1 a b c; o2 = circle o2 b d f; g = on_circle g o1 b, on_circle g o2 b ? perp g f d e \ No newline at end of file +b c = segment b c; a = on_bline a b c; d = on_line d a b; h = on_pline h d b c, on_line h a c; e = mirror e h c; f = on_line f d e, on_line f b c; o1 = circle o1 b d f; o2 = circle o2 c e f; g = on_circle g o1 f, on_circle g o2 f ? perp g f d e +example7_2 +b c = segment b c; a = on_bline a b c; i = incenter i a b c; o = on_bline o b i; p = on_circle p a b, on_circle p o b; q = on_circle q i b, on_circle q o b; r = on_line r i p, on_line r b q ? perp b r c r +example7_3? +a b = segment a b; x = on_bline x a b; y = on_bline y a b; c = on_circle c x a; d = on_circle d y a, on_line d b c; e = on_circle e x a; f = on_circle f y a, on_line f b e; p = on_line p c f, on_circle p x a; q = on_line q c f, on_circle q y a ? +example7_4 +a b c = triangle a b c; o = circle o a b c; a1 = midpoint a1 b c; a2 = on_line a2 a a1, on_circle a2 o a; qa = foot qa a1 a o; pa = on_line pa a1 qa, on_tline pa a2 o a2; b1 = midpoint b1 c a; b2 = on_line b2 b b1, on_circle b2 o b; qb = foot qb b1 b o; pb = on_line pb b1 qb, on_tline pb b2 o b2; c1 = midpoint c1 a b; c2 = on_line c2 c c1, on_circle c2 o c; qc = foot qc c1 c o; pc = on_line pc c1 qc, on_tline pc c2 o c2 ? coll pa pb pc +example7_5 +a b c = triangle a b c; d e f x = excenter2 d e f x a b c; o1 = circle o1 a e f; p = on_line p b c, on_circle p o1 a; q = on_line q b c, on_circle q o1 a; m = midpoint m a d; o2 = circle o2 m p q; t = on_cirlce t o2 m, on_cirlce t x d ? coll o2 x t +example7_6 +a b c = triangle a b c; o = circle o a b c; h = orthocenter h a b c; s = on_circle s o a; p = on_line p b c, on_tline p s a s; o2 = circle o2 a s p; x = on_line x s h, on_circle x o2 a; r = on_line r a b, on_line r o p; q = on_line q a c, on_line q o p; y = foot y q a r; z = foot z r a q ? cong x y z +example7_7_1 +a b = segment a b; o1 = on_tline o1 a a b; o2 = on_tline o2 b b a; p = on_circle p o1 a, on_circle p o2 b; q = on_circle q o1 a, on_circle q o2 b; c = on_tline c p p o1, on_circle c o2 b; t = on_line t a p, on_line t b c; o3 = circle o3 p q t ? perp b p p o3 +example7_7_2 +a b = segment a b; o1 = on_tline o1 a a b; o2 = on_tline o2 b b a; p = on_circle p o1 a, on_circle p o2 b; q = on_circle q o1 a, on_circle q o2 b; c = on_tline c p p o1, on_circle c o2 b; t = on_line t a p, on_line t b c; o3 = circle o3 p q t ? perp b t t o3 +example7_8 +a b c = triangle a b c; o = circle o a b c; d = on_line d a o, on_line d b c; u = foot u d a c; v = foot v d a b; e = on_tline e a a o, on_line e d u; f = on_tline f a a o, on_line f d v; p = on_line p e c, on_line p f b ? perp p d b c +example7_9 +a b c = triangle a b c; o = circle o a b c; h = orthocenter h a b c; d = on_line d a h, on_line d b c; e = on_line e a h, on_circle e o a; x = midpoint x d e; p = on_circle p o a, on_circle p x e; q = on_circle q p h, on_tline q p p h; m = midpoint m b c ? cyclic p d m q +example7_10 +a b c = triangle a b c; h = orthocenter h a b c; o = circle o a b c; d = on_circle d o a, on_circle d a c; k = on_line k a d, on_circle k a b; l = on_line l b c, on_pline l k c d; m = midpoint m b c; n = foot n h a l; t = midpoint t a h ? coll m n t diff --git a/rules1.txt b/rules1.txt index beded28..0c0ffc5 100644 --- a/rules1.txt +++ b/rules1.txt @@ -1,3 +1,5 @@ cyclic A B C D, coll P A B, coll P C D => eqratio P A P C P D P B +coll P A B, coll P C D, ncoll A B C D, eqratio P A P C P D P B => cyclic A B C D cyclic A B C D, cyclic A B E F, cyclic C D E F, coll P A B, coll P C D => coll P E F -cyclic A B C D, cyclic A B E F, coll P A B, coll P C D, coll P E F => cyclic C D E F \ No newline at end of file +cyclic A B C D E F, on_line G A B, on_line G D E, on_line H B C, on_line H E F, on_line I C D, on_line I F A => coll G H I +cyclic A B C D E, on_line G A B, on_line G D E, on_line H B C, on_line H E F, on_line I C D, on_line I F A, coll G H I => cyclic A B C D E F \ No newline at end of file From 589a847d5b42cdce539562e95ef11daff727993f Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.com> Date: Tue, 25 Feb 2025 15:05:15 +0800 Subject: [PATCH 04/27] pascal --- circle.txt | 50 +++++++++++++++++++++++++++++++++++--------------- rules1.txt | 4 ++-- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/circle.txt b/circle.txt index ee44a7d..3c31c26 100644 --- a/circle.txt +++ b/circle.txt @@ -1,29 +1,15 @@ cyclic2power a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; p = on_line p a b, on_line p c d ? eqratio p a p c p d p b radical_axis -a b = segment a b; o1 = on_bline o1 a b; o2 = on_bline o2 a b; o3 = free; c = on_circle c o1 a; d = on_circle d o1 a, on_circle d o3 c; e = on_circle e o2 a, on_circle e o3 c; f = on_circle f o2 a, on_circle f o3 c; g = on_line g c d, on_line g e f ? coll g a b -radical_axis2 -a b c = triangle a b c; e = free; o1 = circle o1 a b c; o2 = circle o2 a b e; o3 = on_bline o3 c e; d = on_circle d o1 a, on_circle d o3 c; f = on_circle f o2 a, on_circle f o3 c; g = on_line g c d, on_line g e f ? coll g a b -radical_axis3 a b c = triangle a b c; d = on_line a b; o1 = circle o1 a b c; e = on_line e c d, on_circle e o1 a; o2 = on_bline o2 c e; f = on_circle f o2 c; g = on_circle g o2 c, on_line g d f ? cyclic a b f g -gcenter -a b c = triangle a b c; d = midpoint d b c; e = midpoint e c a; f = midpoint f a b; g = on_line g b e, on_line g c f ? coll a g d -hcenter -a b c = triangle a b c; d = foot d a b c; e = foot e b c a; f = foot f c a b; g = on_line g b e, on_line g c f ? coll a g d -icenter -a b c = triangle a b c; d = angle_bisector d a b c, angle_bisector d a c b ? eqangle a b a d a d a c -ocenter -a b c = triangle a b c; d = on_bline d a b, on_bline d a c ? cong d b d c example7_1 b c = segment b c; a = on_bline a b c; d = on_line d a b; h = on_pline h d b c, on_line h a c; e = mirror e h c; f = on_line f d e, on_line f b c; o1 = circle o1 b d f; o2 = circle o2 c e f; g = on_circle g o1 f, on_circle g o2 f ? perp g f d e example7_2 b c = segment b c; a = on_bline a b c; i = incenter i a b c; o = on_bline o b i; p = on_circle p a b, on_circle p o b; q = on_circle q i b, on_circle q o b; r = on_line r i p, on_line r b q ? perp b r c r -example7_3? -a b = segment a b; x = on_bline x a b; y = on_bline y a b; c = on_circle c x a; d = on_circle d y a, on_line d b c; e = on_circle e x a; f = on_circle f y a, on_line f b e; p = on_line p c f, on_circle p x a; q = on_line q c f, on_circle q y a ? example7_4 a b c = triangle a b c; o = circle o a b c; a1 = midpoint a1 b c; a2 = on_line a2 a a1, on_circle a2 o a; qa = foot qa a1 a o; pa = on_line pa a1 qa, on_tline pa a2 o a2; b1 = midpoint b1 c a; b2 = on_line b2 b b1, on_circle b2 o b; qb = foot qb b1 b o; pb = on_line pb b1 qb, on_tline pb b2 o b2; c1 = midpoint c1 a b; c2 = on_line c2 c c1, on_circle c2 o c; qc = foot qc c1 c o; pc = on_line pc c1 qc, on_tline pc c2 o c2 ? coll pa pb pc example7_5 -a b c = triangle a b c; d e f x = excenter2 d e f x a b c; o1 = circle o1 a e f; p = on_line p b c, on_circle p o1 a; q = on_line q b c, on_circle q o1 a; m = midpoint m a d; o2 = circle o2 m p q; t = on_cirlce t o2 m, on_cirlce t x d ? coll o2 x t +a b c = triangle a b c; d e f x = excenter2 d e f x a b c; o1 = circle o1 a e f; p = on_line p b c, on_circle p o1 a; q = on_line q b c, on_circle q o1 a; m = midpoint m a d; o2 = circle o2 m p q; t = on_circle t o2 m, on_circle t x d ? coll o2 x t example7_6 a b c = triangle a b c; o = circle o a b c; h = orthocenter h a b c; s = on_circle s o a; p = on_line p b c, on_tline p s a s; o2 = circle o2 a s p; x = on_line x s h, on_circle x o2 a; r = on_line r a b, on_line r o p; q = on_line q a c, on_line q o p; y = foot y q a r; z = foot z r a q ? cong x y z example7_7_1 @@ -36,3 +22,37 @@ example7_9 a b c = triangle a b c; o = circle o a b c; h = orthocenter h a b c; d = on_line d a h, on_line d b c; e = on_line e a h, on_circle e o a; x = midpoint x d e; p = on_circle p o a, on_circle p x e; q = on_circle q p h, on_tline q p p h; m = midpoint m b c ? cyclic p d m q example7_10 a b c = triangle a b c; h = orthocenter h a b c; o = circle o a b c; d = on_circle d o a, on_circle d a c; k = on_line k a d, on_circle k a b; l = on_line l b c, on_pline l k c d; m = midpoint m b c; n = foot n h a l; t = midpoint t a h ? coll m n t +exercise7_1 +a b = segment a b; x = on_bline x a b; y = on_bline y a b; c = on_circle c x a; d = on_circle d y a, on_line d b c; e = on_circle e x a, on_line e d a; f = on_circle f y a, on_line f c a; o = cricle o a e f ? perp o b c d +exercise7_2 +a b c = segment a b c; d = foot d a b c; e = foot e b c a; f = foot f c a b; h = on_line h a d, on_line h b e; p = on_line p b e, on_line p d f; q = on_line q a b, on_tline q p b c; n = on_line n e q, on_line n a d ? cong a n a h +exercise7_4 +a b c = triangle a b c; o = circle o a b c; i = circle i o b c; g = on_circle g i o; x = circle x a b g; y = circle y a c g; e = on_line e a c, on_circle e x a; f = on_line f a b, on_circle f y a; k = on_line k b e, on_line k c f; t = on_line t a k, on_line t b c ? coll t o g +exercise7_5 +a b c = triangle a b c; o = cricle o a b c; d = on_circle d o a; e = on_line e a d, on_line e b c; m = midpoint m a d; n = midpoint n b c; w = circle w e m n; x = on_circle x o a, on_circle x w e; y = on_circle y o a, on_circle y w e; z = on_line z a b, on_line z c d ? coll x y z +exercise7_7 +a b c = triangle a b c; d e f i = incenter2 d e f i a b c; p = on_line p a d, on_circle p i d; q = on_line q e f, on_tline q p a d; x = on_line x d e, on_line x a q; y = on_line y d f, on_line y a q ? cong a x a y +exercise7_8 +a b c = triangle a b c; x y z i = incenter2 x y z i a b c; g = on_line g b y, on_line g c z; r = on_pline r y b c, on_pline r b c y; s = on_pline s z b c, on_pline s b c z ? cong g r g s +exercise7_9 +b c = segment b c; a = on_bline a b c; i = incenter i a b c; o = circle o a b c; m = on_circle m b i, on_circle m o b; n = on_circle n c i, on_circle n o c; d = on_circle d o a; e = on_line e a d, on_line e b i; f = on_line f a d, on_line f c i; p = on_line p d m, on_line p c i; q = on_line q d n, on_line q b i; x = on_line x c e, on_line x b f ? cyclic d p i x +exercise7_10 +a b c = triangle a b c; i = incenter i a b c; d = foot d i b c; o1 = incenter o1 a b d; o2 = incenter o2 a c d; e = foot e o1 a b; f = foot f o1 a d; g = foot g o2 a c; p = on_line p e g, on_circle p o1 e; q = on_line q e g, on_circle q o2 g; x = on_tline x p o1 p, on_tline x q o2 q ? coll x a d +exercise7_11 +b c = segment b c; a = on_bline a b c; d = on_line d a c; o = circle o b c d; k = on_circle k o b; t = on_line t c k, on_pline t a b c; m = midpoint m d t ? eqangle k t k a a c a m +exercise7_12 +a b c = triangle a b c; d e f i = incenter2 d e f i a b c; z = midpoint z b c; m = midpoint m a b; n = midpoint n a c; x = on_circle x i d, on_circle x z b; y = on_circle y i d, on_circle y z b; p = on_line p e f, on_line p x y ? coll p m n +exercise7_13 +a b c = triangle a b c; d = foot d a b c; e = foot e b c a; m = midpoint a b; o = circle o a b c; f = on_line f d e, on_circle f o a; k = on_line k d e, on_circle k o a; w = circle w m d e; p = on_line p m k, on_circle p w m; q = on_line q m f, on_circle q w m ? cyclic a p q b +exercise7_14_1 +a b = segment a b; o = on_bline o a b; p = on_bline p a b; c = on_tline c a a p, on_circle c o a; d = on_tline d a a o, on_circle d o a; e = midpoint e a c; f = midpoint f a d ? cyclic a e b f +exercise7_14_2 +a b = segment a b; o = on_bline o a b; p = on_bline p a b; c = on_tline c a a p, on_circle c o a; d = on_tline d a a o, on_circle d o a; e = midpoint e a c; w = circle w a b e; f = on_circle f w a, on_line f a d; g = on_circle g o a; h = on_line h a g, on_circle h p a; k = on_line k a g, on_circle k w a ? cong k g k h +exercise7_15 +a b = segment a b; o = on_bline o a b; p = on_tline p a o a, on_tline p b o b; c = on_circle c o a; d = on_line d p c, on_circle d o a; e = on_pline e c p b, on_circle e o a; f = on_line f a e, on_line f p b; g = on_line g d e, on_line g p b ? cong g f g b +example6_1 +a b c = triangle a b c; o = circle o a b c; P = free; a1 = on_line a1 a p, on_circle a1 o a; b1 = on_line b1 b p, on_circle b1 o b; c1 = on_line c1 c p, on_circle c1 o c; q = on_circle q o a; x = on_line x q a1, on_line x b c; y = on_line y q b1, on_line y a c; z = on_line z q c1, on_line z a b ? coll x y z +example6_2 +a b = segment a b; o = midpoint o a b; p = on_tline p b o b; c = on_circle c o a; d = on_line d p c, on_circle d o a; e = on_line e a c, on_line e p o; f = on_line f a d, on_line f p o ? cong o e o f +example6_3 +a b c = triangle a b c; d = foot d a b c; e = foot e b c a; f = foot f c a b; h = on_line h a d, on_line h b e; p = reflect p e a d; q = reflect q f a d; x = on_line x b q, on_line x c p; y = on_line y b p, on_line y c q; z = on_line z a x, on_line z h y ? coll z b c \ No newline at end of file diff --git a/rules1.txt b/rules1.txt index 0c0ffc5..721c817 100644 --- a/rules1.txt +++ b/rules1.txt @@ -1,5 +1,5 @@ cyclic A B C D, coll P A B, coll P C D => eqratio P A P C P D P B coll P A B, coll P C D, ncoll A B C D, eqratio P A P C P D P B => cyclic A B C D cyclic A B C D, cyclic A B E F, cyclic C D E F, coll P A B, coll P C D => coll P E F -cyclic A B C D E F, on_line G A B, on_line G D E, on_line H B C, on_line H E F, on_line I C D, on_line I F A => coll G H I -cyclic A B C D E, on_line G A B, on_line G D E, on_line H B C, on_line H E F, on_line I C D, on_line I F A, coll G H I => cyclic A B C D E F \ No newline at end of file +cyclic A B C D E F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I +cyclic A B C D E, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A, coll G H I => cyclic A B C D E F \ No newline at end of file From 4cdf9065933f399f4d260a1f019262c8dc8166b6 Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.cn> Date: Tue, 25 Feb 2025 15:09:38 +0800 Subject: [PATCH 05/27] onlinecircle --- chiaya.sh | 25 +++++++++++++++++++++---- circle.txt | 22 ++++------------------ kirine.txt | 21 ++++++++------------- numericals.py | 1 - rules.txt | 4 +++- 5 files changed, 36 insertions(+), 37 deletions(-) diff --git a/chiaya.sh b/chiaya.sh index e9904c0..a03f141 100644 --- a/chiaya.sh +++ b/chiaya.sh @@ -6,7 +6,7 @@ export PYTHONPATH=$PYTHONPATH:$MELIAD_PATH DDAR_ARGS=( --defs_file=$(pwd)/defs.txt \ - --rules_file=$(pwd)/rules1.txt \ + --rules_file=$(pwd)/rules.txt \ ); BATCH_SIZE=2 @@ -34,13 +34,30 @@ LM_ARGS=( --gin_param=Trainer.restore_state_variables=False ); +INPUT_FILE=circle.txt python -m alphageometry \ --alsologtostderr \ ---problems_file=$(pwd)/circle.txt \ ---problem_name=radical_axis3 \ +--problems_file=$(pwd)/$INPUT_FILE \ +--problem_name=example7_5 \ --mode=alphageometry \ "${DDAR_ARGS[@]}" \ "${SEARCH_ARGS[@]}" \ "${LM_ARGS[@]}" \ ---out_file="kirine.txt" \ No newline at end of file +--out_file="./output/example7_5.txt"\ + +# for pro in $(cat $INPUT_FILE | grep "example"); +# do +# echo "solve problem $pro$" +# python -m alphageometry \ +# --alsologtostderr \ +# --problems_file=$(pwd)/$INPUT_FILE \ +# --problem_name=${pro} \ +# --mode=alphageometry \ +# "${DDAR_ARGS[@]}" \ +# "${SEARCH_ARGS[@]}" \ +# "${LM_ARGS[@]}" \ +# --out_file="./output/${pro}.txt"\ + +# echo "finish problem $pro$" +# done \ No newline at end of file diff --git a/circle.txt b/circle.txt index ee44a7d..9431e3d 100644 --- a/circle.txt +++ b/circle.txt @@ -1,31 +1,17 @@ -cyclic2power +example_cyclic2power a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; p = on_line p a b, on_line p c d ? eqratio p a p c p d p b -radical_axis -a b = segment a b; o1 = on_bline o1 a b; o2 = on_bline o2 a b; o3 = free; c = on_circle c o1 a; d = on_circle d o1 a, on_circle d o3 c; e = on_circle e o2 a, on_circle e o3 c; f = on_circle f o2 a, on_circle f o3 c; g = on_line g c d, on_line g e f ? coll g a b -radical_axis2 -a b c = triangle a b c; e = free; o1 = circle o1 a b c; o2 = circle o2 a b e; o3 = on_bline o3 c e; d = on_circle d o1 a, on_circle d o3 c; f = on_circle f o2 a, on_circle f o3 c; g = on_line g c d, on_line g e f ? coll g a b -radical_axis3 +example_radical_axis3 a b c = triangle a b c; d = on_line a b; o1 = circle o1 a b c; e = on_line e c d, on_circle e o1 a; o2 = on_bline o2 c e; f = on_circle f o2 c; g = on_circle g o2 c, on_line g d f ? cyclic a b f g -gcenter -a b c = triangle a b c; d = midpoint d b c; e = midpoint e c a; f = midpoint f a b; g = on_line g b e, on_line g c f ? coll a g d -hcenter -a b c = triangle a b c; d = foot d a b c; e = foot e b c a; f = foot f c a b; g = on_line g b e, on_line g c f ? coll a g d -icenter -a b c = triangle a b c; d = angle_bisector d a b c, angle_bisector d a c b ? eqangle a b a d a d a c -ocenter -a b c = triangle a b c; d = on_bline d a b, on_bline d a c ? cong d b d c example7_1 b c = segment b c; a = on_bline a b c; d = on_line d a b; h = on_pline h d b c, on_line h a c; e = mirror e h c; f = on_line f d e, on_line f b c; o1 = circle o1 b d f; o2 = circle o2 c e f; g = on_circle g o1 f, on_circle g o2 f ? perp g f d e example7_2 b c = segment b c; a = on_bline a b c; i = incenter i a b c; o = on_bline o b i; p = on_circle p a b, on_circle p o b; q = on_circle q i b, on_circle q o b; r = on_line r i p, on_line r b q ? perp b r c r -example7_3? -a b = segment a b; x = on_bline x a b; y = on_bline y a b; c = on_circle c x a; d = on_circle d y a, on_line d b c; e = on_circle e x a; f = on_circle f y a, on_line f b e; p = on_line p c f, on_circle p x a; q = on_line q c f, on_circle q y a ? example7_4 a b c = triangle a b c; o = circle o a b c; a1 = midpoint a1 b c; a2 = on_line a2 a a1, on_circle a2 o a; qa = foot qa a1 a o; pa = on_line pa a1 qa, on_tline pa a2 o a2; b1 = midpoint b1 c a; b2 = on_line b2 b b1, on_circle b2 o b; qb = foot qb b1 b o; pb = on_line pb b1 qb, on_tline pb b2 o b2; c1 = midpoint c1 a b; c2 = on_line c2 c c1, on_circle c2 o c; qc = foot qc c1 c o; pc = on_line pc c1 qc, on_tline pc c2 o c2 ? coll pa pb pc example7_5 -a b c = triangle a b c; d e f x = excenter2 d e f x a b c; o1 = circle o1 a e f; p = on_line p b c, on_circle p o1 a; q = on_line q b c, on_circle q o1 a; m = midpoint m a d; o2 = circle o2 m p q; t = on_cirlce t o2 m, on_cirlce t x d ? coll o2 x t +a b c = triangle a b c; d e f x = excenter2 d e f x a b c; o1 = circle o1 a e f; p = on_line p b c, on_circle p o1 a; q = on_line q b c, on_circle q o1 a; m = midpoint m a d; o2 = circle o2 m p q; t = on_circle t o2 m, on_circle t x d ? coll o2 x t example7_6 -a b c = triangle a b c; o = circle o a b c; h = orthocenter h a b c; s = on_circle s o a; p = on_line p b c, on_tline p s a s; o2 = circle o2 a s p; x = on_line x s h, on_circle x o2 a; r = on_line r a b, on_line r o p; q = on_line q a c, on_line q o p; y = foot y q a r; z = foot z r a q ? cong x y z +a b c = triangle a b c; o = circle o a b c; h = orthocenter h a b c; s = on_circle s o a; p = on_line p b c, on_tline p s a s; o2 = circle o2 a s p; x = on_line x s h, on_circle x o2 a; r = on_line r a b, on_line r o p; q = on_line q a c, on_line q o p; y = foot y q a r; z = foot z r a q ? coll x y z example7_7_1 a b = segment a b; o1 = on_tline o1 a a b; o2 = on_tline o2 b b a; p = on_circle p o1 a, on_circle p o2 b; q = on_circle q o1 a, on_circle q o2 b; c = on_tline c p p o1, on_circle c o2 b; t = on_line t a p, on_line t b c; o3 = circle o3 p q t ? perp b p p o3 example7_7_2 diff --git a/kirine.txt b/kirine.txt index 2f9d5e7..7f8aaf2 100644 --- a/kirine.txt +++ b/kirine.txt @@ -1,23 +1,18 @@ ========================== * From theorem premises: -A B C D E F G H I : Points -A,D,B are collinear [00] -EB = EC [01] -EA = EB [02] -EF = EA [03] -C,F,D are collinear [04] -GC = GF [05] -GH = GC [06] -GI = GC [07] -D,H,I are collinear [08] +A B C D E F : Points +DA = DB [00] +DB = DC [01] +DE = DA [02] +C,F,E are collinear [03] +B,F,A are collinear [04] * Auxiliary Constructions: : Points * Proof steps: -001. EB = EC [01] & EA = EB [02] & EF = EA [03] ⇒ C,F,A,B are concyclic [09] -002. GC = GF [05] & GI = GC [07] & GH = GC [06] ⇒ C,F,I,H are concyclic [10] -003. C,F,A,B are concyclic [09] & C,F,I,H are concyclic [10] & C,F,D are collinear [04] & A,D,B are collinear [00] & D,H,I are collinear [08] ⇒ H,A,I,B are concyclic +001. DA = DB [00] & DE = DA [02] & DB = DC [01] ⇒ C,B,E,A are concyclic [05] +002. C,B,E,A are concyclic [05] & C,F,E are collinear [03] & B,F,A are collinear [04] ⇒ CF:FA = BF:FE ========================== diff --git a/numericals.py b/numericals.py index 9d539cc..d5a63e5 100644 --- a/numericals.py +++ b/numericals.py @@ -401,7 +401,6 @@ def __init__( self.center = self.radius = self.r2 = None return # raise ValueError('Circle without center need p1 p2 p3') - l12 = _perpendicular_bisector(p1, p2) l23 = _perpendicular_bisector(p2, p3) center = line_line_intersection(l12, l23) diff --git a/rules.txt b/rules.txt index 7ce1664..57fb4d1 100644 --- a/rules.txt +++ b/rules.txt @@ -43,4 +43,6 @@ para a b c d, coll m a d, coll n b c, eqratio6 m a m d n b n c, sameside m a d n para a b c d, coll m a d, coll n b c, para m n a b => eqratio6 m a m d n b n c cyclic A B C D, coll P A B, coll P C D => eqratio P A P C P D P B coll P A B, coll P C D, ncoll A B C D, eqratio P A P C P D P B => cyclic A B C D -cyclic A B C D, cyclic A B E F, cyclic C D E F, coll P A B, coll P C D => coll P E F \ No newline at end of file +cyclic A B C D, cyclic A B E F, cyclic C D E F, coll P A B, coll P C D => coll P E F +cyclic A B C D E F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I +cyclic A B C D E, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A, coll G H I => cyclic A B C D E F \ No newline at end of file From 4281481cf3ab29ba634ade169ca1d84e88790e27 Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.cn> Date: Tue, 25 Feb 2025 19:52:15 +0800 Subject: [PATCH 06/27] experiment67 --- chiaya.sh | 17 ++++--- circle.txt | 6 +-- dd_test.py | 3 ++ kirine.txt | 128 +++++++++++++++++++++++++++++++++++++++++++++++++---- rules1.txt | 2 +- 5 files changed, 137 insertions(+), 19 deletions(-) diff --git a/chiaya.sh b/chiaya.sh index a03f141..76c9ee9 100644 --- a/chiaya.sh +++ b/chiaya.sh @@ -9,9 +9,11 @@ DDAR_ARGS=( --rules_file=$(pwd)/rules.txt \ ); -BATCH_SIZE=2 -BEAM_SIZE=2 -DEPTH=2 +SIZE=2 + +BATCH_SIZE=$SIZE +BEAM_SIZE=$SIZE +DEPTH=$SIZE SEARCH_ARGS=( --beam_size=$BEAM_SIZE @@ -39,14 +41,15 @@ INPUT_FILE=circle.txt python -m alphageometry \ --alsologtostderr \ --problems_file=$(pwd)/$INPUT_FILE \ ---problem_name=example7_5 \ +--problem_name=example6_3 \ --mode=alphageometry \ "${DDAR_ARGS[@]}" \ "${SEARCH_ARGS[@]}" \ "${LM_ARGS[@]}" \ ---out_file="./output/example7_5.txt"\ +--out_file="kirine.txt"\ + -# for pro in $(cat $INPUT_FILE | grep "example"); +# for pro in $(cat $INPUT_FILE | grep "example6"); # do # echo "solve problem $pro$" # python -m alphageometry \ @@ -57,7 +60,7 @@ python -m alphageometry \ # "${DDAR_ARGS[@]}" \ # "${SEARCH_ARGS[@]}" \ # "${LM_ARGS[@]}" \ -# --out_file="./output/${pro}.txt"\ +# --out_file="./output_old/${pro}.txt"\ # echo "finish problem $pro$" # done \ No newline at end of file diff --git a/circle.txt b/circle.txt index 8348881..19e9a7d 100644 --- a/circle.txt +++ b/circle.txt @@ -23,13 +23,13 @@ a b c = triangle a b c; o = circle o a b c; h = orthocenter h a b c; d = on_line example7_10 a b c = triangle a b c; h = orthocenter h a b c; o = circle o a b c; d = on_circle d o a, on_circle d a c; k = on_line k a d, on_circle k a b; l = on_line l b c, on_pline l k c d; m = midpoint m b c; n = foot n h a l; t = midpoint t a h ? coll m n t exercise7_1 -a b = segment a b; x = on_bline x a b; y = on_bline y a b; c = on_circle c x a; d = on_circle d y a, on_line d b c; e = on_circle e x a, on_line e d a; f = on_circle f y a, on_line f c a; o = cricle o a e f ? perp o b c d +a b = segment a b; x = on_bline x a b; y = on_bline y a b; c = on_circle c x a; d = on_circle d y a, on_line d b c; e = on_circle e x a, on_line e d a; f = on_circle f y a, on_line f c a; o = circle o a e f ? perp o b c d exercise7_2 a b c = segment a b c; d = foot d a b c; e = foot e b c a; f = foot f c a b; h = on_line h a d, on_line h b e; p = on_line p b e, on_line p d f; q = on_line q a b, on_tline q p b c; n = on_line n e q, on_line n a d ? cong a n a h exercise7_4 a b c = triangle a b c; o = circle o a b c; i = circle i o b c; g = on_circle g i o; x = circle x a b g; y = circle y a c g; e = on_line e a c, on_circle e x a; f = on_line f a b, on_circle f y a; k = on_line k b e, on_line k c f; t = on_line t a k, on_line t b c ? coll t o g exercise7_5 -a b c = triangle a b c; o = cricle o a b c; d = on_circle d o a; e = on_line e a d, on_line e b c; m = midpoint m a d; n = midpoint n b c; w = circle w e m n; x = on_circle x o a, on_circle x w e; y = on_circle y o a, on_circle y w e; z = on_line z a b, on_line z c d ? coll x y z +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_line e a d, on_line e b c; m = midpoint m a d; n = midpoint n b c; w = circle w e m n; x = on_circle x o a, on_circle x w e; y = on_circle y o a, on_circle y w e; z = on_line z a b, on_line z c d ? coll x y z exercise7_7 a b c = triangle a b c; d e f i = incenter2 d e f i a b c; p = on_line p a d, on_circle p i d; q = on_line q e f, on_tline q p a d; x = on_line x d e, on_line x a q; y = on_line y d f, on_line y a q ? cong a x a y exercise7_8 @@ -51,7 +51,7 @@ a b = segment a b; o = on_bline o a b; p = on_bline p a b; c = on_tline c a a p, exercise7_15 a b = segment a b; o = on_bline o a b; p = on_tline p a o a, on_tline p b o b; c = on_circle c o a; d = on_line d p c, on_circle d o a; e = on_pline e c p b, on_circle e o a; f = on_line f a e, on_line f p b; g = on_line g d e, on_line g p b ? cong g f g b example6_1 -a b c = triangle a b c; o = circle o a b c; P = free; a1 = on_line a1 a p, on_circle a1 o a; b1 = on_line b1 b p, on_circle b1 o b; c1 = on_line c1 c p, on_circle c1 o c; q = on_circle q o a; x = on_line x q a1, on_line x b c; y = on_line y q b1, on_line y a c; z = on_line z q c1, on_line z a b ? coll x y z +a b c = triangle a b c; o = circle o a b c; p = free; a1 = on_line a1 a p, on_circle a1 o a; b1 = on_line b1 b p, on_circle b1 o b; c1 = on_line c1 c p, on_circle c1 o c; q = on_circle q o a; x = on_line x q a1, on_line x b c; y = on_line y q b1, on_line y a c; z = on_line z q c1, on_line z a b ? coll x y z example6_2 a b = segment a b; o = midpoint o a b; p = on_tline p b o b; c = on_circle c o a; d = on_line d p c, on_circle d o a; e = on_line e a c, on_line e p o; f = on_line f a d, on_line f p o ? cong o e o f example6_3 diff --git a/dd_test.py b/dd_test.py index 6cb2c40..22a98b1 100644 --- a/dd_test.py +++ b/dd_test.py @@ -44,6 +44,9 @@ def test_imo_2022_p4_should_succeed(self): g, _ = gh.Graph.build_problem(p, DDTest.defs) goal_args = g.names2nodes(p.goal.args) + for _,rule in DDTest.rules.items(): + print(rule.name) + success = False for level in range(MAX_LEVEL): added, _, _, _ = dd.bfs_one_level(g, DDTest.rules, level, p) diff --git a/kirine.txt b/kirine.txt index 7f8aaf2..bd638e7 100644 --- a/kirine.txt +++ b/kirine.txt @@ -1,18 +1,130 @@ ========================== * From theorem premises: -A B C D E F : Points -DA = DB [00] -DB = DC [01] -DE = DA [02] -C,F,E are collinear [03] -B,F,A are collinear [04] +A B C D E F G H I J K L : Points +D,C,B are collinear [00] +AD ⟂ BC [01] +BE ⟂ AC [02] +A,C,E are collinear [03] +A,F,B are collinear [04] +CF ⟂ AB [05] +G,E,B are collinear [06] +A,D,G are collinear [07] +AE = AH [08] +DE = DH [09] +DF = DI [10] +AF = AI [11] +C,H,J are collinear [12] +J,I,B are collinear [13] +H,K,B are collinear [14] +C,I,K are collinear [15] +A,L,J are collinear [16] +L,G,K are collinear [17] * Auxiliary Constructions: : Points * Proof steps: -001. DA = DB [00] & DE = DA [02] & DB = DC [01] ⇒ C,B,E,A are concyclic [05] -002. C,B,E,A are concyclic [05] & C,F,E are collinear [03] & B,F,A are collinear [04] ⇒ CF:FA = BF:FE +001. AE = AH [08] & DE = DH [09] ⇒ AD ⟂ HE [18] +002. AE = AH [08] & DE = DH [09] (SSS)⇒ ∠HAD = ∠DAE [19] +003. A,F,B are collinear [04] & D,C,B are collinear [00] & AD ⟂ BC [01] & CF ⟂ AB [05] ⇒ ∠AFC = ∠ADC [20] +004. ∠AFC = ∠ADC [20] ⇒ A,C,D,F are concyclic [21] +005. A,C,D,F are concyclic [21] ⇒ ∠DAC = ∠DFC [22] +006. A,C,D,F are concyclic [21] ⇒ ∠ACD = ∠AFD [23] +007. D,C,B are collinear [00] & AD ⟂ BC [01] ⇒ AD ⟂ DC [24] +008. G,E,B are collinear [06] & AC ⟂ BE [02] ⇒ AC ⟂ GE [25] +009. AD ⟂ DC [24] & AC ⟂ GE [25] ⇒ ∠DAC = ∠(DC-GE) [26] +010. D,C,B are collinear [00] & ∠DAC = ∠DFC [22] & ∠DAC = ∠(DC-GE) [26] & G,E,B are collinear [06] ⇒ ∠DBE = ∠DFC [27] +011. A,F,B are collinear [04] & CF ⟂ AB [05] ⇒ CF ⟂ AF [28] +012. AD ⟂ DC [24] & CF ⟂ AF [28] ⇒ ∠DAF = ∠DCF [29] +013. AD ⟂ DC [24] & CF ⟂ AF [28] ⇒ ∠(AD-CF) = ∠(DC-AF) [30] +014. A,C,E are collinear [03] & D,C,B are collinear [00] & AD ⟂ BC [01] & BE ⟂ AC [02] ⇒ ∠AEB = ∠ADB [31] +015. ∠AEB = ∠ADB [31] ⇒ A,D,E,B are concyclic [32] +016. A,D,E,B are concyclic [32] ⇒ ∠DAB = ∠DEB [33] +017. A,D,E,B are concyclic [32] ⇒ ∠AED = ∠ABD [34] +018. D,C,B are collinear [00] & ∠DAF = ∠DCF [29] & A,F,B are collinear [04] & ∠DAB = ∠DEB [33] ⇒ ∠DEB = ∠DCF [35] +019. ∠DBE = ∠DFC [27] & ∠DEB = ∠DCF [35] (Similar Triangles)⇒ DB:DF = DE:DC [36] +020. ∠DBE = ∠DFC [27] & ∠DEB = ∠DCF [35] (Similar Triangles)⇒ DB:DE = DF:DC [37] +021. DB:DF = DE:DC [36] & DF = DI [10] & DE = DH [09] ⇒ DB:DI = DH:DC [38] +022. DE = DH [09] ⇒ ∠DHE = ∠HED [39] +023. AF = AI [11] & DF = DI [10] ⇒ AD ⟂ IF [40] +024. AF = AI [11] & DF = DI [10] (SSS)⇒ ∠IAD = ∠DAF [41] +025. DF = DI [10] ⇒ ∠IFD = ∠DIF [42] +026. ∠AED = ∠ABD [34] & A,C,E are collinear [03] & D,C,B are collinear [00] & AD ⟂ HE [18] & AD ⟂ BC [01] & AD ⟂ IF [40] & ∠ACD = ∠AFD [23] & A,F,B are collinear [04] & ∠IFD = ∠DIF [42] ⇒ ∠DIF = ∠(DE-FI) [43] +027. ∠DIF = ∠(DE-FI) [43] ⇒ DI ∥ DE [44] +028. D,C,B are collinear [00] & ∠HED = ∠DHE [39] & AD ⟂ HE [18] & AD ⟂ BC [01] & DE ∥ DI [44] ⇒ ∠BDI = ∠HDC [45] +029. D,C,B are collinear [00] & ∠HED = ∠DHE [39] & AD ⟂ HE [18] & AD ⟂ BC [01] & DE ∥ DI [44] ⇒ ∠HDB = ∠CDI [46] +030. DB:DI = DH:DC [38] & ∠BDI = ∠HDC [45] (Similar Triangles)⇒ ∠BID = ∠HCD [47] +031. DI ∥ DE [44] ⇒ D,I,E are collinear [48] +032. G,E,B are collinear [06] & ∠HAD = ∠DAE [19] & A,C,E are collinear [03] & ∠DAC = ∠(DC-GE) [26] & D,C,B are collinear [00] & AD ⟂ HE [18] & AD ⟂ BC [01] & AD ⟂ IF [40] ⇒ ∠(GE-FI) = ∠DAH [49] +033. G,E,B are collinear [06] & ∠IAD = ∠DAF [41] & A,F,B are collinear [04] & ∠BAD = ∠BED [33] ⇒ ∠GED = ∠DAI [50] +034. ∠(GE-FI) = ∠DAH [49] & ∠GED = ∠DAI [50] ⇒ ∠(FI-DE) = ∠HAI [51] +035. C,H,J are collinear [12] & I,B,J are collinear [13] & ∠BID = ∠HCD [47] & D,I,E are collinear [48] & D,C,B are collinear [00] & DI ∥ DE [44] & AD ⟂ HE [18] & AD ⟂ BC [01] & AD ⟂ IF [40] & ∠(FI-DE) = ∠HAI [51] ⇒ ∠HAI = ∠HJI [52] +036. ∠HAI = ∠HJI [52] ⇒ A,I,H,J are concyclic [53] +037. A,C,E are collinear [03] & A,F,B are collinear [04] & CF ⟂ AB [05] & BE ⟂ AC [02] ⇒ ∠CEB = ∠CFB [54] +038. ∠CEB = ∠CFB [54] ⇒ C,F,E,B are concyclic [55] +039. C,F,E,B are concyclic [55] ⇒ ∠CEF = ∠CBF [56] +040. AF = AI [11] (SSS)⇒ ∠AIF = ∠IFA [57] +041. ∠CEF = ∠CBF [56] & A,C,E are collinear [03] & A,F,B are collinear [04] & ∠AIF = ∠IFA [57] & AD ⟂ HE [18] & AD ⟂ BC [01] & AD ⟂ IF [40] ⇒ ∠AIF = ∠(AC-EF) [58] +042. A,C,E are collinear [03] & ∠AIF = ∠(AC-EF) [58] ⇒ ∠AIF = ∠AEF [59] +043. ∠AIF = ∠AEF [59] ⇒ A,F,E,I are concyclic [60] +044. AE = AH [08] (SSS)⇒ ∠AHE = ∠HEA [61] +045. A,F,B are collinear [04] & ∠CEF = ∠CBF [56] & A,C,E are collinear [03] & ∠AHE = ∠HEA [61] & AD ⟂ IF [40] & AD ⟂ EH [18] & AD ⟂ BC [01] ⇒ ∠AHE = ∠AFE [62] +046. ∠AHE = ∠AFE [62] ⇒ A,F,E,H are concyclic [63] +047. A,D,G are collinear [07] & G,E,B are collinear [06] & ∠HAD = ∠DAE [19] & A,C,E are collinear [03] & ∠DAC = ∠(DC-GE) [26] & D,C,B are collinear [00] & AD ⟂ HE [18] & AD ⟂ BC [01] ⇒ ∠HAG = ∠HEG [64] +048. ∠HAG = ∠HEG [64] ⇒ A,G,E,H are concyclic [65] +049. A,I,H,J are concyclic [53] & A,F,E,I are concyclic [60] & A,F,E,H are concyclic [63] & A,G,E,H are concyclic [65] ⇒ E,A,G,J are concyclic [66] +050. E,A,G,J are concyclic [66] ⇒ ∠EAJ = ∠EGJ [67] +051. A,L,J are collinear [16] & ∠EAJ = ∠EGJ [67] & A,C,E are collinear [03] & G,E,B are collinear [06] & AD ⟂ BC [01] & BE ⟂ AC [02] & AD ⟂ HE [18] & AD ⟂ IF [40] ⇒ ∠(FI-AD) = ∠(GJ-AL) [68] +052. A,C,E are collinear [03] & A,F,B are collinear [04] & CF ⟂ AB [05] & BE ⟂ AC [02] ⇒ ∠AEB = ∠CFA [69] +053. AC ⟂ GE [25] & CF ⟂ AF [28] ⇒ ∠ACF = ∠(GE-AF) [70] +054. ∠ACF = ∠(GE-AF) [70] & G,E,B are collinear [06] & A,F,B are collinear [04] ⇒ ∠ACF = ∠EBA [71] +055. ∠AEB = ∠CFA [69] & ∠ACF = ∠EBA [71] (Similar Triangles)⇒ AE:AB = AF:AC [72] +056. AE:AB = AF:AC [72] & AE = AH [08] & AF = AI [11] ⇒ AH:AB = AI:AC [73] +057. A,F,B are collinear [04] & ∠CEF = ∠CBF [56] & A,C,E are collinear [03] & ∠AHE = ∠HEA [61] & AD ⟂ IF [40] & AD ⟂ EH [18] & AD ⟂ BC [01] ⇒ ∠(AH-FI) = ∠AFE [74] +058. ∠(AH-FI) = ∠AFE [74] & ∠(FE-AC) = ∠FIA [58] ⇒ ∠HAI = ∠FAC [75] +059. ∠HAI = ∠FAC [75] & A,F,B are collinear [04] ⇒ ∠HAB = ∠IAC [76] +060. AH:AB = AI:AC [73] & ∠HAB = ∠IAC [76] (Similar Triangles)⇒ ∠HAI = ∠(BH-CI) [77] +061. H,K,B are collinear [14] & C,I,K are collinear [15] & ∠HAI = ∠(BH-CI) [77] ⇒ ∠HAI = ∠HKI [78] +062. ∠HAI = ∠HKI [78] ⇒ A,I,H,K are concyclic [79] +063. A,I,H,K are concyclic [79] & A,F,E,I are concyclic [60] & A,F,E,H are concyclic [63] & A,I,H,J are concyclic [53] & A,G,E,H are concyclic [65] ⇒ I,K,G,J are concyclic [80] +064. I,K,G,J are concyclic [80] ⇒ ∠IKG = ∠IJG [81] +065. DB:DE = DF:DC [37] & DE = DH [09] & DF = DI [10] ⇒ DB:DH = DI:DC [82] +066. DB:DH = DI:DC [82] & ∠HDB = ∠CDI [46] (Similar Triangles)⇒ ∠HBD = ∠CID [83] +067. D,C,B are collinear [00] & D,I,E are collinear [48] & H,K,B are collinear [14] & C,I,K are collinear [15] & ∠HBD = ∠CID [83] ⇒ ∠BDI = ∠BKI [84] +068. ∠BDI = ∠BKI [84] ⇒ D,I,K,B are concyclic [85] +069. D,I,K,B are concyclic [85] ⇒ ∠DKI = ∠DBI [86] +070. L,G,K are collinear [17] & ∠IKG = ∠IJG [81] & C,I,K are collinear [15] & J,I,B are collinear [13] & ∠DKI = ∠DBI [86] & D,C,B are collinear [00] & AD ⟂ IF [40] & AD ⟂ EH [18] & AD ⟂ BC [01] ⇒ ∠(FI-DK) = ∠JGL [87] +071. ∠(FI-AD) = ∠(GJ-AL) [68] & ∠(FI-DK) = ∠JGL [87] ⇒ ∠ADK = ∠ALG [88] +072. A,L,J are collinear [16] & L,G,K are collinear [17] & ∠ADK = ∠ALG [88] ⇒ ∠DAL = ∠DKL [89] +073. ∠DAL = ∠DKL [89] ⇒ A,L,D,K are concyclic [90] +074. A,L,D,K are concyclic [90] ⇒ ∠ADL = ∠AKL [91] +075. A,I,H,K are concyclic [79] & A,F,E,I are concyclic [60] & A,F,E,H are concyclic [63] & A,I,H,J are concyclic [53] & A,G,E,H are concyclic [65] ⇒ K,A,G,J are concyclic [92] +076. K,A,G,J are concyclic [92] ⇒ ∠GKA = ∠GJA [93] +077. A,I,H,K are concyclic [79] & A,F,E,I are concyclic [60] & A,F,E,H are concyclic [63] & A,G,E,H are concyclic [65] ⇒ K,A,F,G are concyclic [94] +078. K,A,F,G are concyclic [94] ⇒ ∠KAF = ∠KGF [95] +079. A,D,G are collinear [07] & A,F,B are collinear [04] & ∠IAD = ∠DAF [41] ⇒ ∠IAG = ∠GAF [96] +080. AF = AI [11] & ∠IAG = ∠GAF [96] (SAS)⇒ GI = GF [97] +081. A,F,E,I are concyclic [60] & A,F,E,H are concyclic [63] & A,G,E,H are concyclic [65] ⇒ I,A,F,G are concyclic [98] +082. AF = AI [11] & GI = GF [97] & I,A,F,G are concyclic [98] ⇒ AF ⟂ FG [99] +083. A,C,E are collinear [03] & G,E,B are collinear [06] & D,C,B are collinear [00] & D,G,A are collinear [07] & AD ⟂ BC [01] & BE ⟂ AC [02] ⇒ ∠CEG = ∠CDG [100] +084. ∠CEG = ∠CDG [100] ⇒ D,C,G,E are concyclic [101] +085. D,C,G,E are concyclic [101] ⇒ ∠DCG = ∠DEG [102] +086. ∠DAF = ∠DCF [29] & A,F,B are collinear [04] & D,C,B are collinear [00] & ∠BAD = ∠BED [33] & ∠DCG = ∠DEG [102] & G,E,B are collinear [06] & AD ⟂ IF [40] & AD ⟂ EH [18] & AD ⟂ BC [01] ⇒ ∠(CG-FI) = ∠CFI [103] +087. ∠(CG-FI) = ∠CFI [103] ⇒ CG ∥ CF [104] +088. L,G,K are collinear [17] & ∠KAF = ∠KGF [95] & A,F,B are collinear [04] & AF ⟂ FG [99] & CF ⟂ AB [05] & CF ∥ CG [104] & ∠(AD-CF) = ∠(DC-AF) [30] & D,C,B are collinear [00] & AD ⟂ HE [18] & AD ⟂ BC [01] & AD ⟂ IF [40] ⇒ ∠(AD-FI) = ∠(LG-AK) [105] +089. A,I,H,K are concyclic [79] & A,F,E,I are concyclic [60] & A,F,E,H are concyclic [63] & A,I,H,J are concyclic [53] ⇒ I,K,A,J are concyclic [106] +090. I,K,A,J are concyclic [106] ⇒ ∠IKA = ∠IJA [107] +091. D,C,B are collinear [00] & D,I,E are collinear [48] & C,H,J are collinear [12] & I,B,J are collinear [13] & ∠BID = ∠HCD [47] ⇒ ∠CDI = ∠CJI [108] +092. ∠CDI = ∠CJI [108] ⇒ D,C,I,J are concyclic [109] +093. D,C,I,J are concyclic [109] ⇒ ∠DCI = ∠DJI [110] +094. A,L,J are collinear [16] & ∠IKA = ∠IJA [107] & C,I,K are collinear [15] & J,I,B are collinear [13] & ∠DCI = ∠DJI [110] & D,C,B are collinear [00] & AD ⟂ IF [40] & AD ⟂ EH [18] & AD ⟂ BC [01] ⇒ ∠(FI-DJ) = ∠KAL [111] +095. ∠(AD-FI) = ∠(LG-AK) [105] & ∠(FI-DJ) = ∠KAL [111] ⇒ ∠ADJ = ∠GLA [112] +096. A,L,J are collinear [16] & D,G,A are collinear [07] & L,G,K are collinear [17] & ∠ADJ = ∠GLA [112] ⇒ ∠DJL = ∠DGL [113] +097. ∠DJL = ∠DGL [113] ⇒ D,L,G,J are concyclic [114] +098. D,L,G,J are concyclic [114] ⇒ ∠DLJ = ∠DGJ [115] +099. D,C,B are collinear [00] & AD ⟂ HE [18] & ∠ADL = ∠AKL [91] & L,G,K are collinear [17] & ∠GKA = ∠GJA [93] & ∠DLJ = ∠DGJ [115] & A,L,J are collinear [16] & A,D,G are collinear [07] & AD ⟂ BC [01] ⇒ DC ∥ DL [116] +100. DC ∥ DL [116] ⇒ D,C,L are collinear [117] +101. D,C,L are collinear [117] & D,C,B are collinear [00] ⇒ C,L,B are collinear ========================== diff --git a/rules1.txt b/rules1.txt index 721c817..62ee122 100644 --- a/rules1.txt +++ b/rules1.txt @@ -2,4 +2,4 @@ cyclic A B C D, coll P A B, coll P C D => eqratio P A P C P D P B coll P A B, coll P C D, ncoll A B C D, eqratio P A P C P D P B => cyclic A B C D cyclic A B C D, cyclic A B E F, cyclic C D E F, coll P A B, coll P C D => coll P E F cyclic A B C D E F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I -cyclic A B C D E, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A, coll G H I => cyclic A B C D E F \ No newline at end of file +cyclic A B C D E, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A, coll G H I => cyclic A B C D E F From d8ac048881b32147cd32f9aee7be129d0a222eee Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.cn> Date: Fri, 7 Mar 2025 22:05:39 +0800 Subject: [PATCH 07/27] cyclic2power --- chiaya.sh | 6 +- dd.py | 77 ++++++++++++++- kirine.txt | 127 ++----------------------- lines.txt | 12 +++ nothing.txt | 180 ++++++++++++++++++++++++++++++++++++ output_new/example6_1.txt | 36 ++++++++ output_new/example7_1.txt | 36 ++++++++ output_new/example7_2.txt | 41 ++++++++ output_new/example7_7_1.txt | 34 +++++++ output_new/example7_7_2.txt | 34 +++++++ output_new/exercise7_1.txt | 75 +++++++++++++++ output_new/exercise7_13.txt | 54 +++++++++++ output_new/exercise7_4.txt | 100 ++++++++++++++++++++ output_new/exercise7_5.txt | 22 +++++ output_old/example6_3.txt | 133 ++++++++++++++++++++++++++ pros2.txt | 6 ++ rules.txt | 1 + rules1.txt | 5 +- rules2.txt | 1 + 19 files changed, 852 insertions(+), 128 deletions(-) create mode 100644 lines.txt create mode 100644 nothing.txt create mode 100644 output_new/example6_1.txt create mode 100644 output_new/example7_1.txt create mode 100644 output_new/example7_2.txt create mode 100644 output_new/example7_7_1.txt create mode 100644 output_new/example7_7_2.txt create mode 100644 output_new/exercise7_1.txt create mode 100644 output_new/exercise7_13.txt create mode 100644 output_new/exercise7_4.txt create mode 100644 output_new/exercise7_5.txt create mode 100644 output_old/example6_3.txt create mode 100644 pros2.txt create mode 100644 rules2.txt diff --git a/chiaya.sh b/chiaya.sh index 76c9ee9..0a73f51 100644 --- a/chiaya.sh +++ b/chiaya.sh @@ -6,7 +6,7 @@ export PYTHONPATH=$PYTHONPATH:$MELIAD_PATH DDAR_ARGS=( --defs_file=$(pwd)/defs.txt \ - --rules_file=$(pwd)/rules.txt \ + --rules_file=$(pwd)/rules1.txt \ ); SIZE=2 @@ -36,12 +36,12 @@ LM_ARGS=( --gin_param=Trainer.restore_state_variables=False ); -INPUT_FILE=circle.txt +INPUT_FILE=pros2.txt python -m alphageometry \ --alsologtostderr \ --problems_file=$(pwd)/$INPUT_FILE \ ---problem_name=example6_3 \ +--problem_name=test_ccc2pt \ --mode=alphageometry \ "${DDAR_ARGS[@]}" \ "${SEARCH_ARGS[@]}" \ diff --git a/dd.py b/dd.py index 19325ff..833d442 100644 --- a/dd.py +++ b/dd.py @@ -27,6 +27,7 @@ import problem as pr from problem import Dependency, EmptyDependency +import itertools def intersect1(set1: set[Any], set2: set[Any]) -> Any: for x in set1: @@ -442,6 +443,72 @@ def match_cyclic_eqangle( record.add((b, a, d, c)) yield dict(zip('ABPQ', [a, b, c, d])) +def match_cyclic2power( + g: gh.Graph, + g_matcher: Callable[str, list[tuple[gm.Point, ...]]], + theorem: pr.Theorem, +) -> Generator[dict[str, gm.Point], None, None]: + """Match cyclic A B C D, coll P A B, coll P C D => eqratio P A P C P D P B""" + record = set() + for a,b,c,d in g_matcher('cyclic'): + debugname([a,b,c,d]) + if (a,b,c,d) in record: + continue + points = [a,b,c,d] + perms = utils.perm4(points) + for p in perms: + record.add(p) + ab = g._get_line(a, b) + cd = g._get_line(c, d) + if ab and cd: + p1s = ab.neighbors(gm.Point, return_set=True) + p2s = cd.neighbors(gm.Point, return_set=True) + p = intersect1(p1s, p2s) + if p: + yield dict(zip('PABCD',[p,a,b,c,d])) + ac = g._get_line(a, c) + bd = g._get_line(b, d) + if ac and bd: + p1s = ac.neighbors(gm.Point, return_set=True) + p2s = bd.neighbors(gm.Point, return_set=True) + p = intersect1(p1s, p2s) + if p: + yield dict(zip('PABCD',[p,a,c,b,d])) + ad = g._get_line(a, d) + bc = g._get_line(b, c) + if ad and bc: + p1s = ad.neighbors(gm.Point, return_set=True) + p2s = bc.neighbors(gm.Point, return_set=True) + p = intersect1(p1s, p2s) + if p: + yield dict(zip('PABCD',[p,a,d,b,c])) + +def match_cyclic2power_tan( + g: gh.Graph, + g_matcher: Callable[str, list[tuple[gm.Point, ...]]], + theorem: pr.Theorem, +) -> Generator[dict[str, gm.Point], None, None]: + """Match circle O A B C, perp O A A P, coll P B C => eqratio P A P B P C P A """ + record = set() + for o,a,b,c in g.all_circles(): + if (o,a) in record: + pass + bc = g._get_line(b,c) + if not bc: + continue + record.add((o,a)) + debugname([o,a,b,c]) + oa = g._get_line(o, a) + if not (oa and oa.val): + continue + for l in a.neighbors(gm.Line): + if g.check_perpl(oa, l): + p1s = l.neighbors(gm.Point, return_set=True) + p2s = bc.neighbors(gm.Point, return_set=True) + p = intersect1(p1s, p2s) + if p: + yield dict(zip('OPABC', [o, p, a, b, c])) + break def rotate_simtri( a: gm.Point, b: gm.Point, c: gm.Point, x: gm.Point, y: gm.Point, z: gm.Point @@ -775,7 +842,6 @@ def match_eqangle6_ncoll_cyclic( if nm.check_ncoll([x.num for x in [a, b, c, x]]): yield dict(zip('ABPQ', [b, c, a, x])) - def match_all( name: str, g: gh.Graph ) -> Generator[tuple[gm.Point, ...], None, None]: @@ -858,6 +924,7 @@ def match_generic( theorem: pr.Theorem ) -> Generator[dict[str, gm.Point], None, None]: """Match any generic rule that is not one of the above match_*() rules.""" + debugname(theorem) clause2enum = {} clauses = [] @@ -933,6 +1000,8 @@ def match_generic( 'eqratio6_coll_ncoll_eqangle6': match_eqratio6_coll_ncoll_eqangle6, 'eqangle6_coll_ncoll_eqratio6': match_eqangle6_coll_ncoll_eqratio6, 'eqangle6_ncoll_cyclic': match_eqangle6_ncoll_cyclic, + 'cyclic_coll_coll_eqratio': match_cyclic2power, + 'circle_perp_coll_eqratio': match_cyclic2power_tan, } @@ -1154,3 +1223,9 @@ def apply_derivations( for arg in args: applied += g.do_algebra(name, arg) return applied + +def debugname(ps): + if type(ps) is list: + print([p.name for p in ps]) + else: + print(ps.name) diff --git a/kirine.txt b/kirine.txt index bd638e7..9de35f2 100644 --- a/kirine.txt +++ b/kirine.txt @@ -1,130 +1,17 @@ ========================== * From theorem premises: -A B C D E F G H I J K L : Points -D,C,B are collinear [00] -AD ⟂ BC [01] -BE ⟂ AC [02] -A,C,E are collinear [03] -A,F,B are collinear [04] -CF ⟂ AB [05] -G,E,B are collinear [06] -A,D,G are collinear [07] -AE = AH [08] -DE = DH [09] -DF = DI [10] -AF = AI [11] -C,H,J are collinear [12] -J,I,B are collinear [13] -H,K,B are collinear [14] -C,I,K are collinear [15] -A,L,J are collinear [16] -L,G,K are collinear [17] +A B C D E : Points +DB = DC [00] +DA = DB [01] +AE ⟂ AD [02] +C,B,E are collinear [03] * Auxiliary Constructions: : Points * Proof steps: -001. AE = AH [08] & DE = DH [09] ⇒ AD ⟂ HE [18] -002. AE = AH [08] & DE = DH [09] (SSS)⇒ ∠HAD = ∠DAE [19] -003. A,F,B are collinear [04] & D,C,B are collinear [00] & AD ⟂ BC [01] & CF ⟂ AB [05] ⇒ ∠AFC = ∠ADC [20] -004. ∠AFC = ∠ADC [20] ⇒ A,C,D,F are concyclic [21] -005. A,C,D,F are concyclic [21] ⇒ ∠DAC = ∠DFC [22] -006. A,C,D,F are concyclic [21] ⇒ ∠ACD = ∠AFD [23] -007. D,C,B are collinear [00] & AD ⟂ BC [01] ⇒ AD ⟂ DC [24] -008. G,E,B are collinear [06] & AC ⟂ BE [02] ⇒ AC ⟂ GE [25] -009. AD ⟂ DC [24] & AC ⟂ GE [25] ⇒ ∠DAC = ∠(DC-GE) [26] -010. D,C,B are collinear [00] & ∠DAC = ∠DFC [22] & ∠DAC = ∠(DC-GE) [26] & G,E,B are collinear [06] ⇒ ∠DBE = ∠DFC [27] -011. A,F,B are collinear [04] & CF ⟂ AB [05] ⇒ CF ⟂ AF [28] -012. AD ⟂ DC [24] & CF ⟂ AF [28] ⇒ ∠DAF = ∠DCF [29] -013. AD ⟂ DC [24] & CF ⟂ AF [28] ⇒ ∠(AD-CF) = ∠(DC-AF) [30] -014. A,C,E are collinear [03] & D,C,B are collinear [00] & AD ⟂ BC [01] & BE ⟂ AC [02] ⇒ ∠AEB = ∠ADB [31] -015. ∠AEB = ∠ADB [31] ⇒ A,D,E,B are concyclic [32] -016. A,D,E,B are concyclic [32] ⇒ ∠DAB = ∠DEB [33] -017. A,D,E,B are concyclic [32] ⇒ ∠AED = ∠ABD [34] -018. D,C,B are collinear [00] & ∠DAF = ∠DCF [29] & A,F,B are collinear [04] & ∠DAB = ∠DEB [33] ⇒ ∠DEB = ∠DCF [35] -019. ∠DBE = ∠DFC [27] & ∠DEB = ∠DCF [35] (Similar Triangles)⇒ DB:DF = DE:DC [36] -020. ∠DBE = ∠DFC [27] & ∠DEB = ∠DCF [35] (Similar Triangles)⇒ DB:DE = DF:DC [37] -021. DB:DF = DE:DC [36] & DF = DI [10] & DE = DH [09] ⇒ DB:DI = DH:DC [38] -022. DE = DH [09] ⇒ ∠DHE = ∠HED [39] -023. AF = AI [11] & DF = DI [10] ⇒ AD ⟂ IF [40] -024. AF = AI [11] & DF = DI [10] (SSS)⇒ ∠IAD = ∠DAF [41] -025. DF = DI [10] ⇒ ∠IFD = ∠DIF [42] -026. ∠AED = ∠ABD [34] & A,C,E are collinear [03] & D,C,B are collinear [00] & AD ⟂ HE [18] & AD ⟂ BC [01] & AD ⟂ IF [40] & ∠ACD = ∠AFD [23] & A,F,B are collinear [04] & ∠IFD = ∠DIF [42] ⇒ ∠DIF = ∠(DE-FI) [43] -027. ∠DIF = ∠(DE-FI) [43] ⇒ DI ∥ DE [44] -028. D,C,B are collinear [00] & ∠HED = ∠DHE [39] & AD ⟂ HE [18] & AD ⟂ BC [01] & DE ∥ DI [44] ⇒ ∠BDI = ∠HDC [45] -029. D,C,B are collinear [00] & ∠HED = ∠DHE [39] & AD ⟂ HE [18] & AD ⟂ BC [01] & DE ∥ DI [44] ⇒ ∠HDB = ∠CDI [46] -030. DB:DI = DH:DC [38] & ∠BDI = ∠HDC [45] (Similar Triangles)⇒ ∠BID = ∠HCD [47] -031. DI ∥ DE [44] ⇒ D,I,E are collinear [48] -032. G,E,B are collinear [06] & ∠HAD = ∠DAE [19] & A,C,E are collinear [03] & ∠DAC = ∠(DC-GE) [26] & D,C,B are collinear [00] & AD ⟂ HE [18] & AD ⟂ BC [01] & AD ⟂ IF [40] ⇒ ∠(GE-FI) = ∠DAH [49] -033. G,E,B are collinear [06] & ∠IAD = ∠DAF [41] & A,F,B are collinear [04] & ∠BAD = ∠BED [33] ⇒ ∠GED = ∠DAI [50] -034. ∠(GE-FI) = ∠DAH [49] & ∠GED = ∠DAI [50] ⇒ ∠(FI-DE) = ∠HAI [51] -035. C,H,J are collinear [12] & I,B,J are collinear [13] & ∠BID = ∠HCD [47] & D,I,E are collinear [48] & D,C,B are collinear [00] & DI ∥ DE [44] & AD ⟂ HE [18] & AD ⟂ BC [01] & AD ⟂ IF [40] & ∠(FI-DE) = ∠HAI [51] ⇒ ∠HAI = ∠HJI [52] -036. ∠HAI = ∠HJI [52] ⇒ A,I,H,J are concyclic [53] -037. A,C,E are collinear [03] & A,F,B are collinear [04] & CF ⟂ AB [05] & BE ⟂ AC [02] ⇒ ∠CEB = ∠CFB [54] -038. ∠CEB = ∠CFB [54] ⇒ C,F,E,B are concyclic [55] -039. C,F,E,B are concyclic [55] ⇒ ∠CEF = ∠CBF [56] -040. AF = AI [11] (SSS)⇒ ∠AIF = ∠IFA [57] -041. ∠CEF = ∠CBF [56] & A,C,E are collinear [03] & A,F,B are collinear [04] & ∠AIF = ∠IFA [57] & AD ⟂ HE [18] & AD ⟂ BC [01] & AD ⟂ IF [40] ⇒ ∠AIF = ∠(AC-EF) [58] -042. A,C,E are collinear [03] & ∠AIF = ∠(AC-EF) [58] ⇒ ∠AIF = ∠AEF [59] -043. ∠AIF = ∠AEF [59] ⇒ A,F,E,I are concyclic [60] -044. AE = AH [08] (SSS)⇒ ∠AHE = ∠HEA [61] -045. A,F,B are collinear [04] & ∠CEF = ∠CBF [56] & A,C,E are collinear [03] & ∠AHE = ∠HEA [61] & AD ⟂ IF [40] & AD ⟂ EH [18] & AD ⟂ BC [01] ⇒ ∠AHE = ∠AFE [62] -046. ∠AHE = ∠AFE [62] ⇒ A,F,E,H are concyclic [63] -047. A,D,G are collinear [07] & G,E,B are collinear [06] & ∠HAD = ∠DAE [19] & A,C,E are collinear [03] & ∠DAC = ∠(DC-GE) [26] & D,C,B are collinear [00] & AD ⟂ HE [18] & AD ⟂ BC [01] ⇒ ∠HAG = ∠HEG [64] -048. ∠HAG = ∠HEG [64] ⇒ A,G,E,H are concyclic [65] -049. A,I,H,J are concyclic [53] & A,F,E,I are concyclic [60] & A,F,E,H are concyclic [63] & A,G,E,H are concyclic [65] ⇒ E,A,G,J are concyclic [66] -050. E,A,G,J are concyclic [66] ⇒ ∠EAJ = ∠EGJ [67] -051. A,L,J are collinear [16] & ∠EAJ = ∠EGJ [67] & A,C,E are collinear [03] & G,E,B are collinear [06] & AD ⟂ BC [01] & BE ⟂ AC [02] & AD ⟂ HE [18] & AD ⟂ IF [40] ⇒ ∠(FI-AD) = ∠(GJ-AL) [68] -052. A,C,E are collinear [03] & A,F,B are collinear [04] & CF ⟂ AB [05] & BE ⟂ AC [02] ⇒ ∠AEB = ∠CFA [69] -053. AC ⟂ GE [25] & CF ⟂ AF [28] ⇒ ∠ACF = ∠(GE-AF) [70] -054. ∠ACF = ∠(GE-AF) [70] & G,E,B are collinear [06] & A,F,B are collinear [04] ⇒ ∠ACF = ∠EBA [71] -055. ∠AEB = ∠CFA [69] & ∠ACF = ∠EBA [71] (Similar Triangles)⇒ AE:AB = AF:AC [72] -056. AE:AB = AF:AC [72] & AE = AH [08] & AF = AI [11] ⇒ AH:AB = AI:AC [73] -057. A,F,B are collinear [04] & ∠CEF = ∠CBF [56] & A,C,E are collinear [03] & ∠AHE = ∠HEA [61] & AD ⟂ IF [40] & AD ⟂ EH [18] & AD ⟂ BC [01] ⇒ ∠(AH-FI) = ∠AFE [74] -058. ∠(AH-FI) = ∠AFE [74] & ∠(FE-AC) = ∠FIA [58] ⇒ ∠HAI = ∠FAC [75] -059. ∠HAI = ∠FAC [75] & A,F,B are collinear [04] ⇒ ∠HAB = ∠IAC [76] -060. AH:AB = AI:AC [73] & ∠HAB = ∠IAC [76] (Similar Triangles)⇒ ∠HAI = ∠(BH-CI) [77] -061. H,K,B are collinear [14] & C,I,K are collinear [15] & ∠HAI = ∠(BH-CI) [77] ⇒ ∠HAI = ∠HKI [78] -062. ∠HAI = ∠HKI [78] ⇒ A,I,H,K are concyclic [79] -063. A,I,H,K are concyclic [79] & A,F,E,I are concyclic [60] & A,F,E,H are concyclic [63] & A,I,H,J are concyclic [53] & A,G,E,H are concyclic [65] ⇒ I,K,G,J are concyclic [80] -064. I,K,G,J are concyclic [80] ⇒ ∠IKG = ∠IJG [81] -065. DB:DE = DF:DC [37] & DE = DH [09] & DF = DI [10] ⇒ DB:DH = DI:DC [82] -066. DB:DH = DI:DC [82] & ∠HDB = ∠CDI [46] (Similar Triangles)⇒ ∠HBD = ∠CID [83] -067. D,C,B are collinear [00] & D,I,E are collinear [48] & H,K,B are collinear [14] & C,I,K are collinear [15] & ∠HBD = ∠CID [83] ⇒ ∠BDI = ∠BKI [84] -068. ∠BDI = ∠BKI [84] ⇒ D,I,K,B are concyclic [85] -069. D,I,K,B are concyclic [85] ⇒ ∠DKI = ∠DBI [86] -070. L,G,K are collinear [17] & ∠IKG = ∠IJG [81] & C,I,K are collinear [15] & J,I,B are collinear [13] & ∠DKI = ∠DBI [86] & D,C,B are collinear [00] & AD ⟂ IF [40] & AD ⟂ EH [18] & AD ⟂ BC [01] ⇒ ∠(FI-DK) = ∠JGL [87] -071. ∠(FI-AD) = ∠(GJ-AL) [68] & ∠(FI-DK) = ∠JGL [87] ⇒ ∠ADK = ∠ALG [88] -072. A,L,J are collinear [16] & L,G,K are collinear [17] & ∠ADK = ∠ALG [88] ⇒ ∠DAL = ∠DKL [89] -073. ∠DAL = ∠DKL [89] ⇒ A,L,D,K are concyclic [90] -074. A,L,D,K are concyclic [90] ⇒ ∠ADL = ∠AKL [91] -075. A,I,H,K are concyclic [79] & A,F,E,I are concyclic [60] & A,F,E,H are concyclic [63] & A,I,H,J are concyclic [53] & A,G,E,H are concyclic [65] ⇒ K,A,G,J are concyclic [92] -076. K,A,G,J are concyclic [92] ⇒ ∠GKA = ∠GJA [93] -077. A,I,H,K are concyclic [79] & A,F,E,I are concyclic [60] & A,F,E,H are concyclic [63] & A,G,E,H are concyclic [65] ⇒ K,A,F,G are concyclic [94] -078. K,A,F,G are concyclic [94] ⇒ ∠KAF = ∠KGF [95] -079. A,D,G are collinear [07] & A,F,B are collinear [04] & ∠IAD = ∠DAF [41] ⇒ ∠IAG = ∠GAF [96] -080. AF = AI [11] & ∠IAG = ∠GAF [96] (SAS)⇒ GI = GF [97] -081. A,F,E,I are concyclic [60] & A,F,E,H are concyclic [63] & A,G,E,H are concyclic [65] ⇒ I,A,F,G are concyclic [98] -082. AF = AI [11] & GI = GF [97] & I,A,F,G are concyclic [98] ⇒ AF ⟂ FG [99] -083. A,C,E are collinear [03] & G,E,B are collinear [06] & D,C,B are collinear [00] & D,G,A are collinear [07] & AD ⟂ BC [01] & BE ⟂ AC [02] ⇒ ∠CEG = ∠CDG [100] -084. ∠CEG = ∠CDG [100] ⇒ D,C,G,E are concyclic [101] -085. D,C,G,E are concyclic [101] ⇒ ∠DCG = ∠DEG [102] -086. ∠DAF = ∠DCF [29] & A,F,B are collinear [04] & D,C,B are collinear [00] & ∠BAD = ∠BED [33] & ∠DCG = ∠DEG [102] & G,E,B are collinear [06] & AD ⟂ IF [40] & AD ⟂ EH [18] & AD ⟂ BC [01] ⇒ ∠(CG-FI) = ∠CFI [103] -087. ∠(CG-FI) = ∠CFI [103] ⇒ CG ∥ CF [104] -088. L,G,K are collinear [17] & ∠KAF = ∠KGF [95] & A,F,B are collinear [04] & AF ⟂ FG [99] & CF ⟂ AB [05] & CF ∥ CG [104] & ∠(AD-CF) = ∠(DC-AF) [30] & D,C,B are collinear [00] & AD ⟂ HE [18] & AD ⟂ BC [01] & AD ⟂ IF [40] ⇒ ∠(AD-FI) = ∠(LG-AK) [105] -089. A,I,H,K are concyclic [79] & A,F,E,I are concyclic [60] & A,F,E,H are concyclic [63] & A,I,H,J are concyclic [53] ⇒ I,K,A,J are concyclic [106] -090. I,K,A,J are concyclic [106] ⇒ ∠IKA = ∠IJA [107] -091. D,C,B are collinear [00] & D,I,E are collinear [48] & C,H,J are collinear [12] & I,B,J are collinear [13] & ∠BID = ∠HCD [47] ⇒ ∠CDI = ∠CJI [108] -092. ∠CDI = ∠CJI [108] ⇒ D,C,I,J are concyclic [109] -093. D,C,I,J are concyclic [109] ⇒ ∠DCI = ∠DJI [110] -094. A,L,J are collinear [16] & ∠IKA = ∠IJA [107] & C,I,K are collinear [15] & J,I,B are collinear [13] & ∠DCI = ∠DJI [110] & D,C,B are collinear [00] & AD ⟂ IF [40] & AD ⟂ EH [18] & AD ⟂ BC [01] ⇒ ∠(FI-DJ) = ∠KAL [111] -095. ∠(AD-FI) = ∠(LG-AK) [105] & ∠(FI-DJ) = ∠KAL [111] ⇒ ∠ADJ = ∠GLA [112] -096. A,L,J are collinear [16] & D,G,A are collinear [07] & L,G,K are collinear [17] & ∠ADJ = ∠GLA [112] ⇒ ∠DJL = ∠DGL [113] -097. ∠DJL = ∠DGL [113] ⇒ D,L,G,J are concyclic [114] -098. D,L,G,J are concyclic [114] ⇒ ∠DLJ = ∠DGJ [115] -099. D,C,B are collinear [00] & AD ⟂ HE [18] & ∠ADL = ∠AKL [91] & L,G,K are collinear [17] & ∠GKA = ∠GJA [93] & ∠DLJ = ∠DGJ [115] & A,L,J are collinear [16] & A,D,G are collinear [07] & AD ⟂ BC [01] ⇒ DC ∥ DL [116] -100. DC ∥ DL [116] ⇒ D,C,L are collinear [117] -101. D,C,L are collinear [117] & D,C,B are collinear [00] ⇒ C,L,B are collinear +001. DB = DC [00] & DA = DB [01] ⇒ D is the circumcenter of \Delta ACB [04] +002. D is the circumcenter of \Delta ACB [04] & AE ⟂ AD [02] & C,B,E are collinear [03] ⇒ EA:CE = BE:EA ========================== diff --git a/lines.txt b/lines.txt new file mode 100644 index 0000000..dc54cae --- /dev/null +++ b/lines.txt @@ -0,0 +1,12 @@ +gcenter +a b c = triangle a b c; d = midpoint d b c; e = midpoint e c a; f = midpoint f a b; g = on_line g b e, on_line g c f ? coll a g d +hcenter +a b c = triangle a b c; d = foot d a b c; e = foot e b c a; f = foot f c a b; g = on_line g b e, on_line g c f ? coll a g d +icenter +a b c = triangle a b c; d = angle_bisector d a b c, angle_bisector d a c b ? eqangle a b a d a d a c +ocenter +a b c = triangle a b c; d = on_bline d a b, on_bline d a c ? cong d b d c +radical_axis +a b = segment a b; o1 = on_bline o1 a b; o2 = on_bline o2 a b; o3 = free; c = on_circle c o1 a; d = on_circle d o1 a, on_circle d o3 c; e = on_circle e o2 a, on_circle e o3 c; f = on_circle f o2 a, on_circle f o3 c; g = on_line g c d, on_line g e f ? coll g a b +radical_axis2 +a b c = triangle a b c; e = free; o1 = circle o1 a b c; o2 = circle o2 a b e; o3 = on_bline o3 c e; d = on_circle d o1 a, on_circle d o3 c; f = on_circle f o2 a, on_circle f o3 c; g = on_line g c d, on_line g e f ? coll g a b \ No newline at end of file diff --git a/nothing.txt b/nothing.txt new file mode 100644 index 0000000..8c2996b --- /dev/null +++ b/nothing.txt @@ -0,0 +1,180 @@ +['d', 'f', 'b', 'a'] +['d', 'f', 'b', 'g'] +['d', 'f', 'b', 'c'] +['d', 'f', 'a', 'b'] +['d', 'f', 'a', 'g'] +['d', 'f', 'a', 'c'] +['d', 'f', 'g', 'b'] +['d', 'f', 'g', 'a'] +['d', 'f', 'g', 'c'] +['d', 'f', 'c', 'b'] +['d', 'f', 'c', 'a'] +['d', 'f', 'c', 'g'] +['d', 'b', 'f', 'a'] +['d', 'b', 'f', 'g'] +['d', 'b', 'f', 'c'] +['d', 'b', 'a', 'f'] +['d', 'b', 'a', 'g'] +['d', 'b', 'a', 'c'] +['d', 'b', 'g', 'f'] +['d', 'b', 'g', 'a'] +['d', 'b', 'g', 'c'] +['d', 'b', 'c', 'f'] +['d', 'b', 'c', 'a'] +['d', 'b', 'c', 'g'] +['d', 'a', 'f', 'b'] +['d', 'a', 'f', 'g'] +['d', 'a', 'f', 'c'] +['d', 'a', 'b', 'f'] +['d', 'a', 'b', 'g'] +['d', 'a', 'b', 'c'] +['d', 'a', 'g', 'f'] +['d', 'a', 'g', 'b'] +['d', 'a', 'g', 'c'] +['d', 'a', 'c', 'f'] +['d', 'a', 'c', 'b'] +['d', 'a', 'c', 'g'] +['d', 'g', 'f', 'b'] +['d', 'g', 'f', 'a'] +['d', 'g', 'f', 'c'] +['d', 'g', 'b', 'f'] +['d', 'g', 'b', 'a'] +['d', 'g', 'b', 'c'] +['d', 'g', 'a', 'f'] +['d', 'g', 'a', 'b'] +['d', 'g', 'a', 'c'] +['d', 'g', 'c', 'f'] +['d', 'g', 'c', 'b'] +['d', 'g', 'c', 'a'] +['d', 'c', 'f', 'b'] +['d', 'c', 'f', 'a'] +['d', 'c', 'f', 'g'] +['d', 'c', 'b', 'f'] +['d', 'c', 'b', 'a'] +['d', 'c', 'b', 'g'] +['d', 'c', 'a', 'f'] +['d', 'c', 'a', 'b'] +['d', 'c', 'a', 'g'] +['d', 'c', 'g', 'f'] +['d', 'c', 'g', 'b'] +['d', 'c', 'g', 'a'] +['d', 'f', 'b', 'a'] +['d', 'f', 'b', 'g'] +['d', 'f', 'b', 'c'] +['d', 'f', 'a', 'b'] +['d', 'f', 'a', 'g'] +['d', 'f', 'a', 'c'] +['d', 'f', 'g', 'b'] +['d', 'f', 'g', 'a'] +['d', 'f', 'g', 'c'] +['d', 'f', 'c', 'b'] +['d', 'f', 'c', 'a'] +['d', 'f', 'c', 'g'] +['d', 'b', 'f', 'a'] +['d', 'b', 'f', 'g'] +['d', 'b', 'f', 'c'] +['d', 'b', 'a', 'f'] +['d', 'b', 'a', 'g'] +['d', 'b', 'a', 'c'] +['d', 'b', 'g', 'f'] +['d', 'b', 'g', 'a'] +['d', 'b', 'g', 'c'] +['d', 'b', 'c', 'f'] +['d', 'b', 'c', 'a'] +['d', 'b', 'c', 'g'] +['d', 'a', 'f', 'b'] +['d', 'a', 'f', 'g'] +['d', 'a', 'f', 'c'] +['d', 'a', 'b', 'f'] +['d', 'a', 'b', 'g'] +['d', 'a', 'b', 'c'] +['d', 'a', 'g', 'f'] +['d', 'a', 'g', 'b'] +['d', 'a', 'g', 'c'] +['d', 'a', 'c', 'f'] +['d', 'a', 'c', 'b'] +['d', 'a', 'c', 'g'] +['d', 'g', 'f', 'b'] +['d', 'g', 'f', 'a'] +['d', 'g', 'f', 'c'] +['d', 'g', 'b', 'f'] +['d', 'g', 'b', 'a'] +['d', 'g', 'b', 'c'] +['d', 'g', 'a', 'f'] +['d', 'g', 'a', 'b'] +['d', 'g', 'a', 'c'] +['d', 'g', 'c', 'f'] +['d', 'g', 'c', 'b'] +['d', 'g', 'c', 'a'] +['d', 'c', 'f', 'b'] +['d', 'c', 'f', 'a'] +['d', 'c', 'f', 'g'] +['d', 'c', 'b', 'f'] +['d', 'c', 'b', 'a'] +['d', 'c', 'b', 'g'] +['d', 'c', 'a', 'f'] +['d', 'c', 'a', 'b'] +['d', 'c', 'a', 'g'] +['d', 'c', 'g', 'f'] +['d', 'c', 'g', 'b'] +['d', 'c', 'g', 'a'] +['d', 'f', 'b', 'a'] +['d', 'f', 'b', 'g'] +['d', 'f', 'b', 'c'] +['d', 'f', 'a', 'b'] +['d', 'f', 'a', 'g'] +['d', 'f', 'a', 'c'] +['d', 'f', 'g', 'b'] +['d', 'f', 'g', 'a'] +['d', 'f', 'g', 'c'] +['d', 'f', 'c', 'b'] +['d', 'f', 'c', 'a'] +['d', 'f', 'c', 'g'] +['d', 'b', 'f', 'a'] +['d', 'b', 'f', 'g'] +['d', 'b', 'f', 'c'] +['d', 'b', 'a', 'f'] +['d', 'b', 'a', 'g'] +['d', 'b', 'a', 'c'] +['d', 'b', 'g', 'f'] +['d', 'b', 'g', 'a'] +['d', 'b', 'g', 'c'] +['d', 'b', 'c', 'f'] +['d', 'b', 'c', 'a'] +['d', 'b', 'c', 'g'] +['d', 'a', 'f', 'b'] +['d', 'a', 'f', 'g'] +['d', 'a', 'f', 'c'] +['d', 'a', 'b', 'f'] +['d', 'a', 'b', 'g'] +['d', 'a', 'b', 'c'] +['d', 'a', 'g', 'f'] +['d', 'a', 'g', 'b'] +['d', 'a', 'g', 'c'] +['d', 'a', 'c', 'f'] +['d', 'a', 'c', 'b'] +['d', 'a', 'c', 'g'] +['d', 'g', 'f', 'b'] +['d', 'g', 'f', 'a'] +['d', 'g', 'f', 'c'] +['d', 'g', 'b', 'f'] +['d', 'g', 'b', 'a'] +['d', 'g', 'b', 'c'] +['d', 'g', 'a', 'f'] +['d', 'g', 'a', 'b'] +['d', 'g', 'a', 'c'] +['d', 'g', 'c', 'f'] +['d', 'g', 'c', 'b'] +['d', 'g', 'c', 'a'] +['d', 'c', 'f', 'b'] +['d', 'c', 'f', 'a'] +['d', 'c', 'f', 'g'] +['d', 'c', 'b', 'f'] +['d', 'c', 'b', 'a'] +['d', 'c', 'b', 'g'] +['d', 'c', 'a', 'f'] +['d', 'c', 'a', 'b'] +['d', 'c', 'a', 'g'] +['d', 'c', 'g', 'f'] +['d', 'c', 'g', 'b'] +['d', 'c', 'g', 'a'] diff --git a/output_new/example6_1.txt b/output_new/example6_1.txt new file mode 100644 index 0000000..334a516 --- /dev/null +++ b/output_new/example6_1.txt @@ -0,0 +1,36 @@ + +========================== + * From theorem premises: +A B C D E F G H I J K L : Points +DA = DB [00] +DB = DC [01] +DF = DA [02] +E,F,A are collinear [03] +DG = DB [04] +G,E,B are collinear [05] +DH = DC [06] +E,H,C are collinear [07] +DI = DA [08] +J,F,I are collinear [09] +B,J,C are collinear [10] +K,A,C are collinear [11] +I,L,H are collinear [12] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. DA = DB [00] & DF = DA [02] & DB = DC [01] & DG = DB [04] ⇒ G,B,F,A are concyclic [13] +002. DF = DA [02] & DI = DA [08] & DB = DC [01] & DA = DB [00] ⇒ F,I,A,C are concyclic [14] +003. F,I,A,C are concyclic [14] & DA = DB [00] & DF = DA [02] & DB = DC [01] & DG = DB [04] & G,B,F,A are concyclic [13] ⇒ G,B,I,C are concyclic [15] +004. G,B,F,A are concyclic [13] & G,B,I,C are concyclic [15] & I,C,F,A are concyclic [14] & G,E,B are collinear [05] & E,F,A are collinear [03] ⇒ E,I,C are collinear [16] +005. DF = DA [02] & DA = DB [00] & DB = DC [01] & DH = DC [06] & DG = DB [04] & G,B,F,A are concyclic [13] ⇒ G,B,C,H are concyclic [17] +006. F,I,A,C are concyclic [14] & DA = DB [00] & DF = DA [02] & DB = DC [01] & DG = DB [04] & G,B,F,A are concyclic [13] ⇒ G,B,I,F are concyclic [18] +007. F,I,A,C are concyclic [14] & DA = DB [00] & DF = DA [02] & DB = DC [01] & DH = DC [06] ⇒ F,I,A,H are concyclic [19] +008. F,I,A,C are concyclic [14] & DA = DB [00] & DF = DA [02] & DB = DC [01] & F,I,A,H are concyclic [19] ⇒ I,C,H,F are concyclic [20] +009. G,B,C,H are concyclic [17] & G,B,I,F are concyclic [18] & I,C,H,F are concyclic [20] & G,E,B are collinear [05] & E,H,C are collinear [07] ⇒ E,F,I are collinear [21] +010. F,I,A,C are concyclic [14] & DA = DB [00] & DF = DA [02] & DB = DC [01] & DG = DB [04] & G,B,F,A are concyclic [13] & F,I,A,H are concyclic [19] ⇒ G,B,I,H are concyclic [22] +011. G,B,F,A are concyclic [13] & G,B,I,H are concyclic [22] & I,H,F,A are concyclic [19] & G,E,B are collinear [05] & E,F,A are collinear [03] ⇒ E,I,H are collinear [23] +012. K,A,C are collinear [11] & E,I,C are collinear [16] & E,F,I are collinear [21] & J,F,I are collinear [09] & E,F,A are collinear [03] & E,I,H are collinear [23] & B,J,C are collinear [10] & I,L,H are collinear [12] ⇒ J,K,L are collinear +========================== diff --git a/output_new/example7_1.txt b/output_new/example7_1.txt new file mode 100644 index 0000000..3910c8e --- /dev/null +++ b/output_new/example7_1.txt @@ -0,0 +1,36 @@ + +========================== + * From theorem premises: +A B C D E F G H I J : Points +∠CAB = ∠ABC [00] +A,D,C are collinear [01] +ED ∥ AB [02] +E,B,C are collinear [03] +E,F,B are collinear [04] +BE = BF [05] +A,G,B are collinear [06] +G,F,D are collinear [07] +HA = HD [08] +HD = HG [09] +IF = IG [10] +IB = IF [11] +IJ = IG [12] +HJ = HG [13] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. A,G,B are collinear [06] & DE ∥ AB [02] ⇒ ED ∥ BG [14] +002. ED ∥ BG [14] & F,E,B are collinear [04] & G,F,D are collinear [07] ⇒ BF:BE = GF:GD [15] +003. BF:BE = GF:GD [15] & BE = BF [05] ⇒ GF = GD [16] +004. IF = IG [10] & IJ = IG [12] & IB = IF [11] ⇒ G,J,F,B are concyclic [17] +005. G,J,F,B are concyclic [17] ⇒ ∠GJF = ∠GBF [18] +006. HA = HD [08] & HD = HG [09] & HJ = HG [13] ⇒ J,A,G,D are concyclic [19] +007. J,A,G,D are concyclic [19] ⇒ ∠JGA = ∠JDA [20] +008. ∠GJF = ∠GBF [18] & A,G,B are collinear [06] & E,F,B are collinear [04] & E,B,C are collinear [03] & ∠CAB = ∠ABC [00] & ∠JGA = ∠JDA [20] & A,D,C are collinear [01] ⇒ ∠DJG = ∠GJF [21] +009. ∠DJG = ∠GJF [21] & G,F,D are collinear [07] ⇒ GF:GD = JF:JD [22] +010. GF:GD = JF:JD [22] & GF = GD [16] ⇒ JF = JD [23] +011. GF = GD [16] & JF = JD [23] ⇒ DF ⟂ GJ +========================== diff --git a/output_new/example7_2.txt b/output_new/example7_2.txt new file mode 100644 index 0000000..0810f1a --- /dev/null +++ b/output_new/example7_2.txt @@ -0,0 +1,41 @@ + +========================== + * From theorem premises: +A B C D E F G H : Points +∠CAB = ∠ABC [00] +CA = CB [01] +∠CBD = ∠DBA [02] +∠ACD = ∠DCB [03] +EA = ED [04] +EF = EA [05] +CF = CA [06] +∠ADF = ∠ADF [07] +EG = EA [08] +DG = DA [09] +A,G,H are collinear [10] +F,D,H are collinear [11] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. EF = EA [05] & EG = EA [08] & EA = ED [04] ⇒ A,D,G,F are concyclic [12] +002. A,D,G,F are concyclic [12] ⇒ ∠AGD = ∠AFD [13] +003. CF = CA [06] ⇒ ∠CFA = ∠FAC [14] +004. CA = CB [01] & CF = CA [06] ⇒ CF = CB [15] +005. CF = CB [15] ⇒ ∠CFB = ∠FBC [16] +006. DG = DA [09] ⇒ ∠DAG = ∠AGD [17] +007. CA = CB [01] & ∠ACD = ∠DCB [03] (SAS)⇒ ∠CAD = ∠DBC [18] +008. CA = CB [01] & ∠ACD = ∠DCB [03] (SAS)⇒ DA = DB [19] +009. A,G,H are collinear [10] & ∠DAG = ∠AGD [17] & ∠AGD = ∠AFD [13] ⇒ ∠AFD = ∠DAH [20] +010. F,D,H are collinear [11] & ∠ADF = ∠ADF [07] ⇒ ∠ADF = ∠ADH [21] +011. ∠AFD = ∠DAH [20] & ∠ADF = ∠ADH [21] (Similar Triangles)⇒ AD:FD = DH:AD [22] +012. DH:AD = AD:FD [22] & BD = AD [19] ⇒ DH:DB = DB:DF [23] +013. F,D,H are collinear [11] ⇒ ∠HDB = ∠FDB [24] +014. DH:DB = DB:DF [23] & ∠HDB = ∠FDB [24] (Similar Triangles)⇒ ∠DHB = ∠FBD [25] +015. ∠DHB = ∠FBD [25] & F,D,H are collinear [11] ⇒ ∠(DF-BH) = ∠FBD [26] +016. ∠CAB = ∠ABC [00] & ∠CBD = ∠DBA [02] & ∠AGD = ∠AFD [13] & ∠CFA = ∠FAC [14] & ∠CFB = ∠FBC [16] & ∠DAG = ∠AGD [17] & ∠CAD = ∠DBC [18] & ∠(DF-BH) = ∠FBD [26] (Angle chase)⇒ ∠(BH-AG) = 1_PI/2 [27] +017. ∠CAB = ∠ABC [00] & ∠CBD = ∠DBA [02] & ∠AGD = ∠AFD [13] & ∠CFA = ∠FAC [14] & ∠CFB = ∠FBC [16] & ∠DAG = ∠AGD [17] & ∠CAD = ∠DBC [18] & ∠(DF-BH) = ∠FBD [26] (Angle chase)⇒ ∠(AG-BH) = 1_PI/2 [28] +018. A,G,H are collinear [10] & ∠(BH-AG) = 1_PI/2 [27] & ∠(AG-BH) = 1_PI/2 [28] ⇒ AH ⟂ BH +========================== diff --git a/output_new/example7_7_1.txt b/output_new/example7_7_1.txt new file mode 100644 index 0000000..b80cccf --- /dev/null +++ b/output_new/example7_7_1.txt @@ -0,0 +1,34 @@ + +========================== + * From theorem premises: +A B C D E F G H I : Points +BA ⟂ DB [00] +CE = CA [01] +DE = DB [02] +CF = CA [03] +DF = DB [04] +EG ⟂ CE [05] +DG = DB [06] +A,E,H are collinear [07] +H,B,G are collinear [08] +IE = IF [09] +IF = IH [10] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. IE = IF [09] & IF = IH [10] ⇒ I is the circumcenter of \Delta EFH [11] +002. CF = CA [03] & CE = CA [01] ⇒ C is the circumcenter of \Delta EFA [12] +003. C is the circumcenter of \Delta EFA [12] & EG ⟂ CE [05] ⇒ ∠GEF = ∠EAF [13] +004. DF = DB [04] & DG = DB [06] & DE = DB [02] ⇒ E,B,G,F are concyclic [14] +005. E,B,G,F are concyclic [14] ⇒ ∠GEF = ∠GBF [15] +006. H,B,G are collinear [08] & A,E,H are collinear [07] & ∠GEF = ∠EAF [13] & ∠GEF = ∠GBF [15] ⇒ ∠HBF = ∠HAF [16] +007. ∠HBF = ∠HAF [16] ⇒ H,A,B,F are concyclic [17] +008. H,A,B,F are concyclic [17] ⇒ ∠HAB = ∠HFB [18] +009. DE = DB [02] & DF = DB [04] ⇒ D is the circumcenter of \Delta BEF [19] +010. D is the circumcenter of \Delta BEF [19] & DB ⟂ BA [00] ⇒ ∠ABF = ∠BEF [20] +011. A,H,E are collinear [07] & ∠HAB = ∠HFB [18] & ∠ABF = ∠BEF [20] ⇒ ∠BEF = ∠EHF [21] +012. I is the circumcenter of \Delta EFH [11] & ∠BEF = ∠EHF [21] ⇒ EI ⟂ BE +========================== diff --git a/output_new/example7_7_2.txt b/output_new/example7_7_2.txt new file mode 100644 index 0000000..7b369c5 --- /dev/null +++ b/output_new/example7_7_2.txt @@ -0,0 +1,34 @@ + +========================== + * From theorem premises: +A B C D E F G H I : Points +AC ⟂ AB [00] +CE = CA [01] +DE = DB [02] +CF = CA [03] +DF = DB [04] +EG ⟂ CE [05] +DG = DB [06] +H,G,B are collinear [07] +H,E,A are collinear [08] +IE = IF [09] +IF = IH [10] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. IE = IF [09] & IF = IH [10] ⇒ I is the circumcenter of \Delta EFH [11] +002. CE = CA [01] & CF = CA [03] ⇒ C is the circumcenter of \Delta AEF [12] +003. C is the circumcenter of \Delta AEF [12] & EG ⟂ CE [05] ⇒ ∠GEF = ∠EAF [13] +004. DF = DB [04] & DG = DB [06] & DE = DB [02] ⇒ E,G,F,B are concyclic [14] +005. E,G,F,B are concyclic [14] ⇒ ∠GEF = ∠GBF [15] +006. G,H,B are collinear [07] & H,A,E are collinear [08] & ∠GEF = ∠EAF [13] & ∠GEF = ∠GBF [15] ⇒ ∠HBF = ∠HAF [16] +007. ∠HBF = ∠HAF [16] ⇒ H,A,F,B are concyclic [17] +008. H,A,F,B are concyclic [17] ⇒ ∠HFA = ∠HBA [18] +009. C is the circumcenter of \Delta AEF [12] & AC ⟂ AB [00] ⇒ ∠FAB = ∠FEA [19] +010. E,H,A are collinear [08] & G,H,B are collinear [07] & ∠HFA = ∠HBA [18] & ∠FAB = ∠FEA [19] ⇒ ∠FEH = ∠FHG [20] +011. I is the circumcenter of \Delta EFH [11] & ∠FEH = ∠FHG [20] ⇒ IH ⟂ HG [21] +012. G,H,B are collinear [07] & IH ⟂ HG [21] ⇒ BH ⟂ HI +========================== diff --git a/output_new/exercise7_1.txt b/output_new/exercise7_1.txt new file mode 100644 index 0000000..8e91573 --- /dev/null +++ b/output_new/exercise7_1.txt @@ -0,0 +1,75 @@ + +========================== + * From theorem premises: +A B C D E F G H I : Points +CA = CB [00] +DA = DB [01] +∠DAB = ∠ABD [02] +CE = CA [03] +B,E,F are collinear [04] +DF = DA [05] +A,G,F are collinear [06] +CG = CA [07] +DH = DA [08] +A,E,H are collinear [09] +IA = IG [10] +IG = IH [11] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. DA = DB [01] & DF = DA [05] ⇒ DF = DB [12] +002. DF = DB [12] ⇒ ∠DFB = ∠FBD [13] +003. ∠DFB = ∠FBD [13] & B,E,F are collinear [04] ⇒ ∠(DF-BE) = ∠EBD [14] +004. CG = CA [07] & IA = IG [10] ⇒ GA ⟂ CI [15] +005. CA = CB [00] & CG = CA [07] & CE = CA [03] ⇒ A,G,B,E are concyclic [16] +006. A,G,B,E are concyclic [16] ⇒ ∠ABG = ∠AEG [17] +007. A,G,B,E are concyclic [16] ⇒ ∠AGB = ∠AEB [18] +008. A,G,B,E are concyclic [16] ⇒ ∠AGE = ∠ABE [19] +009. ∠AGB = ∠AEB [18] & A,G,F are collinear [06] ⇒ ∠(AF-BG) = ∠AEB [20] +010. DF = DA [05] ⇒ ∠DFA = ∠FAD [21] +011. ∠DAB = ∠ABD [02] & ∠ABG = ∠AEG [17] & ∠(AF-BG) = ∠AEB [20] & ∠DFA = ∠FAD [21] & ∠(DF-BE) = ∠EBD [14] (Angle chase)⇒ EG ⟂ DF [22] +012. A,G,F are collinear [06] & GA ⟂ CI [15] & EG ⟂ DF [22] ⇒ ∠(GE-DF) = ∠(CI-AG) [23] +013. CA = CB [00] & DA = DB [01] ⇒ AB ⟂ CD [24] +014. CA = CB [00] & DA = DB [01] (SSS)⇒ ∠(BC-AD) = ∠(BD-AC) [25] +015. A,G,F are collinear [06] & AB ⟂ CD [24] & GA ⟂ CI [15] ⇒ ∠(CI-AG) = ∠(CD-AB) [26] +016. ∠(CI-AG) = ∠(CD-AB) [26] & ∠AGE = ∠ABE [19] ⇒ ∠ICD = ∠GEB [27] +017. ∠(GE-DF) = ∠(CI-AG) [23] & ∠ICD = ∠GEB [27] ⇒ ∠(AG-CD) = ∠(DF-BE) [28] +018. A,G,F are collinear [06] & ∠(DF-BE) = ∠EBD [14] & ∠(AG-CD) = ∠(DF-BE) [28] ⇒ ∠(AG-CD) = ∠EBD [29] +019. A,G,F are collinear [06] & ∠DFA = ∠FAD [21] ⇒ ∠(DF-AG) = ∠GAD [30] +020. ∠(GE-DF) = ∠(CI-AG) [23] & ∠(DF-AG) = ∠GAD [30] ⇒ ∠EGA = ∠(CI-AD) [31] +021. DF = DA [05] & DH = DA [08] & DA = DB [01] ⇒ A,B,H,F are concyclic [32] +022. A,B,H,F are concyclic [32] ⇒ ∠ABF = ∠AHF [33] +023. A,B,H,F are concyclic [32] ⇒ ∠AHB = ∠AFB [34] +024. A,B,H,F are concyclic [32] ⇒ ∠ABH = ∠AFH [35] +025. ∠ABF = ∠AHF [33] & B,E,F are collinear [04] & A,E,H are collinear [09] ⇒ ∠BAE = ∠(BE-FH) [36] +026. A,G,F are collinear [06] & ∠AGE = ∠ABE [19] ⇒ ∠GEB = ∠GAB [37] +027. ∠BAE = ∠(BE-FH) [36] & ∠GEB = ∠GAB [37] ⇒ ∠(FH-GE) = ∠EAG [38] +028. IA = IG [10] & IG = IH [11] ⇒ IH = IA [39] +029. DH = DA [08] & IH = IA [39] ⇒ AH ⟂ DI [40] +030. ∠AHB = ∠AFB [34] & A,E,H are collinear [09] & B,E,F are collinear [04] ⇒ ∠(AE-BH) = ∠(AF-BE) [41] +031. CG = CA [07] & CA = CB [00] ⇒ CB = CG [42] +032. CB = CG [42] ⇒ ∠CBG = ∠BGC [43] +033. CE = CA [03] & CA = CB [00] ⇒ CB = CE [44] +034. CB = CE [44] ⇒ ∠CBE = ∠BEC [45] +035. CE = CA [03] & CG = CA [07] ⇒ CG = CE [46] +036. CG = CE [46] ⇒ ∠CGE = ∠GEC [47] +037. ∠ABG = ∠AEG [17] & ∠(AE-BH) = ∠(AF-BE) [41] & ∠ABH = ∠AFH [35] & ∠CBG = ∠BGC [43] & ∠CBE = ∠BEC [45] & ∠CGE = ∠GEC [47] (Angle chase)⇒ FH ⟂ CE [48] +038. AH ⟂ DI [40] & A,E,H are collinear [09] & FH ⟂ CE [48] ⇒ ∠(FH-CE) = ∠(DI-AE) [49] +039. CE = CA [03] ⇒ ∠CEA = ∠EAC [50] +040. ∠(FH-CE) = ∠(DI-AE) [49] & ∠CEA = ∠EAC [50] ⇒ ∠(FH-AE) = ∠(DI-AC) [51] +041. ∠EGA = ∠(CI-AD) [31] & A,G,F are collinear [06] & ∠(FH-GE) = ∠EAG [38] & ∠(FH-AE) = ∠(DI-AC) [51] ⇒ ∠(DI-AC) = ∠(CI-AD) [52] +042. ∠(BC-AD) = ∠(BD-AC) [25] & ∠(DI-AC) = ∠(CI-AD) [52] ⇒ ∠CBD = ∠CID [53] +043. ∠CBD = ∠CID [53] ⇒ C,B,D,I are concyclic [54] +044. C,B,D,I are concyclic [54] ⇒ ∠DCI = ∠DBI [55] +045. C,B,D,I are concyclic [54] ⇒ ∠CDB = ∠CIB [56] +046. ∠(AG-CD) = ∠EBD [29] & ∠DCI = ∠DBI [55] ⇒ ∠(AG-CI) = ∠EBI [57] +047. A,G,F are collinear [06] & GA ⟂ CI [15] ⇒ ∠(AG-CI) = ∠(CI-AG) [58] +048. A,G,F are collinear [06] & ∠(AG-CD) = ∠(DF-BE) [28] ⇒ ∠(CD-BE) = ∠(AG-DF) [59] +049. ∠(CD-BE) = ∠(AG-DF) [59] & ∠(DF-BE) = ∠EBD [14] ⇒ ∠(AG-BE) = ∠CDB [60] +050. A,G,F are collinear [06] & ∠(AG-BE) = ∠CDB [60] & ∠CDB = ∠CIB [56] ⇒ ∠CIB = ∠(AG-BE) [61] +051. ∠(AG-CI) = ∠(CI-AG) [58] & ∠CIB = ∠(AG-BE) [61] ⇒ ∠(AG-BI) = ∠(CI-BE) [62] +052. F,E,B are collinear [04] & ∠(AG-CI) = ∠EBI [57] & A,G,F are collinear [06] & ∠(AG-BI) = ∠(CI-BE) [62] ⇒ IB ⟂ EF +========================== diff --git a/output_new/exercise7_13.txt b/output_new/exercise7_13.txt new file mode 100644 index 0000000..921f695 --- /dev/null +++ b/output_new/exercise7_13.txt @@ -0,0 +1,54 @@ + +========================== + * From theorem premises: +A B C D E F G H I J K L : Points +C,B,D are collinear [00] +AD ⟂ BC [01] +C,E,A are collinear [02] +BE ⟂ AC [03] +B,F,A are collinear [04] +FA = FB [05] +GA = GB [06] +GB = GC [07] +GH = GA [08] +E,H,D are collinear [09] +E,I,D are collinear [10] +∠DFI = ∠DFI [11] +GI = GA [12] +JF = JD [13] +JD = JE [14] +K,I,F are collinear [15] +JK = JF [16] +H,F,L are collinear [17] +JL = JF [18] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. C,B,D are collinear [00] & AD ⟂ BC [01] ⇒ AD ⟂ DB [19] +002. B,F,A are collinear [04] & FA = FB [05] ⇒ F is midpoint of BA [20] +003. AD ⟂ DB [19] & F is midpoint of BA [20] ⇒ AF = DF [21] +004. C,E,A are collinear [02] & AC ⟂ BE [03] ⇒ AE ⟂ EB [22] +005. AE ⟂ EB [22] & F is midpoint of BA [20] ⇒ AF = EF [23] +006. AF = DF [21] & AF = EF [23] ⇒ FE = FD [24] +007. FE = FD [24] ⇒ ∠DEF = ∠FDE [25] +008. JF = JD [13] & JK = JF [16] & JD = JE [14] ⇒ K,E,F,D are concyclic [26] +009. K,E,F,D are concyclic [26] ⇒ ∠KFE = ∠KDE [27] +010. K,I,F are collinear [15] & E,I,D are collinear [10] & ∠DEF = ∠FDE [25] & ∠KFE = ∠KDE [27] ⇒ ∠DKF = ∠FDI [28] +011. K,I,F are collinear [15] & ∠DFI = ∠DFI [11] ⇒ ∠DFK = ∠DFI [29] +012. ∠DKF = ∠FDI [28] & ∠DFK = ∠DFI [29] (Similar Triangles)⇒ FD:FK = FI:FD [30] +013. FD:FK = FI:FD [30] & EF = DF [24] & AF = DF [21] & FA = FB [05] & FA = EF [23] ⇒ FB:FI = FK:FA [31] +014. K,I,F are collinear [15] & B,F,A are collinear [04] & FB:FI = FK:FA [31] ⇒ K,B,I,A are concyclic [32] +015. JF = JD [13] & JL = JF [18] & JD = JE [14] ⇒ E,F,D,L are concyclic [33] +016. E,F,D,L are concyclic [33] ⇒ ∠LFD = ∠LED [34] +017. E,H,D are collinear [09] & ∠DEF = ∠FDE [25] & ∠LFD = ∠LED [34] & H,F,L are collinear [17] ⇒ ∠(HF-EL) = ∠HEF [35] +018. E,D,F,L are concyclic [33] & K,E,F,D are concyclic [26] ⇒ L,K,F,E are concyclic [36] +019. L,K,F,E are concyclic [36] ⇒ ∠LKF = ∠LEF [37] +020. K,I,F are collinear [15] & ∠LKF = ∠LEF [37] ⇒ ∠ELK = ∠(EF-KI) [38] +021. ∠(HF-EL) = ∠HEF [35] & ∠ELK = ∠(EF-KI) [38] ⇒ ∠(HF-KL) = ∠(EH-KI) [39] +022. H,F,L are collinear [17] & E,I,D are collinear [10] & E,H,D are collinear [09] & K,I,F are collinear [15] & ∠(HF-KL) = ∠(EH-KI) [39] ⇒ ∠LHI = ∠LKI [40] +023. ∠LHI = ∠LKI [40] ⇒ K,H,I,L are concyclic [41] +024. K,B,I,A are concyclic [32] & GA = GB [06] & GI = GA [12] & GB = GC [07] & GH = GA [08] & K,H,I,L are concyclic [41] ⇒ A,K,L,B are concyclic +========================== diff --git a/output_new/exercise7_4.txt b/output_new/exercise7_4.txt new file mode 100644 index 0000000..92dd3f3 --- /dev/null +++ b/output_new/exercise7_4.txt @@ -0,0 +1,100 @@ + +========================== + * From theorem premises: +A B C D E F G H I J K L : Points +DA = DB [00] +DB = DC [01] +ED = EB [02] +EB = EC [03] +EF = ED [04] +GA = GB [05] +GB = GF [06] +HA = HC [07] +HC = HF [08] +GI = GA [09] +A,C,I are collinear [10] +HJ = HA [11] +A,B,J are collinear [12] +B,I,K are collinear [13] +C,K,J are collinear [14] +B,L,C are collinear [15] +A,K,L are collinear [16] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. HA = HC [07] & HJ = HA [11] & HC = HF [08] ⇒ A,F,C,J are concyclic [17] +002. A,F,C,J are concyclic [17] ⇒ ∠FAC = ∠FJC [18] +003. A,F,C,J are concyclic [17] ⇒ ∠ACF = ∠AJF [19] +004. A,F,C,J are concyclic [17] ⇒ ∠AFC = ∠AJC [20] +005. A,F,C,J are concyclic [17] ⇒ ∠AFJ = ∠ACJ [21] +006. ED = EB [02] & EF = ED [04] & EB = EC [03] ⇒ F,D,B,C are concyclic [22] +007. F,D,B,C are concyclic [22] ⇒ ∠FDB = ∠FCB [23] +008. F,D,B,C are concyclic [22] ⇒ ∠FBD = ∠FCD [24] +009. F,D,B,C are concyclic [22] ⇒ ∠CFD = ∠CBD [25] +010. F,D,B,C are concyclic [22] ⇒ ∠DFB = ∠DCB [26] +011. ∠ACF = ∠AJF [19] & A,B,J are collinear [12] ⇒ ∠ACF = ∠(AB-FJ) [27] +012. DA = DB [00] ⇒ ∠DAB = ∠ABD [28] +013. DB = DC [01] & DA = DB [00] ⇒ DA = DC [29] +014. DA = DC [29] ⇒ ∠DAC = ∠ACD [30] +015. DB = DC [01] ⇒ ∠DBC = ∠BCD [31] +016. ∠FDB = ∠FCB [23] & ∠ACF = ∠(AB-FJ) [27] & ∠DAB = ∠ABD [28] & ∠DAC = ∠ACD [30] & ∠DBC = ∠BCD [31] (Angle chase)⇒ DF ⟂ FJ [32] +017. GA = GB [05] & GI = GA [09] & GB = GF [06] ⇒ A,F,B,I are concyclic [33] +018. GA = GB [05] & GI = GA [09] & GB = GF [06] ⇒ GI = GF [34] +019. A,F,B,I are concyclic [33] ⇒ ∠ABF = ∠AIF [35] +020. A,F,B,I are concyclic [33] ⇒ ∠FAB = ∠FIB [36] +021. A,F,B,I are concyclic [33] ⇒ ∠AFB = ∠AIB [37] +022. ∠ABF = ∠AIF [35] & A,C,I are collinear [10] ⇒ ∠ABF = ∠(AC-FI) [38] +023. ∠ABF = ∠AIF [35] & A,C,I are collinear [10] ⇒ ∠BAC = ∠BFI [39] +024. ∠FBD = ∠FCD [24] & ∠FDB = ∠FCB [23] & ∠ABF = ∠(AC-FI) [38] & ∠DAB = ∠ABD [28] & ∠DAC = ∠ACD [30] & ∠DBC = ∠BCD [31] (Angle chase)⇒ DF ⟂ FI [40] +025. C,K,J are collinear [14] & ∠FJC = ∠FAC [18] & DF ⟂ FJ [32] & DF ⟂ FI [40] ⇒ ∠(FI-CK) = ∠FAC [41] +026. ∠(FI-CK) = ∠FAC [41] & ∠FAB = ∠FIB [36] ⇒ ∠(CK-BI) = ∠CAB [42] +027. I,K,B are collinear [13] & K,J,C are collinear [14] & ∠(CK-BI) = ∠CAB [42] ⇒ ∠BKC = ∠BAC [43] +028. ∠BKC = ∠BAC [43] ⇒ A,B,K,C are concyclic [44] +029. B,L,C are collinear [15] & ∠FCB = ∠FDB [23] ⇒ ∠(FC-BL) = ∠FDB [45] +030. ∠CFD = ∠CBD [25] & ∠CBD = ∠DCB [31] & ∠DFB = ∠DCB [26] ⇒ ∠DFB = ∠CFD [46] +031. ∠(FC-BL) = ∠FDB [45] & ∠DFB = ∠CFD [46] ⇒ ∠(BL-FD) = ∠DBF [47] +032. ∠AFB = ∠AIB [37] & A,C,I are collinear [10] ⇒ ∠AFB = ∠(AC-BI) [48] +033. ∠AFC = ∠AJC [20] & A,B,J are collinear [12] ⇒ ∠AFC = ∠(AB-CJ) [49] +034. GI = GA [09] & GA = GB [05] ⇒ GB = GI [50] +035. GB = GI [50] ⇒ ∠GBI = ∠BIG [51] +036. GB = GF [06] ⇒ ∠GBF = ∠BFG [52] +037. GI = GF [34] ⇒ ∠GIF = ∠IFG [53] +038. ∠FBD = ∠FCD [24] & ∠ABF = ∠(AC-FI) [38] & ∠AFB = ∠(AC-BI) [48] & ∠AFC = ∠(AB-CJ) [49] & ∠DAB = ∠ABD [28] & ∠DAC = ∠ACD [30] & ∠GBI = ∠BIG [51] & ∠GBF = ∠BFG [52] & ∠GIF = ∠IFG [53] (Angle chase)⇒ CJ ⟂ GI [54] +039. C,K,J are collinear [14] & DF ⟂ FI [40] & CJ ⟂ GI [54] ⇒ ∠(IG-CK) = ∠DFI [55] +040. C,K,J are collinear [14] & ∠ACJ = ∠AFJ [21] ⇒ ∠ACK = ∠AFJ [56] +041. ∠AFB = ∠(AC-BI) [48] & ∠ACK = ∠AFJ [56] ⇒ ∠(BI-CK) = ∠BFJ [57] +042. C,K,J are collinear [14] & ∠(BI-CK) = ∠BFJ [57] & DF ⟂ FJ [32] & DF ⟂ FI [40] ⇒ ∠(BI-CK) = ∠BFI [58] +043. ∠(IG-CK) = ∠DFI [55] & ∠(BI-CK) = ∠BFI [58] ⇒ ∠GIB = ∠DFB [59] +044. B,L,C are collinear [15] & ∠(BL-FD) = ∠DBF [47] & ∠GIB = ∠DFB [59] & ∠IBG = ∠GIB [51] ⇒ ∠IBG = ∠LBD [60] +045. DA = DB [00] & GA = GB [05] (SSS)⇒ ∠(AD-BG) = ∠(AG-BD) [61] +046. DA = DB [00] & GA = GB [05] ⇒ AB ⟂ DG [62] +047. ∠IBG = ∠LBD [60] & ∠(AD-BG) = ∠(AG-BD) [61] ⇒ ∠(BI-AD) = ∠(BL-AG) [63] +048. A,B,K,C are concyclic [44] ⇒ ∠AKB = ∠ACB [64] +049. ∠(BI-AD) = ∠(BL-AG) [63] & B,L,C are collinear [15] & ∠AKB = ∠ACB [64] & B,I,K are collinear [13] ⇒ ∠CAK = ∠GAD [65] +050. GI = GA [09] ⇒ ∠GIA = ∠IAG [66] +051. ∠GIA = ∠IAG [66] & A,C,I are collinear [10] ⇒ ∠(GI-AC) = ∠CAG [67] +052. DA = DC [29] & HA = HC [07] ⇒ AC ⟂ DH [68] +053. AC ⟂ DH [68] & DF ⟂ FI [40] ⇒ ∠DFI = ∠(AC-DH) [69] +054. EF = ED [04] & ED = EB [02] ⇒ EB = EF [70] +055. EB = EF [70] & GB = GF [06] ⇒ BF ⟂ EG [71] +056. BF ⟂ EG [71] & AB ⟂ DG [62] ⇒ ∠(DG-AB) = ∠(EG-FB) [72] +057. BF ⟂ EG [71] & AB ⟂ DG [62] ⇒ ∠DGE = ∠ABF [73] +058. ∠(DG-AB) = ∠(EG-FB) [72] & ∠BAC = ∠BFI [39] ⇒ ∠(DG-AC) = ∠(EG-FI) [74] +059. AB ⟂ DG [62] & AC ⟂ DH [68] ⇒ ∠(DG-AC) = ∠(AB-DH) [75] +060. ∠(DG-AC) = ∠(EG-FI) [74] & ∠(DG-AC) = ∠(AB-DH) [75] ⇒ ∠(AB-DH) = ∠(EG-FI) [76] +061. ∠DFI = ∠(AC-DH) [69] & ∠(AB-DH) = ∠(EG-FI) [76] ⇒ ∠(AC-DF) = ∠(AB-EG) [77] +062. C,K,J are collinear [14] & AB ⟂ DG [62] & CJ ⟂ GI [54] ⇒ ∠(IG-CK) = ∠(AB-DG) [78] +063. I,B,K are collinear [13] & K,J,C are collinear [14] & ∠FAC = ∠FJC [18] & ∠AFB = ∠AIB [37] & A,C,I are collinear [10] ⇒ ∠FBK = ∠FJK [79] +064. ∠FBK = ∠FJK [79] ⇒ F,B,K,J are concyclic [80] +065. F,B,K,J are concyclic [80] ⇒ ∠FBJ = ∠FKJ [81] +066. C,K,J are collinear [14] & ∠DGE = ∠ABF [73] & ∠FBJ = ∠FKJ [81] & A,B,J are collinear [12] ⇒ ∠CKF = ∠DGE [82] +067. ∠(IG-CK) = ∠(AB-DG) [78] & ∠CKF = ∠DGE [82] ⇒ ∠(GI-FK) = ∠(AB-EG) [83] +068. ∠(AC-DF) = ∠(AB-EG) [77] & ∠(GI-FK) = ∠(AB-EG) [83] ⇒ ∠(IG-FK) = ∠(AC-FD) [84] +069. ∠(GI-AC) = ∠CAG [67] & ∠(IG-FK) = ∠(AC-FD) [84] ⇒ ∠(AC-FK) = ∠(AG-DF) [85] +070. ∠CAK = ∠GAD [65] & ∠(AC-FK) = ∠(AG-DF) [85] ⇒ ∠KAD = ∠KFD [86] +071. ∠KAD = ∠KFD [86] ⇒ A,F,D,K are concyclic [87] +072. A,B,K,C are concyclic [44] & A,F,D,K are concyclic [87] & F,D,B,C are concyclic [22] & A,K,L are collinear [16] & B,L,C are collinear [15] ⇒ F,D,L are collinear +========================== diff --git a/output_new/exercise7_5.txt b/output_new/exercise7_5.txt new file mode 100644 index 0000000..9fbdf35 --- /dev/null +++ b/output_new/exercise7_5.txt @@ -0,0 +1,22 @@ + +========================== + * From theorem premises: +A B C D E J K L : Points +DB = DC [00] +DA = DB [01] +DE = DA [02] +DJ = DA [03] +DK = DA [04] +A,L,B are collinear [05] +L,E,C are collinear [06] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. DB = DC [00] & DA = DB [01] & DE = DA [02] ⇒ A,E,C,B are concyclic [07] +002. DA = DB [01] & DK = DA [04] & DB = DC [00] & DJ = DA [03] ⇒ B,J,A,K are concyclic [08] +003. DA = DB [01] & DK = DA [04] & DB = DC [00] & A,E,C,B are concyclic [07] & DJ = DA [03] ⇒ J,E,C,K are concyclic [09] +004. A,E,C,B are concyclic [07] & B,J,A,K are concyclic [08] & J,E,C,K are concyclic [09] & A,L,B are collinear [05] & L,E,C are collinear [06] ⇒ L,K,J are collinear +========================== diff --git a/output_old/example6_3.txt b/output_old/example6_3.txt new file mode 100644 index 0000000..6fda53a --- /dev/null +++ b/output_old/example6_3.txt @@ -0,0 +1,133 @@ + +========================== + * From theorem premises: +A B C D E F G H I J K L : Points +D,C,B are collinear [00] +AD ⟂ BC [01] +E,C,A are collinear [02] +BE ⟂ AC [03] +∠(AD-BE) = ∠(AD-BE) [04] +F,A,B are collinear [05] +CF ⟂ AB [06] +G,D,A are collinear [07] +G,E,B are collinear [08] +AE = AH [09] +DE = DH [10] +AF = AI [11] +DF = DI [12] +J,I,B are collinear [13] +J,C,H are collinear [14] +K,C,I are collinear [15] +H,K,B are collinear [16] +G,K,L are collinear [17] +J,A,L are collinear [18] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. AE = AH [09] & DE = DH [10] ⇒ AD ⟂ EH [19] +002. AE = AH [09] & DE = DH [10] (SSS)⇒ ∠ADE = ∠HDA [20] +003. AE = AH [09] & DE = DH [10] (SSS)⇒ ∠EAD = ∠DAH [21] +004. F,A,B are collinear [05] & C,D,B are collinear [00] & AD ⟂ BC [01] & CF ⟂ AB [06] ⇒ ∠AFC = ∠ADC [22] +005. ∠AFC = ∠ADC [22] ⇒ F,D,C,A are concyclic [23] +006. F,D,C,A are concyclic [23] ⇒ ∠FDC = ∠FAC [24] +007. F,D,C,A are concyclic [23] ⇒ ∠ADF = ∠ACF [25] +008. E,C,A are collinear [02] & D,C,B are collinear [00] & F,A,B are collinear [05] & ∠FDC = ∠FAC [24] ⇒ ∠ECD = ∠BFD [26] +009. AF = AI [11] & DF = DI [12] ⇒ AD ⟂ FI [27] +010. AF = AI [11] & DF = DI [12] (SSS)⇒ ∠ADF = ∠IDA [28] +011. AF = AI [11] & DF = DI [12] (SSS)⇒ ∠AFD = ∠DIA [29] +012. C,D,B are collinear [00] & E,C,A are collinear [02] & BE ⟂ AC [03] & AD ⟂ BC [01] ⇒ ∠ADB = ∠AEB [30] +013. ∠ADB = ∠AEB [30] ⇒ E,D,A,B are concyclic [31] +014. E,D,A,B are concyclic [31] ⇒ ∠EDB = ∠EAB [32] +015. E,D,A,B are concyclic [31] ⇒ ∠EDA = ∠EBA [33] +016. C,D,B are collinear [00] & ∠FDC = ∠FAC [24] & F,A,B are collinear [05] & AD ⟂ FI [27] & AD ⟂ EH [19] & AD ⟂ BC [01] & ∠EDB = ∠EAB [32] & E,C,A are collinear [02] ⇒ ∠EDC = ∠BDF [34] +017. ∠ECD = ∠BFD [26] & ∠EDC = ∠BDF [34] (Similar Triangles)⇒ DE:DC = DB:DF [35] +018. ∠ECD = ∠BFD [26] & ∠EDC = ∠BDF [34] (Similar Triangles)⇒ DE:DB = DC:DF [36] +019. DE:DC = DB:DF [35] & DE = DH [10] & DF = DI [12] ⇒ DH:DC = DB:DI [37] +020. DE = DH [10] ⇒ ∠HED = ∠DHE [38] +021. E,C,A are collinear [02] & G,E,B are collinear [08] & AC ⟂ BE [03] ⇒ EC ⟂ GE [39] +022. F,A,B are collinear [05] & CF ⟂ AB [06] ⇒ FC ⟂ FA [40] +023. EC ⟂ GE [39] & FC ⟂ FA [40] ⇒ ∠ECF = ∠(GE-FA) [41] +024. ∠ECF = ∠(GE-FA) [41] & E,C,A are collinear [02] & G,E,B are collinear [08] & F,A,B are collinear [05] ⇒ ∠ACF = ∠EBA [42] +025. G,D,A are collinear [07] & ∠EDA = ∠EBA [33] & ∠ACF = ∠EBA [42] & ∠ADF = ∠ACF [25] & ∠ADF = ∠IDA [28] ⇒ ∠IDG = ∠EDG [43] +026. ∠IDG = ∠EDG [43] ⇒ DI ∥ ED [44] +027. C,D,B are collinear [00] & ∠DHE = ∠HED [38] & AD ⟂ EH [19] & AD ⟂ BC [01] & DE ∥ DI [44] ⇒ ∠HDC = ∠BDI [45] +028. C,D,B are collinear [00] & ∠DHE = ∠HED [38] & AD ⟂ EH [19] & AD ⟂ BC [01] & DE ∥ DI [44] ⇒ ∠CDI = ∠HDB [46] +029. DH:DC = DB:DI [37] & ∠HDC = ∠BDI [45] (Similar Triangles)⇒ ∠DHC = ∠DBI [47] +030. G,D,A are collinear [07] & ∠ADE = ∠HDA [20] & ∠ADE = ∠ABE [33] & ∠FCA = ∠ABE [42] & ∠FDA = ∠FCA [25] ⇒ ∠FDG = ∠HDG [48] +031. ∠FDG = ∠HDG [48] ⇒ FD ∥ DH [49] +032. DF ∥ DH [49] ⇒ F,D,H are collinear [50] +033. AE = AH [09] (SSS)⇒ ∠AEH = ∠EHA [51] +034. ∠AEH = ∠EHA [51] & E,C,A are collinear [02] & AD ⟂ EH [19] & AD ⟂ BC [01] & AD ⟂ FI [27] & ∠FDC = ∠FAC [24] & D,C,B are collinear [00] & F,A,B are collinear [05] & ∠AFD = ∠DIA [29] ⇒ ∠DIA = ∠EHA [52] +035. DF = DI [12] ⇒ ∠DFI = ∠FID [53] +036. ∠FID = ∠DFI [53] & AD ⟂ FI [27] & AD ⟂ EH [19] ⇒ ∠(EH-DI) = ∠(FD-EH) [54] +037. ∠DIA = ∠EHA [52] & ∠(EH-DI) = ∠(FD-EH) [54] ⇒ ∠IAH = ∠(EH-DF) [55] +038. J,I,B are collinear [13] & C,J,H are collinear [14] & ∠DHC = ∠DBI [47] & F,D,H are collinear [50] & D,C,B are collinear [00] & DF ∥ DH [49] & AD ⟂ EH [19] & AD ⟂ BC [01] & AD ⟂ FI [27] & ∠IAH = ∠(EH-DF) [55] ⇒ ∠IAH = ∠IJH [56] +039. ∠IAH = ∠IJH [56] ⇒ J,I,A,H are concyclic [57] +040. AF = AI [11] (SSS)⇒ ∠AFI = ∠FIA [58] +041. F,A,B are collinear [05] & E,C,A are collinear [02] & BE ⟂ AC [03] & CF ⟂ AB [06] ⇒ ∠BFC = ∠BEC [59] +042. ∠BFC = ∠BEC [59] ⇒ F,E,C,B are concyclic [60] +043. F,E,C,B are concyclic [60] ⇒ ∠FEC = ∠FBC [61] +044. E,C,A are collinear [02] & ∠AFI = ∠FIA [58] & F,A,B are collinear [05] & AD ⟂ EH [19] & AD ⟂ BC [01] & AD ⟂ FI [27] & ∠FEC = ∠FBC [61] ⇒ ∠AEF = ∠AIF [62] +045. ∠AEF = ∠AIF [62] ⇒ F,E,I,A are concyclic [63] +046. C,D,B are collinear [00] & G,D,A are collinear [07] & BC ⟂ AD [01] ⇒ DC ⟂ GD [64] +047. EC ⟂ GE [39] & DC ⟂ GD [64] ⇒ ∠ECD = ∠EGD [65] +048. G,E,B are collinear [08] & G,D,A are collinear [07] & F,A,B are collinear [05] & ∠FEC = ∠FBC [61] & E,C,A are collinear [02] & ∠ECD = ∠EGD [65] & D,C,B are collinear [00] ⇒ ∠EGA = ∠EFA [66] +049. ∠EGA = ∠EFA [66] ⇒ G,E,A,F are concyclic [67] +050. G,E,B are collinear [08] & G,D,A are collinear [07] & ∠AEH = ∠EHA [51] & E,C,A are collinear [02] & AD ⟂ EH [19] & AD ⟂ BC [01] & AD ⟂ FI [27] & ∠ECD = ∠EGD [65] & D,C,B are collinear [00] ⇒ ∠EGA = ∠EHA [68] +051. ∠EGA = ∠EHA [68] ⇒ G,E,A,H are concyclic [69] +052. J,I,A,H are concyclic [57] & F,E,I,A are concyclic [63] & G,E,A,F are concyclic [67] & G,E,A,H are concyclic [69] ⇒ J,A,G,E are concyclic [70] +053. J,A,G,E are concyclic [70] ⇒ ∠JAE = ∠JGE [71] +054. G,D,A are collinear [07] & ∠JAE = ∠JGE [71] & E,C,A are collinear [02] & G,E,B are collinear [08] & BE ⟂ AC [03] & AD ⟂ BC [01] & AD ⟂ EH [19] ⇒ ∠(EH-GD) = ∠GJA [72] +055. DE:DB = DC:DF [36] & DE = DH [10] & DF = DI [12] ⇒ DH:DB = DC:DI [73] +056. DH:DB = DC:DI [73] & ∠CDI = ∠HDB [46] (Similar Triangles)⇒ ∠DCI = ∠DHB [74] +057. K,C,I are collinear [15] & K,B,H are collinear [16] & C,D,B are collinear [00] & F,D,H are collinear [50] & ∠DCI = ∠DHB [74] ⇒ ∠CKH = ∠CDH [75] +058. ∠CKH = ∠CDH [75] ⇒ K,D,C,H are concyclic [76] +059. K,D,C,H are concyclic [76] ⇒ ∠KDC = ∠KHC [77] +060. F,A,B are collinear [05] & E,C,A are collinear [02] & BE ⟂ AC [03] & CF ⟂ AB [06] ⇒ ∠AFC = ∠BEA [78] +061. ∠AFC = ∠BEA [78] & ∠ACF = ∠EBA [42] (Similar Triangles)⇒ AE:AB = AF:AC [79] +062. AE:AB = AF:AC [79] & AE = AH [09] & AF = AI [11] ⇒ AH:AB = IA:CA [80] +063. F,A,B are collinear [05] & ∠FEC = ∠FBC [61] & E,C,A are collinear [02] & ∠AEH = ∠EHA [51] & AD ⟂ EH [19] & AD ⟂ BC [01] & AD ⟂ FI [27] ⇒ ∠EHA = ∠EFA [81] +064. E,C,A are collinear [02] & ∠AFI = ∠FIA [58] & F,A,B are collinear [05] & AD ⟂ EH [19] & AD ⟂ BC [01] & AD ⟂ FI [27] & ∠FEC = ∠FBC [61] ⇒ ∠FEC = ∠(EH-IA) [82] +065. ∠EHA = ∠EFA [81] & ∠FEC = ∠(EH-IA) [82] ⇒ ∠(FA-EC) = ∠HAI [83] +066. ∠(FA-EC) = ∠HAI [83] & F,A,B are collinear [05] & E,C,A are collinear [02] ⇒ ∠BAH = ∠CAI [84] +067. AH:AB = IA:CA [80] & ∠BAH = ∠CAI [84] (Similar Triangles)⇒ ∠(CI-BH) = ∠IAH [85] +068. C,K,I are collinear [15] & K,B,H are collinear [16] & ∠IAH = ∠(CI-BH) [85] ⇒ ∠IAH = ∠IKH [86] +069. ∠IAH = ∠IKH [86] ⇒ K,I,A,H are concyclic [87] +070. J,I,A,H are concyclic [57] & F,E,I,A are concyclic [63] & G,E,A,F are concyclic [67] & G,E,A,H are concyclic [69] & K,I,A,H are concyclic [87] ⇒ J,H,K,G are concyclic [88] +071. J,H,K,G are concyclic [88] ⇒ ∠JHK = ∠JGK [89] +072. ∠KDC = ∠KHC [77] & D,C,B are collinear [00] & H,K,B are collinear [16] & AD ⟂ FI [27] & AD ⟂ EH [19] & AD ⟂ BC [01] & ∠JHK = ∠JGK [89] & J,C,H are collinear [14] ⇒ ∠JGK = ∠(EH-KD) [90] +073. ∠(EH-GD) = ∠GJA [72] & ∠JGK = ∠(EH-KD) [90] ⇒ ∠(JA-GK) = ∠GDK [91] +074. G,K,L are collinear [17] & J,A,L are collinear [18] & ∠(JA-GK) = ∠GDK [91] & G,D,A are collinear [07] ⇒ ∠KLA = ∠KDA [92] +075. ∠KLA = ∠KDA [92] ⇒ K,D,A,L are concyclic [93] +076. K,D,A,L are concyclic [93] ⇒ ∠KAD = ∠KLD [94] +077. J,I,A,H are concyclic [57] & F,E,I,A are concyclic [63] & G,E,A,F are concyclic [67] & G,E,A,H are concyclic [69] & K,I,A,H are concyclic [87] ⇒ J,K,A,G are concyclic [95] +078. J,K,A,G are concyclic [95] ⇒ ∠GJA = ∠GKA [96] +079. G,D,A are collinear [07] & C,D,B are collinear [00] & E,C,A are collinear [02] & G,E,B are collinear [08] & BE ⟂ AC [03] & AD ⟂ BC [01] ⇒ ∠GDB = ∠AEG [97] +080. G,D,A are collinear [07] & G,E,B are collinear [08] & ∠(AD-BE) = ∠(AD-BE) [04] ⇒ ∠AGE = ∠DGB [98] +081. ∠GDB = ∠AEG [97] & ∠AGE = ∠DGB [98] (Similar Triangles)⇒ EA:EG = DB:DG [99] +082. ∠GDB = ∠AEG [97] & ∠AGE = ∠DGB [98] (Similar Triangles)⇒ GA:GE = GB:GD [100] +083. E,C,A are collinear [02] & G,D,A are collinear [07] & ∠EAD = ∠DAH [21] ⇒ ∠EAG = ∠GAH [101] +084. AE = AH [09] & ∠EAG = ∠GAH [101] (SAS)⇒ GE = GH [102] +085. EA:EG = DB:DG [99] & AE = AH [09] & GE = GH [102] ⇒ AH:GH = DB:GD [103] +086. GA:GE = GB:GD [100] & GE = GH [102] ⇒ GA:GH = GB:GD [104] +087. AH:GH = DB:GD [103] & GA:GH = GB:GD [104] (Similar Triangles)⇒ ∠BDG = ∠AHG [105] +088. K,I,A,H are concyclic [87] & F,E,I,A are concyclic [63] & G,E,A,F are concyclic [67] & G,E,A,H are concyclic [69] ⇒ H,K,A,G are concyclic [106] +089. H,K,A,G are concyclic [106] ⇒ ∠GHA = ∠GKA [107] +090. G,D,A are collinear [07] & ∠BDG = ∠AHG [105] & D,C,B are collinear [00] & ∠GHA = ∠GKA [107] & AD ⟂ EH [19] & AD ⟂ BC [01] ⇒ ∠GKA = ∠(GD-EH) [108] +091. J,I,B are collinear [13] & C,J,H are collinear [14] & C,D,B are collinear [00] & F,D,H are collinear [50] & ∠DHC = ∠DBI [47] ⇒ ∠BJH = ∠BDH [109] +092. ∠BJH = ∠BDH [109] ⇒ H,J,D,B are concyclic [110] +093. H,J,D,B are concyclic [110] ⇒ ∠HJD = ∠HBD [111] +094. J,I,A,H are concyclic [57] & F,E,I,A are concyclic [63] & G,E,A,F are concyclic [67] & G,E,A,H are concyclic [69] & K,I,A,H are concyclic [87] ⇒ J,H,K,A are concyclic [112] +095. J,H,K,A are concyclic [112] ⇒ ∠JHK = ∠JAK [113] +096. ∠HJD = ∠HBD [111] & J,C,H are collinear [14] & D,C,B are collinear [00] & AD ⟂ FI [27] & AD ⟂ EH [19] & AD ⟂ BC [01] & ∠JHK = ∠JAK [113] & H,K,B are collinear [16] ⇒ ∠KAJ = ∠(EH-JD) [114] +097. ∠GKA = ∠(GD-EH) [108] & ∠KAJ = ∠(EH-JD) [114] ⇒ ∠(GK-JA) = ∠GDJ [115] +098. G,D,A are collinear [07] & G,K,L are collinear [17] & J,A,L are collinear [18] & ∠(GK-JA) = ∠GDJ [115] ⇒ ∠GDJ = ∠GLJ [116] +099. ∠GDJ = ∠GLJ [116] ⇒ G,J,D,L are concyclic [117] +100. G,J,D,L are concyclic [117] ⇒ ∠GJL = ∠GDL [118] +101. C,D,B are collinear [00] & AD ⟂ EH [19] & ∠KAD = ∠KLD [94] & G,K,L are collinear [17] & ∠GJA = ∠GKA [96] & ∠GJL = ∠GDL [118] & J,A,L are collinear [18] & G,D,A are collinear [07] & AD ⟂ BC [01] ⇒ DC ∥ DL [119] +102. DC ∥ DL [119] ⇒ C,D,L are collinear [120] +103. C,D,L are collinear [120] & D,C,B are collinear [00] ⇒ C,L,B are collinear +========================== diff --git a/pros2.txt b/pros2.txt new file mode 100644 index 0000000..d078c93 --- /dev/null +++ b/pros2.txt @@ -0,0 +1,6 @@ +test_circle +a b c = triangle a b c; o = circle o a b c; d = on_tline d a b c, on_circle d o a ? cyclic a b c a +test_ccc2p +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; p = on_line p a b, on_line p c d ? eqratio p a p c p d p b +test_ccc2pt +a b c = triangle a b c; o = circle o a b c; p = on_line p b c, on_tline p a o a; d = on_circle d o a; e = on_line e p d, on_circle e o a ? eqratio p a p b p c p a \ No newline at end of file diff --git a/rules.txt b/rules.txt index 57fb4d1..c1252b8 100644 --- a/rules.txt +++ b/rules.txt @@ -42,6 +42,7 @@ eqratio6 B A B C Q P Q R, eqratio6 C A C B R P R Q, ncoll A B C, cong A B P Q => para a b c d, coll m a d, coll n b c, eqratio6 m a m d n b n c, sameside m a d n b c => para m n a b para a b c d, coll m a d, coll n b c, para m n a b => eqratio6 m a m d n b n c cyclic A B C D, coll P A B, coll P C D => eqratio P A P C P D P B +circle O A B C, perp O A A P, coll P B C => eqratio P A P B P C P A coll P A B, coll P C D, ncoll A B C D, eqratio P A P C P D P B => cyclic A B C D cyclic A B C D, cyclic A B E F, cyclic C D E F, coll P A B, coll P C D => coll P E F cyclic A B C D E F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I diff --git a/rules1.txt b/rules1.txt index 62ee122..bda7c18 100644 --- a/rules1.txt +++ b/rules1.txt @@ -1,5 +1,2 @@ cyclic A B C D, coll P A B, coll P C D => eqratio P A P C P D P B -coll P A B, coll P C D, ncoll A B C D, eqratio P A P C P D P B => cyclic A B C D -cyclic A B C D, cyclic A B E F, cyclic C D E F, coll P A B, coll P C D => coll P E F -cyclic A B C D E F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I -cyclic A B C D E, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A, coll G H I => cyclic A B C D E F +circle O A B C, perp O A A P, coll P B C => eqratio P A P B P C P A diff --git a/rules2.txt b/rules2.txt new file mode 100644 index 0000000..e643e0a --- /dev/null +++ b/rules2.txt @@ -0,0 +1 @@ +cong O A O B, cong O B O C, cong O C O D => cyclic A B C D \ No newline at end of file From cb01a10cd41e9d137ed7be34b6e3468cb9cdcffb Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.cn> Date: Sun, 9 Mar 2025 10:57:35 +0800 Subject: [PATCH 08/27] match_circle --- dd.py | 382 ++++++++++++++++++++++++++++++++++++++++++++++++- graph.py | 11 ++ graph_utils.py | 43 ++++++ rules.txt | 1 + rules1.txt | 13 ++ 5 files changed, 443 insertions(+), 7 deletions(-) diff --git a/dd.py b/dd.py index 833d442..78d46cd 100644 --- a/dd.py +++ b/dd.py @@ -35,6 +35,17 @@ def intersect1(set1: set[Any], set2: set[Any]) -> Any: return x return None +def intersect2(set1: set[Any], set2: set[Any]) -> Any: + a = None + b = None + for x in set1: + if x in set2: + if a == None: + a = x + else: + b = x + break + return a,b def diff_point(l: gm.Line, a: gm.Point) -> gm.Point: for x in l.neighbors(gm.Point): @@ -88,7 +99,7 @@ def match_eqratio_eqratio_eqratio( c, d = g.two_points_of_length(l12) m, n = g.two_points_of_length(l3) p, q = g.two_points_of_length(l34) - # eqangle a b c d m n p q + # eqangle a b c d m n p q (eqratio) e, f = g.two_points_of_length(l2) r, u = g.two_points_of_length(l4) yield dict(zip('abcdefmnpqru', [a, b, c, d, e, f, m, n, p, q, r, u])) @@ -510,6 +521,359 @@ def match_cyclic2power_tan( yield dict(zip('OPABC', [o, p, a, b, c])) break +def match_cyclic2power_tan( + g: gh.Graph, + g_matcher: Callable[str, list[tuple[gm.Point, ...]]], + theorem: pr.Theorem, +) -> Generator[dict[str, gm.Point], None, None]: + """Match circle O A B C, perp O A A P, coll P B C => eqratio P A P B P C P A """ + record = set() + for o,a,b,c in g.all_circles(): + if (o,a) in record: + pass + bc = g._get_line(b,c) + if not bc: + continue + record.add((o,a)) + debugname([o,a,b,c]) + oa = g._get_line(o, a) + if not (oa and oa.val): + continue + for l in a.neighbors(gm.Line): + if g.check_perpl(oa, l): + p1s = l.neighbors(gm.Point, return_set=True) + p2s = bc.neighbors(gm.Point, return_set=True) + p = intersect1(p1s, p2s) + if p: + yield dict(zip('OPABC', [o, p, a, b, c])) + break + +def match_power2cyclic( + g: gh.Graph, + g_matcher: Callable[str, list[tuple[gm.Point, ...]]], + theorem: pr.Theorem, +) -> Generator[dict[str, gm.Point], None, None]: + """Match coll P A B, coll P C D, ncoll A B C D, eqratio P A P C P D P B => cyclic A B C D""" + all_lines = g.type2nodes[gm.Line] + for l1,l2 in utils.comb2(all_lines): + l1s = l1.neighbors(gm.Point, return_set=True) + l2s = l2.neighbors(gm.Point, return_set=True) + p = intersect1(l1s,l2s) + if not p: + continue + l1s = list(l1s) + l2s = list(l2s) + for a,b in utils.comb2(l1s): + for c,d in utils.comb2(l2s): + if g.check_eqratio([p, a, p, c, p, d, p, b]): + yield dict(zip('PABCD', [p, a, b, c, d])) + + +def match_pascal6( + g: gh.Graph, + g_matcher: Callable[str, list[tuple[gm.Point, ...]]], + theorem: pr.Theorem, +) -> Generator[dict[str, gm.Point], None, None]: + """Match cyclic A B C D E F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I""" + recordc = set() + for o,x,y,z in g.all_circles(): + circle = g.get_circle_thru_triplet(x,y,z) + if circle in recordc: + continue + recordc.add(circle) + record = set() + for a, b, c, d, e, f in utils.perm6(circle.neighbors(gm.Point)): + if (a,b,c,d,e,f) in record: + continue + # 6! = 60 * 12 + record.add((a,b,c,d,e,f)) + record.add((b,c,d,e,f,a)) + record.add((c,d,e,f,a,b)) + record.add((d,e,f,a,b,c)) + record.add((e,f,a,b,c,d)) + record.add((f,a,b,c,d,e)) + record.add((f,e,d,c,b,a)) + record.add((e,d,c,b,a,f)) + record.add((d,c,b,a,f,e)) + record.add((c,b,a,f,e,d)) + record.add((b,a,f,e,d,c)) + record.add((a,f,e,d,c,b)) + + ab = g._get_line(a, b) + bc = g._get_line(b, c) + cd = g._get_line(c, d) + de = g._get_line(d, e) + ef = g._get_line(e, f) + fa = g._get_line(f, a) + + if ab and bc and cd and de and ef and fa: + g1s = ab.neighbors(gm.Point, return_set=True) + g2s = cd.neighbors(gm.Point, return_set=True) + h1s = bc.neighbors(gm.Point, return_set=True) + h2s = ef.neighbors(gm.Point, return_set=True) + i1s = cd.neighbors(gm.Point, return_set=True) + i2s = fa.neighbors(gm.Point, return_set=True) + gg = intersect1(g1s, g2s) + h = intersect1(h1s, h2s) + i = intersect1(i1s, i2s) + if gg and h and i: + yield dict(zip('ABCDEFGHI',[a,b,c,d,e,f,gg,h,i])) + +def match_pascal6_rev( + g: gh.Graph, + g_matcher: Callable[str, list[tuple[gm.Point, ...]]], + theorem: pr.Theorem, +) -> Generator[dict[str, gm.Point], None, None]: + """Match cyclic A B C D E, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A, coll G H I => cyclic A B C D E F""" + recordc = set() + for o,x,y,z in g.all_circles(): + circle = g.get_circle_thru_triplet(x,y,z) + if circle in recordc: + continue + recordc.add(circle) + record = set() + for a, b, c, d, e in utils.perm5(circle.neighbors(gm.Point)): + if (a,b,c,d,e) in record: + continue + record.add((a,b,c,d,e)) + + ab = g._get_line(a, b) + bc = g._get_line(b, c) + cd = g._get_line(c, d) + de = g._get_line(d, e) + + if not (ab and bc and cd and de): + continue + + g1s = ab.neighbors(gm.Point, return_set=True) + g2s = cd.neighbors(gm.Point, return_set=True) + gg = intersect1(g1s, g2s) + if not gg: + continue + + for f in g.all_points(): + if f in {a,b,c,d,e}: + continue + ef = g._get_line(e, f) + fa = g._get_line(f, a) + if ef and fa: + h1s = bc.neighbors(gm.Point, return_set=True) + h2s = ef.neighbors(gm.Point, return_set=True) + i1s = cd.neighbors(gm.Point, return_set=True) + i2s = fa.neighbors(gm.Point, return_set=True) + h = intersect1(h1s, h2s) + i = intersect1(i1s, i2s) + if h and i and g.check_coll([gg,h,i]): + yield dict(zip('ABCDEFGHI',[a,b,c,d,e,f,gg,h,i])) + +def match_pascal5( + g: gh.Graph, + g_matcher: Callable[str, list[tuple[gm.Point, ...]]], + theorem: pr.Theorem, +) -> Generator[dict[str, gm.Point], None, None]: + """Match cyclic A B C D E, perp O A A G, coll G C D, coll H A B, coll H D E, coll I B C, coll I E A => coll G H I""" + recordc = set() + for o,x,y,z in g.all_circles(): + circle = g.get_circle_thru_triplet(x,y,z) + if circle in recordc: + continue + recordc.add(circle) + record = set() + for a,b,c,d,e in utils.perm5(circle.neighbors(gm.Point)): + if (a,b,c,d,e) in record or (a,e,d,c,b) in record: + continue + record.add((a,b,c,d,e)) + + ab = g._get_line(a, b) + bc = g._get_line(b, c) + cd = g._get_line(c, d) + de = g._get_line(d, e) + ea = g._get_line(e, a) + + if not (ab and bc and cd and de and ea): + continue + oa = g._get_line(o, a) + if not (oa and oa.val): + continue + la = None + for l in a.neighbors(gm.Line): + if g.check_perpl(oa, l): + la = l + break + if not la: + continue + g1s = la.neighbors(gm.Point, return_set=True) + g2s = cd.neighbors(gm.Point, return_set=True) + h1s = ab.neighbors(gm.Point, return_set=True) + h2s = de.neighbors(gm.Point, return_set=True) + i1s = bc.neighbors(gm.Point, return_set=True) + i2s = ea.neighbors(gm.Point, return_set=True) + gg = intersect1(g1s, g2s) + h = intersect1(h1s, h2s) + i = intersect1(i1s, i2s) + if gg and h and i: + yield dict(zip('OABCDEGHI',[o,a,b,c,d,e,gg,h,i])) + +def match_pascal41( + g: gh.Graph, + g_matcher: Callable[str, list[tuple[gm.Point, ...]]], + theorem: pr.Theorem, +) -> Generator[dict[str, gm.Point], None, None]: + """circle O A B C, cong O A O D, perp O A A G, coll G B C, coll H A B, coll H C D, perp O B B I, coll I D A => coll G H I (AABBCD)""" + recordc = set() + for o,x,y,z in g.all_circles(): + circle = g.get_circle_thru_triplet(x,y,z) + if circle in recordc: + continue + recordc.add(circle) + record = set() + for a,b,c,d in utils.perm4(circle.neighbors(gm.Point)): + if (a,b,c,d) in record or (b,a,d,c) in record: + continue + record.add((a,b,c,d)) + ab = g._get_line(a, b) + bc = g._get_line(b, c) + cd = g._get_line(c, d) + da = g._get_line(d, a) + if not (ab and bc and cd and da): + continue + oa = g._get_line(o, a) + if not (oa and oa.val): + continue + la = None + for l in a.neighbors(gm.Line): + if g.check_perpl(oa, l): + la = l + break + if not la: + continue + ob = g._get_line(o, b) + if not (ob and ob.val): + continue + lb = None + for l in b.neighbors(gm.Line): + if g.check_perpl(ob, l): + lb = l + break + if not lb: + continue + + g1s = la.neighbors(gm.Point, return_set=True) + g2s = bc.neighbors(gm.Point, return_set=True) + h1s = ab.neighbors(gm.Point, return_set=True) + h2s = cd.neighbors(gm.Point, return_set=True) + i1s = lb.neighbors(gm.Point, return_set=True) + i2s = da.neighbors(gm.Point, return_set=True) + gg = intersect1(g1s, g2s) + h = intersect1(h1s, h2s) + i = intersect1(i1s, i2s) + if gg and h and i: + yield dict(zip('OABCDGHI',[o,a,b,c,d,gg,h,i])) + +def match_pascal42( + g: gh.Graph, + g_matcher: Callable[str, list[tuple[gm.Point, ...]]], + theorem: pr.Theorem, +) -> Generator[dict[str, gm.Point], None, None]: + """circle O A B C, cong O A O D, perp O A A G, perp O B B G, coll H A C, coll H B D, coll I C B, coll I D A => coll G H I (AACBBD)""" + recordc = set() + for o,x,y,z in g.all_circles(): + circle = g.get_circle_thru_triplet(x,y,z) + if circle in recordc: + continue + recordc.add(circle) + record = set() + for a,b,c,d in utils.perm4(circle.neighbors(gm.Point)): + if (a,b,c,d) in record or (b,a,c,d) in record or (a,b,d,c) in record or (b,a,d,c) in record: + continue + record.add((a,b,c,d)) + ac = g._get_line(a, c) + bd = g._get_line(b, d) + bc = g._get_line(c, b) + ad = g._get_line(d, a) + if not (ac and bc and ad and bd): + continue + oa = g._get_line(o, a) + if not (oa and oa.val): + continue + la = None + for l in a.neighbors(gm.Line): + if g.check_perpl(oa, l): + la = l + break + if not la: + continue + ob = g._get_line(o, b) + if not (ob and ob.val): + continue + lb = None + for l in b.neighbors(gm.Line): + if g.check_perpl(ob, l): + lb = l + break + if not lb: + continue + + g1s = la.neighbors(gm.Point, return_set=True) + g2s = lb.neighbors(gm.Point, return_set=True) + h1s = ac.neighbors(gm.Point, return_set=True) + h2s = bd.neighbors(gm.Point, return_set=True) + i1s = ad.neighbors(gm.Point, return_set=True) + i2s = bc.neighbors(gm.Point, return_set=True) + gg = intersect1(g1s, g2s) + h = intersect1(h1s, h2s) + i = intersect1(i1s, i2s) + if gg and h and i: + yield dict(zip('OABCDGHI',[o,a,b,c,d,gg,h,i])) + +def match_radical_axis( + g: gh.Graph, + g_matcher: Callable[str, list[tuple[gm.Point, ...]]], + theorem: pr.Theorem, +) -> Generator[dict[str, gm.Point], None, None]: + """cyclic A B C D, cyclic A B E F, cyclic C D E F, coll P A B, coll P C D => coll P E F""" + circles = set() + for o,x,y,z in g.all_circles(): + circle = g.get_circle_thru_triplet(x,y,z) + circles.add(circle) + + intersect_cnt = dict[(gm.Circle,gm.Circle),list[gm.Point]] + circles = list(circles) + for c1,c2 in utils.comb2(circles): + c1s = c1.neighbors(gm.Point, return_set=True) + c2s = c1.neighbors(gm.Point, return_set=True) + intersect_cnt[(c1,c2)] = intersect_cnt[(c2,c1)] = [x for x in c1s if x in c2s] + + for c1,c2,c3 in utils.comb3(circles): + c12 = intersect_cnt[(c1,c2)] + c13 = intersect_cnt[(c1,c3)] + c23 = intersect_cnt[(c2,c3)] + if c12 == 2 and c13 == 2 and c23 == 2: + c1s = c1.neighbors(gm.Point, return_set=True) + c2s = c1.neighbors(gm.Point, return_set=True) + c3s = c1.neighbors(gm.Point, return_set=True) + a,b = intersect2(c1s,c2s) + c,d = intersect2(c1s,c3s) + e,f = intersect2(c2s,c3s) + assert a and b and c and d and e and f + ab = g._get_line(a,b) + cd = g._get_line(c,d) + ef = g._get_line(e,f) + pab = ab.neighbors(gm.Point, return_set=True) + pcd = cd.neighbors(gm.Point, return_set=True) + pef = ef.neighbors(gm.Point, return_set=True) + p1 = intersect1(pab,pcd) + p2 = intersect1(pab,pef) + p3 = intersect1(pcd,pef) + # if p1 and p2 and p3: + # continue + if p1: + yield dict(zip('ABCDEFP',[a,b,c,d,e,f,p1])) + if p2: + yield dict(zip('ABCDEFP',[a,b,e,f,c,d,p2])) + if p3: + yield dict(zip('ABCDEFP',[c,d,e,f,c,d,p3])) + def rotate_simtri( a: gm.Point, b: gm.Point, c: gm.Point, x: gm.Point, y: gm.Point, z: gm.Point ) -> Generator[tuple[gm.Point, ...], None, None]: @@ -798,14 +1162,14 @@ def match_eqratio6_coll_ncoll_eqangle6( theorem: pr.Theorem, ) -> Generator[dict[str, gm.Point], None, None]: """Match eqratio6 d b d c a b a c, coll d b c, ncoll a b c => eqangle6 a b a d a d a c.""" - records = set() + record = set() for b, d, c in g_matcher('coll'): for a in g.all_points(): if g.check_coll([a, b, c]): continue - if (a, b, d, c) in records or (a, c, d, b) in records: + if (a, b, d, c) in record or (a, c, d, b) in record: continue - records.add((a, b, d, c)) + record.add((a, b, d, c)) if g.check_eqratio([d, b, d, c, a, b, a, c]): yield dict(zip('abcd', [a, b, c, d])) @@ -817,14 +1181,14 @@ def match_eqangle6_coll_ncoll_eqratio6( theorem: pr.Theorem, ) -> Generator[dict[str, gm.Point], None, None]: """Match eqangle6 a b a d a d a c, coll d b c, ncoll a b c => eqratio6 d b d c a b a c.""" - records = set() + record = set() for b, d, c in g_matcher('coll'): for a in g.all_points(): if g.check_coll([a, b, c]): continue - if (a, b, d, c) in records or (a, c, d, b) in records: + if (a, b, d, c) in record or (a, c, d, b) in record: continue - records.add((a, b, d, c)) + record.add((a, b, d, c)) if g.check_eqangle([a, b, a, d, a, d, a, c]): yield dict(zip('abcd', [a, b, c, d])) @@ -870,6 +1234,10 @@ def match_all( return g.all_midps() if name == 'circle': return g.all_circles() + if name == 'cyclic6': + return g.all_cyclics6() + if name == 'cyclic5': + return g.all_cyclics5() raise ValueError(f'Unrecognize {name}') diff --git a/graph.py b/graph.py index ddadb4a..39d0c8c 100644 --- a/graph.py +++ b/graph.py @@ -2999,6 +2999,16 @@ def all_cyclics(self) -> Generator[tuple[Point, ...], None, None]: for x, y, z, t in utils.perm4(c.neighbors(Point)): yield x, y, z, t + def all_cyclics6(self) -> Generator[tuple[Point, ...], None, None]: + for c in self.type2nodes[Circle]: + for x, y, z, t, u, v in utils.perm6(c.neighbors(Point)): + yield x, y, z, t, u, v + + def all_cyclics5(self) -> Generator[tuple[Point, ...], None, None]: + for c in self.type2nodes[Circle]: + for x, y, z, t, u in utils.perm5(c.neighbors(Point)): + yield x, y, z, t, u + def all_colls(self) -> Generator[tuple[Point, ...], None, None]: for l in self.type2nodes[Line]: for x, y, z in utils.perm3(l.neighbors(Point)): @@ -3031,6 +3041,7 @@ def two_points_of_length(self, l: Length) -> tuple[Point, Point]: s = l.neighbors(Segment)[0] p1, p2 = s.points return p1, p2 + def create_consts_str(g: Graph, s: str) -> Union[Ratio, Angle]: diff --git a/graph_utils.py b/graph_utils.py index f53214b..aac4544 100644 --- a/graph_utils.py +++ b/graph_utils.py @@ -130,3 +130,46 @@ def _perm4(elems): def perm4(elems): return list(_perm4(elems)) + +def _perm5(elems): + for x in elems: + for y in elems: + if y == x: + continue + for z in elems: + if z in (x, y): + continue + for t in elems: + if t in (x, y, z): + continue + for u in elems: + if u not in (x, y, z, t): + yield x, y, z, t, u + +def perm5(elems): + if len(elems) < 5: + return [] + return list(_perm5(elems)) + +def _perm6(elems): + for x in elems: + for y in elems: + if y == x: + continue + for z in elems: + if z in (x, y): + continue + for t in elems: + if t in (x, y, z): + continue + for u in elems: + if u in (x, y, z, t): + continue + for v in elems: + if v not in (x, y, z, t, u): + yield x, y, z, t, u, v + +def perm6(elems): + if len(elems) < 6: + return [] + return list(_perm6(elems)) \ No newline at end of file diff --git a/rules.txt b/rules.txt index c1252b8..072fe3f 100644 --- a/rules.txt +++ b/rules.txt @@ -44,6 +44,7 @@ para a b c d, coll m a d, coll n b c, para m n a b => eqratio6 m a m d n b n c cyclic A B C D, coll P A B, coll P C D => eqratio P A P C P D P B circle O A B C, perp O A A P, coll P B C => eqratio P A P B P C P A coll P A B, coll P C D, ncoll A B C D, eqratio P A P C P D P B => cyclic A B C D +circle O A B C, perp O A A P, coll P B C => eqratio P A P B P C P A cyclic A B C D, cyclic A B E F, cyclic C D E F, coll P A B, coll P C D => coll P E F cyclic A B C D E F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I cyclic A B C D E, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A, coll G H I => cyclic A B C D E F \ No newline at end of file diff --git a/rules1.txt b/rules1.txt index bda7c18..a2b7037 100644 --- a/rules1.txt +++ b/rules1.txt @@ -1,2 +1,15 @@ cyclic A B C D, coll P A B, coll P C D => eqratio P A P C P D P B circle O A B C, perp O A A P, coll P B C => eqratio P A P B P C P A +coll P A B, coll P C D, ncoll A B C D, eqratio P A P C P D P B => cyclic A B C D +cyclic A B C D, cyclic A B E F, cyclic C D E F, coll P A B, coll P C D => coll P E F +circle O A B C, cong O A O D, cong O A O E, cong O A O F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I +circle O A B C, cong O A O D, cong O A O E, perp O A A G, coll G C D, coll H A B, coll H D E, coll I B C, coll I E A => coll G H I +circle O A B C, cong O A O D, perp O A A G, coll G B C, coll H A B, coll H C D, perp O B B I, coll I D A => coll G H I +circle O A B C, cong O A O D, perp O A A G, perp O B B G, coll H A C, coll H B D, coll I C B, coll I D A => coll G H I +circle O A B C, cong O A O D, cong O A O E, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A, coll G H I => cong O A O F + +A A B B C D +AA BC / AB CD / BB DA + +A A C B B D +AA BB / AC BD / CB DA From 1fa6aaf58392fc23ccfc0694152fee6668cc4dad Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.cn> Date: Sun, 9 Mar 2025 21:26:14 +0800 Subject: [PATCH 09/27] test_pascal --- alphageometry.py | 3 +- chiaya.sh | 2 +- dd.py | 164 ++++++++++++++++++++++++++------------ kirine.txt | 17 ++-- nothing.txt | 202 ++++++----------------------------------------- pros2.txt | 18 ++++- rules.txt | 1 - rules1.txt | 16 +--- rules2.txt | 7 +- 9 files changed, 173 insertions(+), 257 deletions(-) diff --git a/alphageometry.py b/alphageometry.py index 80a299a..72d250c 100644 --- a/alphageometry.py +++ b/alphageometry.py @@ -29,7 +29,6 @@ import pretty as pt import problem as pr - _GIN_SEARCH_PATHS = flags.DEFINE_list( 'gin_search_paths', ['third_party/py/meliad/transformer/configs'], @@ -605,7 +604,6 @@ def run_alphageometry( def main(_): global DEFINITIONS global RULES - # definitions of terms used in our domain-specific language. DEFINITIONS = pr.Definition.from_txt_file(_DEFS_FILE.value, to_dict=True) # load inference rules used in DD. @@ -650,3 +648,4 @@ def main(_): if __name__ == '__main__': app.run(main) + diff --git a/chiaya.sh b/chiaya.sh index 0a73f51..b99f227 100644 --- a/chiaya.sh +++ b/chiaya.sh @@ -41,7 +41,7 @@ INPUT_FILE=pros2.txt python -m alphageometry \ --alsologtostderr \ --problems_file=$(pwd)/$INPUT_FILE \ ---problem_name=test_ccc2pt \ +--problem_name=test_pascal61 \ --mode=alphageometry \ "${DDAR_ARGS[@]}" \ "${SEARCH_ARGS[@]}" \ diff --git a/dd.py b/dd.py index 78d46cd..07b0c34 100644 --- a/dd.py +++ b/dd.py @@ -27,7 +27,7 @@ import problem as pr from problem import Dependency, EmptyDependency -import itertools +import time def intersect1(set1: set[Any], set2: set[Any]) -> Any: for x in set1: @@ -53,6 +53,22 @@ def diff_point(l: gm.Line, a: gm.Point) -> gm.Point: return x return None +import time + +def measure_time(func): + def wrapper(*args, **kwargs): + start_time = time.time() + + result = func(*args, **kwargs) + + end_time = time.time() + elapsed_time = end_time - start_time + + print(f"Function '{func.__name__}' took {elapsed_time:.9f} seconds to complete.") + + return result + + return wrapper # pylint: disable=protected-access # pylint: disable=unused-argument @@ -462,7 +478,6 @@ def match_cyclic2power( """Match cyclic A B C D, coll P A B, coll P C D => eqratio P A P C P D P B""" record = set() for a,b,c,d in g_matcher('cyclic'): - debugname([a,b,c,d]) if (a,b,c,d) in record: continue points = [a,b,c,d] @@ -500,15 +515,10 @@ def match_cyclic2power_tan( theorem: pr.Theorem, ) -> Generator[dict[str, gm.Point], None, None]: """Match circle O A B C, perp O A A P, coll P B C => eqratio P A P B P C P A """ - record = set() for o,a,b,c in g.all_circles(): - if (o,a) in record: - pass bc = g._get_line(b,c) if not bc: continue - record.add((o,a)) - debugname([o,a,b,c]) oa = g._get_line(o, a) if not (oa and oa.val): continue @@ -521,32 +531,6 @@ def match_cyclic2power_tan( yield dict(zip('OPABC', [o, p, a, b, c])) break -def match_cyclic2power_tan( - g: gh.Graph, - g_matcher: Callable[str, list[tuple[gm.Point, ...]]], - theorem: pr.Theorem, -) -> Generator[dict[str, gm.Point], None, None]: - """Match circle O A B C, perp O A A P, coll P B C => eqratio P A P B P C P A """ - record = set() - for o,a,b,c in g.all_circles(): - if (o,a) in record: - pass - bc = g._get_line(b,c) - if not bc: - continue - record.add((o,a)) - debugname([o,a,b,c]) - oa = g._get_line(o, a) - if not (oa and oa.val): - continue - for l in a.neighbors(gm.Line): - if g.check_perpl(oa, l): - p1s = l.neighbors(gm.Point, return_set=True) - p2s = bc.neighbors(gm.Point, return_set=True) - p = intersect1(p1s, p2s) - if p: - yield dict(zip('OPABC', [o, p, a, b, c])) - break def match_power2cyclic( g: gh.Graph, @@ -568,20 +552,23 @@ def match_power2cyclic( if g.check_eqratio([p, a, p, c, p, d, p, b]): yield dict(zip('PABCD', [p, a, b, c, d])) - +@measure_time def match_pascal6( g: gh.Graph, g_matcher: Callable[str, list[tuple[gm.Point, ...]]], theorem: pr.Theorem, ) -> Generator[dict[str, gm.Point], None, None]: """Match cyclic A B C D E F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I""" + tchiaya=time.time() recordc = set() + record = set() + cnt = 0 for o,x,y,z in g.all_circles(): - circle = g.get_circle_thru_triplet(x,y,z) - if circle in recordc: + if (o,x) in recordc: continue - recordc.add(circle) - record = set() + circle = g.get_circle_thru_triplet(x,y,z) + for op in circle.neighbors(gm.Point): + recordc.add((o,op)) for a, b, c, d, e, f in utils.perm6(circle.neighbors(gm.Point)): if (a,b,c,d,e,f) in record: continue @@ -608,7 +595,7 @@ def match_pascal6( if ab and bc and cd and de and ef and fa: g1s = ab.neighbors(gm.Point, return_set=True) - g2s = cd.neighbors(gm.Point, return_set=True) + g2s = de.neighbors(gm.Point, return_set=True) h1s = bc.neighbors(gm.Point, return_set=True) h2s = ef.neighbors(gm.Point, return_set=True) i1s = cd.neighbors(gm.Point, return_set=True) @@ -618,6 +605,8 @@ def match_pascal6( i = intersect1(i1s, i2s) if gg and h and i: yield dict(zip('ABCDEFGHI',[a,b,c,d,e,f,gg,h,i])) + tkirine = time.time() + print(tkirine-tchiaya) def match_pascal6_rev( g: gh.Graph, @@ -626,12 +615,13 @@ def match_pascal6_rev( ) -> Generator[dict[str, gm.Point], None, None]: """Match cyclic A B C D E, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A, coll G H I => cyclic A B C D E F""" recordc = set() + record = set() for o,x,y,z in g.all_circles(): - circle = g.get_circle_thru_triplet(x,y,z) - if circle in recordc: + if (o,x) in recordc: continue - recordc.add(circle) - record = set() + circle = g.get_circle_thru_triplet(x,y,z) + for op in circle.neighbors(gm.Point): + recordc.add((o.name,op.name)) for a, b, c, d, e in utils.perm5(circle.neighbors(gm.Point)): if (a,b,c,d,e) in record: continue @@ -666,6 +656,7 @@ def match_pascal6_rev( if h and i and g.check_coll([gg,h,i]): yield dict(zip('ABCDEFGHI',[a,b,c,d,e,f,gg,h,i])) +@measure_time def match_pascal5( g: gh.Graph, g_matcher: Callable[str, list[tuple[gm.Point, ...]]], @@ -673,12 +664,13 @@ def match_pascal5( ) -> Generator[dict[str, gm.Point], None, None]: """Match cyclic A B C D E, perp O A A G, coll G C D, coll H A B, coll H D E, coll I B C, coll I E A => coll G H I""" recordc = set() + record = set() for o,x,y,z in g.all_circles(): - circle = g.get_circle_thru_triplet(x,y,z) - if circle in recordc: + if (o,x) in recordc: continue - recordc.add(circle) - record = set() + circle = g.get_circle_thru_triplet(x,y,z) + for op in circle.neighbors(gm.Point): + recordc.add((o,op)) for a,b,c,d,e in utils.perm5(circle.neighbors(gm.Point)): if (a,b,c,d,e) in record or (a,e,d,c,b) in record: continue @@ -1335,6 +1327,74 @@ def match_generic( yield mapping +@measure_time +def match_generic_debug( + g: gh.Graph, + cache: Callable[str, list[tuple[gm.Point, ...]]], + theorem: pr.Theorem +) -> Generator[dict[str, gm.Point], None, None]: + """Match any generic rule that is not one of the above match_*() rules.""" + + tchiaya = time.time() + clause2enum = {} + clauses = [] + numerical_checks = [] + for clause in theorem.premise: + if clause.name in ['ncoll', 'npara', 'nperp', 'sameside']: + numerical_checks.append(clause) + continue + + enum = cache(clause.name) + if len(enum) == 0: # pylint: disable=g-explicit-length-test + return 0 + + clause2enum[clause] = enum + clauses.append((len(set(clause.args)), clause)) + + clauses = sorted(clauses, key=lambda x: x[0], reverse=True) + _, clauses = zip(*clauses) + + for mapping in try_to_map([(c, clause2enum[c]) for c in clauses], {}): + if not mapping: + continue + + checks_ok = True + for check in numerical_checks: + args = [mapping[a] for a in check.args] + if check.name == 'ncoll': + checks_ok = g.check_ncoll(args) + elif check.name == 'npara': + checks_ok = g.check_npara(args) + elif check.name == 'nperp': + checks_ok = g.check_nperp(args) + elif check.name == 'sameside': + checks_ok = g.check_sameside(args) + if not checks_ok: + break + if not checks_ok: + continue + + yield mapping + tkirine = time.time() + print(tkirine-tchiaya) + +def match_test( + g: gh.Graph, + cache: Callable[str, list[tuple[gm.Point, ...]]], + theorem: pr.Theorem +) -> Generator[dict[str, gm.Point], None, None]: + """test""" + debugname(theorem) + tchiaya = time.time() + + for o,x,y,z in g.all_circles(): + circle = g.get_circle_thru_triplet(x,y,z) + sox = g._get_segment(o,x).val + print(vars(sox)) + + tkirine = time.time() + print(tkirine-tchiaya,theorem.name) + BUILT_IN_FNS = { 'cong_cong_cong_cyclic': match_cong_cong_cong_cyclic, 'cong_cong_cong_ncoll_contri*': match_cong_cong_cong_ncoll_contri, @@ -1370,6 +1430,10 @@ def match_generic( 'eqangle6_ncoll_cyclic': match_eqangle6_ncoll_cyclic, 'cyclic_coll_coll_eqratio': match_cyclic2power, 'circle_perp_coll_eqratio': match_cyclic2power_tan, + #'cyclic_coll_coll_coll_coll_coll_coll_coll': match_pascal6, + 'circle_cong_cong_perp_coll_coll_coll_coll_coll_coll' : match_pascal5, + 'cyclic_coll_coll_coll_coll_coll_coll_coll': match_generic_debug, + #'cyclic_cyclic_cong': match_test, } @@ -1592,8 +1656,8 @@ def apply_derivations( applied += g.do_algebra(name, arg) return applied -def debugname(ps): +def debugname(ps,n=0): if type(ps) is list: - print([p.name for p in ps]) + print(n,[p.name for p in ps]) else: - print(ps.name) + print(n,ps.name) diff --git a/kirine.txt b/kirine.txt index 9de35f2..55d3eb5 100644 --- a/kirine.txt +++ b/kirine.txt @@ -1,17 +1,24 @@ ========================== * From theorem premises: -A B C D E : Points +A B C D E F G H I J : Points DB = DC [00] DA = DB [01] -AE ⟂ AD [02] -C,B,E are collinear [03] +DE = DA [02] +DF = DA [03] +DG = DA [04] +E,H,F are collinear [05] +H,B,A are collinear [06] +I,B,C are collinear [07] +I,F,G are collinear [08] +E,J,C are collinear [09] +G,J,A are collinear [10] * Auxiliary Constructions: : Points * Proof steps: -001. DB = DC [00] & DA = DB [01] ⇒ D is the circumcenter of \Delta ACB [04] -002. D is the circumcenter of \Delta ACB [04] & AE ⟂ AD [02] & C,B,E are collinear [03] ⇒ EA:CE = BE:EA +001. DF = DA [03] & DG = DA [04] & DE = DA [02] & DB = DC [00] & DA = DB [01] ⇒ B,F,G,E,C,A are concyclic [11] +002. B,F,G,E,C,A are concyclic [11] & I,B,C are collinear [07] & I,F,G are collinear [08] & E,J,C are collinear [09] & G,J,A are collinear [10] & E,H,F are collinear [05] & H,B,A are collinear [06] ⇒ I,H,J are collinear ========================== diff --git a/nothing.txt b/nothing.txt index 8c2996b..8a24a23 100644 --- a/nothing.txt +++ b/nothing.txt @@ -1,180 +1,22 @@ -['d', 'f', 'b', 'a'] -['d', 'f', 'b', 'g'] -['d', 'f', 'b', 'c'] -['d', 'f', 'a', 'b'] -['d', 'f', 'a', 'g'] -['d', 'f', 'a', 'c'] -['d', 'f', 'g', 'b'] -['d', 'f', 'g', 'a'] -['d', 'f', 'g', 'c'] -['d', 'f', 'c', 'b'] -['d', 'f', 'c', 'a'] -['d', 'f', 'c', 'g'] -['d', 'b', 'f', 'a'] -['d', 'b', 'f', 'g'] -['d', 'b', 'f', 'c'] -['d', 'b', 'a', 'f'] -['d', 'b', 'a', 'g'] -['d', 'b', 'a', 'c'] -['d', 'b', 'g', 'f'] -['d', 'b', 'g', 'a'] -['d', 'b', 'g', 'c'] -['d', 'b', 'c', 'f'] -['d', 'b', 'c', 'a'] -['d', 'b', 'c', 'g'] -['d', 'a', 'f', 'b'] -['d', 'a', 'f', 'g'] -['d', 'a', 'f', 'c'] -['d', 'a', 'b', 'f'] -['d', 'a', 'b', 'g'] -['d', 'a', 'b', 'c'] -['d', 'a', 'g', 'f'] -['d', 'a', 'g', 'b'] -['d', 'a', 'g', 'c'] -['d', 'a', 'c', 'f'] -['d', 'a', 'c', 'b'] -['d', 'a', 'c', 'g'] -['d', 'g', 'f', 'b'] -['d', 'g', 'f', 'a'] -['d', 'g', 'f', 'c'] -['d', 'g', 'b', 'f'] -['d', 'g', 'b', 'a'] -['d', 'g', 'b', 'c'] -['d', 'g', 'a', 'f'] -['d', 'g', 'a', 'b'] -['d', 'g', 'a', 'c'] -['d', 'g', 'c', 'f'] -['d', 'g', 'c', 'b'] -['d', 'g', 'c', 'a'] -['d', 'c', 'f', 'b'] -['d', 'c', 'f', 'a'] -['d', 'c', 'f', 'g'] -['d', 'c', 'b', 'f'] -['d', 'c', 'b', 'a'] -['d', 'c', 'b', 'g'] -['d', 'c', 'a', 'f'] -['d', 'c', 'a', 'b'] -['d', 'c', 'a', 'g'] -['d', 'c', 'g', 'f'] -['d', 'c', 'g', 'b'] -['d', 'c', 'g', 'a'] -['d', 'f', 'b', 'a'] -['d', 'f', 'b', 'g'] -['d', 'f', 'b', 'c'] -['d', 'f', 'a', 'b'] -['d', 'f', 'a', 'g'] -['d', 'f', 'a', 'c'] -['d', 'f', 'g', 'b'] -['d', 'f', 'g', 'a'] -['d', 'f', 'g', 'c'] -['d', 'f', 'c', 'b'] -['d', 'f', 'c', 'a'] -['d', 'f', 'c', 'g'] -['d', 'b', 'f', 'a'] -['d', 'b', 'f', 'g'] -['d', 'b', 'f', 'c'] -['d', 'b', 'a', 'f'] -['d', 'b', 'a', 'g'] -['d', 'b', 'a', 'c'] -['d', 'b', 'g', 'f'] -['d', 'b', 'g', 'a'] -['d', 'b', 'g', 'c'] -['d', 'b', 'c', 'f'] -['d', 'b', 'c', 'a'] -['d', 'b', 'c', 'g'] -['d', 'a', 'f', 'b'] -['d', 'a', 'f', 'g'] -['d', 'a', 'f', 'c'] -['d', 'a', 'b', 'f'] -['d', 'a', 'b', 'g'] -['d', 'a', 'b', 'c'] -['d', 'a', 'g', 'f'] -['d', 'a', 'g', 'b'] -['d', 'a', 'g', 'c'] -['d', 'a', 'c', 'f'] -['d', 'a', 'c', 'b'] -['d', 'a', 'c', 'g'] -['d', 'g', 'f', 'b'] -['d', 'g', 'f', 'a'] -['d', 'g', 'f', 'c'] -['d', 'g', 'b', 'f'] -['d', 'g', 'b', 'a'] -['d', 'g', 'b', 'c'] -['d', 'g', 'a', 'f'] -['d', 'g', 'a', 'b'] -['d', 'g', 'a', 'c'] -['d', 'g', 'c', 'f'] -['d', 'g', 'c', 'b'] -['d', 'g', 'c', 'a'] -['d', 'c', 'f', 'b'] -['d', 'c', 'f', 'a'] -['d', 'c', 'f', 'g'] -['d', 'c', 'b', 'f'] -['d', 'c', 'b', 'a'] -['d', 'c', 'b', 'g'] -['d', 'c', 'a', 'f'] -['d', 'c', 'a', 'b'] -['d', 'c', 'a', 'g'] -['d', 'c', 'g', 'f'] -['d', 'c', 'g', 'b'] -['d', 'c', 'g', 'a'] -['d', 'f', 'b', 'a'] -['d', 'f', 'b', 'g'] -['d', 'f', 'b', 'c'] -['d', 'f', 'a', 'b'] -['d', 'f', 'a', 'g'] -['d', 'f', 'a', 'c'] -['d', 'f', 'g', 'b'] -['d', 'f', 'g', 'a'] -['d', 'f', 'g', 'c'] -['d', 'f', 'c', 'b'] -['d', 'f', 'c', 'a'] -['d', 'f', 'c', 'g'] -['d', 'b', 'f', 'a'] -['d', 'b', 'f', 'g'] -['d', 'b', 'f', 'c'] -['d', 'b', 'a', 'f'] -['d', 'b', 'a', 'g'] -['d', 'b', 'a', 'c'] -['d', 'b', 'g', 'f'] -['d', 'b', 'g', 'a'] -['d', 'b', 'g', 'c'] -['d', 'b', 'c', 'f'] -['d', 'b', 'c', 'a'] -['d', 'b', 'c', 'g'] -['d', 'a', 'f', 'b'] -['d', 'a', 'f', 'g'] -['d', 'a', 'f', 'c'] -['d', 'a', 'b', 'f'] -['d', 'a', 'b', 'g'] -['d', 'a', 'b', 'c'] -['d', 'a', 'g', 'f'] -['d', 'a', 'g', 'b'] -['d', 'a', 'g', 'c'] -['d', 'a', 'c', 'f'] -['d', 'a', 'c', 'b'] -['d', 'a', 'c', 'g'] -['d', 'g', 'f', 'b'] -['d', 'g', 'f', 'a'] -['d', 'g', 'f', 'c'] -['d', 'g', 'b', 'f'] -['d', 'g', 'b', 'a'] -['d', 'g', 'b', 'c'] -['d', 'g', 'a', 'f'] -['d', 'g', 'a', 'b'] -['d', 'g', 'a', 'c'] -['d', 'g', 'c', 'f'] -['d', 'g', 'c', 'b'] -['d', 'g', 'c', 'a'] -['d', 'c', 'f', 'b'] -['d', 'c', 'f', 'a'] -['d', 'c', 'f', 'g'] -['d', 'c', 'b', 'f'] -['d', 'c', 'b', 'a'] -['d', 'c', 'b', 'g'] -['d', 'c', 'a', 'f'] -['d', 'c', 'a', 'b'] -['d', 'c', 'a', 'g'] -['d', 'c', 'g', 'f'] -['d', 'c', 'g', 'b'] -['d', 'c', 'g', 'a'] +circle_perp_coll_eqratio +coll_coll_ncoll_eqratio_cyclic +cyclic_cyclic_cyclic_coll_coll_coll +circle_cong_cong_cong_coll_coll_coll_coll_coll_coll_coll +circle_cong_cong_perp_coll_coll_coll_coll_coll_coll +circle_cong_perp_coll_coll_coll_perp_coll_coll +circle_cong_perp_perp_coll_coll_coll_coll_coll +circle_cong_cong_coll_coll_coll_coll_coll_coll_coll_cong + +cyclic A B C D, coll P A B, coll P C D => eqratio P A P C P D P B +circle O A B C, perp O A A P, coll P B C => eqratio P A P B P C P A +coll P A B, coll P C D, ncoll A B C D, eqratio P A P C P D P B => cyclic A B C D +cyclic A B C D, cyclic A B E F, cyclic C D E F, coll P A B, coll P C D => coll P E F +circle O A B C, cong O A O D, cong O A O E, cong O A O F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I +circle O A B C, cong O A O D, cong O A O E, perp O A A G, coll G C D, coll H A B, coll H D E, coll I B C, coll I E A => coll G H I +circle O A B C, cong O A O D, perp O A A G, coll G B C, coll H A B, coll H C D, perp O B B I, coll I D A => coll G H I +circle O A B C, cong O A O D, perp O A A G, perp O B B G, coll H A C, coll H B D, coll I C B, coll I D A => coll G H I +circle O A B C, cong O A O D, cong O A O E, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A, coll G H I => cong O A O F + +cyclic A B C D E F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I +circle O A B C, cong O A O D, cong O A O E, cong O A O F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I +cyclic A B C D, cyclic A B C E => cong A D A E \ No newline at end of file diff --git a/pros2.txt b/pros2.txt index d078c93..fbcffe9 100644 --- a/pros2.txt +++ b/pros2.txt @@ -2,5 +2,19 @@ test_circle a b c = triangle a b c; o = circle o a b c; d = on_tline d a b c, on_circle d o a ? cyclic a b c a test_ccc2p a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; p = on_line p a b, on_line p c d ? eqratio p a p c p d p b -test_ccc2pt -a b c = triangle a b c; o = circle o a b c; p = on_line p b c, on_tline p a o a; d = on_circle d o a; e = on_line e p d, on_circle e o a ? eqratio p a p b p c p a \ No newline at end of file +test_ccc2pt1 +a b c = triangle a b c; o = circle o a b c; p = on_line p b c, on_tline p a o a; d = on_circle d o a; e = on_line e p d, on_circle e o a ? eqratio p a p b p c p a +test_ccc2pt2 +a b c = triangle a b c; o = circle o a b c; p = on_line p b c, on_tline p a o a; d = on_circle d o a; e = on_line e p d, on_circle e o a ? eqratio p a p d p e p a +test_ccc2pt3 +a b c = triangle a b c; o = circle o a b c; p = on_line p b a, on_tline p c o c; d = on_circle d o a; e = on_line e p d, on_circle e o a ? eqratio p c p b p a p c +test_ccc2pt4 +a b c = triangle a b c; o = circle o a b c; p = on_line p b a, on_tline p c o c; d = on_circle d o a; e = on_line e p d, on_circle e o a ? eqratio p c p d p e p c +test_pascal61 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_circle e o a; f = on_circle f o a; g = on_line g a b, on_line g d e; h = on_line h b c, on_line h e f; i = on_line i c d, on_line i f a ? coll g h i +test_pascal62 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_circle e o a; f = on_circle f o a; g = on_line g a b, on_line g d e; h = on_line h b c, on_line h e f; i = on_line i c d, on_line i f a; a1 b1 c1 = triangle a1 b1 c1; o1 = circle o1 a1 b1 c1; d1 = on_circle d1 o1 a1; e1 = on_circle e1 o1 a1; f1 = on_circle f1 o1 a1 ? coll g h i +test_circle2 +a b c = triangle a b c; o = circle o a b c; d = free; w = circle w a b d ? cong o a w a +test_pascal5 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_circle e o a; g = on_tline g a o a, on_line g c d; h = on_line h a b, on_line h d e; i = on_line i b c, on_line i e a ? coll g h i \ No newline at end of file diff --git a/rules.txt b/rules.txt index 072fe3f..c1252b8 100644 --- a/rules.txt +++ b/rules.txt @@ -44,7 +44,6 @@ para a b c d, coll m a d, coll n b c, para m n a b => eqratio6 m a m d n b n c cyclic A B C D, coll P A B, coll P C D => eqratio P A P C P D P B circle O A B C, perp O A A P, coll P B C => eqratio P A P B P C P A coll P A B, coll P C D, ncoll A B C D, eqratio P A P C P D P B => cyclic A B C D -circle O A B C, perp O A A P, coll P B C => eqratio P A P B P C P A cyclic A B C D, cyclic A B E F, cyclic C D E F, coll P A B, coll P C D => coll P E F cyclic A B C D E F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I cyclic A B C D E, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A, coll G H I => cyclic A B C D E F \ No newline at end of file diff --git a/rules1.txt b/rules1.txt index a2b7037..e0cf648 100644 --- a/rules1.txt +++ b/rules1.txt @@ -1,15 +1 @@ -cyclic A B C D, coll P A B, coll P C D => eqratio P A P C P D P B -circle O A B C, perp O A A P, coll P B C => eqratio P A P B P C P A -coll P A B, coll P C D, ncoll A B C D, eqratio P A P C P D P B => cyclic A B C D -cyclic A B C D, cyclic A B E F, cyclic C D E F, coll P A B, coll P C D => coll P E F -circle O A B C, cong O A O D, cong O A O E, cong O A O F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I -circle O A B C, cong O A O D, cong O A O E, perp O A A G, coll G C D, coll H A B, coll H D E, coll I B C, coll I E A => coll G H I -circle O A B C, cong O A O D, perp O A A G, coll G B C, coll H A B, coll H C D, perp O B B I, coll I D A => coll G H I -circle O A B C, cong O A O D, perp O A A G, perp O B B G, coll H A C, coll H B D, coll I C B, coll I D A => coll G H I -circle O A B C, cong O A O D, cong O A O E, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A, coll G H I => cong O A O F - -A A B B C D -AA BC / AB CD / BB DA - -A A C B B D -AA BB / AC BD / CB DA +cyclic A B C D E F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I diff --git a/rules2.txt b/rules2.txt index e643e0a..1c87686 100644 --- a/rules2.txt +++ b/rules2.txt @@ -1 +1,6 @@ -cong O A O B, cong O B O C, cong O C O D => cyclic A B C D \ No newline at end of file +cong O A O B, cong O B O C, cong O C O D => cyclic A B C D +A A B B C D +AA BC / AB CD / BB DA + +A A C B B D +AA BB / AC BD / CB DA \ No newline at end of file From dfd4d3a4631eb86f808a79213b952d03b53100e1 Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.cn> Date: Mon, 10 Mar 2025 19:07:10 +0800 Subject: [PATCH 10/27] match_dd --- chiaya.sh | 2 +- dd.py | 151 ++++++++++++++++++++++++++++++----------------------- kirine.txt | 20 +++---- pros2.txt | 18 ++++++- rules1.txt | 2 +- test.py | 9 +++- 6 files changed, 121 insertions(+), 81 deletions(-) diff --git a/chiaya.sh b/chiaya.sh index b99f227..de13e97 100644 --- a/chiaya.sh +++ b/chiaya.sh @@ -41,7 +41,7 @@ INPUT_FILE=pros2.txt python -m alphageometry \ --alsologtostderr \ --problems_file=$(pwd)/$INPUT_FILE \ ---problem_name=test_pascal61 \ +--problem_name=test_pascal63 \ --mode=alphageometry \ "${DDAR_ARGS[@]}" \ "${SEARCH_ARGS[@]}" \ diff --git a/dd.py b/dd.py index 07b0c34..bb66b5d 100644 --- a/dd.py +++ b/dd.py @@ -55,21 +55,6 @@ def diff_point(l: gm.Line, a: gm.Point) -> gm.Point: import time -def measure_time(func): - def wrapper(*args, **kwargs): - start_time = time.time() - - result = func(*args, **kwargs) - - end_time = time.time() - elapsed_time = end_time - start_time - - print(f"Function '{func.__name__}' took {elapsed_time:.9f} seconds to complete.") - - return result - - return wrapper - # pylint: disable=protected-access # pylint: disable=unused-argument @@ -476,6 +461,7 @@ def match_cyclic2power( theorem: pr.Theorem, ) -> Generator[dict[str, gm.Point], None, None]: """Match cyclic A B C D, coll P A B, coll P C D => eqratio P A P C P D P B""" + ta = time.time() record = set() for a,b,c,d in g_matcher('cyclic'): if (a,b,c,d) in record: @@ -508,6 +494,8 @@ def match_cyclic2power( p = intersect1(p1s, p2s) if p: yield dict(zip('PABCD',[p,a,d,b,c])) + tb = time.time() + print("c2p",tb-ta) def match_cyclic2power_tan( g: gh.Graph, @@ -515,6 +503,7 @@ def match_cyclic2power_tan( theorem: pr.Theorem, ) -> Generator[dict[str, gm.Point], None, None]: """Match circle O A B C, perp O A A P, coll P B C => eqratio P A P B P C P A """ + ta = time.time() for o,a,b,c in g.all_circles(): bc = g._get_line(b,c) if not bc: @@ -530,6 +519,8 @@ def match_cyclic2power_tan( if p: yield dict(zip('OPABC', [o, p, a, b, c])) break + tb = time.time() + print(tb-ta) def match_power2cyclic( @@ -538,6 +529,7 @@ def match_power2cyclic( theorem: pr.Theorem, ) -> Generator[dict[str, gm.Point], None, None]: """Match coll P A B, coll P C D, ncoll A B C D, eqratio P A P C P D P B => cyclic A B C D""" + ta = time.time() all_lines = g.type2nodes[gm.Line] for l1,l2 in utils.comb2(all_lines): l1s = l1.neighbors(gm.Point, return_set=True) @@ -549,20 +541,20 @@ def match_power2cyclic( l2s = list(l2s) for a,b in utils.comb2(l1s): for c,d in utils.comb2(l2s): - if g.check_eqratio([p, a, p, c, p, d, p, b]): + if g.check_eqratio([p, a, p, c, p, d, p, b]) and not g.check_coll([p,a,c]): yield dict(zip('PABCD', [p, a, b, c, d])) + tb = time.time() + print("p2c",tb-ta) -@measure_time def match_pascal6( g: gh.Graph, g_matcher: Callable[str, list[tuple[gm.Point, ...]]], theorem: pr.Theorem, ) -> Generator[dict[str, gm.Point], None, None]: """Match cyclic A B C D E F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I""" - tchiaya=time.time() + ta = time.time() recordc = set() record = set() - cnt = 0 for o,x,y,z in g.all_circles(): if (o,x) in recordc: continue @@ -605,8 +597,8 @@ def match_pascal6( i = intersect1(i1s, i2s) if gg and h and i: yield dict(zip('ABCDEFGHI',[a,b,c,d,e,f,gg,h,i])) - tkirine = time.time() - print(tkirine-tchiaya) + tb = time.time() + print(tb-ta) def match_pascal6_rev( g: gh.Graph, @@ -614,6 +606,7 @@ def match_pascal6_rev( theorem: pr.Theorem, ) -> Generator[dict[str, gm.Point], None, None]: """Match cyclic A B C D E, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A, coll G H I => cyclic A B C D E F""" + ta = time.time() recordc = set() record = set() for o,x,y,z in g.all_circles(): @@ -621,9 +614,9 @@ def match_pascal6_rev( continue circle = g.get_circle_thru_triplet(x,y,z) for op in circle.neighbors(gm.Point): - recordc.add((o.name,op.name)) + recordc.add((o,op)) for a, b, c, d, e in utils.perm5(circle.neighbors(gm.Point)): - if (a,b,c,d,e) in record: + if (a,b,c,d,e) in record or (e,d,c,b,a) in record: continue record.add((a,b,c,d,e)) @@ -636,13 +629,13 @@ def match_pascal6_rev( continue g1s = ab.neighbors(gm.Point, return_set=True) - g2s = cd.neighbors(gm.Point, return_set=True) + g2s = de.neighbors(gm.Point, return_set=True) gg = intersect1(g1s, g2s) if not gg: continue for f in g.all_points(): - if f in {a,b,c,d,e}: + if f in {o,a,b,c,d,e}: continue ef = g._get_line(e, f) fa = g._get_line(f, a) @@ -654,15 +647,17 @@ def match_pascal6_rev( h = intersect1(h1s, h2s) i = intersect1(i1s, i2s) if h and i and g.check_coll([gg,h,i]): - yield dict(zip('ABCDEFGHI',[a,b,c,d,e,f,gg,h,i])) + yield dict(zip('OABCDEFGHI',[o,a,b,c,d,e,f,gg,h,i])) + tb = time.time() + print(tb-ta) -@measure_time def match_pascal5( g: gh.Graph, g_matcher: Callable[str, list[tuple[gm.Point, ...]]], theorem: pr.Theorem, ) -> Generator[dict[str, gm.Point], None, None]: """Match cyclic A B C D E, perp O A A G, coll G C D, coll H A B, coll H D E, coll I B C, coll I E A => coll G H I""" + ta = time.time() recordc = set() record = set() for o,x,y,z in g.all_circles(): @@ -705,6 +700,8 @@ def match_pascal5( i = intersect1(i1s, i2s) if gg and h and i: yield dict(zip('OABCDEGHI',[o,a,b,c,d,e,gg,h,i])) + tb = time.time() + print(tb-ta) def match_pascal41( g: gh.Graph, @@ -712,13 +709,15 @@ def match_pascal41( theorem: pr.Theorem, ) -> Generator[dict[str, gm.Point], None, None]: """circle O A B C, cong O A O D, perp O A A G, coll G B C, coll H A B, coll H C D, perp O B B I, coll I D A => coll G H I (AABBCD)""" + ta = time.time() recordc = set() + record = set() for o,x,y,z in g.all_circles(): - circle = g.get_circle_thru_triplet(x,y,z) - if circle in recordc: + if (o,x) in recordc: continue - recordc.add(circle) - record = set() + circle = g.get_circle_thru_triplet(x,y,z) + for op in circle.neighbors(gm.Point): + recordc.add((o,op)) for a,b,c,d in utils.perm4(circle.neighbors(gm.Point)): if (a,b,c,d) in record or (b,a,d,c) in record: continue @@ -761,6 +760,8 @@ def match_pascal41( i = intersect1(i1s, i2s) if gg and h and i: yield dict(zip('OABCDGHI',[o,a,b,c,d,gg,h,i])) + tb = time.time() + print(tb-ta) def match_pascal42( g: gh.Graph, @@ -768,13 +769,15 @@ def match_pascal42( theorem: pr.Theorem, ) -> Generator[dict[str, gm.Point], None, None]: """circle O A B C, cong O A O D, perp O A A G, perp O B B G, coll H A C, coll H B D, coll I C B, coll I D A => coll G H I (AACBBD)""" + ta = time.time() recordc = set() + record = set() for o,x,y,z in g.all_circles(): - circle = g.get_circle_thru_triplet(x,y,z) - if circle in recordc: + if (o,x) in recordc: continue - recordc.add(circle) - record = set() + circle = g.get_circle_thru_triplet(x,y,z) + for op in circle.neighbors(gm.Point): + recordc.add((o,op)) for a,b,c,d in utils.perm4(circle.neighbors(gm.Point)): if (a,b,c,d) in record or (b,a,c,d) in record or (a,b,d,c) in record or (b,a,d,c) in record: continue @@ -817,6 +820,8 @@ def match_pascal42( i = intersect1(i1s, i2s) if gg and h and i: yield dict(zip('OABCDGHI',[o,a,b,c,d,gg,h,i])) + tb = time.time() + print(tb-ta) def match_radical_axis( g: gh.Graph, @@ -824,47 +829,53 @@ def match_radical_axis( theorem: pr.Theorem, ) -> Generator[dict[str, gm.Point], None, None]: """cyclic A B C D, cyclic A B E F, cyclic C D E F, coll P A B, coll P C D => coll P E F""" + ta = time.time() circles = set() + recordc = set() for o,x,y,z in g.all_circles(): + if (o,x) in recordc: + continue circle = g.get_circle_thru_triplet(x,y,z) + for op in circle.neighbors(gm.Point): + recordc.add((o,op)) circles.add(circle) - intersect_cnt = dict[(gm.Circle,gm.Circle),list[gm.Point]] + intersectps = {} circles = list(circles) for c1,c2 in utils.comb2(circles): c1s = c1.neighbors(gm.Point, return_set=True) - c2s = c1.neighbors(gm.Point, return_set=True) - intersect_cnt[(c1,c2)] = intersect_cnt[(c2,c1)] = [x for x in c1s if x in c2s] + c2s = c2.neighbors(gm.Point, return_set=True) + intersectps[(c1,c2)] = intersectps[(c2,c1)] = {x for x in c1s if x in c2s} for c1,c2,c3 in utils.comb3(circles): - c12 = intersect_cnt[(c1,c2)] - c13 = intersect_cnt[(c1,c3)] - c23 = intersect_cnt[(c2,c3)] - if c12 == 2 and c13 == 2 and c23 == 2: - c1s = c1.neighbors(gm.Point, return_set=True) - c2s = c1.neighbors(gm.Point, return_set=True) - c3s = c1.neighbors(gm.Point, return_set=True) - a,b = intersect2(c1s,c2s) - c,d = intersect2(c1s,c3s) - e,f = intersect2(c2s,c3s) + c12 = intersectps[(c1,c2)] + c13 = intersectps[(c1,c3)] + c23 = intersectps[(c2,c3)] + if len(c12) == 2 and len(c13) == 2 and len(c23) == 2: + a,b = c12 + c,d = c13 + e,f = c23 assert a and b and c and d and e and f ab = g._get_line(a,b) cd = g._get_line(c,d) ef = g._get_line(e,f) - pab = ab.neighbors(gm.Point, return_set=True) - pcd = cd.neighbors(gm.Point, return_set=True) - pef = ef.neighbors(gm.Point, return_set=True) - p1 = intersect1(pab,pcd) - p2 = intersect1(pab,pef) - p3 = intersect1(pcd,pef) - # if p1 and p2 and p3: - # continue - if p1: - yield dict(zip('ABCDEFP',[a,b,c,d,e,f,p1])) - if p2: - yield dict(zip('ABCDEFP',[a,b,e,f,c,d,p2])) - if p3: - yield dict(zip('ABCDEFP',[c,d,e,f,c,d,p3])) + if ab and cd and ef: + pab = ab.neighbors(gm.Point, return_set=True) + pcd = cd.neighbors(gm.Point, return_set=True) + pef = ef.neighbors(gm.Point, return_set=True) + p1 = intersect1(pab,pcd) + p2 = intersect1(pab,pef) + p3 = intersect1(pcd,pef) + # if p1 and p2 and p3: + # continue + if p1: + yield dict(zip('ABCDEFP',[a,b,c,d,e,f,p1])) + if p2: + yield dict(zip('ABCDEFP',[a,b,e,f,c,d,p2])) + if p3: + yield dict(zip('ABCDEFP',[c,d,e,f,a,b,p3])) + tb = time.time() + print(tb-ta) def rotate_simtri( a: gm.Point, b: gm.Point, c: gm.Point, x: gm.Point, y: gm.Point, z: gm.Point @@ -1285,6 +1296,7 @@ def match_generic( ) -> Generator[dict[str, gm.Point], None, None]: """Match any generic rule that is not one of the above match_*() rules.""" debugname(theorem) + ta = time.time() clause2enum = {} clauses = [] @@ -1326,8 +1338,10 @@ def match_generic( yield mapping + tb = time.time() + print(tb-ta) + -@measure_time def match_generic_debug( g: gh.Graph, cache: Callable[str, list[tuple[gm.Point, ...]]], @@ -1376,7 +1390,7 @@ def match_generic_debug( yield mapping tkirine = time.time() - print(tkirine-tchiaya) + print(theorem.name,tkirine-tchiaya) def match_test( g: gh.Graph, @@ -1430,9 +1444,14 @@ def match_test( 'eqangle6_ncoll_cyclic': match_eqangle6_ncoll_cyclic, 'cyclic_coll_coll_eqratio': match_cyclic2power, 'circle_perp_coll_eqratio': match_cyclic2power_tan, - #'cyclic_coll_coll_coll_coll_coll_coll_coll': match_pascal6, + 'coll_coll_ncoll_eqratio_cyclic': match_power2cyclic, + 'cyclic_cyclic_cyclic_coll_coll_coll': match_radical_axis, + 'cyclic_coll_coll_coll_coll_coll_coll_coll': match_pascal6, 'circle_cong_cong_perp_coll_coll_coll_coll_coll_coll' : match_pascal5, - 'cyclic_coll_coll_coll_coll_coll_coll_coll': match_generic_debug, + 'circle_cong_perp_coll_coll_coll_perp_coll_coll' : match_pascal41, + 'circle_cong_perp_perp_coll_coll_coll_coll_coll' : match_pascal42, + 'circle_cong_cong_coll_coll_coll_coll_coll_coll_coll_cong' : match_pascal6_rev, + #'circle_perp_coll_eqratio': match_generic_debug, #'cyclic_cyclic_cong': match_test, } diff --git a/kirine.txt b/kirine.txt index 55d3eb5..cdffacd 100644 --- a/kirine.txt +++ b/kirine.txt @@ -2,23 +2,23 @@ ========================== * From theorem premises: A B C D E F G H I J : Points -DB = DC [00] -DA = DB [01] +DA = DB [00] +DB = DC [01] DE = DA [02] DF = DA [03] DG = DA [04] -E,H,F are collinear [05] -H,B,A are collinear [06] -I,B,C are collinear [07] -I,F,G are collinear [08] -E,J,C are collinear [09] -G,J,A are collinear [10] +E,F,H are collinear [05] +H,A,B are collinear [06] +F,I,G are collinear [07] +C,I,B are collinear [08] +J,A,G are collinear [09] +E,C,J are collinear [10] * Auxiliary Constructions: : Points * Proof steps: -001. DF = DA [03] & DG = DA [04] & DE = DA [02] & DB = DC [00] & DA = DB [01] ⇒ B,F,G,E,C,A are concyclic [11] -002. B,F,G,E,C,A are concyclic [11] & I,B,C are collinear [07] & I,F,G are collinear [08] & E,J,C are collinear [09] & G,J,A are collinear [10] & E,H,F are collinear [05] & H,B,A are collinear [06] ⇒ I,H,J are collinear +001. DF = DA [03] & DG = DA [04] & DA = DB [00] & DE = DA [02] & DB = DC [01] ⇒ E,B,F,C,A,G are concyclic [11] +002. E,B,F,C,A,G are concyclic [11] & E,F,H are collinear [05] & H,A,B are collinear [06] & F,I,G are collinear [07] & C,I,B are collinear [08] & J,A,G are collinear [09] & E,C,J are collinear [10] ⇒ I,J,H are collinear ========================== diff --git a/pros2.txt b/pros2.txt index fbcffe9..c96000a 100644 --- a/pros2.txt +++ b/pros2.txt @@ -14,7 +14,23 @@ test_pascal61 a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_circle e o a; f = on_circle f o a; g = on_line g a b, on_line g d e; h = on_line h b c, on_line h e f; i = on_line i c d, on_line i f a ? coll g h i test_pascal62 a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_circle e o a; f = on_circle f o a; g = on_line g a b, on_line g d e; h = on_line h b c, on_line h e f; i = on_line i c d, on_line i f a; a1 b1 c1 = triangle a1 b1 c1; o1 = circle o1 a1 b1 c1; d1 = on_circle d1 o1 a1; e1 = on_circle e1 o1 a1; f1 = on_circle f1 o1 a1 ? coll g h i +test_pascal63 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_circle e o a; f = on_circle f o a; g = on_line g a b, on_line g d e; h = on_line h b c, on_line h e f; i = on_line i c d, on_line i f a; a1 = free; b1 = free; c1 = free; o1 = circle o1 a1 b1 c1; d1 = on_circle d1 o1 a1; e1 = on_circle e1 o1 a1; f1 = on_circle f1 o1 a1 ? coll g h i test_circle2 a b c = triangle a b c; o = circle o a b c; d = free; w = circle w a b d ? cong o a w a test_pascal5 -a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_circle e o a; g = on_tline g a o a, on_line g c d; h = on_line h a b, on_line h d e; i = on_line i b c, on_line i e a ? coll g h i \ No newline at end of file +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_circle e o a; g = on_tline g a o a, on_line g c d; h = on_line h a b, on_line h d e; i = on_line i b c, on_line i e a ? coll g h i +test_pascal41 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; g = on_tline g a o a, on_line g b c; h = on_line h a b, on_line h c d; i = on_tline i b o b, on_line i d a ? coll g h i +test_pascal42 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; g = on_tline g a o a, on_tline g b o b; h = on_line h a c, on_line h b d; i = on_line i c b, on_line i d a ? coll g h i +test_pascal6_rev +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_circle e o a; g = on_line g a b, on_line g d e; h = on_line h b c; i = on_line i g h, on_line i c d; f = on_line f h e, on_line f a i ? cong o a o f +test_p2ccc +a b = segment a b; o = on_bline o a b; w = on_bline w a b; c = on_circle c o a; d = on_circle d o a; p = on_line p a b, on_line p c d; e = on_circle e w a; f = on_circle f w a, on_line f p e ? cyclic c d e f +test_radical_axis1 +a b = segment a b; o1 = on_bline o1 a b; o2 = on_bline o2 a b; o3 = free; c = on_circle c o1 a; d = on_circle d o1 a, on_circle d o3 c; e = on_circle e o2 a, on_circle e o3 c; f = on_circle f o2 a, on_circle f o3 c; g = on_line g c d, on_line g e f ? coll g a b +test_radical_axis2 +a b c = triangle a b c; e = free; o1 = circle o1 a b c; o2 = circle o2 a b e; o3 = on_bline o3 c e; d = on_circle d o1 a, on_circle d o3 c; f = on_circle f o2 a, on_circle f o3 c; g = on_line g c d, on_line g e f ? coll g a b +test_radical_axis_rev +a b c = triangle a b c; d = on_line a b; o1 = circle o1 a b c; e = on_line e c d, on_circle e o1 a; o2 = on_bline o2 c e; f = on_circle f o2 c; g = on_circle g o2 c, on_line g d f ? cyclic a b f g \ No newline at end of file diff --git a/rules1.txt b/rules1.txt index e0cf648..53244e4 100644 --- a/rules1.txt +++ b/rules1.txt @@ -1 +1 @@ -cyclic A B C D E F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I +cyclic A B C D E F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I \ No newline at end of file diff --git a/test.py b/test.py index a6b76de..ff35ee3 100644 --- a/test.py +++ b/test.py @@ -1,2 +1,7 @@ -import tensorflow as tf -print("TensorFlow GPU available:", tf.test.is_gpu_available()) \ No newline at end of file +a = {3,4,5,6,7} + +b = {z for z in a if z %2 == 0} + +x,y = b + +print(x,y) \ No newline at end of file From 3a0d8f72e63e5cbf7930fed8501a92f51c151446 Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.cn> Date: Tue, 18 Mar 2025 10:00:01 +0800 Subject: [PATCH 11/27] me&ce --- dd.py | 238 ++++++++++++++++++++++++++++++++++++++++++++++++++ graph.py | 6 ++ numericals.py | 14 +++ rules.txt | 9 +- test.py | 14 ++- 5 files changed, 276 insertions(+), 5 deletions(-) diff --git a/dd.py b/dd.py index bb66b5d..5580b3f 100644 --- a/dd.py +++ b/dd.py @@ -876,7 +876,241 @@ def match_radical_axis( yield dict(zip('ABCDEFP',[c,d,e,f,a,b,p3])) tb = time.time() print(tb-ta) + +def match_menelaus( + g: gh.Graph, + g_matcher: Callable[str, list[tuple[gm.Point, ...]]], + theorem: pr.Theorem, +) -> Generator[dict[str, gm.Point], None, None]: + """Match coll A F B, coll B D C, coll C E A, coll D E F => eqratio30 A F F B B D D C C E E A""" + #print("menelaus") + recordl = set() + ta = time.time() + all_lines = g.type2nodes[gm.Line] + for l1,l2,l3 in utils.comb3(all_lines): + l1s = l1.neighbors(gm.Point, return_set=True) + l2s = l2.neighbors(gm.Point, return_set=True) + l3s = l3.neighbors(gm.Point, return_set=True) + # l1: bc, l2: ca, l3: ab + a = intersect1(l2s,l3s) + b = intersect1(l1s,l3s) + c = intersect1(l1s,l2s) + if not (a and b and c): + continue + if a == b or b == c or c == a: + continue + if (a, b, c) in recordl: + continue + recordl.add((a, b, c)) + recordl.add((a, c, b)) + recordl.add((b, a, c)) + recordl.add((b, c, a)) + recordl.add((c, a, b)) + recordl.add((c, b, a)) + recordp = set() + for d, e, f in utils.cross3(l1s, l2s, l3s): + if d in {a, b, c} or e in {a, b, c} or f in {a, b, c}: + continue + if (d, e, f) in recordp: + continue + recordp.add((d, e, f)) + recordp.add((d, f, e)) + recordp.add((e, d, f)) + recordp.add((e, f, d)) + recordp.add((f, d, e)) + recordp.add((f, e, d)) + if g.check_coll([d, e, f]): + #debugname([a, b, c, d, e, f]) + yield dict(zip('ABCDEF', [a, b, c, d, e, f])) + tb = time.time() + print(tb-ta) + + +def match_ceva( + g: gh.Graph, + g_matcher: Callable[str, list[tuple[gm.Point, ...]]], + theorem: pr.Theorem, +) -> Generator[dict[str, gm.Point], None, None]: + """Match coll A F B, coll B D C, coll C E A, coll B P E, coll C P F, coll A P D => eqratio30 A F F B B D D C C E E A""" + #print("ceva") + recordl = set() + ta = time.time() + all_lines = g.type2nodes[gm.Line] + for l1,l2,l3 in utils.comb3(all_lines): + l1s = l1.neighbors(gm.Point, return_set=True) + l2s = l2.neighbors(gm.Point, return_set=True) + l3s = l3.neighbors(gm.Point, return_set=True) + # l1: bc, l2: ca, l3: ab + a = intersect1(l2s,l3s) + b = intersect1(l1s,l3s) + c = intersect1(l1s,l2s) + if not (a and b and c): + continue + if a == b or b == c or c == a: + continue + if (a, b, c) in recordl: + continue + recordl.add((a, b, c)) + recordl.add((a, c, b)) + recordl.add((b, a, c)) + recordl.add((b, c, a)) + recordl.add((c, a, b)) + recordl.add((c, b, a)) + recordp = set() + for d, e, f in utils.cross3(l1s, l2s, l3s): + if d in {a, b, c} or e in {a, b, c} or f in {a, b, c}: + continue + if (d, e, f) in recordp: + continue + recordp.add((d, e, f)) + recordp.add((d, f, e)) + recordp.add((e, d, f)) + recordp.add((e, f, d)) + recordp.add((f, d, e)) + recordp.add((f, e, d)) + + ad = g._get_line(a, d) + be = g._get_line(b, e) + if not (ad and be): + continue + ads = ad.neighbors(gm.Point, return_set=True) + bes = be.neighbors(gm.Point, return_set=True) + p = intersect1(ads, bes) + if g.check_coll([p, c, f]): + #debugname([p, a, b, c, d, e, f]) + yield dict(zip('PABCDEF', [p, a, b, c, d, e, f])) + tb = time.time() + #print(tb-ta) + +def match_menelaus_rev( + g: gh.Graph, + g_matcher: Callable[str, list[tuple[gm.Point, ...]]], + theorem: pr.Theorem, +) -> Generator[dict[str, gm.Point], None, None]: + """Match coll A F B, coll B D C, coll C E A, eqratio30 A F F B B D D C C E E A => coll D E F""" + print("menelaus_rev") + recordl = set() + ta = time.time() + all_lines = g.type2nodes[gm.Line] + for l1,l2,l3 in utils.comb3(all_lines): + l1s = l1.neighbors(gm.Point, return_set=True) + l2s = l2.neighbors(gm.Point, return_set=True) + l3s = l3.neighbors(gm.Point, return_set=True) + # l1: bc, l2: ca, l3: ab + a = intersect1(l2s,l3s) + b = intersect1(l1s,l3s) + c = intersect1(l1s,l2s) + if not (a and b and c): + continue + if a == b or b == c or c == a: + continue + if (a, b, c) in recordl: + continue + recordl.add((a, b, c)) + recordl.add((a, c, b)) + recordl.add((b, a, c)) + recordl.add((b, c, a)) + recordl.add((c, a, b)) + recordl.add((c, b, a)) + recordp = set() + for d, e, f in utils.cross3(l1s, l2s, l3s): + if d in {a, b, c} or e in {a, b, c} or f in {a, b, c}: + continue + if (d, e, f) in recordp: + continue + recordp.add((d, e, f)) + recordp.add((d, f, e)) + recordp.add((e, d, f)) + recordp.add((e, f, d)) + recordp.add((f, d, e)) + recordp.add((f, e, d)) + + x1 = g.check_onseg([d, b, c]) + x2 = g.check_onseg([e, c, a]) + x3 = g.check_onseg([f, a, b]) + if x1 + x2 + x3 not in {0, 2}: + continue + if g.check_eqratio30([a, f, f, b, b, d, d, c, c, e, e, a]): + yield dict(zip('ABCDEF', [a, b, c, d, e, f])) + tb = time.time() + print(tb-ta) +def match_ceva_rev( + g: gh.Graph, + g_matcher: Callable[str, list[tuple[gm.Point, ...]]], + theorem: pr.Theorem, +) -> Generator[dict[str, gm.Point], None, None]: + """Match coll A F B, coll B D C, coll C E A, coll B P E, coll C P F, eqratio30 A F F B B D D C C E E A => coll A P D""" + print("ceva_rev") + recordl = set() + ta = time.time() + all_lines = g.type2nodes[gm.Line] + for l1,l2,l3 in utils.comb3(all_lines): + l1s = l1.neighbors(gm.Point, return_set=True) + l2s = l2.neighbors(gm.Point, return_set=True) + l3s = l3.neighbors(gm.Point, return_set=True) + # l1: bc, l2: ca, l3: ab + a = intersect1(l2s,l3s) + b = intersect1(l1s,l3s) + c = intersect1(l1s,l2s) + if not (a and b and c): + continue + if a == b or b == c or c == a: + continue + if (a, b, c) in recordl: + continue + recordl.add((a, b, c)) + recordl.add((a, c, b)) + recordl.add((b, a, c)) + recordl.add((b, c, a)) + recordl.add((c, a, b)) + recordl.add((c, b, a)) + recordp = set() + for d, e, f in utils.cross3(l1s, l2s, l3s): + if d in {a, b, c} or e in {a, b, c} or f in {a, b, c}: + continue + if (d, e, f) in recordp: + continue + recordp.add((d, e, f)) + recordp.add((d, f, e)) + recordp.add((e, d, f)) + recordp.add((e, f, d)) + recordp.add((f, d, e)) + recordp.add((f, e, d)) + + x1 = g.check_onseg([d, b, c]) + x2 = g.check_onseg([e, c, a]) + x3 = g.check_onseg([f, a, b]) + if x1 + x2 + x3 not in {1, 3}: + continue + if g.check_eqratio30([a, f, f, b, b, d, d, c, c, e, e, a]): + ad = g._get_line(a, d) + be = g._get_line(b, e) + cf = g._get_line(c, f) + if ad and be: + ads = ad.neighbors(gm.Point, return_set=True) + bes = be.neighbors(gm.Point, return_set=True) + pab = intersect1(ads, bes) + if pab: + #debugname([pab, c, a, b, f, d, e]) + yield dict(zip('PABCDEF', [pab, c, a, b, f, d, e])) + if be and cf: + bes = be.neighbors(gm.Point, return_set=True) + cfs = cf.neighbors(gm.Point, return_set=True) + pbc = intersect1(bes, cfs) + if pbc: + #debugname([pbc, a, b, c, d, e, f]) + yield dict(zip('PABCDEF', [pbc, a, b, c, d, e, f])) + if cf and ad: + cfs = cf.neighbors(gm.Point, return_set=True) + ads = ad.neighbors(gm.Point, return_set=True) + pca = intersect1(cfs, ads) + if pca: + #debugname([pca, b, c, a, e, f, d]) + yield dict(zip('PABCDEF', [pca, b, c, a, e, f, d])) + tb = time.time() + print(tb-ta) + def rotate_simtri( a: gm.Point, b: gm.Point, c: gm.Point, x: gm.Point, y: gm.Point, z: gm.Point ) -> Generator[tuple[gm.Point, ...], None, None]: @@ -1451,6 +1685,10 @@ def match_test( 'circle_cong_perp_coll_coll_coll_perp_coll_coll' : match_pascal41, 'circle_cong_perp_perp_coll_coll_coll_coll_coll' : match_pascal42, 'circle_cong_cong_coll_coll_coll_coll_coll_coll_coll_cong' : match_pascal6_rev, + 'coll_coll_coll_coll_eqratio30': match_menelaus, + 'coll_coll_coll_coll_coll_coll_eqratio30': match_ceva, + 'coll_coll_coll_eqratio30_coll': match_menelaus_rev, + 'coll_coll_coll_coll_coll_eqratio30_coll': match_ceva_rev, #'circle_perp_coll_eqratio': match_generic_debug, #'cyclic_cyclic_cong': match_test, } diff --git a/graph.py b/graph.py index 39d0c8c..071df9b 100644 --- a/graph.py +++ b/graph.py @@ -1002,6 +1002,12 @@ def check_ncoll(self, points: list[Point]) -> bool: def check_sameside(self, points: list[Point]) -> bool: return nm.check_sameside([p.num for p in points]) + def check_onseg(self, points: list[Point]) -> bool: + return nm.check_onseg([p.num for p in points]) + + def check_offseg(self, points: list[Point]) -> bool: + return nm.check_offseg([p.num for p in points]) + def make_equal(self, x: gm.Node, y: gm.Node, deps: Dependency) -> None: """Make that two nodes x and y are equal, i.e. merge their value node.""" if x.val is None: diff --git a/numericals.py b/numericals.py index d5a63e5..4adf096 100644 --- a/numericals.py +++ b/numericals.py @@ -678,6 +678,20 @@ def check_sameside(points: list[Point]) -> bool: yz = y - z return ba.dot(bc) * yx.dot(yz) > 0 +def check_onseg(points: list[Point]) -> bool: + b, a, c = points + # whether b(on line ac) is on segment ac + ba = b - a + bc = b - c + return ba.dot(bc) < 0 + +def check_offseg(points: list[Point]) -> bool: + b, a, c = points + # whether b(on line ac) is not on segment ac + ba = b - a + bc = b - c + return ba.dot(bc) > 0 + def check_para_or_coll(points: list[Point]) -> bool: return check_para(points) or check_coll(points) diff --git a/rules.txt b/rules.txt index c1252b8..d4e395a 100644 --- a/rules.txt +++ b/rules.txt @@ -46,4 +46,11 @@ circle O A B C, perp O A A P, coll P B C => eqratio P A P B P C P A coll P A B, coll P C D, ncoll A B C D, eqratio P A P C P D P B => cyclic A B C D cyclic A B C D, cyclic A B E F, cyclic C D E F, coll P A B, coll P C D => coll P E F cyclic A B C D E F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I -cyclic A B C D E, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A, coll G H I => cyclic A B C D E F \ No newline at end of file +circle O A B C, cong O A O D, cong O A O E, perp O A A G, coll G C D, coll H A B, coll H D E, coll I B C, coll I E A => coll G H I +circle O A B C, cong O A O D, perp O A A G, coll G B C, coll H A B, coll H C D, perp O B B I, coll I D A => coll G H I +circle O A B C, cong O A O D, perp O A A G, perp O B B G, coll H A C, coll H B D, coll I C B, coll I D A => coll G H I +circle O A B C, cong O A O D, cong O A O E, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A, coll G H I => cong O A O F +coll A F B, coll B D C, coll C E A, coll D E F => eqratio30 A F F B B D D C C E E A +coll A F B, coll B D C, coll C E A, coll B P E, coll C P F, coll A P D => eqratio30 A F F B B D D C C E E A +coll A F B, coll B D C, coll C E A, eqratio30 A F F B B D D C C E E A => coll D E F +coll A F B, coll B D C, coll C E A, coll B P E, coll C P F, eqratio30 A F F B B D D C C E E A => coll A P D diff --git a/test.py b/test.py index ff35ee3..cc6f888 100644 --- a/test.py +++ b/test.py @@ -1,7 +1,13 @@ -a = {3,4,5,6,7} +a = (2>0) -b = {z for z in a if z %2 == 0} +b = True -x,y = b +c = (3<0) -print(x,y) \ No newline at end of file +print(a+b) + +print(a+c) + +print(2*a+b) + +print(a) \ No newline at end of file From a3b7a33bc9125419c62dad4792a80ea533dfea32 Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.com> Date: Tue, 18 Mar 2025 19:38:38 +0800 Subject: [PATCH 12/27] reproduce --- ar.py | 47 ++++- geometry.py | 72 +++++++- graph.py | 502 ++++++++++++++++++++++++++++++++++++++++++++++++++-- pretty.py | 2 + problem.py | 255 +++++++++++++++++++++++--- test.py | 19 +- 6 files changed, 831 insertions(+), 66 deletions(-) diff --git a/ar.py b/ar.py index 01dd8cc..58c1fd9 100644 --- a/ar.py +++ b/ar.py @@ -17,7 +17,7 @@ from collections import defaultdict # pylint: disable=g-importing-member from fractions import Fraction as frac # pylint: disable=g-importing-member -from typing import Any, Generator +from typing import Any, Generator, Union import geometry as gm import numpy as np @@ -363,7 +363,7 @@ def register(self, vc: list[tuple[str, float]], dep: pr.Dependency) -> None: def register2( self, a: str, b: str, m: float, n: float, dep: pr.Dependency ) -> None: - self.register([(a, m), (b, -n)], dep) + self.register([(a, n), (b, -m)], dep) def register3(self, a: str, b: str, f: float, dep: pr.Dependency) -> None: self.register([(a, 1), (b, -1), (self.const, -f)], dep) @@ -373,6 +373,11 @@ def register4( ) -> None: self.register([(a, 1), (b, -1), (c, -1), (d, 1)], dep) + def register5( + self, a: str, b: str, c: str, dep: pr.Dependency + ) -> None: + self.register([(a, 1), (b, -1), (c, -1)], dep) + def why(self, e: dict[str, float]) -> list[Any]: """AR traceback == MILP.""" if not self.do_why: @@ -401,7 +406,7 @@ def why(self, e: dict[str, float]) -> list[Any]: deps = [] for i, dep in enumerate(self.deps): if x[2 * i] > 1e-12 or x[2 * i + 1] > 1e-12: - if dep not in deps: + if dep is not None and dep not in deps: deps.append(dep) return deps @@ -426,7 +431,7 @@ def add_eq2( self, a: str, b: str, m: float, n: float, dep: pr.Dependency ) -> None: # a/b = m/n - if not self.add_expr([(a, m), (b, -n)]): + if not self.add_expr([(a, n), (b, -m)]): return [] self.register2(a, b, m, n, dep) @@ -455,6 +460,19 @@ def add_eq4(self, a: str, b: str, c: str, d: str, dep: pr.Dependency) -> None: self.groups, [{(a, b), (c, d)}, {(b, a), (d, c)}] ) + + def add_eq5(self, a: str, b: str, c: str, dep: pr.Dependency) -> None: + # a = b + c + self.eqs.add((a, b, c)) + self.eqs.add((a, c, b)) + + expr = list(minus({a: 1, b: -1}, {c: 1}).items()) + + if not self.add_expr(expr): + return [] + + self.register5(a, b, c, dep) + def pairs(self) -> Generator[list[tuple[str, str]], None, None]: for v1, v2 in perm2(list(self.v2e.keys())): # pylint: disable=g-builtin-op if v1 == self.const or v2 == self.const: @@ -575,19 +593,30 @@ def add_const_ratio( def add_eqratio( self, - l1: gm.Length, - l2: gm.Length, - l3: gm.Length, - l4: gm.Length, + l1: Union[gm.Length, gm.Length_Pro], + l2: Union[gm.Length, gm.Length_Pro], + l3: Union[gm.Length, gm.Length_Pro], + l4: Union[gm.Length, gm.Length_Pro], dep: pr.Dependency, ) -> None: l1, l2, l3, l4 = self.get_name([l1, l2, l3, l4]) - return self.add_eq4(l1, l2, l3, l4, dep) + return super().add_eq4(l1, l2, l3, l4, dep) + + def add_length_pro( + self, + lp: gm.Length_Pro, + l1: gm.Length, + l2: gm.Length, + dep=None, + ) -> None: + lp, l1, l2 = self.get_name([lp, l1, l2]) + return super().add_eq5(lp, l1, l2, dep) def get_all_eqs_and_why(self) -> Generator[Any, None, None]: return super().get_all_eqs_and_why(True) + class AngleTable(GeometricTable): """Coefficient matrix A for slope(direction).""" diff --git a/geometry.py b/geometry.py index ba9463f..34544ad 100644 --- a/geometry.py +++ b/geometry.py @@ -17,6 +17,7 @@ from __future__ import annotations from collections import defaultdict # pylint: disable=g-importing-member from typing import Any, Type +from multiset import Multiset # pylint: disable=protected-access @@ -521,6 +522,44 @@ def lengths(self) -> tuple[Length, Length]: if l1 is None or l2 is None: return l1, l2 return l1.rep(), l2.rep() + + +class Length_Pro(Node): + """Node of type Length Product.""" + def new_val(self) -> Value: + return Value() + + def set_lengths(self, l1: Length, l2: Length) -> None: + if l1.name > l2.name: + l1, l2 = l2, l1 + self._l = Multiset([l1, l2]) + + @property + def lengths(self) -> tuple[Length, Length]: + l1, l2 = self._l + if l1 is None or l2 is None: + return l1, l2 + l1r = l1.rep() + l2r = l2.rep() + if l1r.name > l2r.name: + l1r, l2r = l2r, l1r + return Multiset([l1r, l2r]) + +class Ratio_Pro(Node): + """Node of type Ratio Product. l1/l2 * l3/l4 = (l1*l3) / (l2*l4)""" + + def new_val(self) -> Value: + return Value() + + def set_products(self, lp13: Length_Pro, lp24: Length_Pro) -> None: + self._lp = lp13, lp24 + + @property + def muls(self) -> tuple[Length_Pro, Length_Pro]: + lp13, lp24 = self._ml + if lp13 is None or lp24 is None: + return lp13, lp24 + return lp13.rep(), lp24.rep() class Value(Node): @@ -541,16 +580,29 @@ def all_angles( def all_ratios( - d1, d2, level=None -) -> tuple[Angle, list[Direction], list[Direction]]: + l1, l2, level=None +) -> tuple[Ratio, list[Length], list[Length]]: level = level or float('inf') - d1s = d1.equivs_upto(level) - d2s = d2.equivs_upto(level) + l1s = l1.equivs_upto(level) + l2s = l2.equivs_upto(level) + + for rat in l1.rep().neighbors(Ratio): + l1_, l2_ = rat._l + if l1_ in l1s and l2_ in l2s: + yield rat, l1s, l2s + +def all_ratios2( + lp1: Length_Pro, lp2: Length_Pro, level=None +) -> tuple[Ratio_Pro, list[Length_Pro], list[Length_Pro]]: + level = level or float('inf') + lp1s = lp1.equivs_upto(level) + lp2s = lp2.equivs_upto(level) + + for ratp in lp1.rep().neighbors(Ratio_Pro): + lp1_, lp2_ = ratp._l + if lp1_ in lp1s and lp2_ in lp2s: + yield ratp, lp1s, lp2s - for ang in d1.rep().neighbors(Ratio): - d1_, d2_ = ang._l - if d1_ in d1s and d2_ in d2s: - yield ang, d1s, d2s RANKING = { @@ -576,3 +628,7 @@ def val_type(x: Node) -> Type[Node]: return Measure if isinstance(x, Ratio): return Value + if isinstance(x, Length_Pro): + return Value + if isinstance(x, Ratio_Pro): + return Value diff --git a/graph.py b/graph.py index 071df9b..469eff4 100644 --- a/graph.py +++ b/graph.py @@ -24,14 +24,14 @@ from absl import logging import ar import geometry as gm -from geometry import Angle, Direction, Length, Ratio +from geometry import Angle, Direction, Length, Ratio, Length_Pro, Ratio_Pro from geometry import Circle, Line, Point, Segment from geometry import Measure, Value import graph_utils as utils import numericals as nm import problem from problem import Dependency, EmptyDependency - +from multiset import Multiset np = nm.np @@ -105,6 +105,8 @@ def __init__(self): Ratio: [], Measure: [], Value: [], + Length_Pro: [], + Ratio_Pro: [], } self._name2point = {} self._name2node = {} @@ -186,6 +188,7 @@ def add_algebra(self, dep: Dependency, level: int) -> None: 'aconst', 'rconst', 'cong', + 'eqratio30' ]: return @@ -212,7 +215,34 @@ def add_algebra(self, dep: Dependency, level: int) -> None: self.rtable.add_eq(ab, cd, dep) else: self.rtable.add_eqratio(ab, cd, mn, pq, dep) - + + if name == 'eqratio30': #TODO + ab, cd, mn, pq, xy, zw = dep.algebra + _abmn_, _ = self._get_or_create_length_pro_l(ab, mn) + _abxy_, _ = self._get_or_create_length_pro_l(ab, xy) + _mnxy_, _ = self._get_or_create_length_pro_l(mn, xy) + _cdpq_, _ = self._get_or_create_length_pro_l(cd, pq) + _cdzw_, _ = self._get_or_create_length_pro_l(cd, zw) + _pqzw_, _ = self._get_or_create_length_pro_l(pq, zw) + + + self.rtable.add_length_pro(_abmn_, ab, mn) + self.rtable.add_length_pro(_abxy_, ab, xy) + self.rtable.add_length_pro(_mnxy_, mn, xy) + self.rtable.add_length_pro(_cdpq_, cd, pq) + self.rtable.add_length_pro(_cdzw_, cd, zw) + self.rtable.add_length_pro(_pqzw_, pq, zw) + + self.rtable.add_eqratio(ab, cd, _pqzw_, _mnxy_ , dep) + self.rtable.add_eqratio(ab, pq, _cdzw_, _mnxy_ , dep) + self.rtable.add_eqratio(ab, zw, _cdpq_, _mnxy_ , dep) + self.rtable.add_eqratio(mn, cd, _pqzw_, _abxy_ , dep) + self.rtable.add_eqratio(mn, pq, _cdzw_, _abxy_ , dep) + self.rtable.add_eqratio(mn, zw, _cdpq_, _abxy_ , dep) + self.rtable.add_eqratio(xy, cd, _pqzw_, _abmn_ , dep) + self.rtable.add_eqratio(xy, pq, _cdzw_, _abmn_ , dep) + self.rtable.add_eqratio(xy, zw, _cdpq_, _abmn_ , dep) + if name == 'aconst': bx, ab, y = dep.algebra self.atable.add_const_angle(bx, ab, y, dep) @@ -364,6 +394,16 @@ def do_algebra(self, name: str, args: list[Point]) -> list[Dependency]: if not (a != b and c != d and (a != c or b != d)): return [] return self.add_cong([a, b, c, d], dep) + + if name == 'eqratio30': # TODO + a, b, c, d, e, f, dep = args + a1, a2 = a._obj.points + b1, b2 = b._obj.points + c1, c2 = c._obj.points + d1, d2 = d._obj.points + e1, e2 = e._obj.points + f1, f2 = f._obj.points + return self.add_eqratio30([a1, a2, b1, b2, c1, c2, d1, d2, e1, e2, f1, f2], dep) return [] @@ -385,15 +425,15 @@ def derive_algebra( # Separate eqangle and eqratio derivations # As they are too numerous => slow down DD+AR. # & reserve them only for last effort. - eqs = {'eqangle': derives.pop('eqangle'), 'eqratio': derives.pop('eqratio')} + eqs = {'eqangle': derives.pop('eqangle'), 'eqratio': derives.pop('eqratio'), 'eqratio30': derives.pop('eqratio30')} return derives, eqs def derive_ratio_algebra( self, level: int, verbose: bool = False ) -> dict[str, list[tuple[Point, ...]]]: """Derive new eqratio predicates.""" - added = {'cong2': [], 'eqratio': []} - + added = {'cong2': [], 'eqratio': [], 'eqratio30': []} + new_products = [] for x in self.rtable.get_all_eqs_and_why(): x, why = x[:-1], x[-1] dep = EmptyDependency(level=level, rule_name='a01') @@ -401,15 +441,90 @@ def derive_ratio_algebra( if len(x) == 2: a, b = x - if gm.is_equiv(a, b): - continue - - (m, n), (p, q) = a._obj.points, b._obj.points - added['cong2'].append((m, n, p, q, dep)) + if type(a) is gm.Length and type(b) is gm.Length: + if gm.is_equiv(a, b): + continue + (m, n), (p, q) = a._obj.points, b._obj.points + added['cong2'].append((m, n, p, q, dep)) + else: + assert type(a) is gm.Length_Pro and type(b) is gm.Length_Pro + a1, a2 = a._l + b1, b2 = b._l + if gm.is_equiv(a1, b1): + if gm.is_equiv(a2, b2): + continue + (m, n), (p, q) = a2._obj.points, b2._obj.points + added['cong2'].append((m, n, p, q, dep)) + elif gm.is_equiv(a1, b2): + if gm.is_equiv(a2, b1): + continue + (m, n), (p, q) = a2._obj.points, b1._obj.points + added['cong2'].append((m, n, p, q, dep)) + elif gm.is_equiv(a2, b1): + m, n = a1._obj.points + p, q = b2._obj.points + added['cong2'].append((m, n, p, q, dep)) + elif gm.is_equiv(a2, b2): + m, n = a1._obj.points + p, q = b1._obj.points + added['cong2'].append((m, n, p, q, dep)) + else: + if gm.is_equiv(a, b): + continue + added['eqratio'].append((a1, b1, b2, a2, dep)) if len(x) == 4: a, b, c, d = x - added['eqratio'].append((a, b, c, d, dep)) + if type(a) is gm.Length and type(d) is gm.Length: + assert type(b) is gm.Length, f"b.type:{type(b)}" + assert type(c) is gm.Length, f"c.type:{type(c)}" + added['eqratio'].append((a, b, c, d, dep)) + if {type(a),type(d)} == {gm.Length, gm.Length_Pro}: + assert {type(b), type(c)} == {gm.Length, gm.Length_Pro}, f"b.type:{type(b)}, c.type:{type(c)}" + if type(a) is gm.Length: # type(d) is gm.Length_Pro + a, d = d, a + if type(b) is gm.Length: # type(c) is gm.Length_Pro + b, c = c, b + a1, a2 = a._l + b1, b2 = b._l + _a1d_, _ = self._get_or_create_length_pro_l(a1, d) + _a2d_, _ = self._get_or_create_length_pro_l(a2, d) + _b1c_, _ = self._get_or_create_length_pro_l(b1, c) + _b2c_, _ = self._get_or_create_length_pro_l(b2, c) + new_products.extend([_a1d_,_a2d_,_b1c_,_b2c_]) + added['eqratio30'].append((a1, b1, a2, b2, d, c, dep)) + + if type(a) is gm.Length_Pro and type(d) is gm.Length_Pro: + assert type(b) is gm.Length_Pro, f"b.type:{type(b)}" + assert type(c) is gm.Length_Pro, f"c.type:{type(c)}" + a1, a2 = a._l + b1, b2 = b._l + c1, c2 = c._l + d1, d2 = d._l + + _a1d1_, _ = self._get_or_create_length_pro_l(a1, d1) + _a1d2_, _ = self._get_or_create_length_pro_l(a1, d2) + _a2d1_, _ = self._get_or_create_length_pro_l(a2, d1) + _a2d2_, _ = self._get_or_create_length_pro_l(a2, d2) + _b1c1_, _ = self._get_or_create_length_pro_l(b1, c1) + _b1c2_, _ = self._get_or_create_length_pro_l(b1, c2) + _b2c1_, _ = self._get_or_create_length_pro_l(b2, c1) + _b2c2_, _ = self._get_or_create_length_pro_l(b2, c2) + new_products.extend([_a1d1_,_a1d2_,_a2d1_,_a2d2_,_b1c1_,_b1c2_,_b2c1_,_b2c2_]) + self._set_ratio_pro_equal(a, b, c, d) + self._set_ratio_pro_equal(a, _b1c1_,_b2c2_, d) + self._set_ratio_pro_equal(a, _b1c2_,_b2c1_, d) + self._set_ratio_pro_equal(_a1d1_, b, c, _a2d2_) + self._set_ratio_pro_equal(_a1d1_, _b1c1_, _b2c2_, _a2d2_) + self._set_ratio_pro_equal(_a1d1_, _b1c2_, _b2c1_, _a2d2_) + self._set_ratio_pro_equal(_a1d2_, b, c, _a2d1_) + self._set_ratio_pro_equal(_a1d2_, _b1c1_, _b2c2_, _a2d1_) + self._set_ratio_pro_equal(_a1d2_, _b1c2_, _b2c1_, _a2d1_) + + + for lp in new_products: + l1, l2 = lp._l + self.rtable.add_length_pro(lp, l1, l2) return added @@ -699,6 +814,8 @@ def add_piece( return self.add_eqangle(args, deps) elif name in ['eqratio', 'eqratio6']: return self.add_eqratio(args, deps) + elif name == 'eqratio30': + return self.add_eqratio30(args, deps) # numerical! elif name == 's_angle': return self.add_s_angle(args, deps) @@ -807,6 +924,8 @@ def check(self, name: str, args: list[Point]) -> bool: if len(args) == 5: return self.check_rconst(args) return self.check_eqratio(args) + if name in ['eqratio30']: + return self.check_eqratio30(args) if name in ['simtri', 'simtri2', 'simtri*']: return self.check_simtri(args) if name in ['contri', 'contri2', 'contri*']: @@ -2087,6 +2206,95 @@ def _get_or_create_ratio_l( r21.opposite = r12 return r12, r21, why1 + why2 + def _get_or_create_length_pro( + self, s1: Segment, s2: Segment, deps: Dependency + ) -> tuple[Length_Pro, list[Dependency]]: + return self._get_or_create_ratio_l(s1._val, s2._val, deps) + + def _get_or_create_length_pro_l( + self, l1: Length, l2: Length, deps: Dependency + ) -> tuple[Length_Pro, list[Dependency]]: + """Get or create a new Length_Pro from two Lenghts l1 and l2.""" + if l1.name > l2.name: + l1, l2 = l2, l1 + for lp in self.type2nodes[Length_Pro]: + if lp.lengths == Multiset([l1.rep(), l2.rep()]): + l1_, l2_ = lp._l + # l1.rep() == l1_ and l2.rep() == l2_ + why1 = l1.why_equal([l1_], None) + l1_.why_rep() + why2 = l2.why_equal([l2_], None) + l2_.why_rep() + return lp, why1 + why2 + + l1, why1 = l1.rep_and_why() + l2, why2 = l2.rep_and_why() + lp12 = self.new_node(Length_Pro, f'{l1.name}*{l2.name}') + self.connect(l1, lp12, deps) + self.connect(l2, lp12, deps) + lp12.set_lengths(l1, l2) + return lp12, why1 + why2 + + def _get_or_create_ratio_pro( + self, s1: Segment, s2: Segment, s3: Segment, s4: Segment, deps: Dependency + ) -> tuple[Ratio_Pro, Ratio_Pro, list[Dependency]]: + return self._get_or_create_ratio_pro_l(s1._val, s2._val, s3._val, s4._val, deps) + + def _get_or_create_ratio_pro_l( + self, l1: Length, l2: Length, l3:Length, l4: Length, deps: Dependency + ) -> tuple[Ratio_Pro, Ratio_Pro, list[Dependency]]: + """Get or create a new Ratio_Pro from four Lengths l1*l3 and l2*l4.""" + if l1.name > l3.name: + l1, l3 = l3, l1 + if l2.name > l4.name: + l2, l4 = l4, l2 + for rp in self.type2nodes[Ratio_Pro]: + lp13_, lp24_ = rp._lp + if lp13_.lengths == Multiset([l1.rep(), l3.rep()]) and lp24_.lengths == Multiset([l2.rep(), l4.rep()]): + l1_, l3_ = lp13_._l + l2_, l4_ = lp24_._l + # l1.rep() == l1_ and l3.rep() == l3_ and l2.rep() == l2_ and l4.rep() == l4_ + why1 = l1.why_equal([l1_], None) + l1_.why_rep() + why2 = l2.why_equal([l2_], None) + l2_.why_rep() + why3 = l3.why_equal([l3_], None) + l3_.why_rep() + why4 = l4.why_equal([l4_], None) + l4_.why_rep() + return rp, rp.opposite, why1 + why2 + why3 + why4 + + l1, why1 = l1.rep_and_why() + l2, why2 = l2.rep_and_why() + l3, why3 = l3.rep_and_why() + l4, why4 = l4.rep_and_why() + lp13 = self.new_node(Length_Pro, f'{l1.name}*{l3.name}') + lp24 = self.new_node(Length_Pro, f'{l2.name}*{l4.name}') + rp1324 = self.new_node(Ratio_Pro, f'{lp13.name}/{lp24.name}') + rp2413 = self.new_node(Ratio_Pro, f'{lp24.name}/{lp13.name}') + self.connect(lp13, rp1324, deps) + self.connect(lp24, rp2413, deps) + self.connect(rp1324, rp2413, deps) + rp1324.set_lengths(lp13, lp24) + rp2413.set_lengths(lp24, lp13) + rp1324.opposite = rp2413 + rp2413.opposite = rp1324 + return rp1324, rp2413, why1 + why2 + why3 + why4 + + def _get_or_create_ratio_pro_lp( + self, lp1: Length_Pro, lp2: Length_Pro, deps: Dependency + ) -> tuple[Ratio_Pro, Ratio_Pro, list[Dependency]]: + """Get or create a new Ratio_Pro from two Length_Pro l1*l2.""" + l1, l3 = lp1._l + l2, l4 = lp2._l + return self._get_or_create_ratio_pro_l(l1, l2, l3, l4, deps) + + def _set_ratio_pro_equal( + self, lp1: Length_Pro, lp2: Length_Pro, lp3: Length_Pro, lp4: Length_Pro, deps: Dependency + ) -> None: + rp12, rp21, _ = self._get_or_create_ratio_pro_lp(lp1, lp2, deps) + rp34, rp43, _ = self._get_or_create_ratio_pro_lp(lp3, lp4, deps) + self.make_equal(rp12, rp34, deps=deps) + self.make_equal(rp21, rp43, deps=deps) + rp13, rp31, _ = self._get_or_create_ratio_pro_lp(lp1, lp3, deps) + rp24, rp42, _ = self._get_or_create_ratio_pro_lp(lp2, lp4, deps) + self.make_equal(rp13, rp24, deps=deps) + self.make_equal(rp31, rp42, deps=deps) + def add_cong2( self, points: list[Point], deps: EmptyDependency ) -> list[Dependency]: @@ -2158,6 +2366,9 @@ def _add_eqratio( ab_cd, cd_ab, why1 = self._get_or_create_ratio(ab, cd, deps=None) mn_pq, pq_mn, why2 = self._get_or_create_ratio(mn, pq, deps=None) + _abpq_, _ = self._get_or_create_length_pro(ab, pq, deps=None) + _cdmn_, _ = self._get_or_create_length_pro(cd, mn, deps=None) + why = why1 + why2 if why: dep0 = deps.populate('eqratio', args) @@ -2181,6 +2392,7 @@ def _add_eqratio( add += [deps1] self.cache_dep('eqratio', [a, b, c, d, m, n, p, q], deps1) self.make_equal(ab_cd, mn_pq, deps=deps1) + self.make_equal(_abpq_, _cdmn_, deps=deps1) is_eq2 = self.is_equal(cd_ab, pq_mn) deps2 = None @@ -2245,6 +2457,205 @@ def add_eqratio( pq, deps, ) + return add + + def make_equal_pairs30( + self, + a: Point, b: Point, c: Point, d: Point, m: Point, n: Point, p: Point, q: Point, x:Point, y:Point, z:Point, w:Point, + ab: Segment, cd: Segment, mn: Segment, pq: Segment, xy: Segment, zw: Segment, + deps: EmptyDependency, + ) -> list[Dependency]: + """Add ab/cd * mn/pq * xy/zw = 1 in case ab and cd are equal.""" + + mn_pq, pq_mn, why1 = self._get_or_create_ratio(mn, pq, deps=None) + xy_zw, zw_xy, why2 = self._get_or_create_ratio(xy, zw, deps=None) + + _mnzw_, _ = self._get_or_create_length_pro(mn, zw, deps=None) + _pqxy_, _ = self._get_or_create_length_pro(pq, xy, deps=None) + + is_equal = self.is_equal(mn_pq, zw_xy) + + if ab != cd: + dep0 = deps.populate('eqratio30', [a, b, c, d, m, n, p, q, x, y, z, w]) + deps = EmptyDependency(level=deps.level, rule_name=None) + + dep = Dependency('cong', [a, b, c, d], None, deps.level) + deps.why = [dep0, dep.why_me_or_cache(self, None)] + + deps = deps.populate('eqratio', [m, n, p, q, z, w, x, y]) + self.make_equal(mn_pq, zw_xy, deps=deps) + self.make_equal(xy_zw, pq_mn, deps=deps) + self.make_equal(_mnzw_, _pqxy_, deps=deps) + + deps.algebra = mn._val, pq._val, zw._val, xy._val + self.cache_dep('eqratio', [m, n, p, q, z, w, x, y], deps) + + if is_equal: + return [] + return [deps] + + def maybe_make_equal_pairs30( + self, + a: Point, b: Point, c: Point, d: Point, m: Point, n: Point, p: Point, q: Point, x:Point, y:Point, z:Point, w:Point, + ab: Segment, cd: Segment, mn: Segment, pq: Segment, xy: Segment, zw: Segment, + deps: EmptyDependency, + ) -> Optional[list[Dependency]]: + """Add ab/cd * mn/pq * xy/zw = 1 in case either two of (ab,cd,mn,pq,xy,zw) are equal.""" + level = deps.level + if self.is_equal(ab, cd, level): + return self.make_equal_pairs30(a, b, c, d, m, n, p, q, x, y, z, w, ab, cd, mn, pq, xy, zw, deps) + elif self.is_equal(ab, pq, level): + return self.make_equal_pairs30(a, b, p, q, m, n, c, d, x, y, z, w, ab, pq, mn, cd, xy, zw, deps) + elif self.is_equal(ab, zw, level): + return self.make_equal_pairs30(a, b, z, w, m, n, p, q, x, y, c, d, ab, zw, mn, pq, xy, cd, deps) + elif self.is_equal(mn, cd, level): + return self.make_equal_pairs30(m, n, c, d, a, b, p, q, x, y, z, w, mn, cd, ab, pq, xy, zw, deps) + elif self.is_equal(mn, pq, level): + return self.make_equal_pairs30(m, n, p, q, a, b, c, d, x, y, z, w, mn, pq, ab, cd, xy, zw, deps) + elif self.is_equal(mn, zw, level): + return self.make_equal_pairs30(m, n, z, w, a, b, p, q, x, y, c, d, mn, zw, ab, pq, xy, cd, deps) + elif self.is_equal(xy, cd, level): + return self.make_equal_pairs30(x, y, c, d, m, n, p, q, a, b, z, w, xy, cd, mn, pq, ab, zw, deps) + elif self.is_equal(xy, pq, level): + return self.make_equal_pairs30(x, y, p, q, m, n, c, d, a, b, z, w, xy, pq, mn, cd, ab, zw, deps) + elif self.is_equal(xy, zw, level): + return self.make_equal_pairs30(x, y, z, w, m, n, p, q, a, b, c, d, xy, zw, mn, pq, ab, cd, deps) + else: + return None + + def _add_eqratio30( + self, + a: Point, + b: Point, + c: Point, + d: Point, + m: Point, + n: Point, + p: Point, + q: Point, + x: Point, + y: Point, + z: Point, + w: Point, + ab: Segment, + cd: Segment, + mn: Segment, + pq: Segment, + xy: Segment, + zw: Segment, + deps: EmptyDependency, + ) -> list[Dependency]: + """Add a new eqratio from 12 points (core).""" + if deps: + deps = deps.copy() + + args = [a, b, c, d, m, n, p, q, x, y, z, w] + i = 0 + for u, v, uv in [(a, b, ab), (c, d, cd), (m, n, mn), (p, q, pq), (x, y, xy), (z, w, zw)]: + if {u, v} == set(uv.points): + continue + u_, v_ = list(uv.points) + if deps: + deps = deps.extend(self, 'eqratio', list(args), 'cong', [u, v, u_, v_]) + args[2 * i - 2] = u_ + args[2 * i - 1] = v_ + + add = [] + + ab_cd, cd_ab, why1 = self._get_or_create_ratio(ab, cd, deps=None) + mnxy_pqzw, pqzw_mnxy, why2 = self._get_or_create_ratio_pro(mn, pq, xy, zw, deps=None) + + why = why1 + why2 + if why: + dep0 = deps.populate('eqratio30', args) + deps = EmptyDependency(level=deps.level, rule_name=None) + deps.why = [dep0] + why + + lab, lcd = ab_cd._l + lpmnxy, lppqzw = mnxy_pqzw._lp + lmn, lxy = lpmnxy._l + lpq, lzw = lppqzw._l + + a, b = lab._obj.points + c, d = lcd._obj.points + m, n = lmn._obj.points + p, q = lpq._obj.points + x, y = lxy._obj.points + z, w = lzw._obj.points + + is_eq1 = self.is_equal(ab_cd, mnxy_pqzw) + deps1 = None + if deps: + deps1 = deps.populate('eqratio30', [a, b, c, d, m, n, p, q, x, y, z, w]) + deps1.algebra = [ab._val, cd._val, mn._val, pq._val, xy._val, zw._val] + if not is_eq1: + add += [deps1] + self.cache_dep('eqratio30', [a, b, c, d, m, n, p, q, x, y, z, w], deps1) + self.make_equal(ab_cd, mnxy_pqzw, deps=deps1) + + is_eq2 = self.is_equal(cd_ab, pqzw_mnxy) + deps2 = None + if deps: + deps2 = deps.populate('eqratio30', [c, d, a, b, p, q, m, n, z, w, x, y]) + deps2.algebra = [cd._val, ab._val, pq._val, mn._val, zw._val, xy._val] + if not is_eq2: + add += [deps2] + self.cache_dep('eqratio30', [c, d, a, b, p, q, m, n, z, w, x, y], deps2) + self.make_equal(cd_ab, pqzw_mnxy, deps=deps2) + return add + + def add_eqratio30( + self, points: list[Point], deps: EmptyDependency + ) -> list[Dependency]: + """Add a new eqratio30 from 12 points.""" + if deps: + deps = deps.copy() + a, b, c, d, m, n, p, q, x, y, z, w = points + ab = self._get_or_create_segment(a, b, deps=None) + cd = self._get_or_create_segment(c, d, deps=None) + mn = self._get_or_create_segment(m, n, deps=None) + pq = self._get_or_create_segment(p, q, deps=None) + xy = self._get_or_create_segment(x, y, deps=None) + zw = self._get_or_create_segment(z, w, deps=None) + + add = self.maybe_make_equal_pairs30( + a, b, c, d, m, n, p, q, x, y, z, w, ab, cd, mn, pq, xy, zw, deps + ) + + if add is not None: + return add + + self.connect_val(ab, deps=None) + self.connect_val(cd, deps=None) + self.connect_val(mn, deps=None) + self.connect_val(pq, deps=None) + self.connect_val(xy, deps=None) + self.connect_val(zw, deps=None) + + _abmn_, why1 = self._get_or_create_length_pro(ab, mn, deps=None) + _abxy_, why2 = self._get_or_create_length_pro(ab, xy, deps=None) + _mnxy_, why3 = self._get_or_create_length_pro(mn, xy, deps=None) + _cdpq_, why4 = self._get_or_create_length_pro(cd, pq, deps=None) + _cdzw_, why5 = self._get_or_create_length_pro(cd, zw, deps=None) + _pqzw_, why6 = self._get_or_create_length_pro(pq, zw, deps=None) + + self.connect_val(_abmn_, deps=why1) + self.connect_val(_abxy_, deps=why2) + self.connect_val(_mnxy_, deps=why3) + self.connect_val(_cdpq_, deps=why4) + self.connect_val(_cdzw_, deps=why5) + self.connect_val(_pqzw_, deps=why6) + + add = [] + add += self._add_eqratio30(a, b, c, d, m, n, p, q, x, y, z, w, ab, cd, mn, pq, xy, zw, deps) + add += self._add_eqratio30(a, b, p, q, m, n, c, d, x, y, z, w, ab, pq, mn, cd, xy, zw, deps) + add += self._add_eqratio30(a, b, z, w, m, n, p, q, x, y, c, d, ab, zw, mn, pq, xy, cd, deps) + add += self._add_eqratio30(m, n, c, d, a, b, p, q, x, y, z, w, mn, cd, ab, pq, xy, zw, deps) + add += self._add_eqratio30(m, n, p, q, a, b, c, d, x, y, z, w, mn, pq, ab, cd, xy, zw, deps) + add += self._add_eqratio30(m, n, z, w, a, b, c, d, x, y, p, q, mn, zw, ab, cd, xy, pq, deps) + add += self._add_eqratio30(x, y, c, d, a, b, p, q, m, n, z, w, xy, cd, ab, pq, mn, zw, deps) + add += self._add_eqratio30(x, y, p, q, a, b, c, d, m, n, z, w, xy, pq, ab, cd, mn, zw, deps) + add += self._add_eqratio30(x, y, z, w, a, b, c, d, m, n, p, q, xy, zw, ab, cd, mn, pq, deps) return add def check_rconst(self, points: list[Point], verbose: bool = False) -> bool: @@ -2337,6 +2748,73 @@ def check_eqratio(self, points: list[Point]) -> bool: return True return False + def check_eqratio30(self, points: list[Point]) -> bool: + """Check if 12 points make an eqratio30 predicate.""" + a, b, c, d, m, n, p, q, x, y, z, w = points + + if {a, b} == {c, d}: + return self.check_eqratio([m, n, p, q, z, w, x, y]) + if {a, b} == {p, q}: + return self.check_eqratio([m, n, c, d, z, w, x, y]) + if {a, b} == {z, w}: + return self.check_eqratio([m, n, p, q, c, d, x, y]) + if {m, n} == {c, d}: + return self.check_eqratio([a, b, p, q, z, w, x, y]) + if {m, n} == {p, q}: + return self.check_eqratio([a, b, c, d, z, w, x, y]) + if {m, n} == {z, w}: + return self.check_eqratio([a, b, p, q, c, d, x, y]) + if {x, y} == {c, d}: + return self.check_eqratio([a, b, p, q, z, w, m, n]) + if {x, y} == {p, q}: + return self.check_eqratio([a, b, c, d, z, w, m, n]) + if {x, y} == {z, w}: + return self.check_eqratio([a, b, p, q, c, d, m, n]) + + ab = self._get_segment(a, b) + cd = self._get_segment(c, d) + mn = self._get_segment(m, n) + pq = self._get_segment(p, q) + xy = self._get_segment(x, y) + zw = self._get_segment(z, w) + + if not (ab and cd and mn and pq and xy and zw): + return False + + if self.is_equal(ab, cd): + return self.check_eqratio([m, n, p, q, z, w, x, y]) + if self.is_equal(ab, pq): + return self.check_eqratio([m, n, c, d, z, w, x, y]) + if self.is_equal(ab, zw): + return self.check_eqratio([m, n, p, q, c, d, x, y]) + if self.is_equal(mn, cd): + return self.check_eqratio([a, b, p, q, z, w, x, y]) + if self.is_equal(mn, pq): + return self.check_eqratio([a, b, c, d, z, w, x, y]) + if self.is_equal(mn, zw): + return self.check_eqratio([a, b, p, q, c, d, x, y]) + if self.is_equal(xy, cd): + return self.check_eqratio([a, b, p, q, z, w, m, n]) + if self.is_equal(xy, pq): + return self.check_eqratio([a, b, c, d, z, w, m, n]) + if self.is_equal(xy, zw): + return self.check_eqratio([a, b, p, q, c, d, m, n]) + + if not (ab.val and cd.val and mn.val and pq.val and xy.val and zw.val): + return False + + if Multiset([ab.val, mn.val, xy.val]) == Multiset([cd.val, pq.val, zw.val]): + return True + + _pqzw_, _ = self._get_or_create_length_pro(pq, zw, deps=None) + _mnxy_, _ = self._get_or_create_length_pro(mn, xy, deps=None) + + for rat1, _, _ in gm.all_ratios(ab._val, cd._val): + for ratp2, _, _ in gm.all_ratios2(_pqzw_._val, _mnxy_._val): + if self.is_equal(rat1, ratp2): + return True + return False + def add_simtri_check( self, points: list[Point], deps: EmptyDependency ) -> list[Dependency]: diff --git a/pretty.py b/pretty.py index d794fd8..e1b947b 100644 --- a/pretty.py +++ b/pretty.py @@ -115,6 +115,8 @@ def pretty_nl(name: str, args: list[str]) -> str: return f'{pretty_angle(a, b, c, d)} = {pretty_angle(e, f, g, h)}' if name in ['eqratio', 'eqratio6', '/']: return '{}{}:{}{} = {}{}:{}{}'.format(*args) + if name == 'eqratio30': + return '({}{}:{}{}) * ({}{}:{}{}) * ({}{}:{}{}) = 1'.format(*args) if name == 'eqratio3': a, b, c, d, o, o = args # pylint: disable=redeclared-assigned-name return f'S {o} {a} {b} {o} {c} {d}' diff --git a/problem.py b/problem.py index 9108837..e210545 100644 --- a/problem.py +++ b/problem.py @@ -456,52 +456,52 @@ def conclusion_name_args( def why_eqratio( - d1: gm.Direction, - d2: gm.Direction, - d3: gm.Direction, - d4: gm.Direction, + l1: gm.Length, + l2: gm.Length, + l3: gm.Length, + l4: gm.Length, level: int, ) -> list[Dependency]: """Why two ratios are equal, returns a Dependency objects.""" - all12 = list(gm.all_ratios(d1, d2, level)) - all34 = list(gm.all_ratios(d3, d4, level)) + all12 = list(gm.all_ratios(l1, l2, level)) + all34 = list(gm.all_ratios(l3, l4, level)) min_why = None - for ang12, d1s, d2s in all12: - for ang34, d3s, d4s in all34: - why0 = gm.why_equal(ang12, ang34, level) + for rat12, l1s, l2s in all12: + for rat34, l3s, l4s in all34: + why0 = gm.why_equal(rat12, rat34, level) if why0 is None: continue - d1_, d2_ = ang12._l - d3_, d4_ = ang34._l - why1 = gm.bfs_backtrack(d1, [d1_], d1s) - why2 = gm.bfs_backtrack(d2, [d2_], d2s) - why3 = gm.bfs_backtrack(d3, [d3_], d3s) - why4 = gm.bfs_backtrack(d4, [d4_], d4s) + l1_, l2_ = rat12._l + l3_, l4_ = rat34._l + why1 = gm.bfs_backtrack(l1, [l1_], l1s) + why2 = gm.bfs_backtrack(l2, [l2_], l2s) + why3 = gm.bfs_backtrack(l3, [l3_], l3s) + why4 = gm.bfs_backtrack(l4, [l4_], l4s) why = why0 + why1 + why2 + why3 + why4 if min_why is None or len(why) < len(min_why[0]): - min_why = why, ang12, ang34, why0, why1, why2, why3, why4 + min_why = why, rat12, rat34, why0, why1, why2, why3, why4 if min_why is None: return None - _, ang12, ang34, why0, why1, why2, why3, why4 = min_why - d1_, d2_ = ang12._l - d3_, d4_ = ang34._l + _, rat12, rat34, why0, why1, why2, why3, why4 = min_why + l1_, l2_ = rat12._l + l3_, l4_ = rat34._l - if d1 == d1_ and d2 == d2_ and d3 == d3_ and d4 == d4_: + if l1 == l1_ and l2 == l2_ and l3 == l3_ and l4 == l4_: return why0 - (a_, b_), (c_, d_) = d1_._obj.points, d2_._obj.points - (e_, f_), (g_, h_) = d3_._obj.points, d4_._obj.points + (a_, b_), (c_, d_) = l1_._obj.points, l2_._obj.points + (e_, f_), (g_, h_) = l3_._obj.points, l4_._obj.points deps = [] if why0: dep = Dependency('eqratio', [a_, b_, c_, d_, e_, f_, g_, h_], '', level) dep.why = why0 deps.append(dep) - (a, b), (c, d) = d1._obj.points, d2._obj.points - (e, f), (g, h) = d3._obj.points, d4._obj.points + (a, b), (c, d) = l1._obj.points, l2._obj.points + (e, f), (g, h) = l3._obj.points, l4._obj.points for why, (x, y), (x_, y_) in zip( [why1, why2, why3, why4], [(a, b), (c, d), (e, f), (g, h)], @@ -514,6 +514,80 @@ def why_eqratio( return deps +def why_eqratio30( + l1: gm.Length, + l2: gm.Length, + lp46: gm.Length_Pro, + lp35: gm.Length_Pro, + level: int, +) -> list[Dependency]: + """Why two ratios are equal, returns a Dependency objects.""" + all12 = list(gm.all_ratios(l1, l2, level)) + all43 = list(gm.all_ratios2(lp46, lp35, level)) + + min_why = None + for rat12, l1s, l2s in all12: + for ratp43, lp4s, lp3s in all43: + why0 = gm.why_equal(rat12, ratp43, level) + if why0 is None: + continue + l1_, l2_ = rat12._l + lp46_, lp35_ = ratp43._l + why1 = gm.bfs_backtrack(l1, [l1_], l1s) + why2 = gm.bfs_backtrack(l2, [l2_], l2s) + why3 = gm.bfs_backtrack(lp35, [lp35_], lp3s) + why4 = gm.bfs_backtrack(lp46, [lp46_], lp4s) + why = why0 + why1 + why2 + why3 + why4 + if min_why is None or len(why) < len(min_why[0]): + min_why = why, rat12, ratp43, why0, why1, why2, why3, why4 + + if min_why is None: + return None + + _, rat12, ratp43, why0, why1, why2, why3, why4 = min_why + l1_, l2_ = rat12._l + lp46_, lp35_ = ratp43._l + + if l1 == l1_ and l2 == l2_ and lp35 == lp35_ and lp46 == lp46_: + return why0 + + l3_, l5_ = lp35._l + l4_, l6_ = lp46._l + + (a_, b_), (c_, d_) = l1_._obj.points, l2_._obj.points + (m_, n_), (p_, q_) = l3_._obj.points, l4_._obj.points + (x_, y_), (z_, w_) = l5_._obj.points, l6_._obj.points + deps = [] + if why0: + dep = Dependency('eqratio30', [a_, b_, c_, d_, m_, n_, p_, q_, x_, y_, z_, w_], '', level) + dep.why = why0 + deps.append(dep) + + l3, l5 = lp35._l + l4, l6 = lp46._l + + (a, b), (c, d) = l1._obj.points, l2._obj.points + (m, n), (p, q) = l3._obj.points, l4._obj.points + (x, y), (z, w) = l5._obj.points, l6._obj.points + + if why1: + dep = Dependency('cong', [a, b, a_, b_], '', level) + dep.why = why1 + deps.append(dep) + if why2: + dep = Dependency('cong', [c, d, c_, d_], '', level) + dep.why = why2 + deps.append(dep) + if why3: + dep = Dependency('eqratio', [m, n, m_, n_, x_, y_, x, y], '', level) + dep.why = why3 + deps.append(dep) + if why4: + dep = Dependency('eqratio', [p, q, p_, q_, z_, w_, z, w], '', level) + dep.why = why4 + deps.append(dep) + return deps + def why_eqangle( d1: gm.Direction, @@ -969,6 +1043,116 @@ def why_me(self, g: Any, level: int) -> None: elif ab._val and cd._val and mn._val and pq._val: self.why = why_eqangle(ab._val, cd._val, mn._val, pq._val, level) + elif self.name == 'eqratio30': + a, b, c, d, m, n, p, q, x, y, z, w = self.args + ab = g._get_segment(a, b) + cd = g._get_segment(c, d) + mn = g._get_segment(m, n) + pq = g._get_segment(p, q) + xy = g._get_segment(x, y) + zw = g._get_segment(z, w) + if ab is None or cd is None or mn is None or pq is None or xy is None or zw is None: + if {a, b} == {c, d}: + dp = Dependency('eqratio', [m, n, p, q, z, w, x, y], None, level) + self.why = [dp.why_me_or_cache(g, level)] + if {a, b} == {p, q}: + dp = Dependency('eqratio', [m, n, c, d, z, w, x, y], None, level) + self.why = [dp.why_me_or_cache(g, level)] + if {a, b} == {z, w}: + dp = Dependency('eqratio', [m, n, p, q, c, d, x, y], None, level) + self.why = [dp.why_me_or_cache(g, level)] + if {m, n} == {c, d}: + dp = Dependency('eqratio', [a, b, p, q, z, w, x, y], None, level) + self.why = [dp.why_me_or_cache(g, level)] + if {m, n} == {p, q}: + dp = Dependency('eqratio', [a, b, c, d, z, w, x, y], None, level) + self.why = [dp.why_me_or_cache(g, level)] + if {m, n} == {z, w}: + dp = Dependency('eqratio', [a, b, p, q, c, d, x, y], None, level) + self.why = [dp.why_me_or_cache(g, level)] + if {x, y} == {c, d}: + dp = Dependency('eqratio', [a, b, p, q, z, w, m, n], None, level) + self.why = [dp.why_me_or_cache(g, level)] + if {x, y} == {p, q}: + dp = Dependency('eqratio', [a, b, c, d, z, w, m, n], None, level) + self.why = [dp.why_me_or_cache(g, level)] + if {x, y} == {z, w}: + dp = Dependency('eqratio', [a, b, p, q, c, d, m, n], None, level) + self.why = [dp.why_me_or_cache(g, level)] + return + + ab_mn, _ = g._get_or_create_length_pro(ab, mn, deps=None) + ab_xy, _ = g._get_or_create_length_pro(ab, xy, deps=None) + mn_xy, _ = g._get_or_create_length_pro(mn, xy, deps=None) + cd_pq, _ = g._get_or_create_length_pro(cd, pq, deps=None) + cd_zw, _ = g._get_or_create_length_pro(cd, zw, deps=None) + pq_zw, _ = g._get_or_create_length_pro(pq, zw, deps=None) + + self.why = [] + if g.is_equal(ab, cd) or g.is_equal(mn_xy, pq_zw): + dep1 = Dependency('cong', [a, b, c, d], None, level) + dep1.why_me(g, level) + dep2 = Dependency('eqratio', [m, n, p, q, z, w, x, y], None, level) + dep2.why_me(g, level) + self.why += [dep1, dep2] + elif g.is_equal(ab, pq) or g.is_equal(mn_xy, cd_zw): + dep1 = Dependency('cong', [a, b, p, q], None, level) + dep1.why_me(g, level) + dep2 = Dependency('eqratio', [m, n, c, d, z, w, x, y], None, level) + dep2.why_me(g, level) + self.why += [dep1, dep2] + elif g.is_equal(ab, zw) or g.is_equal(mn_xy, cd_pq): + dep1 = Dependency('cong', [a, b, z, w], None, level) + dep1.why_me(g, level) + dep2 = Dependency('eqratio', [m, n, c, d, p, q, x, y], None, level) + dep2.why_me(g, level) + self.why += [dep1, dep2] + elif g.is_equal(mn, cd) or g.is_equal(ab_xy, pq_zw): + dep1 = Dependency('cong', [m, n, c, d], None, level) + dep1.why_me(g, level) + dep2 = Dependency('eqratio', [a, b, p, q, z, w, x, y], None, level) + dep2.why_me(g, level) + self.why += [dep1, dep2] + elif g.is_equal(mn, pq) or g.is_equal(ab_xy, cd_zw): + dep1 = Dependency('cong', [m, n, p, q], None, level) + dep1.why_me(g, level) + dep2 = Dependency('eqratio', [a, b, c, d, z, w, x, y], None, level) + dep2.why_me(g, level) + self.why += [dep1, dep2] + elif g.is_equal(mn, zw) or g.is_equal(ab_xy, cd_pq): + dep1 = Dependency('cong', [m, n, z, w], None, level) + dep1.why_me(g, level) + dep2 = Dependency('eqratio', [a, b, c, d, p, q, x, y], None, level) + dep2.why_me(g, level) + self.why += [dep1, dep2] + elif g.is_equal(xy, cd) or g.is_equal(ab_mn, pq_zw): + dep1 = Dependency('cong', [x, y, c, d], None, level) + dep1.why_me(g, level) + dep2 = Dependency('eqratio', [a, b, p, q, z, w, m, n], None, level) + dep2.why_me(g, level) + self.why += [dep1, dep2] + elif g.is_equal(xy, pq) or g.is_equal(ab_mn, cd_zw): + dep1 = Dependency('cong', [x, y, p, q], None, level) + dep1.why_me(g, level) + dep2 = Dependency('eqratio', [a, b, c, d, z, w, m, n], None, level) + dep2.why_me(g, level) + self.why += [dep1, dep2] + elif g.is_equal(xy, zw) or g.is_equal(ab_mn, cd_pq): + dep1 = Dependency('cong', [x, y, z, w], None, level) + dep1.why_me(g, level) + dep2 = Dependency('eqratio', [a, b, c, d, p, q, m, n], None, level) + dep2.why_me(g, level) + self.why += [dep1, dep2] + else: + self.why = None + + if self.why is None: + self.why = why_eqratio30(ab._val, cd._val, mn_xy, pq_zw, level) + + if self.why is None: + self.why = [] + + elif self.name in ['diff', 'npara', 'nperp', 'ncoll', 'sameside']: self.why = [] @@ -1129,5 +1313,28 @@ def hashed_txt(name: str, args: list[str]) -> tuple[str, ...]: if name in ['sameside', 's_angle']: return (name,) + tuple(args) + + if name in ['eqratio30']: + a, b, c, d, e, f, g, h, i, j, k, l = args + a, b = sorted([a, b]) + c, d = sorted([c, d]) + e, f = sorted([e, f]) + g, h = sorted([g, h]) + i, j = sorted([i, j]) + k, l = sorted([k, l]) + ratios1 = [(a, b),(e, f),(i, j)] + ratios1.sort() + ratios2 = [(c, d),(g, h),(k, l)] + ratios2.sort() + if ratios1 > ratios2: + ratios1, ratios2 = ratios2, ratios1 + a, b = ratios1[0] + e, f = ratios1[1] + i, j = ratios1[2] + c, d = ratios2[0] + g, h = ratios2[1] + k, l = ratios2[2] + + return (name, a, b, c, d, e, f, g, h, i, j, k, l) raise ValueError(f'Not recognize {name} to hash.') diff --git a/test.py b/test.py index cc6f888..63fde3a 100644 --- a/test.py +++ b/test.py @@ -1,13 +1,6 @@ -a = (2>0) - -b = True - -c = (3<0) - -print(a+b) - -print(a+c) - -print(2*a+b) - -print(a) \ No newline at end of file +for why, (u, v), (u_, v_) in zip( + ['why1', 'why2', 'why3', 'why4'], + [('a', 'b'), ('c', 'd'), ('e', 'f'), ('g', 'h')], + [('a_', 'b_'), ('c_', 'd_'), ('e_', 'f_'), ('g_', 'h_')], + ): + print(why, u, v, u_, v_) \ No newline at end of file From 43a64309606fb351ef7833862ba6b95cb32ea2bf Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.cn> Date: Wed, 19 Mar 2025 10:09:31 +0800 Subject: [PATCH 13/27] debugre --- ar.py | 2 ++ chiaya.sh | 4 ++-- dd.py | 4 ++-- ddar.py | 29 ++++++++++++++++++++-------- geometry.py | 24 +++++++++++++---------- graph.py | 52 +++++++++++++++++++++++++++++++++----------------- graph_utils.py | 8 ++++++++ kirine.txt | 24 +++++++++++------------ pros2.txt | 14 +++++++++++++- rules1.txt | 2 +- test.py | 8 ++------ 11 files changed, 110 insertions(+), 61 deletions(-) diff --git a/ar.py b/ar.py index 58c1fd9..71eccbe 100644 --- a/ar.py +++ b/ar.py @@ -561,6 +561,7 @@ def get_all_eqs_and_why( for out in super().get_all_eqs_and_why(return_quads): if len(out) == 3: x, y, why = out + print('out2', x, y) x, y = self.map2obj([x, y]) yield x, y, why if len(out) == 4: @@ -569,6 +570,7 @@ def get_all_eqs_and_why( yield x, y, f, why if len(out) == 5: a, b, x, y, why = out + print('out4', a, b, x, y) a, b, x, y = self.map2obj([a, b, x, y]) yield a, b, x, y, why diff --git a/chiaya.sh b/chiaya.sh index de13e97..3d29c78 100644 --- a/chiaya.sh +++ b/chiaya.sh @@ -9,7 +9,7 @@ DDAR_ARGS=( --rules_file=$(pwd)/rules1.txt \ ); -SIZE=2 +SIZE=4 BATCH_SIZE=$SIZE BEAM_SIZE=$SIZE @@ -41,7 +41,7 @@ INPUT_FILE=pros2.txt python -m alphageometry \ --alsologtostderr \ --problems_file=$(pwd)/$INPUT_FILE \ ---problem_name=test_pascal63 \ +--problem_name=test_gcenter1 \ --mode=alphageometry \ "${DDAR_ARGS[@]}" \ "${SEARCH_ARGS[@]}" \ diff --git a/dd.py b/dd.py index 5580b3f..3f3cb9e 100644 --- a/dd.py +++ b/dd.py @@ -977,10 +977,10 @@ def match_ceva( bes = be.neighbors(gm.Point, return_set=True) p = intersect1(ads, bes) if g.check_coll([p, c, f]): - #debugname([p, a, b, c, d, e, f]) + debugname([p, a, b, c, d, e, f]) yield dict(zip('PABCDEF', [p, a, b, c, d, e, f])) tb = time.time() - #print(tb-ta) + print(tb-ta) def match_menelaus_rev( g: gh.Graph, diff --git a/ddar.py b/ddar.py index 8f910cb..f3f3275 100644 --- a/ddar.py +++ b/ddar.py @@ -42,10 +42,10 @@ def saturate_or_goal( eq4s = [] branching = [] all_added = [] - + max_level = 2 while len(level_times) < max_level: level = len(level_times) + 1 - + print(f"hello from {level}") t = time.time() added, derv, eq4, n_branching = dd.bfs_one_level( g, theorems, level, p, verbose=False, nm_check=True, timeout=timeout @@ -55,6 +55,7 @@ def saturate_or_goal( derives.append(derv) eq4s.append(eq4) + level_time = time.time() - t logging.info(f'Depth {level}/{max_level} time = {level_time}') # pylint: disable=logging-fstring-interpolation @@ -62,15 +63,21 @@ def saturate_or_goal( if p.goal is not None: goal_args = list(map(lambda x: g.get(x, lambda: int(x)), p.goal.args)) - if g.check(p.goal.name, goal_args): # found goal + #print(p.goal.name, [ag.name for ag in goal_args]) + qicong = g.check(p.goal.name, goal_args) + if qicong: # found goal + print("yattaze") break + else: + print("yamero") + pass if not added: # saturated + print("satori") break if level_time > timeout: break - return derives, eq4s, branching, all_added @@ -93,10 +100,10 @@ def solve( while len(level_times) < max_level: dervs, eq4, next_branches, added = saturate_or_goal( - g, theorems, level_times, controller, max_level, timeout=timeout + g, theorems, level_times, controller, max_level/10, timeout=timeout ) all_added += added - + print(len(level_times),level_times) derives += dervs eq4s += eq4 branches += next_branches @@ -104,9 +111,15 @@ def solve( # Now, it is either goal or saturated if controller.goal is not None: goal_args = g.names2points(controller.goal.args) - if g.check(controller.goal.name, goal_args): # found goal + #print(controller.goal.name, [ag.name for ag in goal_args]) + ifcong = g.check(controller.goal.name, goal_args) + if ifcong: # found goal status = 'solved' + print("solved") break + else: + pass + #print("failed") if not derives: # officially saturated. break @@ -154,4 +167,4 @@ def get_proof_steps( setup = [(prems, [tuple(p)]) for p, prems in setup] aux = [(prems, [tuple(p)]) for p, prems in aux] - return setup, aux, log, refs + return setup, aux, log, refs \ No newline at end of file diff --git a/geometry.py b/geometry.py index 34544ad..e02ecab 100644 --- a/geometry.py +++ b/geometry.py @@ -132,14 +132,18 @@ def merge_one(self, node: Node, deps: list[Any]) -> None: def is_val(self, node: Node) -> bool: return ( - isinstance(self, Line) - and isinstance(node, Direction) - or isinstance(self, Segment) - and isinstance(node, Length) - or isinstance(self, Angle) - and isinstance(node, Measure) - or isinstance(self, Ratio) - and isinstance(node, Value) + (isinstance(self, Line) + and isinstance(node, Direction)) + or (isinstance(self, Segment) + and isinstance(node, Length)) + or (isinstance(self, Angle) + and isinstance(node, Measure)) + or (isinstance(self, Ratio) + and isinstance(node, Value)) + or (isinstance(self, Ratio_Pro) + and isinstance(node, Value)) + or (isinstance(self, Length_Pro) + and isinstance(node, Value)) ) def set_val(self, node: Node) -> None: @@ -170,7 +174,7 @@ def connect_to(self, node: Node, deps: list[Any] = None) -> None: rep.edge_graph[node].update({self: deps}) else: rep.edge_graph[node] = {self: deps} - + if self.is_val(node): self.set_val(node) node.set_obj(self) @@ -551,7 +555,7 @@ class Ratio_Pro(Node): def new_val(self) -> Value: return Value() - def set_products(self, lp13: Length_Pro, lp24: Length_Pro) -> None: + def set_lengths(self, lp13: Length_Pro, lp24: Length_Pro) -> None: self._lp = lp13, lp24 @property diff --git a/graph.py b/graph.py index 469eff4..1a9f57a 100644 --- a/graph.py +++ b/graph.py @@ -391,8 +391,10 @@ def do_algebra(self, name: str, args: list[Point]) -> list[Dependency]: if name in ['cong', 'cong2']: a, b, c, d, dep = args + print('before', a.name, b.name, c.name, d.name) if not (a != b and c != d and (a != c or b != d)): return [] + print('after', a.name, b.name, c.name, d.name) return self.add_cong([a, b, c, d], dep) if name == 'eqratio30': # TODO @@ -442,9 +444,11 @@ def derive_ratio_algebra( if len(x) == 2: a, b = x if type(a) is gm.Length and type(b) is gm.Length: + print("myab",a.name,b.name) if gm.is_equiv(a, b): continue (m, n), (p, q) = a._obj.points, b._obj.points + print(m.name,n.name,p.name,q.name) added['cong2'].append((m, n, p, q, dep)) else: assert type(a) is gm.Length_Pro and type(b) is gm.Length_Pro @@ -497,6 +501,7 @@ def derive_ratio_algebra( if type(a) is gm.Length_Pro and type(d) is gm.Length_Pro: assert type(b) is gm.Length_Pro, f"b.type:{type(b)}" assert type(c) is gm.Length_Pro, f"c.type:{type(c)}" + continue a1, a2 = a._l b1, b2 = b._l c1, c2 = c._l @@ -785,6 +790,10 @@ def connect_val(self, node: gm.Node, deps: Dependency) -> gm.Node: name = 'l(' + node.name + ')' if isinstance(node, Ratio): name = 'r(' + node.name + ')' + if isinstance(node, Ratio_Pro): + name = 'rp(' + node.name + ')' + if isinstance(node, Length_Pro): + name = 'lp(' + node.name + ')' v = self.new_node(gm.val_type(node), name) self.connect(node, v, deps=deps) return v @@ -1131,7 +1140,6 @@ def make_equal(self, x: gm.Node, y: gm.Node, deps: Dependency) -> None: """Make that two nodes x and y are equal, i.e. merge their value node.""" if x.val is None: x, y = y, x - self.connect_val(x, deps=None) self.connect_val(y, deps=None) vx = x._val @@ -2207,12 +2215,12 @@ def _get_or_create_ratio_l( return r12, r21, why1 + why2 def _get_or_create_length_pro( - self, s1: Segment, s2: Segment, deps: Dependency + self, s1: Segment, s2: Segment, deps=None ) -> tuple[Length_Pro, list[Dependency]]: - return self._get_or_create_ratio_l(s1._val, s2._val, deps) + return self._get_or_create_length_pro_l(s1._val, s2._val, deps) def _get_or_create_length_pro_l( - self, l1: Length, l2: Length, deps: Dependency + self, l1: Length, l2: Length, deps=None ) -> tuple[Length_Pro, list[Dependency]]: """Get or create a new Length_Pro from two Lenghts l1 and l2.""" if l1.name > l2.name: @@ -2220,10 +2228,13 @@ def _get_or_create_length_pro_l( for lp in self.type2nodes[Length_Pro]: if lp.lengths == Multiset([l1.rep(), l2.rep()]): l1_, l2_ = lp._l - # l1.rep() == l1_ and l2.rep() == l2_ - why1 = l1.why_equal([l1_], None) + l1_.why_rep() - why2 = l2.why_equal([l2_], None) + l2_.why_rep() - return lp, why1 + why2 + if l1.rep() == l1_:# l1.rep() == l1_ and l2.rep() == l2_ + why1 = l1.why_equal([l1_], None) + l1_.why_rep() + why2 = l2.why_equal([l2_], None) + l2_.why_rep() + return lp, why1 + why2 + else: #l2.rep() == l1_ and l1.rep == l2_ + why1 = l2.why_equal([l1_], None) + l1_.why_rep() + why2 = l1.why_equal([l2_], None) + l2_.why_rep() l1, why1 = l1.rep_and_why() l2, why2 = l2.rep_and_why() @@ -2234,12 +2245,12 @@ def _get_or_create_length_pro_l( return lp12, why1 + why2 def _get_or_create_ratio_pro( - self, s1: Segment, s2: Segment, s3: Segment, s4: Segment, deps: Dependency + self, s1: Segment, s2: Segment, s3: Segment, s4: Segment, deps=None ) -> tuple[Ratio_Pro, Ratio_Pro, list[Dependency]]: return self._get_or_create_ratio_pro_l(s1._val, s2._val, s3._val, s4._val, deps) def _get_or_create_ratio_pro_l( - self, l1: Length, l2: Length, l3:Length, l4: Length, deps: Dependency + self, l1: Length, l2: Length, l3:Length, l4: Length, deps=None ) -> tuple[Ratio_Pro, Ratio_Pro, list[Dependency]]: """Get or create a new Ratio_Pro from four Lengths l1*l3 and l2*l4.""" if l1.name > l3.name: @@ -2264,6 +2275,8 @@ def _get_or_create_ratio_pro_l( l4, why4 = l4.rep_and_why() lp13 = self.new_node(Length_Pro, f'{l1.name}*{l3.name}') lp24 = self.new_node(Length_Pro, f'{l2.name}*{l4.name}') + lp13.set_lengths(l1, l3) + lp24.set_lengths(l2, l4) rp1324 = self.new_node(Ratio_Pro, f'{lp13.name}/{lp24.name}') rp2413 = self.new_node(Ratio_Pro, f'{lp24.name}/{lp13.name}') self.connect(lp13, rp1324, deps) @@ -2276,7 +2289,7 @@ def _get_or_create_ratio_pro_l( return rp1324, rp2413, why1 + why2 + why3 + why4 def _get_or_create_ratio_pro_lp( - self, lp1: Length_Pro, lp2: Length_Pro, deps: Dependency + self, lp1: Length_Pro, lp2: Length_Pro, deps=None ) -> tuple[Ratio_Pro, Ratio_Pro, list[Dependency]]: """Get or create a new Ratio_Pro from two Length_Pro l1*l2.""" l1, l3 = lp1._l @@ -2284,7 +2297,7 @@ def _get_or_create_ratio_pro_lp( return self._get_or_create_ratio_pro_l(l1, l2, l3, l4, deps) def _set_ratio_pro_equal( - self, lp1: Length_Pro, lp2: Length_Pro, lp3: Length_Pro, lp4: Length_Pro, deps: Dependency + self, lp1: Length_Pro, lp2: Length_Pro, lp3: Length_Pro, lp4: Length_Pro, deps=None ) -> None: rp12, rp21, _ = self._get_or_create_ratio_pro_lp(lp1, lp2, deps) rp34, rp43, _ = self._get_or_create_ratio_pro_lp(lp3, lp4, deps) @@ -2618,6 +2631,14 @@ def add_eqratio30( xy = self._get_or_create_segment(x, y, deps=None) zw = self._get_or_create_segment(z, w, deps=None) + + self.connect_val(ab, deps=None) + self.connect_val(cd, deps=None) + self.connect_val(mn, deps=None) + self.connect_val(pq, deps=None) + self.connect_val(xy, deps=None) + self.connect_val(zw, deps=None) + add = self.maybe_make_equal_pairs30( a, b, c, d, m, n, p, q, x, y, z, w, ab, cd, mn, pq, xy, zw, deps ) @@ -2625,12 +2646,7 @@ def add_eqratio30( if add is not None: return add - self.connect_val(ab, deps=None) - self.connect_val(cd, deps=None) - self.connect_val(mn, deps=None) - self.connect_val(pq, deps=None) - self.connect_val(xy, deps=None) - self.connect_val(zw, deps=None) + add = [] _abmn_, why1 = self._get_or_create_length_pro(ab, mn, deps=None) _abxy_, why2 = self._get_or_create_length_pro(ab, xy, deps=None) diff --git a/graph_utils.py b/graph_utils.py index aac4544..022b0b0 100644 --- a/graph_utils.py +++ b/graph_utils.py @@ -30,6 +30,14 @@ def _cross(elems1, elems2): def cross(elems1, elems2): return list(_cross(elems1, elems2)) +def _cross3(elems1, elems2, elems3): + for e1 in elems1: + for e2 in elems2: + for e3 in elems3: + yield e1, e2, e3 + +def cross3(elems1, elems2, elems3): + return list(_cross3(elems1, elems2, elems3)) def _comb2(elems): if len(elems) < 2: diff --git a/kirine.txt b/kirine.txt index cdffacd..d0d00a5 100644 --- a/kirine.txt +++ b/kirine.txt @@ -1,24 +1,22 @@ ========================== * From theorem premises: -A B C D E F G H I J : Points -DA = DB [00] +A B C D E F G : Points +C,B,D are collinear [00] DB = DC [01] -DE = DA [02] -DF = DA [03] -DG = DA [04] -E,F,H are collinear [05] -H,A,B are collinear [06] -F,I,G are collinear [07] -C,I,B are collinear [08] -J,A,G are collinear [09] -E,C,J are collinear [10] +EC = EA [02] +C,E,A are collinear [03] +F,B,E are collinear [04] +F,D,A are collinear [05] +B,G,A are collinear [06] +C,F,G are collinear [07] * Auxiliary Constructions: : Points * Proof steps: -001. DF = DA [03] & DG = DA [04] & DA = DB [00] & DE = DA [02] & DB = DC [01] ⇒ E,B,F,C,A,G are concyclic [11] -002. E,B,F,C,A,G are concyclic [11] & E,F,H are collinear [05] & H,A,B are collinear [06] & F,I,G are collinear [07] & C,I,B are collinear [08] & J,A,G are collinear [09] & E,C,J are collinear [10] ⇒ I,J,H are collinear +001. B,G,A are collinear [06] & C,B,D are collinear [00] & C,E,A are collinear [03] & F,B,E are collinear [04] & C,F,G are collinear [07] & F,D,A are collinear [05] ⇒ (BD:DC) * (AG:GB) * (CE:EA) = 1 [08] +002. (BD:DC) * (AG:GB) * (CE:EA) = 1 [08] & DB = DC [01] ⇒ AG:GB = EA:CE [09] +003. EC = EA [02] & AG:GB = EA:CE [09] (Ratio chase)⇒ BG = GA ========================== diff --git a/pros2.txt b/pros2.txt index c96000a..d58eacd 100644 --- a/pros2.txt +++ b/pros2.txt @@ -33,4 +33,16 @@ a b = segment a b; o1 = on_bline o1 a b; o2 = on_bline o2 a b; o3 = free; c = on test_radical_axis2 a b c = triangle a b c; e = free; o1 = circle o1 a b c; o2 = circle o2 a b e; o3 = on_bline o3 c e; d = on_circle d o1 a, on_circle d o3 c; f = on_circle f o2 a, on_circle f o3 c; g = on_line g c d, on_line g e f ? coll g a b test_radical_axis_rev -a b c = triangle a b c; d = on_line a b; o1 = circle o1 a b c; e = on_line e c d, on_circle e o1 a; o2 = on_bline o2 c e; f = on_circle f o2 c; g = on_circle g o2 c, on_line g d f ? cyclic a b f g \ No newline at end of file +a b c = triangle a b c; d = on_line a b; o1 = circle o1 a b c; e = on_line e c d, on_circle e o1 a; o2 = on_bline o2 c e; f = on_circle f o2 c; g = on_circle g o2 c, on_line g d f ? cyclic a b f g +test_gcenter1 +a b c = triangle a b c; d = midpoint d b c; e = midpoint e c a; g = on_line g b e, on_line g a d; f = on_line f a b, on_line f c g ? cong f a f b +test_gcenter2 +a b c = triangle a b c; d = midpoint d b c; e = midpoint e c a; f = midpoint f a b; g = on_line g b e, on_line g c f ? coll a g d +test_icenter1 +a b c = triangle a b c; d = angle_bisector d b a c, on_line d b c; e = angle_bisector e a b c, on_line e a c; i = on_line i a d, on_line i b e; f = on_line f c i, on_line f a b ? eqangle c a c f c f c b +example2_1 +a b c = triangle a b c; d = foot d a b c; h = on_line h a d; e = on_line e a c, on_line e b h; f = on_line f a b, on_line f c h; p = on_pline p a b c, on_line p d f; q = on_line q p a, on_line q d e ? cong a p a q +test_menelaus +a b c = triangle a b c; d = midpoint d b c; e = on_line e c a; f = on_line f a b, on_line f d e ? eqratio c e e a b f f a +exercise20_2 +a b = segment; o = midpoint o a b; c = on_bline c a b, on_circle c o a; m = midpoint b c; d = foot d c a m; e = on_line e c d, on_line e a b; n = midpoint n a e ? cong a n b e \ No newline at end of file diff --git a/rules1.txt b/rules1.txt index 53244e4..b996bb1 100644 --- a/rules1.txt +++ b/rules1.txt @@ -1 +1 @@ -cyclic A B C D E F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I \ No newline at end of file +coll A F B, coll B D C, coll C E A, coll B P E, coll C P F, coll A P D => eqratio30 A F F B B D D C C E E A \ No newline at end of file diff --git a/test.py b/test.py index 63fde3a..ffc7e66 100644 --- a/test.py +++ b/test.py @@ -1,6 +1,2 @@ -for why, (u, v), (u_, v_) in zip( - ['why1', 'why2', 'why3', 'why4'], - [('a', 'b'), ('c', 'd'), ('e', 'f'), ('g', 'h')], - [('a_', 'b_'), ('c_', 'd_'), ('e_', 'f_'), ('g_', 'h_')], - ): - print(why, u, v, u_, v_) \ No newline at end of file +_ab_ = 1 +print(_ab_) \ No newline at end of file From 7a149b363ec37565cfbf93e4de0b7a8cca0fb610 Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.cn> Date: Wed, 19 Mar 2025 16:30:23 +0800 Subject: [PATCH 14/27] simplify frac --- ar.py | 6 +- chiaya.sh | 4 +- dd.py | 2 +- ddar.py | 1 - geometry.py | 1 - graph.py | 169 ++++++++++++++++++++++++++++--------------------- graph_utils.py | 2 +- kirine.txt | 26 ++++---- nothing.txt | 26 +++++++- problem.py | 1 + pros2.txt | 4 +- rules1.txt | 5 +- test.py | 8 ++- 13 files changed, 159 insertions(+), 96 deletions(-) diff --git a/ar.py b/ar.py index 71eccbe..9e25e2e 100644 --- a/ar.py +++ b/ar.py @@ -561,7 +561,7 @@ def get_all_eqs_and_why( for out in super().get_all_eqs_and_why(return_quads): if len(out) == 3: x, y, why = out - print('out2', x, y) + #print('out2', x, y) x, y = self.map2obj([x, y]) yield x, y, why if len(out) == 4: @@ -570,7 +570,7 @@ def get_all_eqs_and_why( yield x, y, f, why if len(out) == 5: a, b, x, y, why = out - print('out4', a, b, x, y) + #print('out4', a, b, x, y) a, b, x, y = self.map2obj([a, b, x, y]) yield a, b, x, y, why @@ -611,6 +611,8 @@ def add_length_pro( l2: gm.Length, dep=None, ) -> None: + if lp.name in self.v2obj: + return lp, l1, l2 = self.get_name([lp, l1, l2]) return super().add_eq5(lp, l1, l2, dep) diff --git a/chiaya.sh b/chiaya.sh index 3d29c78..54be5a8 100644 --- a/chiaya.sh +++ b/chiaya.sh @@ -9,7 +9,7 @@ DDAR_ARGS=( --rules_file=$(pwd)/rules1.txt \ ); -SIZE=4 +SIZE=8 BATCH_SIZE=$SIZE BEAM_SIZE=$SIZE @@ -41,7 +41,7 @@ INPUT_FILE=pros2.txt python -m alphageometry \ --alsologtostderr \ --problems_file=$(pwd)/$INPUT_FILE \ ---problem_name=test_gcenter1 \ +--problem_name=exercise20_2_1 \ --mode=alphageometry \ "${DDAR_ARGS[@]}" \ "${SEARCH_ARGS[@]}" \ diff --git a/dd.py b/dd.py index 3f3cb9e..3ce4aea 100644 --- a/dd.py +++ b/dd.py @@ -976,7 +976,7 @@ def match_ceva( ads = ad.neighbors(gm.Point, return_set=True) bes = be.neighbors(gm.Point, return_set=True) p = intersect1(ads, bes) - if g.check_coll([p, c, f]): + if p is not None and g.check_coll([p, c, f]): debugname([p, a, b, c, d, e, f]) yield dict(zip('PABCDEF', [p, a, b, c, d, e, f])) tb = time.time() diff --git a/ddar.py b/ddar.py index f3f3275..7a6813e 100644 --- a/ddar.py +++ b/ddar.py @@ -42,7 +42,6 @@ def saturate_or_goal( eq4s = [] branching = [] all_added = [] - max_level = 2 while len(level_times) < max_level: level = len(level_times) + 1 print(f"hello from {level}") diff --git a/geometry.py b/geometry.py index e02ecab..3050f20 100644 --- a/geometry.py +++ b/geometry.py @@ -123,7 +123,6 @@ def merge(self, nodes: list[Node], deps: list[Any]) -> None: def merge_one(self, node: Node, deps: list[Any]) -> None: node.rep().set_rep(self.rep()) - if node in self.merge_graph: return diff --git a/graph.py b/graph.py index 1a9f57a..41a4b5d 100644 --- a/graph.py +++ b/graph.py @@ -391,10 +391,8 @@ def do_algebra(self, name: str, args: list[Point]) -> list[Dependency]: if name in ['cong', 'cong2']: a, b, c, d, dep = args - print('before', a.name, b.name, c.name, d.name) if not (a != b and c != d and (a != c or b != d)): return [] - print('after', a.name, b.name, c.name, d.name) return self.add_cong([a, b, c, d], dep) if name == 'eqratio30': # TODO @@ -435,54 +433,33 @@ def derive_ratio_algebra( ) -> dict[str, list[tuple[Point, ...]]]: """Derive new eqratio predicates.""" added = {'cong2': [], 'eqratio': [], 'eqratio30': []} - new_products = [] + new_products = set() for x in self.rtable.get_all_eqs_and_why(): x, why = x[:-1], x[-1] dep = EmptyDependency(level=level, rule_name='a01') dep.why = why + A = [] + B = [] if len(x) == 2: a, b = x if type(a) is gm.Length and type(b) is gm.Length: - print("myab",a.name,b.name) - if gm.is_equiv(a, b): - continue - (m, n), (p, q) = a._obj.points, b._obj.points - print(m.name,n.name,p.name,q.name) - added['cong2'].append((m, n, p, q, dep)) + A = [a] + B = [b] else: assert type(a) is gm.Length_Pro and type(b) is gm.Length_Pro a1, a2 = a._l b1, b2 = b._l - if gm.is_equiv(a1, b1): - if gm.is_equiv(a2, b2): - continue - (m, n), (p, q) = a2._obj.points, b2._obj.points - added['cong2'].append((m, n, p, q, dep)) - elif gm.is_equiv(a1, b2): - if gm.is_equiv(a2, b1): - continue - (m, n), (p, q) = a2._obj.points, b1._obj.points - added['cong2'].append((m, n, p, q, dep)) - elif gm.is_equiv(a2, b1): - m, n = a1._obj.points - p, q = b2._obj.points - added['cong2'].append((m, n, p, q, dep)) - elif gm.is_equiv(a2, b2): - m, n = a1._obj.points - p, q = b1._obj.points - added['cong2'].append((m, n, p, q, dep)) - else: - if gm.is_equiv(a, b): - continue - added['eqratio'].append((a1, b1, b2, a2, dep)) + A = [a1, a2] + B = [b1, b2] if len(x) == 4: a, b, c, d = x if type(a) is gm.Length and type(d) is gm.Length: assert type(b) is gm.Length, f"b.type:{type(b)}" assert type(c) is gm.Length, f"c.type:{type(c)}" - added['eqratio'].append((a, b, c, d, dep)) + A = [a,d] + B = [b,c] if {type(a),type(d)} == {gm.Length, gm.Length_Pro}: assert {type(b), type(c)} == {gm.Length, gm.Length_Pro}, f"b.type:{type(b)}, c.type:{type(c)}" if type(a) is gm.Length: # type(d) is gm.Length_Pro @@ -491,41 +468,80 @@ def derive_ratio_algebra( b, c = c, b a1, a2 = a._l b1, b2 = b._l - _a1d_, _ = self._get_or_create_length_pro_l(a1, d) - _a2d_, _ = self._get_or_create_length_pro_l(a2, d) - _b1c_, _ = self._get_or_create_length_pro_l(b1, c) - _b2c_, _ = self._get_or_create_length_pro_l(b2, c) - new_products.extend([_a1d_,_a2d_,_b1c_,_b2c_]) - added['eqratio30'].append((a1, b1, a2, b2, d, c, dep)) + A = [a1, a2, d] + B = [b1, b2, c] if type(a) is gm.Length_Pro and type(d) is gm.Length_Pro: assert type(b) is gm.Length_Pro, f"b.type:{type(b)}" assert type(c) is gm.Length_Pro, f"c.type:{type(c)}" - continue a1, a2 = a._l b1, b2 = b._l c1, c2 = c._l d1, d2 = d._l - - _a1d1_, _ = self._get_or_create_length_pro_l(a1, d1) - _a1d2_, _ = self._get_or_create_length_pro_l(a1, d2) - _a2d1_, _ = self._get_or_create_length_pro_l(a2, d1) - _a2d2_, _ = self._get_or_create_length_pro_l(a2, d2) - _b1c1_, _ = self._get_or_create_length_pro_l(b1, c1) - _b1c2_, _ = self._get_or_create_length_pro_l(b1, c2) - _b2c1_, _ = self._get_or_create_length_pro_l(b2, c1) - _b2c2_, _ = self._get_or_create_length_pro_l(b2, c2) - new_products.extend([_a1d1_,_a1d2_,_a2d1_,_a2d2_,_b1c1_,_b1c2_,_b2c1_,_b2c2_]) - self._set_ratio_pro_equal(a, b, c, d) - self._set_ratio_pro_equal(a, _b1c1_,_b2c2_, d) - self._set_ratio_pro_equal(a, _b1c2_,_b2c1_, d) - self._set_ratio_pro_equal(_a1d1_, b, c, _a2d2_) - self._set_ratio_pro_equal(_a1d1_, _b1c1_, _b2c2_, _a2d2_) - self._set_ratio_pro_equal(_a1d1_, _b1c2_, _b2c1_, _a2d2_) - self._set_ratio_pro_equal(_a1d2_, b, c, _a2d1_) - self._set_ratio_pro_equal(_a1d2_, _b1c1_, _b2c2_, _a2d1_) - self._set_ratio_pro_equal(_a1d2_, _b1c2_, _b2c1_, _a2d1_) - + A = [a1, a2, d1, d2] + B = [b1, b2, c1, c2] + + print('before',[ag.name for ag in A],[ag.name for ag in B]) + A_ = [] + for x in A: + for y in B: + if gm.is_equiv(x, y): + B.remove(y) + A_.append(x) + break + for x in A_: + A.remove(x) + + print('after',[ag.name for ag in A],[ag.name for ag in B]) + if len(A) == 0: + continue + elif len(A) == 1: + a = A[0] + b = B[0] + m, n = a._obj.points + p, q = b._obj.points + added['cong2'].append((m, n, p, q, dep)) + elif len(A) == 2: + a, d = A + b, c = B + added['eqratio'].append((a, b, c, d, dep)) + elif len(A) == 3: + a1, a2, d = A + b1, b2, c = B + _a1a2_, _ = self._get_or_create_length_pro_l(a1, a2) + _a1d_, _ = self._get_or_create_length_pro_l(a1, d) + _a2d_, _ = self._get_or_create_length_pro_l(a2, d) + _b1b2_, _ = self._get_or_create_length_pro_l(b1, b2) + _b1c_, _ = self._get_or_create_length_pro_l(b1, c) + _b2c_, _ = self._get_or_create_length_pro_l(b2, c) + new_products.update([_a1a2_,_a1d_,_a2d_,_b1b2_,_b1c_,_b2c_]) + added['eqratio30'].append((a1, b1, a2, b2, d, c, dep)) + else : #len(A) == 4 + a1, a2, d1, d2 = A + b1, b2, c1, c2 = B + _a1a2_, _ = self._get_or_create_length_pro_l(a1, a2) + _a1d1_, _ = self._get_or_create_length_pro_l(a1, d1) + _a1d2_, _ = self._get_or_create_length_pro_l(a1, d2) + _a2d1_, _ = self._get_or_create_length_pro_l(a2, d1) + _a2d2_, _ = self._get_or_create_length_pro_l(a2, d2) + _d1d2_, _ = self._get_or_create_length_pro_l(d1, d2) + _b1b2_, _ = self._get_or_create_length_pro_l(b1, b2) + _b1c1_, _ = self._get_or_create_length_pro_l(b1, c1) + _b1c2_, _ = self._get_or_create_length_pro_l(b1, c2) + _b2c1_, _ = self._get_or_create_length_pro_l(b2, c1) + _b2c2_, _ = self._get_or_create_length_pro_l(b2, c2) + _c1c2_, _ = self._get_or_create_length_pro_l(c1, c2) + new_products.update([_a1a2_,_a1d1_,_a1d2_,_a2d1_,_a2d2_,_d1d2_,_b1b2_,_b1c1_,_b1c2_,_b2c1_,_b2c2_,_d1d2_]) + + self._set_ratio_pro_equal(_a1a2_, _b1b2_, _c1c2_, _d1d2_, dep) + self._set_ratio_pro_equal(_a1a2_, _b1c1_, _b2c2_, _d1d2_, dep) + self._set_ratio_pro_equal(_a1a2_, _b1c2_, _b2c1_, _d1d2_, dep) + self._set_ratio_pro_equal(_a1d1_, _b1b2_, _c1c2_, _a2d2_, dep) + self._set_ratio_pro_equal(_a1d1_, _b1c1_, _b2c2_, _a2d2_, dep) + self._set_ratio_pro_equal(_a1d1_, _b1c2_, _b2c1_, _a2d2_, dep) + self._set_ratio_pro_equal(_a1d2_, _b1b2_, _c1c2_, _a2d1_, dep) + self._set_ratio_pro_equal(_a1d2_, _b1c1_, _b2c2_, _a2d1_, dep) + self._set_ratio_pro_equal(_a1d2_, _b1c2_, _b2c1_, _a2d1_, dep) for lp in new_products: l1, l2 = lp._l @@ -641,6 +657,7 @@ def build_problem( args = list(map(lambda x: g.get(x, lambda: int(x)), pr.goal.args)) check = nm.check(pr.goal.name, args) + print(check) g.url = pr.url g.build_def = (pr, definitions) @@ -2227,7 +2244,7 @@ def _get_or_create_length_pro_l( l1, l2 = l2, l1 for lp in self.type2nodes[Length_Pro]: if lp.lengths == Multiset([l1.rep(), l2.rep()]): - l1_, l2_ = lp._l + l1_, l2_ = lp.lengths if l1.rep() == l1_:# l1.rep() == l1_ and l2.rep() == l2_ why1 = l1.why_equal([l1_], None) + l1_.why_rep() why2 = l2.why_equal([l2_], None) + l2_.why_rep() @@ -2260,13 +2277,20 @@ def _get_or_create_ratio_pro_l( for rp in self.type2nodes[Ratio_Pro]: lp13_, lp24_ = rp._lp if lp13_.lengths == Multiset([l1.rep(), l3.rep()]) and lp24_.lengths == Multiset([l2.rep(), l4.rep()]): - l1_, l3_ = lp13_._l - l2_, l4_ = lp24_._l - # l1.rep() == l1_ and l3.rep() == l3_ and l2.rep() == l2_ and l4.rep() == l4_ - why1 = l1.why_equal([l1_], None) + l1_.why_rep() - why2 = l2.why_equal([l2_], None) + l2_.why_rep() - why3 = l3.why_equal([l3_], None) + l3_.why_rep() - why4 = l4.why_equal([l4_], None) + l4_.why_rep() + l1_, l3_ = lp13_.lengths + l2_, l4_ = lp24_.lengths + if l1.rep() == l1_: + why1 = l1.why_equal([l1_], None) + l1_.why_rep() + why3 = l3.why_equal([l3_], None) + l3_.why_rep() + else: + why1 = l3.why_equal([l1_], None) + l1_.why_rep() + why3 = l1.why_equal([l3_], None) + l3_.why_rep() + if l2.rep() == l2_: + why2 = l2.why_equal([l2_], None) + l2_.why_rep() + why4 = l4.why_equal([l4_], None) + l4_.why_rep() + else: + why2 = l4.why_equal([l2_], None) + l2_.why_rep() + why4 = l2.why_equal([l4_], None) + l4_.why_rep() return rp, rp.opposite, why1 + why2 + why3 + why4 l1, why1 = l1.rep_and_why() @@ -2297,14 +2321,15 @@ def _get_or_create_ratio_pro_lp( return self._get_or_create_ratio_pro_l(l1, l2, l3, l4, deps) def _set_ratio_pro_equal( - self, lp1: Length_Pro, lp2: Length_Pro, lp3: Length_Pro, lp4: Length_Pro, deps=None + self, lp1: Length_Pro, lp2: Length_Pro, lp3: Length_Pro, lp4: Length_Pro, dep=None ) -> None: - rp12, rp21, _ = self._get_or_create_ratio_pro_lp(lp1, lp2, deps) - rp34, rp43, _ = self._get_or_create_ratio_pro_lp(lp3, lp4, deps) + deps = dep + rp12, rp21, _ = self._get_or_create_ratio_pro_lp(lp1, lp2) + rp34, rp43, _ = self._get_or_create_ratio_pro_lp(lp3, lp4) self.make_equal(rp12, rp34, deps=deps) self.make_equal(rp21, rp43, deps=deps) - rp13, rp31, _ = self._get_or_create_ratio_pro_lp(lp1, lp3, deps) - rp24, rp42, _ = self._get_or_create_ratio_pro_lp(lp2, lp4, deps) + rp13, rp31, _ = self._get_or_create_ratio_pro_lp(lp1, lp3) + rp24, rp42, _ = self._get_or_create_ratio_pro_lp(lp2, lp4) self.make_equal(rp13, rp24, deps=deps) self.make_equal(rp31, rp42, deps=deps) diff --git a/graph_utils.py b/graph_utils.py index 022b0b0..ba8939c 100644 --- a/graph_utils.py +++ b/graph_utils.py @@ -180,4 +180,4 @@ def _perm6(elems): def perm6(elems): if len(elems) < 6: return [] - return list(_perm6(elems)) \ No newline at end of file + return list(_perm6(elems)) diff --git a/kirine.txt b/kirine.txt index d0d00a5..3c5b44a 100644 --- a/kirine.txt +++ b/kirine.txt @@ -2,21 +2,25 @@ ========================== * From theorem premises: A B C D E F G : Points -C,B,D are collinear [00] -DB = DC [01] -EC = EA [02] -C,E,A are collinear [03] -F,B,E are collinear [04] -F,D,A are collinear [05] -B,G,A are collinear [06] -C,F,G are collinear [07] +BC = BA [00] +D,B,C are collinear [01] +DB = DC [02] +D,A,E are collinear [03] +F,C,A are collinear [04] +B,F,E are collinear [05] +FA:CA = FA:CA [06] +GA = GF [07] * Auxiliary Constructions: : Points * Proof steps: -001. B,G,A are collinear [06] & C,B,D are collinear [00] & C,E,A are collinear [03] & F,B,E are collinear [04] & C,F,G are collinear [07] & F,D,A are collinear [05] ⇒ (BD:DC) * (AG:GB) * (CE:EA) = 1 [08] -002. (BD:DC) * (AG:GB) * (CE:EA) = 1 [08] & DB = DC [01] ⇒ AG:GB = EA:CE [09] -003. EC = EA [02] & AG:GB = EA:CE [09] (Ratio chase)⇒ BG = GA +001. F,C,A are collinear [04] & D,B,C are collinear [01] & D,A,E are collinear [03] & B,F,E are collinear [05] ⇒ (AF:FC) * (CB:BD) * (DE:EA) = 1 [08] +002. F,C,A are collinear [04] & D,B,C are collinear [01] & D,A,E are collinear [03] & B,F,E are collinear [05] ⇒ (DC:CB) * (EA:AD) * (BF:FE) = 1 [09] +003. DB = DC [02] (Distance chase)⇒ CD:CB = 1_/2 [10] +004. GA = GF [07] (Distance chase)⇒ FG:FA = 1_/2 [11] +005. (AF:FC) * (CB:BD) * (DE:EA) = 1 [08] & BC = BA [00] & DB = DC [02] & (DC:CB) * (EA:AD) * (BF:FE) = 1 [09] & CD:CB = 1_/2 [10] & FG:FA = 1_/2 [11] ⇒ FG:FA = FC:FA [12] +006. FG:FA = FC:FA [12] & FA:CA = FA:CA [06] ⇒ FG = FC [13] +007. FG = FC [13] & GA = GF [07] ⇒ AG = CF ========================== diff --git a/nothing.txt b/nothing.txt index 8a24a23..e930451 100644 --- a/nothing.txt +++ b/nothing.txt @@ -19,4 +19,28 @@ circle O A B C, cong O A O D, cong O A O E, coll G A B, coll G D E, coll H B C, cyclic A B C D E F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I circle O A B C, cong O A O D, cong O A O E, cong O A O F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I -cyclic A B C D, cyclic A B C E => cong A D A E \ No newline at end of file +cyclic A B C D, cyclic A B C E => cong A D A E + +001. A,F,C are collinear [06] & B,D,C are collinear [03] & A,D,E are collinear [04] & F,B,E are collinear [07] ⇒ (AF:FC) * (CB:BD) * (DE:EA) = 1 [10] +002. (AF:FC) * (CB:BD) * (DE:EA) = 1 [10] & BC = BA [00] & DB = DC [02] ⇒ (AF:FC) * (AB:AE) * (DE:DC) = 1 [11] +003. A,D,E are collinear [04] & B,D,C are collinear [03] & BC ⟂ AB [01] & BE ⟂ AD [05] ⇒ ∠BEA = ∠ABD [12] +004. A,D,E are collinear [04] ⇒ ∠BAE = ∠BAD [13] +005. ∠BEA = ∠ABD [12] & ∠BAE = ∠BAD [13] ⇒ EB:EA = BD:BA [14] +006. EB:EA = BD:BA [14] & DB = DC [02] ⇒ BE:AE = DC:AB [15] +007. A,D,E are collinear [04] & B,D,C are collinear [03] & BC ⟂ AB [01] & BE ⟂ AD [05] ⇒ ∠BED = ∠DBA [16] +008. D,B,C are collinear [03] & A,D,E are collinear [04] ⇒ ∠BDE = ∠BDA [17] +009. ∠BED = ∠DBA [16] & ∠BDE = ∠BDA [17] ⇒ EB:ED = BA:BD [18] +010. EB:ED = BA:BD [18] & DB = DC [02] ⇒ BE:DE = AB:DC [19] +011. BC = BA [00] & DB = DC [02] & (AF:FC) * (AB:AE) * (DE:DC) = 1 [11] & BE:AE = DC:AB [15] & BE:DE = AB:DC [19] (Ratio chase)⇒ BC:DC = AF:FC [20] +012. DB = DC [02] (Distance chase)⇒ CD:CB = 1_/2 [21] +013. GA = GF [09] (Distance chase)⇒ FG:AF = 1_/2 [22] +014. BC:DC = AF:FC [20] & BC = BA [00] & CD:CB = 1_/2 [21] & FG:AF = 1_/2 [22] & AG = FG [09] ⇒ AG:AF = FC:AF [23] +015. AG:AF = FC:AF [23] & AF:AC = AF:AC [08] ⇒ AG = FC + +001. F,C,A are collinear [04] & D,B,C are collinear [01] & D,A,E are collinear [03] & B,F,E are collinear [05] ⇒ (AF:FC) * (CB:BD) * (DE:EA) = 1 [08] +002. F,C,A are collinear [04] & D,B,C are collinear [01] & D,A,E are collinear [03] & B,F,E are collinear [05] ⇒ (DC:CB) * (EA:AD) * (BF:FE) = 1 [09] +003. DB = DC [02] (Distance chase)⇒ CD:CB = 1_/2 [10] +004. GA = GF [07] (Distance chase)⇒ FG:FA = 1_/2 [11] +005. (AF:FC) * (CB:BD) * (DE:EA) = 1 [08] & BC = BA [00] & DB = DC [02] & (DC:CB) * (EA:AD) * (BF:FE) = 1 [09] & CD:CB = 1_/2 [10] & FG:FA = 1_/2 [11] ⇒ FG:FA = FC:FA [12] +006. FG:FA = FC:FA [12] & FA:CA = FA:CA [06] ⇒ FG = FC [13] +007. FG = FC [13] & GA = GF [07] ⇒ AG = CF \ No newline at end of file diff --git a/problem.py b/problem.py index e210545..523bad7 100644 --- a/problem.py +++ b/problem.py @@ -762,6 +762,7 @@ def __init__( self.trace = None def _find(self, dep_hashed: tuple[str, ...]) -> Dependency: + self.why = [w for w in self.why if type(w) is not EmptyDependency] for w in self.why: f = w._find(dep_hashed) if f: diff --git a/pros2.txt b/pros2.txt index d58eacd..dc401c2 100644 --- a/pros2.txt +++ b/pros2.txt @@ -45,4 +45,6 @@ a b c = triangle a b c; d = foot d a b c; h = on_line h a d; e = on_line e a c, test_menelaus a b c = triangle a b c; d = midpoint d b c; e = on_line e c a; f = on_line f a b, on_line f d e ? eqratio c e e a b f f a exercise20_2 -a b = segment; o = midpoint o a b; c = on_bline c a b, on_circle c o a; m = midpoint b c; d = foot d c a m; e = on_line e c d, on_line e a b; n = midpoint n a e ? cong a n b e \ No newline at end of file +a b = segment a b; c = on_tline c b a b, on_circle c b a; d = midpoint d b c; e = foot e b a d; f = on_line f b e, on_line f a c; g = midpoint g a f ? cong a g c f +example1_11 +a b c = triangle a b c; d = on_line d a b; e = on_line e a c; f = midpoint f d e; g = on_line g d e; h = mirror h f g; i = on_line i a b; j = on_line j g i, on_line j a c; k = on_line k a b; l = on_line l k h, on_line l a c; m = on_line m j k, on_line m d e; n = on_line n i l, on_line n d e ? cong f m f n \ No newline at end of file diff --git a/rules1.txt b/rules1.txt index b996bb1..12e5b12 100644 --- a/rules1.txt +++ b/rules1.txt @@ -1 +1,4 @@ -coll A F B, coll B D C, coll C E A, coll B P E, coll C P F, coll A P D => eqratio30 A F F B B D D C C E E A \ No newline at end of file +coll A F B, coll B D C, coll C E A, coll D E F => eqratio30 A F F B B D D C C E E A +eqangle6 B A B C Q P Q R, eqangle6 C A C B R P R Q, ncoll A B C => simtri A B C P Q R +eqangle6 B A B C Q R Q P, eqangle6 C A C B R Q R P, ncoll A B C => simtri2 A B C P Q R +eqratio a b c d m n p q, eqratio c d e f p q r u => eqratio a b e f m n r u \ No newline at end of file diff --git a/test.py b/test.py index ffc7e66..7655524 100644 --- a/test.py +++ b/test.py @@ -1,2 +1,6 @@ -_ab_ = 1 -print(_ab_) \ No newline at end of file +from multiset import Multiset + +A = Multiset([1,2,2,3]) +B = Multiset([2,3,4,5]) + +print(A,B) \ No newline at end of file From fc61ea45adf34475c84425fea34d5ef37b5a8157 Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.cn> Date: Thu, 20 Mar 2025 13:02:21 +0800 Subject: [PATCH 15/27] eqratio40 --- alphageometry.py | 3 +- ar.py | 2 + chiaya.sh | 12 +-- dd.py | 40 +++++----- graph.py | 23 ++++-- kirine.txt | 75 +++++++++++++----- nothing.txt | 202 ++++++++++++++++++++++++++++++++++++++++++++++- numericals.py | 10 +++ pretty.py | 2 + problem.py | 29 ++++++- pros2.txt | 14 +++- rules1.txt | 2 - test.py | 7 +- 13 files changed, 361 insertions(+), 60 deletions(-) diff --git a/alphageometry.py b/alphageometry.py index 72d250c..cad18a1 100644 --- a/alphageometry.py +++ b/alphageometry.py @@ -380,7 +380,8 @@ def try_translate_constrained_to_construct(string: str, g: gh.Graph) -> str: """ if string[-1] != ';': return 'ERROR: must end with ;' - + if ':' not in string: + return 'ERROR: must contain :' head, prem_str = string.split(' : ') point = head.strip() diff --git a/ar.py b/ar.py index 9e25e2e..934dcad 100644 --- a/ar.py +++ b/ar.py @@ -219,6 +219,8 @@ def update_groups( Returns: groups1, links, history: result of the update. """ + print("len1",len(groups1)) + print("len2",len(groups2)) history = [] links = [] for g2 in groups2: diff --git a/chiaya.sh b/chiaya.sh index 54be5a8..1e3905f 100644 --- a/chiaya.sh +++ b/chiaya.sh @@ -6,14 +6,14 @@ export PYTHONPATH=$PYTHONPATH:$MELIAD_PATH DDAR_ARGS=( --defs_file=$(pwd)/defs.txt \ - --rules_file=$(pwd)/rules1.txt \ + --rules_file=$(pwd)/rules.txt \ ); -SIZE=8 +SIZE=4 -BATCH_SIZE=$SIZE -BEAM_SIZE=$SIZE -DEPTH=$SIZE +BATCH_SIZE=16 +BEAM_SIZE=32 +DEPTH=2 SEARCH_ARGS=( --beam_size=$BEAM_SIZE @@ -41,7 +41,7 @@ INPUT_FILE=pros2.txt python -m alphageometry \ --alsologtostderr \ --problems_file=$(pwd)/$INPUT_FILE \ ---problem_name=exercise20_2_1 \ +--problem_name=cmo23_5 \ --mode=alphageometry \ "${DDAR_ARGS[@]}" \ "${SEARCH_ARGS[@]}" \ diff --git a/dd.py b/dd.py index 3ce4aea..7692774 100644 --- a/dd.py +++ b/dd.py @@ -495,7 +495,7 @@ def match_cyclic2power( if p: yield dict(zip('PABCD',[p,a,d,b,c])) tb = time.time() - print("c2p",tb-ta) + #print("c2p",tb-ta) def match_cyclic2power_tan( g: gh.Graph, @@ -520,7 +520,7 @@ def match_cyclic2power_tan( yield dict(zip('OPABC', [o, p, a, b, c])) break tb = time.time() - print(tb-ta) + #print(tb-ta) def match_power2cyclic( @@ -544,7 +544,7 @@ def match_power2cyclic( if g.check_eqratio([p, a, p, c, p, d, p, b]) and not g.check_coll([p,a,c]): yield dict(zip('PABCD', [p, a, b, c, d])) tb = time.time() - print("p2c",tb-ta) + #print("p2c",tb-ta) def match_pascal6( g: gh.Graph, @@ -598,7 +598,7 @@ def match_pascal6( if gg and h and i: yield dict(zip('ABCDEFGHI',[a,b,c,d,e,f,gg,h,i])) tb = time.time() - print(tb-ta) + #print(tb-ta) def match_pascal6_rev( g: gh.Graph, @@ -649,7 +649,7 @@ def match_pascal6_rev( if h and i and g.check_coll([gg,h,i]): yield dict(zip('OABCDEFGHI',[o,a,b,c,d,e,f,gg,h,i])) tb = time.time() - print(tb-ta) + #print(tb-ta) def match_pascal5( g: gh.Graph, @@ -701,7 +701,7 @@ def match_pascal5( if gg and h and i: yield dict(zip('OABCDEGHI',[o,a,b,c,d,e,gg,h,i])) tb = time.time() - print(tb-ta) + #print(tb-ta) def match_pascal41( g: gh.Graph, @@ -761,7 +761,7 @@ def match_pascal41( if gg and h and i: yield dict(zip('OABCDGHI',[o,a,b,c,d,gg,h,i])) tb = time.time() - print(tb-ta) + #print(tb-ta) def match_pascal42( g: gh.Graph, @@ -821,7 +821,7 @@ def match_pascal42( if gg and h and i: yield dict(zip('OABCDGHI',[o,a,b,c,d,gg,h,i])) tb = time.time() - print(tb-ta) + #print(tb-ta) def match_radical_axis( g: gh.Graph, @@ -875,7 +875,7 @@ def match_radical_axis( if p3: yield dict(zip('ABCDEFP',[c,d,e,f,a,b,p3])) tb = time.time() - print(tb-ta) + #print(tb-ta) def match_menelaus( g: gh.Graph, @@ -923,7 +923,7 @@ def match_menelaus( #debugname([a, b, c, d, e, f]) yield dict(zip('ABCDEF', [a, b, c, d, e, f])) tb = time.time() - print(tb-ta) + #print(tb-ta) def match_ceva( @@ -980,7 +980,7 @@ def match_ceva( debugname([p, a, b, c, d, e, f]) yield dict(zip('PABCDEF', [p, a, b, c, d, e, f])) tb = time.time() - print(tb-ta) + #print(tb-ta) def match_menelaus_rev( g: gh.Graph, @@ -988,7 +988,7 @@ def match_menelaus_rev( theorem: pr.Theorem, ) -> Generator[dict[str, gm.Point], None, None]: """Match coll A F B, coll B D C, coll C E A, eqratio30 A F F B B D D C C E E A => coll D E F""" - print("menelaus_rev") + #print("menelaus_rev") recordl = set() ta = time.time() all_lines = g.type2nodes[gm.Line] @@ -1033,7 +1033,7 @@ def match_menelaus_rev( if g.check_eqratio30([a, f, f, b, b, d, d, c, c, e, e, a]): yield dict(zip('ABCDEF', [a, b, c, d, e, f])) tb = time.time() - print(tb-ta) + #print(tb-ta) def match_ceva_rev( g: gh.Graph, @@ -1041,7 +1041,7 @@ def match_ceva_rev( theorem: pr.Theorem, ) -> Generator[dict[str, gm.Point], None, None]: """Match coll A F B, coll B D C, coll C E A, coll B P E, coll C P F, eqratio30 A F F B B D D C C E E A => coll A P D""" - print("ceva_rev") + #print("ceva_rev") recordl = set() ta = time.time() all_lines = g.type2nodes[gm.Line] @@ -1109,7 +1109,7 @@ def match_ceva_rev( #debugname([pca, b, c, a, e, f, d]) yield dict(zip('PABCDEF', [pca, b, c, a, e, f, d])) tb = time.time() - print(tb-ta) + #print(tb-ta) def rotate_simtri( a: gm.Point, b: gm.Point, c: gm.Point, x: gm.Point, y: gm.Point, z: gm.Point @@ -1529,7 +1529,7 @@ def match_generic( theorem: pr.Theorem ) -> Generator[dict[str, gm.Point], None, None]: """Match any generic rule that is not one of the above match_*() rules.""" - debugname(theorem) + #debugname(theorem) ta = time.time() clause2enum = {} @@ -1573,7 +1573,7 @@ def match_generic( yield mapping tb = time.time() - print(tb-ta) + #print(tb-ta) def match_generic_debug( @@ -1624,7 +1624,7 @@ def match_generic_debug( yield mapping tkirine = time.time() - print(theorem.name,tkirine-tchiaya) + #print(theorem.name,tkirine-tchiaya) def match_test( g: gh.Graph, @@ -1638,10 +1638,10 @@ def match_test( for o,x,y,z in g.all_circles(): circle = g.get_circle_thru_triplet(x,y,z) sox = g._get_segment(o,x).val - print(vars(sox)) + #print(vars(sox)) tkirine = time.time() - print(tkirine-tchiaya,theorem.name) + #print(tkirine-tchiaya,theorem.name) BUILT_IN_FNS = { 'cong_cong_cong_cyclic': match_cong_cong_cong_cyclic, diff --git a/graph.py b/graph.py index 41a4b5d..f2af41c 100644 --- a/graph.py +++ b/graph.py @@ -481,7 +481,7 @@ def derive_ratio_algebra( A = [a1, a2, d1, d2] B = [b1, b2, c1, c2] - print('before',[ag.name for ag in A],[ag.name for ag in B]) + #print('before',[ag.name for ag in A],[ag.name for ag in B]) A_ = [] for x in A: for y in B: @@ -492,7 +492,7 @@ def derive_ratio_algebra( for x in A_: A.remove(x) - print('after',[ag.name for ag in A],[ag.name for ag in B]) + #print('after',[ag.name for ag in A],[ag.name for ag in B]) if len(A) == 0: continue elif len(A) == 1: @@ -2321,9 +2321,22 @@ def _get_or_create_ratio_pro_lp( return self._get_or_create_ratio_pro_l(l1, l2, l3, l4, deps) def _set_ratio_pro_equal( - self, lp1: Length_Pro, lp2: Length_Pro, lp3: Length_Pro, lp4: Length_Pro, dep=None + self, lp1: Length_Pro, lp2: Length_Pro, lp3: Length_Pro, lp4: Length_Pro, dep:EmptyDependency ) -> None: - deps = dep + l11, l12 = lp1._l + l21, l22 = lp2._l + l31, l32 = lp3._l + l41, l42 = lp4._l + a1, b1 = l11._obj.points + c1, d1 = l12._obj.points + a2, b2 = l21._obj.points + c2, d2 = l22._obj.points + a3, b3 = l31._obj.points + c3, d3 = l32._obj.points + a4, b4 = l41._obj.points + c4, d4 = l42._obj.points + deps = dep.populate('eqratio40', [a1, b1, a2, b2, c1, d1, c2, d2, a4, b4, a3, b3, c4, d4, c3, d3]) + #deps = dep rp12, rp21, _ = self._get_or_create_ratio_pro_lp(lp1, lp2) rp34, rp43, _ = self._get_or_create_ratio_pro_lp(lp3, lp4) self.make_equal(rp12, rp34, deps=deps) @@ -2851,7 +2864,7 @@ def check_eqratio30(self, points: list[Point]) -> bool: _mnxy_, _ = self._get_or_create_length_pro(mn, xy, deps=None) for rat1, _, _ in gm.all_ratios(ab._val, cd._val): - for ratp2, _, _ in gm.all_ratios2(_pqzw_._val, _mnxy_._val): + for ratp2, _, _ in gm.all_ratios2(_pqzw_, _mnxy_): if self.is_equal(rat1, ratp2): return True return False diff --git a/kirine.txt b/kirine.txt index 3c5b44a..1c41922 100644 --- a/kirine.txt +++ b/kirine.txt @@ -1,26 +1,65 @@ ========================== * From theorem premises: -A B C D E F G : Points -BC = BA [00] -D,B,C are collinear [01] -DB = DC [02] -D,A,E are collinear [03] -F,C,A are collinear [04] -B,F,E are collinear [05] -FA:CA = FA:CA [06] -GA = GF [07] +A B C D E F G H I : Points +C,B,D are collinear [00] +CA = DC [01] +EC = ED [02] +EA = EC [03] +FB = FC [04] +C,B,F are collinear [05] +FG = FC [06] +EG = EC [07] +B,G,H are collinear [08] +A,C,H are collinear [09] +A,B,I are collinear [10] +C,G,I are collinear [11] * Auxiliary Constructions: -: Points - +J : Points +J,C,H are collinear [12] +JH = JC [13] * Proof steps: -001. F,C,A are collinear [04] & D,B,C are collinear [01] & D,A,E are collinear [03] & B,F,E are collinear [05] ⇒ (AF:FC) * (CB:BD) * (DE:EA) = 1 [08] -002. F,C,A are collinear [04] & D,B,C are collinear [01] & D,A,E are collinear [03] & B,F,E are collinear [05] ⇒ (DC:CB) * (EA:AD) * (BF:FE) = 1 [09] -003. DB = DC [02] (Distance chase)⇒ CD:CB = 1_/2 [10] -004. GA = GF [07] (Distance chase)⇒ FG:FA = 1_/2 [11] -005. (AF:FC) * (CB:BD) * (DE:EA) = 1 [08] & BC = BA [00] & DB = DC [02] & (DC:CB) * (EA:AD) * (BF:FE) = 1 [09] & CD:CB = 1_/2 [10] & FG:FA = 1_/2 [11] ⇒ FG:FA = FC:FA [12] -006. FG:FA = FC:FA [12] & FA:CA = FA:CA [06] ⇒ FG = FC [13] -007. FG = FC [13] & GA = GF [07] ⇒ AG = CF +001. FG = FC [06] & FB = FC [04] ⇒ FB = FG [14] +002. FG = FC [06] & FB = FC [04] ⇒ F is the circumcenter of \Delta BGC [15] +003. FB = FG [14] ⇒ ∠FBG = ∠BGF [16] +004. EG = EC [07] & FG = FC [06] ⇒ GC ⟂ EF [17] +005. EG = EC [07] & FG = FC [06] (SSS)⇒ ∠GEF = ∠FEC [18] +006. F is the circumcenter of \Delta BGC [15] & C,B,F are collinear [05] ⇒ BG ⟂ CG [19] +007. C,B,D are collinear [00] & ∠FBG = ∠BGF [16] & C,B,F are collinear [05] & GC ⟂ EF [17] & BG ⟂ CG [19] ⇒ ∠GBD = ∠GFE [20] +008. EC = ED [02] & EA = EC [03] ⇒ EA = ED [21] +009. CD = CA [01] & EA = ED [21] ⇒ AD ⟂ CE [22] +010. CD = CA [01] & EA = ED [21] (SSS)⇒ ∠ACE = ∠ECD [23] +011. C,B,F are collinear [05] & FB = FC [04] ⇒ F is midpoint of CB [24] +012. J,C,H are collinear [12] & JH = JC [13] ⇒ J is midpoint of CH [25] +013. F is midpoint of CB [24] & J is midpoint of CH [25] ⇒ FJ ∥ BH [26] +014. BG ⟂ CG [19] & AD ⟂ CE [22] & FJ ∥ BH [26] & B,G,H are collinear [08] ⇒ ∠(CE-AD) = ∠(JF-CG) [27] +015. EC = ED [02] & EG = EC [07] & EA = EC [03] ⇒ A,C,G,D are concyclic [28] +016. A,C,G,D are concyclic [28] ⇒ ∠CAD = ∠CGD [29] +017. A,C,G,D are concyclic [28] ⇒ ∠AGC = ∠ADC [30] +018. CD = CA [01] ⇒ ∠CAD = ∠ADC [31] +019. ∠CAD = ∠CGD [29] & ∠CAD = ∠ADC [31] & C,B,D are collinear [00] ⇒ ∠(AD-CB) = ∠CGD [32] +020. ∠(CE-AD) = ∠(JF-CG) [27] & ∠(AD-CB) = ∠CGD [32] ⇒ ∠(CE-FJ) = ∠(BC-DG) [33] +021. C,B,D are collinear [00] & ∠GEF = ∠FEC [18] & GC ⟂ EF [17] & BG ⟂ CG [19] & ∠(CE-FJ) = ∠(BC-DG) [33] & FJ ∥ BH [26] & B,G,H are collinear [08] ⇒ ∠GDB = ∠GEF [34] +022. ∠GBD = ∠GFE [20] & ∠GDB = ∠GEF [34] (Similar Triangles)⇒ BG:FG = BD:FE [35] +023. BG:FG = BD:FE [35] & FG = FC [06] & BF = CF [04] ⇒ EF:BD = BF:BG [36] +024. J,C,H are collinear [12] & A,C,H are collinear [09] & C,B,F are collinear [05] & ∠ACE = ∠ECD [23] & C,B,D are collinear [00] ⇒ ∠JCE = ∠ECF [37] +025. GC ⟂ EF [17] & BG ⟂ CG [19] & FJ ∥ BH [26] & B,G,H are collinear [08] ⇒ FJ ∥ FE [38] +026. FJ ∥ FE [38] ⇒ J,E,F are collinear [39] +027. ∠JCE = ∠ECF [37] & J,E,F are collinear [39] ⇒ JE:EF = JC:CF [40] +028. B,G,H are collinear [08] & CG ⟂ BG [19] ⇒ CG ⟂ GH [41] +029. CG ⟂ GH [41] & J is midpoint of CH [25] ⇒ CJ = GJ [42] +030. JE:EF = JC:CF [40] & JG = JC [42] & BF = CF [04] ⇒ JE:EF = JG:BF [43] +031. J,C,H are collinear [12] & A,C,H are collinear [09] & ∠AGC = ∠ADC [30] & C,B,D are collinear [00] & ∠CAD = ∠ADC [31] ⇒ ∠DAJ = ∠CGA [44] +032. ∠(CE-AD) = ∠(JF-CG) [27] & ∠DAJ = ∠CGA [44] ⇒ ∠(CE-AJ) = ∠(JF-AG) [45] +033. J,E,F are collinear [39] & A,C,H are collinear [09] & ∠(CE-AJ) = ∠(JF-AG) [45] & J,C,H are collinear [12] & FJ ∥ BH [26] & B,G,H are collinear [08] & ∠GEF = ∠FEC [18] & GC ⟂ EF [17] & BG ⟂ CG [19] ⇒ ∠GEJ = ∠GAH [46] +034. C,B,F are collinear [05] & ∠FBG = ∠BGF [16] & FJ ∥ BH [26] & B,G,H are collinear [08] ⇒ ∠GFJ = ∠JFC [47] +035. FG = FC [06] & ∠GFJ = ∠JFC [47] (SAS)⇒ ∠GJF = ∠FJC [48] +036. J,E,F are collinear [39] & B,G,H are collinear [08] & A,C,H are collinear [09] & ∠GJF = ∠FJC [48] & J,C,H are collinear [12] & GC ⟂ EF [17] & BG ⟂ CG [19] ⇒ ∠GJE = ∠GHA [49] +037. ∠GEJ = ∠GAH [46] & ∠GJE = ∠GHA [49] (Similar Triangles)⇒ JG:HG = JE:HA [50] +038. JE:EF = JG:BF [43] & JG:GH = JE:AH [50] ⇒ BF:GH = EF:AH [51] +039. EF:BD = BF:BG [36] & EF:AH = BF:GH [51] ⇒ HG:GB = AH:BD [52] +040. CA = DC [01] & HG:GB = AH:BD [52] ⇒ (HG:GB) * (BD:DC) * (CA:AH) = 1 [53] +041. B,G,H are collinear [08] & C,B,D are collinear [00] & A,C,H are collinear [09] & A,B,I are collinear [10] & C,G,I are collinear [11] & (HG:GB) * (BD:DC) * (CA:AH) = 1 [53] ⇒ I,H,D are collinear ========================== diff --git a/nothing.txt b/nothing.txt index e930451..b06e630 100644 --- a/nothing.txt +++ b/nothing.txt @@ -43,4 +43,204 @@ cyclic A B C D, cyclic A B C E => cong A D A E 004. GA = GF [07] (Distance chase)⇒ FG:FA = 1_/2 [11] 005. (AF:FC) * (CB:BD) * (DE:EA) = 1 [08] & BC = BA [00] & DB = DC [02] & (DC:CB) * (EA:AD) * (BF:FE) = 1 [09] & CD:CB = 1_/2 [10] & FG:FA = 1_/2 [11] ⇒ FG:FA = FC:FA [12] 006. FG:FA = FC:FA [12] & FA:CA = FA:CA [06] ⇒ FG = FC [13] -007. FG = FC [13] & GA = GF [07] ⇒ AG = CF \ No newline at end of file +007. FG = FC [13] & GA = GF [07] ⇒ AG = CF + +001. C,D,B are collinear [02] & DB = DC [03] ⇒ D is midpoint of CB [10] +002. G,F,A are collinear [08] & GA = GF [09] ⇒ G is midpoint of FA [11] +003. D is midpoint of CB [10] & G is midpoint of FA [11] ⇒ DC:CB = GA:AF [12] +004. D,A,E are collinear [04] & BE ⟂ AD [05] ⇒ ∠DEB = ∠BEA [13] +005. C,D,B are collinear [02] & BC ⟂ AB [01] ⇒ CD ⟂ AB [14] +006. F,B,E are collinear [06] & BE ⟂ AD [05] ⇒ EF ⟂ DA [15] +007. CD ⟂ AB [14] & EF ⟂ DA [15] ⇒ ∠(CD-EF) = ∠BAD [16] +008. D,C,B are collinear [02] & D,A,E are collinear [04] & ∠(CD-EF) = ∠BAD [16] & E,F,B are collinear [06] ⇒ ∠DBE = ∠BAE [17] +009. ∠DEB = ∠BEA [13] & ∠DBE = ∠BAE [17] (Similar Triangles)⇒ DE:BE = DB:BA [18] +010. C,A,F are collinear [07] & E,F,B are collinear [06] & D,A,E are collinear [04] & C,D,B are collinear [02] ⇒ (DE:EB) * (CA:DA) * (FB:CF) = 1 [19] +011. C,A,F are collinear [07] & E,F,B are collinear [06] & D,A,E are collinear [04] & C,D,B are collinear [02] ⇒ (AF:FC) * (CB:BD) * (DE:EA) = 1 [20] +012. F,B,E are collinear [06] & D,A,E are collinear [04] & BE ⟂ AD [05] ⇒ FE ⟂ EA [21] +013. FE ⟂ EA [21] & G is midpoint of FA [11] ⇒ FG = EG [22] +014. FE ⟂ EA [21] & G is midpoint of FA [11] ⇒ AG = EG [23] +015. DC:CB = GA:AF [12] & BC = BA [00] & GA = GF [09] & DE:BE = DB:BA [18] & DB = DC [03] & (DE:EB) * (CA:DA) * (FB:CF) = 1 [19] & (AF:FC) * (CB:BD) * (DE:EA) = 1 [20] & GE = GF [22] ⇒ CF:AF = GE:AF [24] +016. CB = AB [00] ⇒ AF:CB = AF:CB [25] +017. CF:AF = GE:AF [24] & AF:CB = AF:CB [25] ⇒ CF = GE [26] +018. CF = GE [26] & AG = EG [23] ⇒ AG = CF + + +cmo23_5 +a b c = triangle a b c; d = on_line d b c; e = on_pline e d a b, on_circle e b d; f = on_pline f d a c, on_circle f c d; g = circle g d e f; h = on_circle h o d, on_line h a d ? eqratio30 a e a f b g b e c f c g +Traceback (most recent call last): + File "/environment/miniconda3/lib/python3.10/runpy.py", line 196, in _run_module_as_main + return _run_code(code, main_globals, None, + File "/environment/miniconda3/lib/python3.10/runpy.py", line 86, in _run_code + exec(code, run_globals) + File "/home/featurize/work/alphageometry/alphageometry.py", line 650, in + app.run(main) + File "/home/featurize/work/alphageometry/lib/python3.10/site-packages/absl/app.py", line 308, in run + _run_main(main, args) + File "/home/featurize/work/alphageometry/lib/python3.10/site-packages/absl/app.py", line 254, in _run_main + sys.exit(main(argv)) + File "/home/featurize/work/alphageometry/alphageometry.py", line 637, in main + run_alphageometry( + File "/home/featurize/work/alphageometry/alphageometry.py", line 553, in run_alphageometry + translations = [ + File "/home/featurize/work/alphageometry/alphageometry.py", line 554, in + try_translate_constrained_to_construct(o, g) + File "/home/featurize/work/alphageometry/alphageometry.py", line 384, in try_translate_constrained_to_construct + head, prem_str = string.split(' : ') +ValueError: not enough values to unpack (expected 2, got 1) + +001. C,F,A are collinear [06] & C,D,B are collinear [02] & E,A,D are collinear [04] & E,F,B are collinear [07] ⇒ (AF:FC) * (CB:BD) * (DE:EA) = 1 [10] +002. C,F,A are collinear [06] & C,D,B are collinear [02] & E,A,D are collinear [04] & E,F,B are collinear [07] ⇒ (ED:EB) * (CA:AD) * (FB:CF) = 1 [11] +003. E,A,D are collinear [04] & BE ⟂ AD [05] ⇒ ∠AEB = ∠BED [12] +004. C,D,B are collinear [02] & E,A,D are collinear [04] & BE ⟂ AD [05] & BC ⟂ AB [01] ⇒ ∠DBA = ∠AEB [13] +005. E,A,D are collinear [04] ⇒ ∠DAB = ∠EAB [14] +006. ∠DBA = ∠AEB [13] & ∠DAB = ∠EAB [14] ⇒ ∠BDA = ∠ABE [15] +007. C,D,B are collinear [02] & E,A,D are collinear [04] & ∠BDA = ∠ABE [15] ⇒ ∠ABE = ∠BDE [16] +008. ∠AEB = ∠BED [12] & ∠ABE = ∠BDE [16] ⇒ BA:DB = BE:DE [17] +009. DB = DC [03] (Distance chase)⇒ CD:CB = 1_/2 [18] +010. GA = GF [09] (Distance chase)⇒ AG:AF = 1_/2 [19] +011. (AF:FC) * (CB:BD) * (DE:EA) = 1 [10] & BC = BA [00] & DB = DC [03] & (ED:EB) * (CA:AD) * (FB:CF) = 1 [11] & BA:DB = BE:DE [17] & CD:CB = 1_/2 [18] & AG:AF = 1_/2 [19] & GA = GF [09] ⇒ AG:FA = CF:FA [20] +012. AG:FA = CF:FA [20] & FA:CA = FA:CA [08] ⇒ AG = CF + +example2_8_1 +a b c = triangle a b c; d = midpoint d a c; e = on_line e b d; f = on_line f a e, on_line f b c; g = on_line g c e, on_line g a b; h = on_pline h f c g, on_line h b d; i = on_circle i e f, on_circle i f e; j = on_circle j e g, on_circle j g e ? cong h i h j +example2_8_2 +a b c = triangle a b c; d = midpoint d a c; e = on_line e b d; f = on_line f a e, on_line f b c; g = on_line g c e, on_line g a b; h = on_pline h f c g, on_line h b d; i = on_circle i e f, on_circle i f e; j = on_circle j e g, on_circle j g e ? cong h i i j +example2_7 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_line e a b, on_line e d c; f = on_line f a d, on_line f b c; p = on_circle p o a; r = on_line r p f, on_circle r o a; s = on_line s p e, on_circle s o a; t = on_line t a c, on_line t b d ? eqratio30 a s s d d c r c b r b a + + +========================== + * From theorem premises: +A B C D E F G H J K L M N O : Points +C,D,B are collinear [00] +BE = BD [01] +ED ∥ AB [02] +CF = CD [03] +FD ∥ AC [04] +GE = GD [05] +GD = GF [06] +D,H,A are collinear [07] +GH = GD [08] +JA = FC [09] +J,E,A are collinear [10] +KB = CH [11] +K,E,B are collinear [12] +LE = LJ [13] +LJ = LF [14] +ME = MK [15] +MK = MH [16] +LN = LF [17] +F,N,A are collinear [18] +MO = MH [19] +H,O,B are collinear [20] + + * Auxiliary Constructions: +Q : Points +D,Q,H are collinear [21] +QH = QD [22] + + * Proof steps: +001. LE = LJ [13] & LJ = LF [14] & LN = LF [17] ⇒ F,J,E,N are concyclic [23] +002. F,J,E,N are concyclic [23] & F,N,A are collinear [18] & J,E,A are collinear [10] ⇒ FA:JA = EA:NA [24] +003. ME = MK [15] & MK = MH [16] & MO = MH [19] ⇒ H,E,O,K are concyclic [25] +004. H,E,O,K are concyclic [25] & H,O,B are collinear [20] & K,E,B are collinear [12] ⇒ BH:BE = BK:BO [26] +005. BH:BE = BK:BO [26] & BE = BD [01] & KB = CH [11] ⇒ HB:DB = CH:OB [27] +006. GH = GD [08] & QH = QD [22] ⇒ HD ⟂ GQ [28] +007. BE = BD [01] & GE = GD [05] ⇒ DE ⟂ BG [29] +008. D,Q,H are collinear [21] & D,H,A are collinear [07] & HD ⟂ GQ [28] & DE ⟂ BG [29] & DE ∥ AB [02] ⇒ ∠GBA = ∠GQA [30] +009. ∠GBA = ∠GQA [30] ⇒ A,Q,G,B are concyclic [31] +010. CF = CD [03] & GD = GF [06] ⇒ DF ⟂ CG [32] +011. DF ⟂ CG [32] & DF ∥ AC [04] & DE ⟂ BG [29] & DE ∥ AB [02] ⇒ ∠GBA = ∠GCA [33] +012. ∠GBA = ∠GCA [33] ⇒ C,G,A,B are concyclic [34] +013. A,Q,G,B are concyclic [31] & C,G,A,B are concyclic [34] ⇒ C,Q,A,B are concyclic [35] +014. C,Q,A,B are concyclic [35] ⇒ ∠CBA = ∠CQA [36] +015. C,Q,A,B are concyclic [35] ⇒ ∠CAQ = ∠CBQ [37] +016. D,C,B are collinear [00] & D,Q,H are collinear [21] & D,H,A are collinear [07] & ∠CBA = ∠CQA [36] ⇒ ∠DBA = ∠CQD [38] +017. C,D,B are collinear [00] & ∠CBA = ∠CQA [36] & D,Q,H are collinear [21] & D,H,A are collinear [07] ⇒ ∠DAB = ∠QCD [39] +018. ∠DBA = ∠CQD [38] & ∠DAB = ∠QCD [39] (Similar Triangles)⇒ DB:AB = DQ:CQ [40] +019. DQ:CQ = DB:AB [40] & HQ = DQ [22] & EB = DB [01] ⇒ QH:QC = BE:BA [41] +020. BE = BD [01] ⇒ ∠BDE = ∠DEB [42] +021. C,D,B are collinear [00] & K,E,B are collinear [12] & ∠BDE = ∠DEB [42] ⇒ ∠EDC = ∠KED [43] +022. C,D,B are collinear [00] & D,A,H are collinear [07] & ∠CBA = ∠CQA [36] & D,Q,H are collinear [21] & AB ∥ DE [02] ⇒ ∠DCQ = ∠EDH [44] +023. ∠EDC = ∠KED [43] & ∠DCQ = ∠EDH [44] ⇒ ∠(DE-CQ) = ∠(KE-DH) [45] +024. D,Q,H are collinear [21] & D,H,A are collinear [07] & ∠(DE-CQ) = ∠(KE-DH) [45] & K,E,B are collinear [12] & DE ∥ AB [02] ⇒ ∠HQC = ∠EBA [46] +025. QH:QC = BE:BA [41] & ∠HQC = ∠EBA [46] (Similar Triangles)⇒ HQ:HC = EB:EA [47] +026. HQ:HC = EB:EA [47] & QH = QD [22] & BE = BD [01] ⇒ DQ:CH = DB:EA [48] +027. D,Q,H are collinear [21] & D,H,A are collinear [07] & C,D,B are collinear [00] & ∠CAQ = ∠CBQ [37] ⇒ ∠DQB = ∠ACD [49] +028. D,C,B are collinear [00] & ∠CAQ = ∠CBQ [37] & D,Q,H are collinear [21] & D,H,A are collinear [07] ⇒ ∠DBQ = ∠CAD [50] +029. ∠DQB = ∠ACD [49] & ∠DBQ = ∠CAD [50] (Similar Triangles)⇒ QD:QB = CD:CA [51] +030. QD:QB = CD:CA [51] & JA = FC [09] & CF = CD [03] & HQ = DQ [22] ⇒ QH:QB = CF:CA [52] +031. CF = CD [03] ⇒ ∠CFD = ∠FDC [53] +032. C,D,B are collinear [00] & D,A,H are collinear [07] & ∠CAQ = ∠CBQ [37] & D,Q,H are collinear [21] & AC ∥ DF [04] ⇒ ∠(CD-QB) = ∠FDH [54] +033. ∠CDF = ∠DFC [53] & ∠(CD-QB) = ∠FDH [54] ⇒ ∠(CF-DH) = ∠(DF-QB) [55] +034. D,Q,H are collinear [21] & D,H,A are collinear [07] & ∠(CF-DH) = ∠(DF-QB) [55] & DF ∥ AC [04] ⇒ ∠HQB = ∠FCA [56] +035. QH:QB = CF:CA [52] & ∠HQB = ∠FCA [56] (Similar Triangles)⇒ HQ:HB = FC:FA [57] +036. HQ:HB = FC:FA [57] & QH = QD [22] & JA = FC [09] ⇒ DQ:HB = JA:FA [58] +037. JA = FC [09] & KB = CH [11] & FA:JA = EA:NA [24] & HB:DB = CH:OB [27] & DQ:CH = DB:EA [48] & DQ:HB = JA:FA [58] (Ratio chase)⇒ NA = OB +========================== + +2_4 + + + * From theorem premises: +A B C D E F G H I : Points +C,B,D are collinear [00] +CA = DC [01] +EC = ED [02] +EA = EC [03] +FB = FC [04] +C,B,F are collinear [05] +FG = FC [06] +EG = EC [07] +B,G,H are collinear [08] +A,C,H are collinear [09] +A,B,I are collinear [10] +C,G,I are collinear [11] + + * Auxiliary Constructions: +J : Points +J,C,H are collinear [12] +JH = JC [13] + + * Proof steps: +001. FG = FC [06] & FB = FC [04] ⇒ FB = FG [14] +002. FG = FC [06] & FB = FC [04] ⇒ F is the circumcenter of \Delta BGC [15] +003. FB = FG [14] ⇒ ∠FBG = ∠BGF [16] +004. EG = EC [07] & FG = FC [06] ⇒ GC ⟂ EF [17] +005. EG = EC [07] & FG = FC [06] (SSS)⇒ ∠GEF = ∠FEC [18] +006. F is the circumcenter of \Delta BGC [15] & C,B,F are collinear [05] ⇒ BG ⟂ CG [19] +007. C,B,D are collinear [00] & ∠FBG = ∠BGF [16] & C,B,F are collinear [05] & GC ⟂ EF [17] & BG ⟂ CG [19] ⇒ ∠GBD = ∠GFE [20] +008. EC = ED [02] & EA = EC [03] ⇒ EA = ED [21] +009. CD = CA [01] & EA = ED [21] ⇒ AD ⟂ CE [22] +010. CD = CA [01] & EA = ED [21] (SSS)⇒ ∠ACE = ∠ECD [23] +011. C,B,F are collinear [05] & FB = FC [04] ⇒ F is midpoint of CB [24] +012. J,C,H are collinear [12] & JH = JC [13] ⇒ J is midpoint of CH [25] +013. F is midpoint of CB [24] & J is midpoint of CH [25] ⇒ FJ ∥ BH [26] +014. BG ⟂ CG [19] & AD ⟂ CE [22] & FJ ∥ BH [26] & B,G,H are collinear [08] ⇒ ∠(CE-AD) = ∠(JF-CG) [27] +015. EC = ED [02] & EG = EC [07] & EA = EC [03] ⇒ A,C,G,D are concyclic [28] +016. A,C,G,D are concyclic [28] ⇒ ∠CAD = ∠CGD [29] +017. A,C,G,D are concyclic [28] ⇒ ∠AGC = ∠ADC [30] +018. CD = CA [01] ⇒ ∠CAD = ∠ADC [31] +019. ∠CAD = ∠CGD [29] & ∠CAD = ∠ADC [31] & C,B,D are collinear [00] ⇒ ∠(AD-CB) = ∠CGD [32] +020. ∠(CE-AD) = ∠(JF-CG) [27] & ∠(AD-CB) = ∠CGD [32] ⇒ ∠(CE-FJ) = ∠(BC-DG) [33] +021. C,B,D are collinear [00] & ∠GEF = ∠FEC [18] & GC ⟂ EF [17] & BG ⟂ CG [19] & ∠(CE-FJ) = ∠(BC-DG) [33] & FJ ∥ BH [26] & B,G,H are collinear [08] ⇒ ∠GDB = ∠GEF [34] +022. ∠GBD = ∠GFE [20] & ∠GDB = ∠GEF [34] (Similar Triangles)⇒ BG:FG = BD:FE [35] +023. BG:FG = BD:FE [35] & FG = FC [06] & BF = CF [04] ⇒ EF:BD = BF:BG [36] +024. J,C,H are collinear [12] & A,C,H are collinear [09] & C,B,F are collinear [05] & ∠ACE = ∠ECD [23] & C,B,D are collinear [00] ⇒ ∠JCE = ∠ECF [37] +025. GC ⟂ EF [17] & BG ⟂ CG [19] & FJ ∥ BH [26] & B,G,H are collinear [08] ⇒ FJ ∥ FE [38] +026. FJ ∥ FE [38] ⇒ J,E,F are collinear [39] +027. ∠JCE = ∠ECF [37] & J,E,F are collinear [39] ⇒ JE:EF = JC:CF [40] +028. B,G,H are collinear [08] & CG ⟂ BG [19] ⇒ CG ⟂ GH [41] +029. CG ⟂ GH [41] & J is midpoint of CH [25] ⇒ CJ = GJ [42] +030. JE:EF = JC:CF [40] & JG = JC [42] & BF = CF [04] ⇒ JE:EF = JG:BF [43] +031. J,C,H are collinear [12] & A,C,H are collinear [09] & ∠AGC = ∠ADC [30] & C,B,D are collinear [00] & ∠CAD = ∠ADC [31] ⇒ ∠DAJ = ∠CGA [44] +032. ∠(CE-AD) = ∠(JF-CG) [27] & ∠DAJ = ∠CGA [44] ⇒ ∠(CE-AJ) = ∠(JF-AG) [45] +033. J,E,F are collinear [39] & A,C,H are collinear [09] & ∠(CE-AJ) = ∠(JF-AG) [45] & J,C,H are collinear [12] & FJ ∥ BH [26] & B,G,H are collinear [08] & ∠GEF = ∠FEC [18] & GC ⟂ EF [17] & BG ⟂ CG [19] ⇒ ∠GEJ = ∠GAH [46] +034. C,B,F are collinear [05] & ∠FBG = ∠BGF [16] & FJ ∥ BH [26] & B,G,H are collinear [08] ⇒ ∠GFJ = ∠JFC [47] +035. FG = FC [06] & ∠GFJ = ∠JFC [47] (SAS)⇒ ∠GJF = ∠FJC [48] +036. J,E,F are collinear [39] & B,G,H are collinear [08] & A,C,H are collinear [09] & ∠GJF = ∠FJC [48] & J,C,H are collinear [12] & GC ⟂ EF [17] & BG ⟂ CG [19] ⇒ ∠GJE = ∠GHA [49] +037. ∠GEJ = ∠GAH [46] & ∠GJE = ∠GHA [49] (Similar Triangles)⇒ JG:HG = JE:HA [50] +038. JE:EF = JG:BF [43] & JG:GH = JE:AH [50] ⇒ BF:GH = EF:AH [51] +039. EF:BD = BF:BG [36] & EF:AH = BF:GH [51] ⇒ HG:GB = AH:BD [52] +040. CA = DC [01] & HG:GB = AH:BD [52] ⇒ (HG:GB) * (BD:DC) * (CA:AH) = 1 [53] +041. B,G,H are collinear [08] & C,B,D are collinear [00] & A,C,H are collinear [09] & A,B,I are collinear [10] & C,G,I are collinear [11] & (HG:GB) * (BD:DC) * (CA:AH) = 1 [53] ⇒ I,H,D are collinear \ No newline at end of file diff --git a/numericals.py b/numericals.py index 4adf096..63ac926 100644 --- a/numericals.py +++ b/numericals.py @@ -808,6 +808,16 @@ def check_eqratio(points: list[Point]) -> bool: gh = g.distance(h) return close_enough(ab * gh, cd * ef) +def check_eqratio30(points: list[Point]) -> bool: + a, b, c, d, e, f, g, h, x, y, z, w = points + ab = a.distance(b) + cd = c.distance(d) + ef = e.distance(f) + gh = g.distance(h) + xy = x.distance(y) + zw = z.distance(w) + return close_enough(ab * ef * xy, cd * gh * zw) + def check_cong(points: list[Point]) -> bool: a, b, c, d = points diff --git a/pretty.py b/pretty.py index e1b947b..8d598a0 100644 --- a/pretty.py +++ b/pretty.py @@ -117,6 +117,8 @@ def pretty_nl(name: str, args: list[str]) -> str: return '{}{}:{}{} = {}{}:{}{}'.format(*args) if name == 'eqratio30': return '({}{}:{}{}) * ({}{}:{}{}) * ({}{}:{}{}) = 1'.format(*args) + if name == 'eqratio40': + return '({}{}:{}{}) * ({}{}:{}{}) * ({}{}:{}{}) * ({}{}:{}{}) = 1'.format(*args) if name == 'eqratio3': a, b, c, d, o, o = args # pylint: disable=redeclared-assigned-name return f'S {o} {a} {b} {o} {c} {d}' diff --git a/problem.py b/problem.py index 523bad7..0023660 100644 --- a/problem.py +++ b/problem.py @@ -762,7 +762,7 @@ def __init__( self.trace = None def _find(self, dep_hashed: tuple[str, ...]) -> Dependency: - self.why = [w for w in self.why if type(w) is not EmptyDependency] + #self.why = [w for w in self.why if type(w) is not EmptyDependency] for w in self.why: f = w._find(dep_hashed) if f: @@ -1337,5 +1337,32 @@ def hashed_txt(name: str, args: list[str]) -> tuple[str, ...]: k, l = ratios2[2] return (name, a, b, c, d, e, f, g, h, i, j, k, l) + + if name in ['eqratio40']: + a, b, c, d, e, f, g, h, i, j, k, l, x, y, z, w = args + a, b = sorted([a, b]) + c, d = sorted([c, d]) + e, f = sorted([e, f]) + g, h = sorted([g, h]) + i, j = sorted([i, j]) + k, l = sorted([k, l]) + x, y = sorted([x, y]) + z, w = sorted([z, w]) + ratios1 = [(a, b),(e, f),(i, j),(x, y)] + ratios1.sort() + ratios2 = [(c, d),(g, h),(k, l),(z, w)] + ratios2.sort() + if ratios1 > ratios2: + ratios1, ratios2 = ratios2, ratios1 + a, b = ratios1[0] + e, f = ratios1[1] + i, j = ratios1[2] + x, y = ratios1[3] + c, d = ratios2[0] + g, h = ratios2[1] + k, l = ratios2[2] + z, w = ratios2[3] + + return (name, a, b, c, d, e, f, g, h, i, j, k, l, x, y, z, w) raise ValueError(f'Not recognize {name} to hash.') diff --git a/pros2.txt b/pros2.txt index dc401c2..3569dde 100644 --- a/pros2.txt +++ b/pros2.txt @@ -47,4 +47,16 @@ a b c = triangle a b c; d = midpoint d b c; e = on_line e c a; f = on_line f a b exercise20_2 a b = segment a b; c = on_tline c b a b, on_circle c b a; d = midpoint d b c; e = foot e b a d; f = on_line f b e, on_line f a c; g = midpoint g a f ? cong a g c f example1_11 -a b c = triangle a b c; d = on_line d a b; e = on_line e a c; f = midpoint f d e; g = on_line g d e; h = mirror h f g; i = on_line i a b; j = on_line j g i, on_line j a c; k = on_line k a b; l = on_line l k h, on_line l a c; m = on_line m j k, on_line m d e; n = on_line n i l, on_line n d e ? cong f m f n \ No newline at end of file +a b c = triangle a b c; d = on_line d a b; e = on_line e a c; f = midpoint f d e; g = on_line g d e; h = mirror h g f; i = on_line i a b; j = on_line j g i, on_line j a c; k = on_line k a b; l = on_line l k h, on_line l a c; m = on_line m j k, on_line m d e; n = on_line n i l, on_line n d e ? cong f m f n +cmo23_5 +a b c = triangle a b c; d = on_line d b c; e = on_pline e d a b, on_circle e b d; f = on_pline f d a c, on_circle f c d; g = circle g d e f; h = on_circle h g d, on_line h a d ? eqratio30 a e a f b h b e c f c h +reduced_cmo_2023_p5_b +a b c = triangle a b c; k = on_line k b c; p = on_pline p k a b, on_circle p b k; q = on_pline q k a c, on_circle q c k; y = circle p k q; t = on_circle t y k, on_line t a k; z1 = on_line z1 p q; d = on_line d a p, eqdistance d a q c; f = on_line f p b, eqdistance f b c t; y1 = circle p d q; y2 = circle p f t; e = on_circle e y1 q, on_line q a; g = on_circle g y2 t, on_line g t b ? cong a e b g +example2_8_1 +a b c = triangle a b c; d = midpoint d a c; e = on_line e b d; f = on_line f a e, on_line f b c; g = on_line g c e, on_line g a b; h = on_pline h f c e, on_line h b d; i = on_circle i e f, on_circle i f e; j = on_circle j e g, on_circle j g e ? cong h i h j +example2_8_2 +a b c = triangle a b c; d = midpoint d a c; e = on_line e b d; f = on_line f a e, on_line f b c; g = on_line g c e, on_line g a b; h = on_pline h f c e, on_line h b d; i = on_circle i e f, on_circle i f e; j = on_circle j e g, on_circle j g e ? cong h i i j +example2_7 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_line e a b, on_line e d c; f = on_line f a d, on_line f b c; p = on_circle p o a; r = on_line r p f, on_circle r o a; s = on_line s p e, on_circle s o a; t = on_line t a c, on_line t b d ? eqratio30 a s s d d c r c b r b a +example2_4 +a b c = triangle a b c; d = on_circle d c a, on_line d b c; o = circle o a c d; m = midpoint m b c; p = on_circle p o c, on_circle p m c; e = on_line e a c, on_line e b p; f = on_line f a b, on_line f c p ? coll d e f \ No newline at end of file diff --git a/rules1.txt b/rules1.txt index 12e5b12..ce7d3c3 100644 --- a/rules1.txt +++ b/rules1.txt @@ -1,4 +1,2 @@ coll A F B, coll B D C, coll C E A, coll D E F => eqratio30 A F F B B D D C C E E A -eqangle6 B A B C Q P Q R, eqangle6 C A C B R P R Q, ncoll A B C => simtri A B C P Q R -eqangle6 B A B C Q R Q P, eqangle6 C A C B R Q R P, ncoll A B C => simtri2 A B C P Q R eqratio a b c d m n p q, eqratio c d e f p q r u => eqratio a b e f m n r u \ No newline at end of file diff --git a/test.py b/test.py index 7655524..c0aa9e8 100644 --- a/test.py +++ b/test.py @@ -1,6 +1,3 @@ -from multiset import Multiset +a = "hello world!" -A = Multiset([1,2,2,3]) -B = Multiset([2,3,4,5]) - -print(A,B) \ No newline at end of file +print('!' in a) \ No newline at end of file From 700b274a6a06074885881c1eff4760021190e116 Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.com> Date: Thu, 20 Mar 2025 13:07:56 +0800 Subject: [PATCH 16/27] 320tmp --- graph.py | 4 ++-- test.py | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/graph.py b/graph.py index 469eff4..11f99f4 100644 --- a/graph.py +++ b/graph.py @@ -433,7 +433,7 @@ def derive_ratio_algebra( ) -> dict[str, list[tuple[Point, ...]]]: """Derive new eqratio predicates.""" added = {'cong2': [], 'eqratio': [], 'eqratio30': []} - new_products = [] + new_products = set() for x in self.rtable.get_all_eqs_and_why(): x, why = x[:-1], x[-1] dep = EmptyDependency(level=level, rule_name='a01') @@ -510,7 +510,7 @@ def derive_ratio_algebra( _b1c2_, _ = self._get_or_create_length_pro_l(b1, c2) _b2c1_, _ = self._get_or_create_length_pro_l(b2, c1) _b2c2_, _ = self._get_or_create_length_pro_l(b2, c2) - new_products.extend([_a1d1_,_a1d2_,_a2d1_,_a2d2_,_b1c1_,_b1c2_,_b2c1_,_b2c2_]) + new_products.update([_a1d1_,_a1d2_,_a2d1_,_a2d2_,_b1c1_,_b1c2_,_b2c1_,_b2c2_]) self._set_ratio_pro_equal(a, b, c, d) self._set_ratio_pro_equal(a, _b1c1_,_b2c2_, d) self._set_ratio_pro_equal(a, _b1c2_,_b2c1_, d) diff --git a/test.py b/test.py index 63fde3a..7ceffb1 100644 --- a/test.py +++ b/test.py @@ -1,6 +1,7 @@ -for why, (u, v), (u_, v_) in zip( - ['why1', 'why2', 'why3', 'why4'], - [('a', 'b'), ('c', 'd'), ('e', 'f'), ('g', 'h')], - [('a_', 'b_'), ('c_', 'd_'), ('e_', 'f_'), ('g_', 'h_')], - ): - print(why, u, v, u_, v_) \ No newline at end of file +from multiset import Multiset + +A = Multiset([1,2,2,3]) +B = Multiset([2,3,4,5]) + +print(A-B) +print(B-A) \ No newline at end of file From ba46be9bd526dc6e2c1cd16258ebd73678f5b56d Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.cn> Date: Wed, 26 Mar 2025 09:37:00 +0800 Subject: [PATCH 17/27] 1stver --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index cd8f7fb..b57c62c 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,5 @@ share/python-wheels/ .installed.cfg *.egg MANIFEST -ag_ckpt_vocab/ \ No newline at end of file +ag_ckpt_vocab/ +meliad_lib/ \ No newline at end of file From 6e62554a57734be6fc14b371e020c672a2680d09 Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.cn> Date: Wed, 26 Mar 2025 17:22:27 +0800 Subject: [PATCH 18/27] 1_11 --- ar.py | 42 ++++- chiaya.sh | 6 +- kirine.txt | 94 +++++------ nothing.txt | 461 +++++++++++++++++++++++++++++++++++++++++++++++++++- test.py | 6 +- 5 files changed, 542 insertions(+), 67 deletions(-) diff --git a/ar.py b/ar.py index 934dcad..8620bbd 100644 --- a/ar.py +++ b/ar.py @@ -221,9 +221,14 @@ def update_groups( """ print("len1",len(groups1)) print("len2",len(groups2)) + cnt = 0 + lenall = len(groups2) history = [] links = [] for g2 in groups2: + cnt += 1 + if cnt % 1000 == 0: + print(f'{cnt}/{lenall}') joins = [None] * len(groups1) # mark which one in groups1 is merged merged_g1 = set() # merge them into this. old = None # any elem in g2 that belong to any set in groups1 (old) @@ -267,8 +272,7 @@ def update_groups( new_groups1 += [set(new)] groups1 = new_groups1 - history.append(groups1) - + #history.append(groups1) return groups1, links, history @@ -479,6 +483,15 @@ def pairs(self) -> Generator[list[tuple[str, str]], None, None]: for v1, v2 in perm2(list(self.v2e.keys())): # pylint: disable=g-builtin-op if v1 == self.const or v2 == self.const: continue + v1s = [v1] + v2s = [v2] + if '*' in v1: + v1s = v1.split('*') + if '*' in v2: + v2s = v2.split('*') + vs = [v for v in v1s if v in v2s] + if vs != []: + continue yield v1, v2 def modulo(self, e: dict[str, float]) -> dict[str, float]: @@ -523,16 +536,36 @@ def get_all_eqs_and_why( value = simplify(frac.numerator, frac.denominator) yield v1, v2, value, self.why(why_dict) continue - + groups.append(vv) if not return_quads: return self.groups, links, _ = update_groups(self.groups, groups) + lenall = len(links) + cnt = 0 for (v1, v2), (v3, v4) in links: + cnt += 1 + if cnt % 1000 == 0: + print(f'{cnt}/{lenall}') if self.check_record_eq(v1, v2, v3, v4): continue + v1s = [v1] + v2s = [v2] + v3s = [v3] + v4s = [v4] + if '*' in v1: + v1s = v1.split('*') + if '*' in v2: + v2s = v2.split('*') + if '*' in v3: + v3s = v3.split('*') + if '*' in v3: + v4s = v4.split('*') + v14 = v1s + v4s + v23 = v2s + v3s + vs = [v for v in v14 if v in v23] e12 = minus(self.v2e[v1], self.v2e[v2]) e34 = minus(self.v2e[v3], self.v2e[v4]) @@ -540,7 +573,8 @@ def get_all_eqs_and_why( minus({v1: 1, v2: -1}, {v3: 1, v4: -1}), minus(e12, e34) ) self.record_eq(v1, v2, v3, v4) - yield v1, v2, v3, v4, self.why(why_dict) + if vs == []: + yield v1, v2, v3, v4, self.why(why_dict) class GeometricTable(Table): diff --git a/chiaya.sh b/chiaya.sh index 1e3905f..6766014 100644 --- a/chiaya.sh +++ b/chiaya.sh @@ -11,8 +11,8 @@ DDAR_ARGS=( SIZE=4 -BATCH_SIZE=16 -BEAM_SIZE=32 +BATCH_SIZE=8 +BEAM_SIZE=16 DEPTH=2 SEARCH_ARGS=( @@ -41,7 +41,7 @@ INPUT_FILE=pros2.txt python -m alphageometry \ --alsologtostderr \ --problems_file=$(pwd)/$INPUT_FILE \ ---problem_name=cmo23_5 \ +--problem_name=example1_11 \ --mode=alphageometry \ "${DDAR_ARGS[@]}" \ "${SEARCH_ARGS[@]}" \ diff --git a/kirine.txt b/kirine.txt index 1c41922..560cb56 100644 --- a/kirine.txt +++ b/kirine.txt @@ -1,65 +1,45 @@ ========================== * From theorem premises: -A B C D E F G H I : Points -C,B,D are collinear [00] -CA = DC [01] -EC = ED [02] -EA = EC [03] -FB = FC [04] -C,B,F are collinear [05] -FG = FC [06] -EG = EC [07] -B,G,H are collinear [08] -A,C,H are collinear [09] -A,B,I are collinear [10] -C,G,I are collinear [11] +A B C D E F G H I J K L M N : Points +D,A,B are collinear [00] +C,E,A are collinear [01] +E,D,F are collinear [02] +FD = FE [03] +E,D,G are collinear [04] +H,F,G are collinear [05] +FG = FH [06] +I,A,B are collinear [07] +C,J,A are collinear [08] +J,I,G are collinear [09] +K,A,B are collinear [10] +H,K,L are collinear [11] +C,L,A are collinear [12] +E,D,M are collinear [13] +K,J,M are collinear [14] +N,E,D are collinear [15] +L,N,I are collinear [16] * Auxiliary Constructions: -J : Points -J,C,H are collinear [12] -JH = JC [13] +: Points + * Proof steps: -001. FG = FC [06] & FB = FC [04] ⇒ FB = FG [14] -002. FG = FC [06] & FB = FC [04] ⇒ F is the circumcenter of \Delta BGC [15] -003. FB = FG [14] ⇒ ∠FBG = ∠BGF [16] -004. EG = EC [07] & FG = FC [06] ⇒ GC ⟂ EF [17] -005. EG = EC [07] & FG = FC [06] (SSS)⇒ ∠GEF = ∠FEC [18] -006. F is the circumcenter of \Delta BGC [15] & C,B,F are collinear [05] ⇒ BG ⟂ CG [19] -007. C,B,D are collinear [00] & ∠FBG = ∠BGF [16] & C,B,F are collinear [05] & GC ⟂ EF [17] & BG ⟂ CG [19] ⇒ ∠GBD = ∠GFE [20] -008. EC = ED [02] & EA = EC [03] ⇒ EA = ED [21] -009. CD = CA [01] & EA = ED [21] ⇒ AD ⟂ CE [22] -010. CD = CA [01] & EA = ED [21] (SSS)⇒ ∠ACE = ∠ECD [23] -011. C,B,F are collinear [05] & FB = FC [04] ⇒ F is midpoint of CB [24] -012. J,C,H are collinear [12] & JH = JC [13] ⇒ J is midpoint of CH [25] -013. F is midpoint of CB [24] & J is midpoint of CH [25] ⇒ FJ ∥ BH [26] -014. BG ⟂ CG [19] & AD ⟂ CE [22] & FJ ∥ BH [26] & B,G,H are collinear [08] ⇒ ∠(CE-AD) = ∠(JF-CG) [27] -015. EC = ED [02] & EG = EC [07] & EA = EC [03] ⇒ A,C,G,D are concyclic [28] -016. A,C,G,D are concyclic [28] ⇒ ∠CAD = ∠CGD [29] -017. A,C,G,D are concyclic [28] ⇒ ∠AGC = ∠ADC [30] -018. CD = CA [01] ⇒ ∠CAD = ∠ADC [31] -019. ∠CAD = ∠CGD [29] & ∠CAD = ∠ADC [31] & C,B,D are collinear [00] ⇒ ∠(AD-CB) = ∠CGD [32] -020. ∠(CE-AD) = ∠(JF-CG) [27] & ∠(AD-CB) = ∠CGD [32] ⇒ ∠(CE-FJ) = ∠(BC-DG) [33] -021. C,B,D are collinear [00] & ∠GEF = ∠FEC [18] & GC ⟂ EF [17] & BG ⟂ CG [19] & ∠(CE-FJ) = ∠(BC-DG) [33] & FJ ∥ BH [26] & B,G,H are collinear [08] ⇒ ∠GDB = ∠GEF [34] -022. ∠GBD = ∠GFE [20] & ∠GDB = ∠GEF [34] (Similar Triangles)⇒ BG:FG = BD:FE [35] -023. BG:FG = BD:FE [35] & FG = FC [06] & BF = CF [04] ⇒ EF:BD = BF:BG [36] -024. J,C,H are collinear [12] & A,C,H are collinear [09] & C,B,F are collinear [05] & ∠ACE = ∠ECD [23] & C,B,D are collinear [00] ⇒ ∠JCE = ∠ECF [37] -025. GC ⟂ EF [17] & BG ⟂ CG [19] & FJ ∥ BH [26] & B,G,H are collinear [08] ⇒ FJ ∥ FE [38] -026. FJ ∥ FE [38] ⇒ J,E,F are collinear [39] -027. ∠JCE = ∠ECF [37] & J,E,F are collinear [39] ⇒ JE:EF = JC:CF [40] -028. B,G,H are collinear [08] & CG ⟂ BG [19] ⇒ CG ⟂ GH [41] -029. CG ⟂ GH [41] & J is midpoint of CH [25] ⇒ CJ = GJ [42] -030. JE:EF = JC:CF [40] & JG = JC [42] & BF = CF [04] ⇒ JE:EF = JG:BF [43] -031. J,C,H are collinear [12] & A,C,H are collinear [09] & ∠AGC = ∠ADC [30] & C,B,D are collinear [00] & ∠CAD = ∠ADC [31] ⇒ ∠DAJ = ∠CGA [44] -032. ∠(CE-AD) = ∠(JF-CG) [27] & ∠DAJ = ∠CGA [44] ⇒ ∠(CE-AJ) = ∠(JF-AG) [45] -033. J,E,F are collinear [39] & A,C,H are collinear [09] & ∠(CE-AJ) = ∠(JF-AG) [45] & J,C,H are collinear [12] & FJ ∥ BH [26] & B,G,H are collinear [08] & ∠GEF = ∠FEC [18] & GC ⟂ EF [17] & BG ⟂ CG [19] ⇒ ∠GEJ = ∠GAH [46] -034. C,B,F are collinear [05] & ∠FBG = ∠BGF [16] & FJ ∥ BH [26] & B,G,H are collinear [08] ⇒ ∠GFJ = ∠JFC [47] -035. FG = FC [06] & ∠GFJ = ∠JFC [47] (SAS)⇒ ∠GJF = ∠FJC [48] -036. J,E,F are collinear [39] & B,G,H are collinear [08] & A,C,H are collinear [09] & ∠GJF = ∠FJC [48] & J,C,H are collinear [12] & GC ⟂ EF [17] & BG ⟂ CG [19] ⇒ ∠GJE = ∠GHA [49] -037. ∠GEJ = ∠GAH [46] & ∠GJE = ∠GHA [49] (Similar Triangles)⇒ JG:HG = JE:HA [50] -038. JE:EF = JG:BF [43] & JG:GH = JE:AH [50] ⇒ BF:GH = EF:AH [51] -039. EF:BD = BF:BG [36] & EF:AH = BF:GH [51] ⇒ HG:GB = AH:BD [52] -040. CA = DC [01] & HG:GB = AH:BD [52] ⇒ (HG:GB) * (BD:DC) * (CA:AH) = 1 [53] -041. B,G,H are collinear [08] & C,B,D are collinear [00] & A,C,H are collinear [09] & A,B,I are collinear [10] & C,G,I are collinear [11] & (HG:GB) * (BD:DC) * (CA:AH) = 1 [53] ⇒ I,H,D are collinear +001. K,A,B are collinear [10] & D,A,B are collinear [00] ⇒ K,A,D are collinear [17] +002. C,J,A are collinear [08] & C,E,A are collinear [01] ⇒ A,J,E are collinear [18] +003. E,D,M are collinear [13] & D,K,A are collinear [17] & A,J,E are collinear [18] & K,J,M are collinear [14] ⇒ (EM:DM) * (JA:KA) * (KD:JE) = 1 [19] +004. D,A,B are collinear [00] & I,A,B are collinear [07] ⇒ D,I,A are collinear [20] +005. E,D,G are collinear [04] & D,I,A are collinear [20] & A,J,E are collinear [18] & J,I,G are collinear [09] ⇒ (EG:DG) * (JA:AI) * (DI:JE) = 1 [21] +006. E,D,G are collinear [04] & D,I,A are collinear [20] & A,J,E are collinear [18] & J,I,G are collinear [09] ⇒ (JG:JI) * (AI:DA) * (ED:EG) = 1 [22] +007. K,A,B are collinear [10] & K,A,D are collinear [17] & I,A,B are collinear [07] ⇒ I,K,D are collinear [23] +008. E,D,G are collinear [04] & E,D,M are collinear [13] ⇒ D,M,G are collinear [24] +009. J,I,G are collinear [09] & I,K,D are collinear [23] & D,M,G are collinear [24] & K,J,M are collinear [14] ⇒ (JG:JI) * (DM:KD) * (KI:MG) = 1 [25] +010. H,F,G are collinear [05] & E,D,G are collinear [04] & E,D,F are collinear [02] ⇒ H,E,D are collinear [26] +011. C,L,A are collinear [12] & C,E,A are collinear [01] ⇒ A,L,E are collinear [27] +012. H,K,L are collinear [11] & D,K,A are collinear [17] & H,E,D are collinear [26] & A,L,E are collinear [27] ⇒ (HL:KL) * (KA:DA) * (ED:HE) = 1 [28] +013. N,E,D are collinear [15] & H,F,G are collinear [05] & E,D,G are collinear [04] & E,D,F are collinear [02] ⇒ D,N,H are collinear [29] +014. H,K,L are collinear [11] & I,K,D are collinear [23] & D,N,H are collinear [29] & L,N,I are collinear [16] ⇒ (HL:KL) * (ND:DI) * (KI:HN) = 1 [30] +015. (EM:DM) * (JA:KA) * (KD:JE) = 1 [19] & (EG:DG) * (JA:AI) * (DI:JE) = 1 [21] & (JG:JI) * (DM:KD) * (KI:MG) = 1 [25] & (JG:JI) * (AI:DA) * (ED:EG) = 1 [22] & (HL:KL) * (KA:DA) * (ED:HE) = 1 [28] & (HL:KL) * (ND:DI) * (KI:HN) = 1 [30] (Ratio chase)⇒ (HE:DG) * (MG:EM) * (ND:HN) = 1 [31] +016. FD = FE [03] & FG = FH [06] (Distance chase)⇒ DG = HE [32] +017. (HE:DG) * (MG:EM) * (ND:HN) = 1 [31] & DG = HE [32] ⇒ MG:EM = HN:ND ========================== diff --git a/nothing.txt b/nothing.txt index b06e630..1c9ac2a 100644 --- a/nothing.txt +++ b/nothing.txt @@ -243,4 +243,463 @@ JH = JC [13] 038. JE:EF = JG:BF [43] & JG:GH = JE:AH [50] ⇒ BF:GH = EF:AH [51] 039. EF:BD = BF:BG [36] & EF:AH = BF:GH [51] ⇒ HG:GB = AH:BD [52] 040. CA = DC [01] & HG:GB = AH:BD [52] ⇒ (HG:GB) * (BD:DC) * (CA:AH) = 1 [53] -041. B,G,H are collinear [08] & C,B,D are collinear [00] & A,C,H are collinear [09] & A,B,I are collinear [10] & C,G,I are collinear [11] & (HG:GB) * (BD:DC) * (CA:AH) = 1 [53] ⇒ I,H,D are collinear \ No newline at end of file +041. B,G,H are collinear [08] & C,B,D are collinear [00] & A,C,H are collinear [09] & A,B,I are collinear [10] & C,G,I are collinear [11] & (HG:GB) * (BD:DC) * (CA:AH) = 1 [53] ⇒ I,H,D are collinear + +True +len1 0 +len2 2 +len1 2 +len2 2 +len1 0 +len2 0 +len1 4 +len2 12 +len1 0 +len2 2 +hello from 1 +len1 2 +len2 2 +len1 4 +len2 2 +len1 6 +len2 2 +len1 8 +len2 2 +len1 10 +len2 2 +len1 12 +len2 2 +len1 14 +len2 2 +len1 16 +len2 2 +len1 18 +len2 2 +len1 20 +len2 2 +len1 20 +len2 2 +len1 22 +len2 2 +len1 22 +len2 2 +len1 24 +len2 2 +len1 26 +len2 2 +len1 28 +len2 2 +len1 0 +len2 0 +len1 12 +len2 12 +len1 30 +len2 36296 +1000/36296 +2000/36296 +3000/36296 +4000/36296 +5000/36296 +6000/36296 +7000/36296 +8000/36296 +9000/36296 +10000/36296 +11000/36296 +12000/36296 +13000/36296 +14000/36296 +15000/36296 +16000/36296 +17000/36296 +18000/36296 +19000/36296 +20000/36296 +21000/36296 +22000/36296 +23000/36296 +24000/36296 +25000/36296 +26000/36296 +27000/36296 +28000/36296 +29000/36296 +30000/36296 +31000/36296 +32000/36296 +33000/36296 +34000/36296 +35000/36296 +36000/36296 +1000/3438 +2000/3438 +3000/3438 +yamero +hello from 2 +len1 0 +len2 0 +len1 12 +len2 12 +len1 36296 +len2 156642 +1000/156642 +2000/156642 +3000/156642 +4000/156642 +5000/156642 +6000/156642 +7000/156642 +8000/156642 +9000/156642 +10000/156642 +11000/156642 +12000/156642 +13000/156642 +14000/156642 +15000/156642 +16000/156642 +17000/156642 +18000/156642 +19000/156642 +20000/156642 +21000/156642 +22000/156642 +23000/156642 +24000/156642 +25000/156642 +26000/156642 +27000/156642 +28000/156642 +29000/156642 +30000/156642 +31000/156642 +32000/156642 +33000/156642 +34000/156642 +35000/156642 +36000/156642 +37000/156642 +38000/156642 +39000/156642 +40000/156642 +41000/156642 +42000/156642 +43000/156642 +44000/156642 +45000/156642 +46000/156642 +47000/156642 +48000/156642 +49000/156642 +50000/156642 +51000/156642 +52000/156642 +53000/156642 +54000/156642 +55000/156642 +56000/156642 +57000/156642 +58000/156642 +59000/156642 +60000/156642 +61000/156642 +62000/156642 +63000/156642 +64000/156642 +65000/156642 +66000/156642 +67000/156642 +68000/156642 +69000/156642 +70000/156642 +71000/156642 +72000/156642 +73000/156642 +74000/156642 +75000/156642 +76000/156642 +77000/156642 +78000/156642 +79000/156642 +80000/156642 +81000/156642 +82000/156642 +83000/156642 +84000/156642 +85000/156642 +86000/156642 +87000/156642 +88000/156642 +89000/156642 +90000/156642 +91000/156642 +92000/156642 +93000/156642 +94000/156642 +95000/156642 +96000/156642 +97000/156642 +98000/156642 +99000/156642 +100000/156642 +101000/156642 +102000/156642 +103000/156642 +104000/156642 +105000/156642 +106000/156642 +107000/156642 +108000/156642 +109000/156642 +110000/156642 +111000/156642 +112000/156642 +113000/156642 +114000/156642 +115000/156642 +116000/156642 +117000/156642 +118000/156642 +119000/156642 +120000/156642 +121000/156642 +122000/156642 +123000/156642 +124000/156642 +125000/156642 +126000/156642 +127000/156642 +128000/156642 +129000/156642 +130000/156642 +131000/156642 +132000/156642 +133000/156642 +134000/156642 +135000/156642 +136000/156642 +137000/156642 +138000/156642 +139000/156642 +140000/156642 +141000/156642 +142000/156642 +143000/156642 +144000/156642 +145000/156642 +146000/156642 +147000/156642 +148000/156642 +149000/156642 +150000/156642 +151000/156642 +152000/156642 +153000/156642 +154000/156642 +155000/156642 +156000/156642 +1000/7832 +2000/7832 +3000/7832 +4000/7832 +5000/7832 +6000/7832 +7000/7832 +yamero +satori +2 [226.20313000679016, 2725.939281463623] +hello from 3 +len1 0 +len2 0 +len1 12 +len2 12 +len1 156642 +len2 165658 +1000/165658 +2000/165658 +3000/165658 +4000/165658 +5000/165658 +6000/165658 +7000/165658 +8000/165658 +9000/165658 +10000/165658 +11000/165658 +12000/165658 +13000/165658 +14000/165658 +15000/165658 +16000/165658 +17000/165658 +18000/165658 +19000/165658 +20000/165658 +21000/165658 +22000/165658 +23000/165658 +24000/165658 +25000/165658 +26000/165658 +27000/165658 +28000/165658 +29000/165658 +30000/165658 +31000/165658 +32000/165658 +33000/165658 +34000/165658 +35000/165658 +36000/165658 +37000/165658 +38000/165658 +39000/165658 +40000/165658 +41000/165658 +42000/165658 +43000/165658 +44000/165658 +45000/165658 +46000/165658 +47000/165658 +48000/165658 +49000/165658 +50000/165658 +51000/165658 +52000/165658 +53000/165658 +54000/165658 +55000/165658 +56000/165658 +57000/165658 +58000/165658 +59000/165658 +60000/165658 +61000/165658 +62000/165658 +63000/165658 +64000/165658 +65000/165658 +66000/165658 +67000/165658 +68000/165658 +69000/165658 +70000/165658 +71000/165658 +72000/165658 +73000/165658 +74000/165658 +75000/165658 +76000/165658 +77000/165658 +78000/165658 +79000/165658 +80000/165658 +81000/165658 +82000/165658 +83000/165658 +84000/165658 +85000/165658 +86000/165658 +87000/165658 +88000/165658 +89000/165658 +90000/165658 +91000/165658 +92000/165658 +93000/165658 +94000/165658 +95000/165658 +96000/165658 +97000/165658 +98000/165658 +99000/165658 +100000/165658 +101000/165658 +102000/165658 +103000/165658 +104000/165658 +105000/165658 +106000/165658 +107000/165658 +108000/165658 +109000/165658 +110000/165658 +111000/165658 +112000/165658 +113000/165658 +114000/165658 +115000/165658 +116000/165658 +117000/165658 +118000/165658 +119000/165658 +120000/165658 +121000/165658 +122000/165658 +123000/165658 +124000/165658 +125000/165658 +126000/165658 +127000/165658 +128000/165658 +129000/165658 +130000/165658 +131000/165658 +132000/165658 +133000/165658 +134000/165658 +135000/165658 +136000/165658 +137000/165658 +138000/165658 +139000/165658 +140000/165658 +141000/165658 +142000/165658 +143000/165658 +144000/165658 +145000/165658 +146000/165658 +147000/165658 +148000/165658 +149000/165658 +150000/165658 +151000/165658 +152000/165658 +153000/165658 +154000/165658 +155000/165658 +156000/165658 +157000/165658 +158000/165658 +159000/165658 +160000/165658 +161000/165658 +162000/165658 +163000/165658 +164000/165658 +165000/165658 +yamero +satori +3 [226.20313000679016, 2725.939281463623, 4785.815370321274] +hello from 4 +len1 165658 +len2 2 +len1 165656 +len2 2 +len1 0 +len2 0 +len1 12 +len2 12 +len1 165654 +len2 130900 +1000/130900 +2000/130900 +3000/130900 +4000/130900 +5000/130900 +6000/130900 +7000/130900 +8000/130900 +9000/130900 \ No newline at end of file diff --git a/test.py b/test.py index c0aa9e8..ff9e055 100644 --- a/test.py +++ b/test.py @@ -1,3 +1,5 @@ -a = "hello world!" +a = [1,2,3] +b = [2,3,4] -print('!' in a) \ No newline at end of file +c = [x for x in a if x in b] +print(c != []) \ No newline at end of file From daed21580f61e1efcfad7be3018e02e6c8ddad90 Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.com> Date: Thu, 27 Mar 2025 09:42:30 +0800 Subject: [PATCH 19/27] euclid_menelaus --- alphageometry.py | 14 ++++++++++++++ rules.txt | 11 +++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/alphageometry.py b/alphageometry.py index cad18a1..3a04b87 100644 --- a/alphageometry.py +++ b/alphageometry.py @@ -173,6 +173,20 @@ def write_solution(g: gh.Graph, p: pr.Problem, out_file: str) -> None: 'r38': '(Similar Triangles)', 'r39': '(Similar Triangles)', 'r40': '(Congruent Triangles)', + 'r43': '(Menelaus)', + 'r44': '(Menelaus)', + 'r45': '(Ceva)', + 'r46': '(Ceva)', + 'r47': '(Circle Power)', + 'r48': '(Circle Power)', + 'r49': '(Circle Power)', + 'r50': '(Circle Power)', + 'r51': '(Radical Axis)', + 'r52': '(Pascal)', + 'r53': '(Pascal)', + 'r54': '(Pascal)', + 'r55': '(Pascal)', + 'r56': '(Pascal)', 'a00': '(Distance chase)', 'a01': '(Ratio chase)', 'a02': '(Angle chase)', diff --git a/rules.txt b/rules.txt index d4e395a..c51396f 100644 --- a/rules.txt +++ b/rules.txt @@ -41,8 +41,13 @@ eqratio6 B A B C Q P Q R, eqangle6 B A B C Q P Q R, ncoll A B C => simtri* A B C eqratio6 B A B C Q P Q R, eqratio6 C A C B R P R Q, ncoll A B C, cong A B P Q => contri* A B C P Q R para a b c d, coll m a d, coll n b c, eqratio6 m a m d n b n c, sameside m a d n b c => para m n a b para a b c d, coll m a d, coll n b c, para m n a b => eqratio6 m a m d n b n c +coll A F B, coll B D C, coll C E A, coll D E F => eqratio30 A F F B B D D C C E E A +coll A F B, coll B D C, coll C E A, eqratio30 A F F B B D D C C E E A => coll D E F +coll A F B, coll B D C, coll C E A, coll B P E, coll C P F, coll A P D => eqratio30 A F F B B D D C C E E A +coll A F B, coll B D C, coll C E A, coll B P E, coll C P F, eqratio30 A F F B B D D C C E E A => coll A P D cyclic A B C D, coll P A B, coll P C D => eqratio P A P C P D P B circle O A B C, perp O A A P, coll P B C => eqratio P A P B P C P A +cong O A O B, perp O A A P, perp O B B P => cong P A P B coll P A B, coll P C D, ncoll A B C D, eqratio P A P C P D P B => cyclic A B C D cyclic A B C D, cyclic A B E F, cyclic C D E F, coll P A B, coll P C D => coll P E F cyclic A B C D E F, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A => coll G H I @@ -50,7 +55,5 @@ circle O A B C, cong O A O D, cong O A O E, perp O A A G, coll G C D, coll H A B circle O A B C, cong O A O D, perp O A A G, coll G B C, coll H A B, coll H C D, perp O B B I, coll I D A => coll G H I circle O A B C, cong O A O D, perp O A A G, perp O B B G, coll H A C, coll H B D, coll I C B, coll I D A => coll G H I circle O A B C, cong O A O D, cong O A O E, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A, coll G H I => cong O A O F -coll A F B, coll B D C, coll C E A, coll D E F => eqratio30 A F F B B D D C C E E A -coll A F B, coll B D C, coll C E A, coll B P E, coll C P F, coll A P D => eqratio30 A F F B B D D C C E E A -coll A F B, coll B D C, coll C E A, eqratio30 A F F B B D D C C E E A => coll D E F -coll A F B, coll B D C, coll C E A, coll B P E, coll C P F, eqratio30 A F F B B D D C C E E A => coll A P D +perp A B A C, perp A D B C, coll B C D => eqratio B A B D B C B A +perp A B A C, coll B C D, perp A D B C => eqratio D A D B D C D A \ No newline at end of file From bf2dfd96b72271e9891dbfa6e53d807dd1d961e9 Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.cn> Date: Thu, 27 Mar 2025 18:49:27 +0800 Subject: [PATCH 20/27] beforenewrep --- ar.py | 52 ++++++++++++++++++------------------ chiaya.sh | 7 ++--- geometry.py | 15 ++++++++--- graph.py | 64 +++++++++++++++++++++++++++++++++++++++++--- kirine.txt | 54 ++++++++++++++----------------------- newpros.txt | 46 ++++---------------------------- nothing.txt | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++- pros2.txt | 4 ++- rules.txt | 2 +- 9 files changed, 206 insertions(+), 114 deletions(-) diff --git a/ar.py b/ar.py index 8620bbd..33fd53e 100644 --- a/ar.py +++ b/ar.py @@ -483,15 +483,15 @@ def pairs(self) -> Generator[list[tuple[str, str]], None, None]: for v1, v2 in perm2(list(self.v2e.keys())): # pylint: disable=g-builtin-op if v1 == self.const or v2 == self.const: continue - v1s = [v1] - v2s = [v2] - if '*' in v1: - v1s = v1.split('*') - if '*' in v2: - v2s = v2.split('*') - vs = [v for v in v1s if v in v2s] - if vs != []: - continue + # v1s = [v1] + # v2s = [v2] + # if '*' in v1: + # v1s = v1.split('*') + # if '*' in v2: + # v2s = v2.split('*') + # vs = [v for v in v1s if v in v2s] + # if vs != []: + # continue yield v1, v2 def modulo(self, e: dict[str, float]) -> dict[str, float]: @@ -551,21 +551,21 @@ def get_all_eqs_and_why( print(f'{cnt}/{lenall}') if self.check_record_eq(v1, v2, v3, v4): continue - v1s = [v1] - v2s = [v2] - v3s = [v3] - v4s = [v4] - if '*' in v1: - v1s = v1.split('*') - if '*' in v2: - v2s = v2.split('*') - if '*' in v3: - v3s = v3.split('*') - if '*' in v3: - v4s = v4.split('*') - v14 = v1s + v4s - v23 = v2s + v3s - vs = [v for v in v14 if v in v23] + # v1s = [v1] + # v2s = [v2] + # v3s = [v3] + # v4s = [v4] + # if '*' in v1: + # v1s = v1.split('*') + # if '*' in v2: + # v2s = v2.split('*') + # if '*' in v3: + # v3s = v3.split('*') + # if '*' in v3: + # v4s = v4.split('*') + # v14 = v1s + v4s + # v23 = v2s + v3s + # vs = [v for v in v14 if v in v23] e12 = minus(self.v2e[v1], self.v2e[v2]) e34 = minus(self.v2e[v3], self.v2e[v4]) @@ -573,8 +573,8 @@ def get_all_eqs_and_why( minus({v1: 1, v2: -1}, {v3: 1, v4: -1}), minus(e12, e34) ) self.record_eq(v1, v2, v3, v4) - if vs == []: - yield v1, v2, v3, v4, self.why(why_dict) + #if vs == []: + yield v1, v2, v3, v4, self.why(why_dict) class GeometricTable(Table): diff --git a/chiaya.sh b/chiaya.sh index 6766014..1c70c63 100644 --- a/chiaya.sh +++ b/chiaya.sh @@ -36,12 +36,13 @@ LM_ARGS=( --gin_param=Trainer.restore_state_variables=False ); -INPUT_FILE=pros2.txt +INPUT_FILE=newpros.txt +SERIES=Menelaus_a python -m alphageometry \ --alsologtostderr \ --problems_file=$(pwd)/$INPUT_FILE \ ---problem_name=example1_11 \ +--problem_name=Menelaus_c32 \ --mode=alphageometry \ "${DDAR_ARGS[@]}" \ "${SEARCH_ARGS[@]}" \ @@ -49,7 +50,7 @@ python -m alphageometry \ --out_file="kirine.txt"\ -# for pro in $(cat $INPUT_FILE | grep "example6"); +# for pro in $(cat $INPUT_FILE | grep $SERIES); # do # echo "solve problem $pro$" # python -m alphageometry \ diff --git a/geometry.py b/geometry.py index 3050f20..ff42792 100644 --- a/geometry.py +++ b/geometry.py @@ -600,10 +600,19 @@ def all_ratios2( level = level or float('inf') lp1s = lp1.equivs_upto(level) lp2s = lp2.equivs_upto(level) - + lp1sname = [lp.name for lp in lp1s] + lp2sname = [lp.name for lp in lp2s] + # print("lp1s:",[lp.name for lp in lp1s],lp1s) + # print("lp2s:",[lp.name for lp in lp2s],lp2s) for ratp in lp1.rep().neighbors(Ratio_Pro): - lp1_, lp2_ = ratp._l - if lp1_ in lp1s and lp2_ in lp2s: + # print("rprp:", ratp.name) + lp1_, lp2_ = ratp._lp + lp1_name = lp1_.name + lp2_name = lp2_.name + # print("lp1name:", lp1_.name,lp1_) + # print("lp2name:", lp2_.name,lp2_) + if lp1_name in lp1sname and lp2_name in lp2sname: + print("rpv:",ratp.val) yield ratp, lp1s, lp2s diff --git a/graph.py b/graph.py index f2af41c..8c9fc5c 100644 --- a/graph.py +++ b/graph.py @@ -215,6 +215,12 @@ def add_algebra(self, dep: Dependency, level: int) -> None: self.rtable.add_eq(ab, cd, dep) else: self.rtable.add_eqratio(ab, cd, mn, pq, dep) + _abpq_, _ = self._get_or_create_length_pro_l(ab, pq) + _cdmn_, _ = self._get_or_create_length_pro_l(cd, mn) + self.rtable.add_length_pro(_abpq_, ab, pq) + self.rtable.add_length_pro(_cdmn_, cd, mn) + self.rtable.add_eq(_abpq_, _cdmn_, dep) + if name == 'eqratio30': #TODO ab, cd, mn, pq, xy, zw = dep.algebra @@ -658,6 +664,8 @@ def build_problem( args = list(map(lambda x: g.get(x, lambda: int(x)), pr.goal.args)) check = nm.check(pr.goal.name, args) print(check) + if not check: + return g.url = pr.url g.build_def = (pr, definitions) @@ -2252,6 +2260,7 @@ def _get_or_create_length_pro_l( else: #l2.rep() == l1_ and l1.rep == l2_ why1 = l2.why_equal([l1_], None) + l1_.why_rep() why2 = l1.why_equal([l2_], None) + l2_.why_rep() + return lp, why1 + why2 l1, why1 = l1.rep_and_why() l2, why2 = l2.rep_and_why() @@ -2318,7 +2327,10 @@ def _get_or_create_ratio_pro_lp( """Get or create a new Ratio_Pro from two Length_Pro l1*l2.""" l1, l3 = lp1._l l2, l4 = lp2._l - return self._get_or_create_ratio_pro_l(l1, l2, l3, l4, deps) + rp, rpo, _ = self._get_or_create_ratio_pro_l(l1, l2, l3, l4, deps) + self.connect(lp1, rp, deps) + self.connect(lp2, rp, deps) + return rp, rpo, _ def _set_ratio_pro_equal( self, lp1: Length_Pro, lp2: Length_Pro, lp3: Length_Pro, lp4: Length_Pro, dep:EmptyDependency @@ -2804,6 +2816,7 @@ def check_eqratio(self, points: list[Point]) -> bool: def check_eqratio30(self, points: list[Point]) -> bool: """Check if 12 points make an eqratio30 predicate.""" + a, b, c, d, m, n, p, q, x, y, z, w = points if {a, b} == {c, d}: @@ -2860,13 +2873,58 @@ def check_eqratio30(self, points: list[Point]) -> bool: if Multiset([ab.val, mn.val, xy.val]) == Multiset([cd.val, pq.val, zw.val]): return True - _pqzw_, _ = self._get_or_create_length_pro(pq, zw, deps=None) + _abmn_, _ = self._get_or_create_length_pro(ab, mn, deps=None) + _abxy_, _ = self._get_or_create_length_pro(ab, xy, deps=None) _mnxy_, _ = self._get_or_create_length_pro(mn, xy, deps=None) + _cdpq_, _ = self._get_or_create_length_pro(cd, pq, deps=None) + _cdzw_, _ = self._get_or_create_length_pro(cd, zw, deps=None) + _pqzw_, _ = self._get_or_create_length_pro(pq, zw, deps=None) for rat1, _, _ in gm.all_ratios(ab._val, cd._val): for ratp2, _, _ in gm.all_ratios2(_pqzw_, _mnxy_): if self.is_equal(rat1, ratp2): - return True + return True + + for rat1, _, _ in gm.all_ratios(ab._val, pq._val): + for ratp2, _, _ in gm.all_ratios2(_cdzw_, _mnxy_): + if self.is_equal(rat1, ratp2): + return True + + for rat1, _, _ in gm.all_ratios(ab._val, zw._val): + for ratp2, _, _ in gm.all_ratios2(_cdpq_, _mnxy_): + if self.is_equal(rat1, ratp2): + return True + + for rat1, _, _ in gm.all_ratios(mn._val, cd._val): + for ratp2, _, _ in gm.all_ratios2(_pqzw_, _abxy_): + if self.is_equal(rat1, ratp2): + return True + + for rat1, _, _ in gm.all_ratios(mn._val, pq._val): + for ratp2, _, _ in gm.all_ratios2(_cdzw_, _abxy_): + if self.is_equal(rat1, ratp2): + return True + + for rat1, _, _ in gm.all_ratios(mn._val, zw._val): + for ratp2, _, _ in gm.all_ratios2(_cdpq_, _abxy_): + if self.is_equal(rat1, ratp2): + return True + + for rat1, _, _ in gm.all_ratios(xy._val, cd._val): + for ratp2, _, _ in gm.all_ratios2(_pqzw_, _abmn_): + if self.is_equal(rat1, ratp2): + return True + + for rat1, _, _ in gm.all_ratios(xy._val, pq._val): + for ratp2, _, _ in gm.all_ratios2(_cdzw_, _abmn_): + if self.is_equal(rat1, ratp2): + return True + + for rat1, _, _ in gm.all_ratios(xy._val, zw._val): + for ratp2, _, _ in gm.all_ratios2(_cdpq_, _abmn_): + if self.is_equal(rat1, ratp2): + return True + return False def add_simtri_check( diff --git a/kirine.txt b/kirine.txt index 560cb56..67c3ffa 100644 --- a/kirine.txt +++ b/kirine.txt @@ -1,45 +1,29 @@ ========================== * From theorem premises: -A B C D E F G H I J K L M N : Points -D,A,B are collinear [00] -C,E,A are collinear [01] -E,D,F are collinear [02] -FD = FE [03] -E,D,G are collinear [04] -H,F,G are collinear [05] -FG = FH [06] -I,A,B are collinear [07] -C,J,A are collinear [08] -J,I,G are collinear [09] -K,A,B are collinear [10] -H,K,L are collinear [11] -C,L,A are collinear [12] -E,D,M are collinear [13] -K,J,M are collinear [14] -N,E,D are collinear [15] -L,N,I are collinear [16] +A B C D E F G H I : Points +C,B,D are collinear [00] +E,A,D are collinear [01] +C,A,F are collinear [02] +B,E,F are collinear [03] +A,B,G are collinear [04] +C,E,G are collinear [05] +HA ∥ BC [06] +D,G,H are collinear [07] +I,A,H are collinear [08] +I,D,F are collinear [09] * Auxiliary Constructions: : Points * Proof steps: -001. K,A,B are collinear [10] & D,A,B are collinear [00] ⇒ K,A,D are collinear [17] -002. C,J,A are collinear [08] & C,E,A are collinear [01] ⇒ A,J,E are collinear [18] -003. E,D,M are collinear [13] & D,K,A are collinear [17] & A,J,E are collinear [18] & K,J,M are collinear [14] ⇒ (EM:DM) * (JA:KA) * (KD:JE) = 1 [19] -004. D,A,B are collinear [00] & I,A,B are collinear [07] ⇒ D,I,A are collinear [20] -005. E,D,G are collinear [04] & D,I,A are collinear [20] & A,J,E are collinear [18] & J,I,G are collinear [09] ⇒ (EG:DG) * (JA:AI) * (DI:JE) = 1 [21] -006. E,D,G are collinear [04] & D,I,A are collinear [20] & A,J,E are collinear [18] & J,I,G are collinear [09] ⇒ (JG:JI) * (AI:DA) * (ED:EG) = 1 [22] -007. K,A,B are collinear [10] & K,A,D are collinear [17] & I,A,B are collinear [07] ⇒ I,K,D are collinear [23] -008. E,D,G are collinear [04] & E,D,M are collinear [13] ⇒ D,M,G are collinear [24] -009. J,I,G are collinear [09] & I,K,D are collinear [23] & D,M,G are collinear [24] & K,J,M are collinear [14] ⇒ (JG:JI) * (DM:KD) * (KI:MG) = 1 [25] -010. H,F,G are collinear [05] & E,D,G are collinear [04] & E,D,F are collinear [02] ⇒ H,E,D are collinear [26] -011. C,L,A are collinear [12] & C,E,A are collinear [01] ⇒ A,L,E are collinear [27] -012. H,K,L are collinear [11] & D,K,A are collinear [17] & H,E,D are collinear [26] & A,L,E are collinear [27] ⇒ (HL:KL) * (KA:DA) * (ED:HE) = 1 [28] -013. N,E,D are collinear [15] & H,F,G are collinear [05] & E,D,G are collinear [04] & E,D,F are collinear [02] ⇒ D,N,H are collinear [29] -014. H,K,L are collinear [11] & I,K,D are collinear [23] & D,N,H are collinear [29] & L,N,I are collinear [16] ⇒ (HL:KL) * (ND:DI) * (KI:HN) = 1 [30] -015. (EM:DM) * (JA:KA) * (KD:JE) = 1 [19] & (EG:DG) * (JA:AI) * (DI:JE) = 1 [21] & (JG:JI) * (DM:KD) * (KI:MG) = 1 [25] & (JG:JI) * (AI:DA) * (ED:EG) = 1 [22] & (HL:KL) * (KA:DA) * (ED:HE) = 1 [28] & (HL:KL) * (ND:DI) * (KI:HN) = 1 [30] (Ratio chase)⇒ (HE:DG) * (MG:EM) * (ND:HN) = 1 [31] -016. FD = FE [03] & FG = FH [06] (Distance chase)⇒ DG = HE [32] -017. (HE:DG) * (MG:EM) * (ND:HN) = 1 [31] & DG = HE [32] ⇒ MG:EM = HN:ND +001. I,A,H are collinear [08] & C,B,D are collinear [00] & AH ∥ BC [06] ⇒ IA ∥ DC [10] +002. IA ∥ DC [10] & I,D,F are collinear [09] & C,A,F are collinear [02] ⇒ IF:DF = AF:CF [11] +003. IA ∥ DC [10] & I,D,F are collinear [09] & C,A,F are collinear [02] ⇒ IF:DF = IA:CD [12] +004. C,B,D are collinear [00] & AH ∥ BC [06] ⇒ AH ∥ BD [13] +005. AH ∥ BD [13] & A,B,G are collinear [04] & D,G,H are collinear [07] ⇒ AG:BG = AH:BD [14] +006. C,A,F are collinear [02] & E,A,D are collinear [01] & C,B,D are collinear [00] & B,E,F are collinear [03] (Menelaus)⇒ (CF:AF) * (AE:CB) * (BD:ED) = 1 [15] +007. A,B,G are collinear [04] & E,A,D are collinear [01] & C,B,D are collinear [00] & C,E,G are collinear [05] (Menelaus)⇒ (BG:AG) * (AE:CB) * (CD:ED) = 1 [16] +008. IF:DF = AF:CF [11] & IF:DF = IA:CD [12] & AG:BG = AH:BD [14] & (CF:AF) * (AE:CB) * (BD:ED) = 1 [15] & (BG:AG) * (AE:CB) * (CD:ED) = 1 [16] (Ratio chase)⇒ IA = AH ========================== diff --git a/newpros.txt b/newpros.txt index 9076165..976a1c6 100644 --- a/newpros.txt +++ b/newpros.txt @@ -1,42 +1,6 @@ -Menelaus_a2 -a b c = triangle a b c; o = circle o a b c; p = on_line p b c, on_tline p a o a; q = on_line q a c, on_tline q b o b; r = on_line r a b, on_tline r c o c ? coll p q r -Menelaus_a7 -a b c = triangle a b c; d e f i = incenter2 d e f i a b c; o = on_bline o a b; m = midpoint m a b; p = on_line p d e, on_circle p o a; q = on_line q d e, on_circle q o a; x = on_line x a b, on_line x d e ? cyclic p q f m -Menelaus_a9 -a b c = triangle a b c; e = midpoint e b c; f = angle_bisector f b a c, on_line f b c; k = on_line k a e, on_pline k f a c ? perp a f k c -Menelaus_a9w -a b c = triangle a b c; e = midpoint e b c; f = angle_bisector f b a c, on_line f b c; k = on_line k a e, on_pline k f a c; d = on_line d a b, on_line d c k ? cong a d a c -Menelaus_b3 -a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; q = on_line q a c, on_line q b d; e = foot e q a b; f = foot f q b c; g = foot g q c d; h = foot h q d a; p = on_line p e h, on_line p b d ? coll p f g -Menelaus_b6 -a b c = triangle a b c; h = orthocenter h a b c; e = on_line e a b; f = on_line f b c, on_line f e h; d = on_line d a c, on_line d e h; m = on_tline m h e h, on_line m b c; n = on_line n a b, on_line n m h; p = on_line p a c, on_line p m h ? eqratio d e e f p n m n -Menelaus_b9 -a b c = triangle a b c; d e f i = incenter2 d e f i a b c; x = on_tline x d b c; i2 = incenter i2 x b c; y = foot y i2 x c; z = foot z i2 x b ? cyclic x y e f -Menelaus_b9w -a b c = triangle a b c; d e f i = incenter2 d e f i a b c; x = on_tline x d b c; i2 = incenter i2 x b c; y = foot y i2 x c; z = foot z i2 x b; p = on_line p b c, on_line p e f ? coll p x y -Menelaus_b10 -a b c = triangle a b c; d = foot d a b c; x e g o1 = excenter2 x e g o1 c a b; y f h o2 = excenter2 y f h o2 b a c; q = on_line q a d, on_line q f h ? coll q e g -Menelaus_b11 -a b c = triangle a b c; o = circle o a b c; p = on_tline p a o a, on_tline p b o b; d = on_line d p c, on_circle d o a; e = on_pline e c p a, on_line e a b; f = on_line f c e, on_line f a d; k = on_line k c d, on_line k a b ? cong e c e f -Menelaus_b11w -a b c = triangle a b c; o = circle o a b c; p = on_tline p a o a, on_tline p b o b; d = on_line d p c, on_circle d o a; e = on_pline e c p a, on_line e a b; f = on_line f c e, on_line f a d; k = on_line k c d, on_line k a b; m = on_line m o p, on_line m a b ? cyclic o m c d -Menelaus_b12 -a b c = triangle a b c; m = midpoint m a b; d = on_line d b c; e = mirror e m d; f = on_line f a b; g = on_line g a c; k = on_line k f e, on_line k g d; v = on_line v f d, on_line v g e; l = on_line l a k, on_line l b c; t = on_line t a v, on_line t b c ? cong d t e l -Menelaus_b13 -x y = segment x y; p = on_line p x y; a = on_circle a x p; b c = tangent b c a y p; d = on_line d a b, on_circle d x a; e = on_line e a c, on_circle e x a; r = on_line r d e, on_line r b c; q = on_line q p r, on_circle q x a ? coll a q y -Menelaus_b15 -a b c = triangle a b c; m = midpoint m b c; i = incenter i a b c; d = on_line d m i, on_line d a c; o = circle o a b c; e = on_line e b i, on_circle e o a ? eqratio e d e i i c i b -Menelaus_b15w -a b c = triangle a b c; m = midpoint m b c; i = incenter i a b c; d = on_line d m i, on_line d a c; o = circle o a b c; e = on_line e b i, on_circle e o a; f = on_line f b i, on_line f a c ? eqratio e d e i i c i b -Menelaus_c3 -a b = segment a b; c = on_tline c b a b, on_circle c b a; d = midpoint d b c; e = foot e b a d; f = on_line f b e, on_line f a c; g = midpoint g a f ? cong a g c f -Menelaus_cDesargues -a b c = triangle a b c; d e = segment d e; g = on_line g a d, on_line g b e; f = on_line f g c; l = on_line l a b, on_line l d e; m = on_line m b c, on_line m e f; n = on_line n a c, on_line n d f ? coll l m n -Menelaus_cNewton -a b c = triangle a b c; d = free; e = on_line e a b, on_line e c d; f = on_line f a d, on_line f b c; g = midpoint g a c; h = midpoint h b d; i = midpoint i e f ? coll g h i -Menelaus_cPappus -a b = segment; c = on_line c a b; d e = segment; f = on_line f d e; g = on_line g a e, on_line g b d; h = on_line h a f, on_line h c d; i = on_line i b f, on_line p c e ? coll g h i -Menelaus_c22 -a b c = triangle a b c; d = on_line d a b; f = on_line f a c; e = mirror e d f; p = on_line p a d, on_line p b e; m = on_line m a b, on_line m d f; n = on_line n p c, on_line n d f ? cong d m d n Menelaus_c32 -a b c = triangle a b c; i = incenter i a b c; d = on_line d a i, on_line d b c; e = on_line e b i, on_line e c a; f = on_tline f c c i, on_line f a b ? coll d e f \ No newline at end of file +a b c = triangle a b c; i = incenter i a b c; d = on_line d a i, on_line d b c; e = on_line e b i, on_line e c a; f = on_tline f c c i, on_line f a b ? eqratio30 d b d c e c e a c a c b +Menelaus_a +a b c = triangle a b c ? eqratio30 a b a c a c b c b c a b +example2_1 +a b c = triangle a b c; d = foot d a b c; h = on_line h a d; e = on_line e a c, on_line e b h; f = on_line f a b, on_line f c h; p = on_pline p a b c, on_line p d f; q = on_line q p a, on_line q d e ? cong a p a q \ No newline at end of file diff --git a/nothing.txt b/nothing.txt index 1c9ac2a..14e4b86 100644 --- a/nothing.txt +++ b/nothing.txt @@ -702,4 +702,78 @@ len2 130900 6000/130900 7000/130900 8000/130900 -9000/130900 \ No newline at end of file +9000/130900 + + +========================== + * From theorem premises: +A B C D E F G H I : Points +C,B,D are collinear [00] +E,A,D are collinear [01] +C,A,F are collinear [02] +B,E,F are collinear [03] +A,B,G are collinear [04] +C,E,G are collinear [05] +HA ∥ BC [06] +D,G,H are collinear [07] +I,A,H are collinear [08] +I,D,F are collinear [09] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. I,A,H are collinear [08] & C,B,D are collinear [00] & AH ∥ BC [06] ⇒ IA ∥ DC [10] +002. IA ∥ DC [10] & I,D,F are collinear [09] & C,A,F are collinear [02] ⇒ IF:DF = AF:CF [11] +003. IA ∥ DC [10] & I,D,F are collinear [09] & C,A,F are collinear [02] ⇒ IF:DF = IA:CD [12] +004. C,B,D are collinear [00] & AH ∥ BC [06] ⇒ AH ∥ BD [13] +005. AH ∥ BD [13] & A,B,G are collinear [04] & D,G,H are collinear [07] ⇒ AG:BG = AH:BD [14] +006. C,A,F are collinear [02] & E,A,D are collinear [01] & C,B,D are collinear [00] & B,E,F are collinear [03] (Menelaus)⇒ (CF:AF) * (AE:CB) * (BD:ED) = 1 [15] +007. A,B,G are collinear [04] & E,A,D are collinear [01] & C,B,D are collinear [00] & C,E,G are collinear [05] (Menelaus)⇒ (BG:AG) * (AE:CB) * (CD:ED) = 1 [16] +008. IF:DF = AF:CF [11] & IF:DF = IA:CD [12] & AG:BG = AH:BD [14] & (CF:AF) * (AE:CB) * (BD:ED) = 1 [15] & (BG:AG) * (AE:CB) * (CD:ED) = 1 [16] (Ratio chase)⇒ IA = AH +========================== + + +Menelaus_a2 +a b c = triangle a b c; o = circle o a b c; p = on_line p b c, on_tline p a o a; q = on_line q a c, on_tline q b o b; r = on_line r a b, on_tline r c o c ? coll p q r +Menelaus_a7 +a b c = triangle a b c; d e f i = incenter2 d e f i a b c; o = on_bline o a b; m = midpoint m a b; p = on_line p d e, on_circle p o a; q = on_line q d e, on_circle q o a; x = on_line x a b, on_line x d e ? cyclic p q f m +Menelaus_a9 +a b c = triangle a b c; e = midpoint e b c; f = angle_bisector f b a c, on_line f b c; k = on_line k a e, on_pline k f a c ? perp a f k c +Menelaus_a9w +a b c = triangle a b c; e = midpoint e b c; f = angle_bisector f b a c, on_line f b c; k = on_line k a e, on_pline k f a c; d = on_line d a b, on_line d c k ? cong a d a c +Menelaus_b3 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; q = on_line q a c, on_line q b d; e = foot e q a b; f = foot f q b c; g = foot g q c d; h = foot h q d a; p = on_line p e h, on_line p b d ? coll p f g +Menelaus_b6 +a b c = triangle a b c; h = orthocenter h a b c; e = on_line e a b; f = on_line f b c, on_line f e h; d = on_line d a c, on_line d e h; m = on_tline m h e h, on_line m b c; n = on_line n a b, on_line n m h; p = on_line p a c, on_line p m h ? eqratio d e e f p n m n +Menelaus_b9 +a b c = triangle a b c; d e f i = incenter2 d e f i a b c; x = on_tline x d b c; i2 = incenter i2 x b c; y = foot y i2 x c; z = foot z i2 x b ? cyclic x y e f +Menelaus_b9w +a b c = triangle a b c; d e f i = incenter2 d e f i a b c; x = on_tline x d b c; i2 = incenter i2 x b c; y = foot y i2 x c; z = foot z i2 x b; p = on_line p b c, on_line p e f ? coll p x y +Menelaus_b10 +a b c = triangle a b c; d = foot d a b c; x e g o1 = excenter2 x e g o1 c a b; y f h o2 = excenter2 y f h o2 b a c; q = on_line q a d, on_line q f h ? coll q e g +Menelaus_b11 +a b c = triangle a b c; o = circle o a b c; p = on_tline p a o a, on_tline p b o b; d = on_line d p c, on_circle d o a; e = on_pline e c p a, on_line e a b; f = on_line f c e, on_line f a d; k = on_line k c d, on_line k a b ? cong e c e f +Menelaus_b11w +a b c = triangle a b c; o = circle o a b c; p = on_tline p a o a, on_tline p b o b; d = on_line d p c, on_circle d o a; e = on_pline e c p a, on_line e a b; f = on_line f c e, on_line f a d; k = on_line k c d, on_line k a b; m = on_line m o p, on_line m a b ? cyclic o m c d +Menelaus_b12 +a b c = triangle a b c; m = midpoint m a b; d = on_line d b c; e = mirror e m d; f = on_line f a b; g = on_line g a c; k = on_line k f e, on_line k g d; v = on_line v f d, on_line v g e; l = on_line l a k, on_line l b c; t = on_line t a v, on_line t b c ? cong d t e l +Menelaus_b13 +x y = segment x y; p = on_line p x y; a = on_circle a x p; b c = tangent b c a y p; d = on_line d a b, on_circle d x a; e = on_line e a c, on_circle e x a; r = on_line r d e, on_line r b c; q = on_line q p r, on_circle q x a ? coll a q y +Menelaus_b15 +a b c = triangle a b c; m = midpoint m b c; i = incenter i a b c; d = on_line d m i, on_line d a c; o = circle o a b c; e = on_line e b i, on_circle e o a ? eqratio e d e i i c i b +Menelaus_b15w +a b c = triangle a b c; m = midpoint m b c; i = incenter i a b c; d = on_line d m i, on_line d a c; o = circle o a b c; e = on_line e b i, on_circle e o a; f = on_line f b i, on_line f a c ? eqratio e d e i i c i b +Menelaus_c3 +a b = segment a b; c = on_tline c b a b, on_circle c b a; d = midpoint d b c; e = foot e b a d; f = on_line f b e, on_line f a c; g = midpoint g a f ? cong a g c f +Menelaus_cDesargues +a b c = triangle a b c; d e = segment d e; g = on_line g a d, on_line g b e; f = on_line f g c; l = on_line l a b, on_line l d e; m = on_line m b c, on_line m e f; n = on_line n a c, on_line n d f ? coll l m n +Menelaus_cNewton +a b c = triangle a b c; d = free; e = on_line e a b, on_line e c d; f = on_line f a d, on_line f b c; g = midpoint g a c; h = midpoint h b d; i = midpoint i e f ? coll g h i +Menelaus_cPappus +a b = segment; c = on_line c a b; d e = segment; f = on_line f d e; g = on_line g a e, on_line g b d; h = on_line h a f, on_line h c d; i = on_line i b f, on_line p c e ? coll g h i +Menelaus_c22 +a b c = triangle a b c; d = on_line d a b; f = on_line f a c; e = mirror e d f; p = on_line p a d, on_line p b e; m = on_line m a b, on_line m d f; n = on_line n p c, on_line n d f ? cong d m d n +Menelaus_c32 +a b c = triangle a b c; i = incenter i a b c; d = on_line d a i, on_line d b c; e = on_line e b i, on_line e c a; f = on_tline f c c i, on_line f a b ? coll d e f \ No newline at end of file diff --git a/pros2.txt b/pros2.txt index 3569dde..1d4e0b1 100644 --- a/pros2.txt +++ b/pros2.txt @@ -59,4 +59,6 @@ a b c = triangle a b c; d = midpoint d a c; e = on_line e b d; f = on_line f a e example2_7 a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_line e a b, on_line e d c; f = on_line f a d, on_line f b c; p = on_circle p o a; r = on_line r p f, on_circle r o a; s = on_line s p e, on_circle s o a; t = on_line t a c, on_line t b d ? eqratio30 a s s d d c r c b r b a example2_4 -a b c = triangle a b c; d = on_circle d c a, on_line d b c; o = circle o a c d; m = midpoint m b c; p = on_circle p o c, on_circle p m c; e = on_line e a c, on_line e b p; f = on_line f a b, on_line f c p ? coll d e f \ No newline at end of file +a b c = triangle a b c; d = on_circle d c a, on_line d b c; o = circle o a c d; m = midpoint m b c; p = on_circle p o c, on_circle p m c; e = on_line e a c, on_line e b p; f = on_line f a b, on_line f c p ? coll d e f +test_anglebi +a b c = triangle a b c; i = incenter i a b c; d = on_line d a i, on_line d b c; e = on_tline e a a i, on_line e b c ? eqratio b d c d b e c e \ No newline at end of file diff --git a/rules.txt b/rules.txt index c51396f..125524f 100644 --- a/rules.txt +++ b/rules.txt @@ -46,7 +46,7 @@ coll A F B, coll B D C, coll C E A, eqratio30 A F F B B D D C C E E A => coll D coll A F B, coll B D C, coll C E A, coll B P E, coll C P F, coll A P D => eqratio30 A F F B B D D C C E E A coll A F B, coll B D C, coll C E A, coll B P E, coll C P F, eqratio30 A F F B B D D C C E E A => coll A P D cyclic A B C D, coll P A B, coll P C D => eqratio P A P C P D P B -circle O A B C, perp O A A P, coll P B C => eqratio P A P B P C P A +circle O A B C, perp O A A P, coll P B C => eqratio P A P B P C P A cong O A O B, perp O A A P, perp O B B P => cong P A P B coll P A B, coll P C D, ncoll A B C D, eqratio P A P C P D P B => cyclic A B C D cyclic A B C D, cyclic A B E F, cyclic C D E F, coll P A B, coll P C D => coll P E F From b6fc84967c02044f9a1fa30f02732f6f4e2d31f6 Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.cn> Date: Fri, 28 Mar 2025 17:20:09 +0800 Subject: [PATCH 21/27] why_eqangle --- chiaya.sh | 6 +-- dd.py | 6 ++- geometry.py | 27 +++++----- graph.py | 103 ++++++++++++++++++++++++++++++++---- kirine.txt | 42 ++++++++------- newpros.txt | 5 +- output_new/Menelaus_c32.txt | 33 ++++++++++++ output_new/example2_1.txt | 29 ++++++++++ output_new/example2_4.txt | 62 ++++++++++++++++++++++ problem.py | 8 +-- trace_back.py | 2 + 11 files changed, 272 insertions(+), 51 deletions(-) create mode 100644 output_new/Menelaus_c32.txt create mode 100644 output_new/example2_1.txt create mode 100644 output_new/example2_4.txt diff --git a/chiaya.sh b/chiaya.sh index 1c70c63..e84daa5 100644 --- a/chiaya.sh +++ b/chiaya.sh @@ -11,8 +11,8 @@ DDAR_ARGS=( SIZE=4 -BATCH_SIZE=8 -BEAM_SIZE=16 +BATCH_SIZE=2 +BEAM_SIZE=2 DEPTH=2 SEARCH_ARGS=( @@ -42,7 +42,7 @@ SERIES=Menelaus_a python -m alphageometry \ --alsologtostderr \ --problems_file=$(pwd)/$INPUT_FILE \ ---problem_name=Menelaus_c32 \ +--problem_name=example2_1 \ --mode=alphageometry \ "${DDAR_ARGS[@]}" \ "${SEARCH_ARGS[@]}" \ diff --git a/dd.py b/dd.py index 7692774..69249cc 100644 --- a/dd.py +++ b/dd.py @@ -103,6 +103,7 @@ def match_eqratio_eqratio_eqratio( # eqangle a b c d m n p q (eqratio) e, f = g.two_points_of_length(l2) r, u = g.two_points_of_length(l4) + #debugname([a, b, c, d, e, f, m, n, p, q, r, u]) yield dict(zip('abcdefmnpqru', [a, b, c, d, e, f, m, n, p, q, r, u])) @@ -977,7 +978,7 @@ def match_ceva( bes = be.neighbors(gm.Point, return_set=True) p = intersect1(ads, bes) if p is not None and g.check_coll([p, c, f]): - debugname([p, a, b, c, d, e, f]) + #debugname([p, a, b, c, d, e, f]) yield dict(zip('PABCDEF', [p, a, b, c, d, e, f])) tb = time.time() #print(tb-ta) @@ -1848,7 +1849,8 @@ def bfs_one_level( hash_conclusion = pr.hashed(name, args) if hash_conclusion in g.cache: continue - + if name == 'cyclic': + print(theorem.name,mp,args) add = g.add_piece(name, args, deps=deps) added += add diff --git a/geometry.py b/geometry.py index ff42792..62bdc74 100644 --- a/geometry.py +++ b/geometry.py @@ -556,10 +556,11 @@ def new_val(self) -> Value: def set_lengths(self, lp13: Length_Pro, lp24: Length_Pro) -> None: self._lp = lp13, lp24 + @property def muls(self) -> tuple[Length_Pro, Length_Pro]: - lp13, lp24 = self._ml + lp13, lp24 = self._lp if lp13 is None or lp24 is None: return lp13, lp24 return lp13.rep(), lp24.rep() @@ -600,19 +601,21 @@ def all_ratios2( level = level or float('inf') lp1s = lp1.equivs_upto(level) lp2s = lp2.equivs_upto(level) - lp1sname = [lp.name for lp in lp1s] - lp2sname = [lp.name for lp in lp2s] - # print("lp1s:",[lp.name for lp in lp1s],lp1s) - # print("lp2s:",[lp.name for lp in lp2s],lp2s) - for ratp in lp1.rep().neighbors(Ratio_Pro): + # lp1sname = [lp.name for lp in lp1s] + # lp2sname = [lp.name for lp in lp2s] + + # print("\nlp1s:",lp1sname,lp1s) + # print("lp2s:",lp2sname,lp2s) + for ratp in lp1.neighbors(Ratio_Pro,do_rep = False): # print("rprp:", ratp.name) lp1_, lp2_ = ratp._lp - lp1_name = lp1_.name - lp2_name = lp2_.name - # print("lp1name:", lp1_.name,lp1_) - # print("lp2name:", lp2_.name,lp2_) - if lp1_name in lp1sname and lp2_name in lp2sname: - print("rpv:",ratp.val) + # lp1_name = lp1_.name + # lp2_name = lp2_.name + # print("\nrpv:",ratp.name) + # print("lp1name:", lp1_name,lp1_) + # print("lp2name:", lp2_name,lp2_) + + if lp1_ in lp1s and lp2_ in lp2s: yield ratp, lp1s, lp2s diff --git a/graph.py b/graph.py index 8c9fc5c..6705d54 100644 --- a/graph.py +++ b/graph.py @@ -1163,12 +1163,17 @@ def check_offseg(self, points: list[Point]) -> bool: def make_equal(self, x: gm.Node, y: gm.Node, deps: Dependency) -> None: """Make that two nodes x and y are equal, i.e. merge their value node.""" + if {type(x),type(y)} == {Ratio,Ratio_Pro}: + pass + #print(x.name, y.name) + if x.val is None: x, y = y, x self.connect_val(x, deps=None) self.connect_val(y, deps=None) vx = x._val vy = y._val + if vx == vy: return @@ -1186,6 +1191,55 @@ def make_equal(self, x: gm.Node, y: gm.Node, deps: Dependency) -> None: self.merge(merges, deps) + if type(x) is Ratio and type(y) is Ratio: + return + assert x != y.opposite, f'{x.name},{y.name}' + x1, x2 = x._l + y1, y2 = y._l + for z in x.neighbors(Ratio_Pro, do_rep=False): + lp13, lp24 = z._lp + l1, l3 = lp13.lengths + l2, l4 = lp24.lengths + if self.is_equal(l3, x1): + l1, l3 = l3, l1 + if self.is_equal(l4, x2): + l2, l4 = l4, l2 + assert self.is_equal(l1, x1) and self.is_equal(l2, x2), f'{l1.name},{l2.name},{l3.name},{l4.name},{x1.name},{x2.name}' + # (x1 * l3) / (x2 * l4) -> (y1 * l3) / (y2 * l4) + if self.is_equal(l3, y2) and self.is_equal(l4, y1): + continue + #print(f'{l1.name},{l2.name},{l3.name},{l4.name},{z.name},{x.name},{y.name}') + if self.is_equal(l3, y2): #simplify + r, _, _ = self._get_or_create_ratio_l(y1, l4) + self.make_equal(z, r, deps) + elif self.is_equal(l4, y1): #simplify + r, _, _ = self._get_or_create_ratio_l(l3, y2) + self.make_equal(z, r, deps) + else: + rp, _, _ = self._get_or_create_ratio_pro_l(y1, y2, l3, l4) + self.make_equal(z, rp, deps) + for z in y.neighbors(Ratio_Pro, do_rep= False): + lp13, lp24 = z._lp + l1, l3 = lp13.lengths + l2, l4 = lp24.lengths + if self.is_equal(l3, y1): + l1, l3 = l3, l1 + if self.is_equal(l4, y2): + l2, l4 = l4, l2 + assert self.is_equal(l1, y1) and self.is_equal(l2, y2),f'{l1.name},{l2.name},{l3.name},{l4.name},{y1.name},{y2.name}' + if self.is_equal(l3, x2) and self.is_equal(l4, x1): + continue + #print(f'{l1.name},{l2.name},{l3.name},{l4.name},{z.name},{y.name},{x.name}') + if self.is_equal(l3, x2): #simplify + r, _, _ = self._get_or_create_ratio_l(x1, l4) + self.make_equal(z, r, deps) + elif self.is_equal(l4, x1): #simplify + r, _, _ = self._get_or_create_ratio_l(l3, x2) + self.make_equal(z, r, deps) + else: + rp, _, _ = self._get_or_create_ratio_pro_l(x1, x2, l3, l4) + self.make_equal(z, rp, deps) + def merge_vals(self, vx: gm.Node, vy: gm.Node, deps: Dependency) -> None: if vx == vy: return @@ -1662,6 +1716,7 @@ def add_cyclic( """Add a new cyclic predicate that 4 points are concyclic.""" points = list(set(points)) og_points = list(points) + print([p.name for p in points]) all_circles = [] for p1, p2, p3 in utils.comb3(points): @@ -2216,7 +2271,7 @@ def _get_or_create_ratio( return self._get_or_create_ratio_l(s1._val, s2._val, deps) def _get_or_create_ratio_l( - self, l1: Length, l2: Length, deps: Dependency + self, l1: Length, l2: Length, deps=None ) -> tuple[Ratio, Ratio, list[Dependency]]: """Get or create a new Ratio from two Lenghts l1 and l2.""" for r in self.type2nodes[Ratio]: @@ -2262,6 +2317,9 @@ def _get_or_create_length_pro_l( why2 = l1.why_equal([l2_], None) + l2_.why_rep() return lp, why1 + why2 + newname = f'{l1.name}*{l2.name}' + for lp in self.type2nodes[Length_Pro]: + assert lp.name != newname, f'{newname},{len(self.type2nodes[Length_Pro])}' l1, why1 = l1.rep_and_why() l2, why2 = l2.rep_and_why() lp12 = self.new_node(Length_Pro, f'{l1.name}*{l2.name}') @@ -2306,10 +2364,8 @@ def _get_or_create_ratio_pro_l( l2, why2 = l2.rep_and_why() l3, why3 = l3.rep_and_why() l4, why4 = l4.rep_and_why() - lp13 = self.new_node(Length_Pro, f'{l1.name}*{l3.name}') - lp24 = self.new_node(Length_Pro, f'{l2.name}*{l4.name}') - lp13.set_lengths(l1, l3) - lp24.set_lengths(l2, l4) + lp13, _ = self._get_or_create_length_pro_l(l1, l3) + lp24, _ = self._get_or_create_length_pro_l(l2, l4) rp1324 = self.new_node(Ratio_Pro, f'{lp13.name}/{lp24.name}') rp2413 = self.new_node(Ratio_Pro, f'{lp24.name}/{lp13.name}') self.connect(lp13, rp1324, deps) @@ -2319,6 +2375,19 @@ def _get_or_create_ratio_pro_l( rp2413.set_lengths(lp24, lp13) rp1324.opposite = rp2413 rp2413.opposite = rp1324 + r12, r21, _ = self._get_or_create_ratio_l(l1, l2) + r14, r41, _ = self._get_or_create_ratio_l(l1, l4) + r32, r23, _ = self._get_or_create_ratio_l(l3, l2) + r34, r43, _ = self._get_or_create_ratio_l(l3, l4) + self.connect(r12, rp1324, deps) + self.connect(r14, rp1324, deps) + self.connect(r32, rp1324, deps) + self.connect(r34, rp1324, deps) + self.connect(r21, rp2413, deps) + self.connect(r41, rp2413, deps) + self.connect(r23, rp2413, deps) + self.connect(r43, rp2413, deps) + return rp1324, rp2413, why1 + why2 + why3 + why4 def _get_or_create_ratio_pro_lp( @@ -2331,6 +2400,17 @@ def _get_or_create_ratio_pro_lp( self.connect(lp1, rp, deps) self.connect(lp2, rp, deps) return rp, rpo, _ + + def _get_or_create_ratio_pro_r( + self, r1: Ratio, r2: Ratio, deps=None + ) -> tuple[Ratio_Pro, Ratio_Pro, list[Dependency]]: + """Get or create a new Ratio_Pro from two Length_Pro l1*l2.""" + l1, l2 = r1._l + l3, l4 = r2._l + rp, rpo, _ = self._get_or_create_ratio_pro_l(l1, l2, l3, l4, deps) + self.connect(r1, rp, deps) + self.connect(r2, rp, deps) + return rp, rpo, _ def _set_ratio_pro_equal( self, lp1: Length_Pro, lp2: Length_Pro, lp3: Length_Pro, lp4: Length_Pro, dep:EmptyDependency @@ -2646,7 +2726,7 @@ def _add_eqratio30( x, y = lxy._obj.points z, w = lzw._obj.points - is_eq1 = self.is_equal(ab_cd, mnxy_pqzw) + is_eq1 = self.is_equal(ab_cd, pqzw_mnxy) deps1 = None if deps: deps1 = deps.populate('eqratio30', [a, b, c, d, m, n, p, q, x, y, z, w]) @@ -2654,9 +2734,9 @@ def _add_eqratio30( if not is_eq1: add += [deps1] self.cache_dep('eqratio30', [a, b, c, d, m, n, p, q, x, y, z, w], deps1) - self.make_equal(ab_cd, mnxy_pqzw, deps=deps1) + self.make_equal(ab_cd, pqzw_mnxy, deps=deps1) - is_eq2 = self.is_equal(cd_ab, pqzw_mnxy) + is_eq2 = self.is_equal(cd_ab, mnxy_pqzw) deps2 = None if deps: deps2 = deps.populate('eqratio30', [c, d, a, b, p, q, m, n, z, w, x, y]) @@ -2664,7 +2744,7 @@ def _add_eqratio30( if not is_eq2: add += [deps2] self.cache_dep('eqratio30', [c, d, a, b, p, q, m, n, z, w, x, y], deps2) - self.make_equal(cd_ab, pqzw_mnxy, deps=deps2) + self.make_equal(cd_ab, mnxy_pqzw, deps=deps2) return add def add_eqratio30( @@ -2814,6 +2894,11 @@ def check_eqratio(self, points: list[Point]) -> bool: return True return False + def all_equiv_ratio_or_pro(self, rp: Ratio_Pro) -> list[Union(Ratio, Ratio_Pro)]: + r2p = [] + for rt in self.type2nodes[Ratio]: + return r2p + def check_eqratio30(self, points: list[Point]) -> bool: """Check if 12 points make an eqratio30 predicate.""" diff --git a/kirine.txt b/kirine.txt index 67c3ffa..4e1bda9 100644 --- a/kirine.txt +++ b/kirine.txt @@ -1,29 +1,33 @@ ========================== * From theorem premises: -A B C D E F G H I : Points -C,B,D are collinear [00] -E,A,D are collinear [01] -C,A,F are collinear [02] -B,E,F are collinear [03] -A,B,G are collinear [04] -C,E,G are collinear [05] -HA ∥ BC [06] -D,G,H are collinear [07] -I,A,H are collinear [08] -I,D,F are collinear [09] +A B C D E F G : Points +∠DAB = ∠CAD [00] +∠ACD = ∠DCB [01] +A,E,D are collinear [02] +E,C,B are collinear [03] +F,D,B are collinear [04] +A,C,F are collinear [05] +G,A,B are collinear [06] +CG ⟂ CD [07] * Auxiliary Constructions: : Points * Proof steps: -001. I,A,H are collinear [08] & C,B,D are collinear [00] & AH ∥ BC [06] ⇒ IA ∥ DC [10] -002. IA ∥ DC [10] & I,D,F are collinear [09] & C,A,F are collinear [02] ⇒ IF:DF = AF:CF [11] -003. IA ∥ DC [10] & I,D,F are collinear [09] & C,A,F are collinear [02] ⇒ IF:DF = IA:CD [12] -004. C,B,D are collinear [00] & AH ∥ BC [06] ⇒ AH ∥ BD [13] -005. AH ∥ BD [13] & A,B,G are collinear [04] & D,G,H are collinear [07] ⇒ AG:BG = AH:BD [14] -006. C,A,F are collinear [02] & E,A,D are collinear [01] & C,B,D are collinear [00] & B,E,F are collinear [03] (Menelaus)⇒ (CF:AF) * (AE:CB) * (BD:ED) = 1 [15] -007. A,B,G are collinear [04] & E,A,D are collinear [01] & C,B,D are collinear [00] & C,E,G are collinear [05] (Menelaus)⇒ (BG:AG) * (AE:CB) * (CD:ED) = 1 [16] -008. IF:DF = AF:CF [11] & IF:DF = IA:CD [12] & AG:BG = AH:BD [14] & (CF:AF) * (AE:CB) * (BD:ED) = 1 [15] & (BG:AG) * (AE:CB) * (CD:ED) = 1 [16] (Ratio chase)⇒ IA = AH +001. A,C,F are collinear [05] & ∠CAD = ∠DAB [00] ⇒ ∠FAD = ∠DAB [08] +002. ∠FAD = ∠DAB [08] & F,D,B are collinear [04] ⇒ FD:DB = AF:AB [09] +003. A,C,F are collinear [05] & ∠ACD = ∠DCB [01] ⇒ ∠FCD = ∠DCB [10] +004. ∠FCD = ∠DCB [10] & F,D,B are collinear [04] ⇒ FD:DB = CF:CB [11] +005. F,D,B are collinear [04] & A,E,D are collinear [02] & A,C,F are collinear [05] & E,C,B are collinear [03] (Menelaus)⇒ (FB:DB) * (AC:AE) * (ED:CF) = 1 [12] +006. F,D,B are collinear [04] & A,E,D are collinear [02] & A,C,F are collinear [05] & E,C,B are collinear [03] (Menelaus)⇒ (FD:FB) * (AE:AD) * (CB:EC) = 1 [13] +007. ∠ACD = ∠DCB [01] & CG ⟂ CD [07] (Angle chase)⇒ ∠ACG = ∠GCB [14] +008. ∠ACG = ∠GCB [14] & G,A,B are collinear [06] ⇒ GA:GB = AC:CB [15] +009. FD:DB = AF:AB [09] & FD:DB = CF:CB [11] & (FB:DB) * (AC:AE) * (ED:CF) = 1 [12] & GA:GB = AC:CB [15] (Ratio chase)⇒ (AF:AB) * (DB:FB) * (AE:GA) * (GB:ED) = 1 [16] +010. E,C,B are collinear [03] & ∠ACD = ∠DCB [01] ⇒ ∠ACD = ∠DCE [17] +011. ∠ACD = ∠DCE [17] & A,E,D are collinear [02] ⇒ AD:ED = AC:EC [18] +012. AD:ED = AC:EC [18] & FD:DB = AF:AB [09] & FD:DB = CF:CB [11] & (FB:DB) * (AC:AE) * (ED:CF) = 1 [12] (Ratio chase)⇒ (AF:AB) * (DB:FB) * (AE:AD) * (CB:EC) = 1 [19] +013. (AF:AB) * (DB:FB) * (AE:GA) * (GB:ED) = 1 [16] & (AF:AB) * (DB:FB) * (AE:AD) * (CB:EC) = 1 [19] & (FD:FB) * (AE:AD) * (CB:EC) = 1 [13] ⇒ (DF:FB) * (BG:GA) * (AE:ED) = 1 [20] +014. F,D,B are collinear [04] & G,A,B are collinear [06] & A,E,D are collinear [02] & (DF:FB) * (BG:GA) * (AE:ED) = 1 [20] (Menelaus)⇒ G,E,F are collinear ========================== diff --git a/newpros.txt b/newpros.txt index 976a1c6..24bef8b 100644 --- a/newpros.txt +++ b/newpros.txt @@ -1,6 +1,7 @@ Menelaus_c32 -a b c = triangle a b c; i = incenter i a b c; d = on_line d a i, on_line d b c; e = on_line e b i, on_line e c a; f = on_tline f c c i, on_line f a b ? eqratio30 d b d c e c e a c a c b +a b c = triangle a b c; i = incenter i a b c; d = on_line d a i, on_line d b c; e = on_line e b i, on_line e c a; f = on_tline f c c i, on_line f a b ? coll d e f Menelaus_a a b c = triangle a b c ? eqratio30 a b a c a c b c b c a b example2_1 -a b c = triangle a b c; d = foot d a b c; h = on_line h a d; e = on_line e a c, on_line e b h; f = on_line f a b, on_line f c h; p = on_pline p a b c, on_line p d f; q = on_line q p a, on_line q d e ? cong a p a q \ No newline at end of file +a b c = triangle a b c; d = foot d a b c; h = on_line h a d; e = on_line e a c, on_line e b h; f = on_line f a b, on_line f c h; p = on_pline p a b c, on_line p d f; q = on_line q p a, on_line q d e ? cong a p a q +why_eqangle diff --git a/output_new/Menelaus_c32.txt b/output_new/Menelaus_c32.txt new file mode 100644 index 0000000..4e1bda9 --- /dev/null +++ b/output_new/Menelaus_c32.txt @@ -0,0 +1,33 @@ + +========================== + * From theorem premises: +A B C D E F G : Points +∠DAB = ∠CAD [00] +∠ACD = ∠DCB [01] +A,E,D are collinear [02] +E,C,B are collinear [03] +F,D,B are collinear [04] +A,C,F are collinear [05] +G,A,B are collinear [06] +CG ⟂ CD [07] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. A,C,F are collinear [05] & ∠CAD = ∠DAB [00] ⇒ ∠FAD = ∠DAB [08] +002. ∠FAD = ∠DAB [08] & F,D,B are collinear [04] ⇒ FD:DB = AF:AB [09] +003. A,C,F are collinear [05] & ∠ACD = ∠DCB [01] ⇒ ∠FCD = ∠DCB [10] +004. ∠FCD = ∠DCB [10] & F,D,B are collinear [04] ⇒ FD:DB = CF:CB [11] +005. F,D,B are collinear [04] & A,E,D are collinear [02] & A,C,F are collinear [05] & E,C,B are collinear [03] (Menelaus)⇒ (FB:DB) * (AC:AE) * (ED:CF) = 1 [12] +006. F,D,B are collinear [04] & A,E,D are collinear [02] & A,C,F are collinear [05] & E,C,B are collinear [03] (Menelaus)⇒ (FD:FB) * (AE:AD) * (CB:EC) = 1 [13] +007. ∠ACD = ∠DCB [01] & CG ⟂ CD [07] (Angle chase)⇒ ∠ACG = ∠GCB [14] +008. ∠ACG = ∠GCB [14] & G,A,B are collinear [06] ⇒ GA:GB = AC:CB [15] +009. FD:DB = AF:AB [09] & FD:DB = CF:CB [11] & (FB:DB) * (AC:AE) * (ED:CF) = 1 [12] & GA:GB = AC:CB [15] (Ratio chase)⇒ (AF:AB) * (DB:FB) * (AE:GA) * (GB:ED) = 1 [16] +010. E,C,B are collinear [03] & ∠ACD = ∠DCB [01] ⇒ ∠ACD = ∠DCE [17] +011. ∠ACD = ∠DCE [17] & A,E,D are collinear [02] ⇒ AD:ED = AC:EC [18] +012. AD:ED = AC:EC [18] & FD:DB = AF:AB [09] & FD:DB = CF:CB [11] & (FB:DB) * (AC:AE) * (ED:CF) = 1 [12] (Ratio chase)⇒ (AF:AB) * (DB:FB) * (AE:AD) * (CB:EC) = 1 [19] +013. (AF:AB) * (DB:FB) * (AE:GA) * (GB:ED) = 1 [16] & (AF:AB) * (DB:FB) * (AE:AD) * (CB:EC) = 1 [19] & (FD:FB) * (AE:AD) * (CB:EC) = 1 [13] ⇒ (DF:FB) * (BG:GA) * (AE:ED) = 1 [20] +014. F,D,B are collinear [04] & G,A,B are collinear [06] & A,E,D are collinear [02] & (DF:FB) * (BG:GA) * (AE:ED) = 1 [20] (Menelaus)⇒ G,E,F are collinear +========================== diff --git a/output_new/example2_1.txt b/output_new/example2_1.txt new file mode 100644 index 0000000..d250bc1 --- /dev/null +++ b/output_new/example2_1.txt @@ -0,0 +1,29 @@ + +========================== + * From theorem premises: +A B C D E F G H I : Points +C,B,D are collinear [00] +E,A,D are collinear [01] +C,A,F are collinear [02] +B,E,F are collinear [03] +A,B,G are collinear [04] +C,E,G are collinear [05] +HA ∥ BC [06] +D,G,H are collinear [07] +I,A,H are collinear [08] +I,D,F are collinear [09] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. I,A,H are collinear [08] & C,B,D are collinear [00] & AH ∥ BC [06] ⇒ IA ∥ DC [10] +002. IA ∥ DC [10] & I,D,F are collinear [09] & C,A,F are collinear [02] ⇒ IF:DF = AF:CF [11] +003. IA ∥ DC [10] & I,D,F are collinear [09] & C,A,F are collinear [02] ⇒ IF:DF = IA:CD [12] +004. C,B,D are collinear [00] & AH ∥ BC [06] ⇒ AH ∥ BD [13] +005. AH ∥ BD [13] & A,B,G are collinear [04] & D,G,H are collinear [07] ⇒ AG:BG = AH:BD [14] +006. C,A,F are collinear [02] & E,A,D are collinear [01] & C,B,D are collinear [00] & B,E,F are collinear [03] (Menelaus)⇒ (CF:AF) * (AE:CB) * (BD:ED) = 1 [15] +007. A,B,G are collinear [04] & E,A,D are collinear [01] & C,B,D are collinear [00] & C,E,G are collinear [05] (Menelaus)⇒ (BG:AG) * (AE:CB) * (CD:ED) = 1 [16] +008. IF:DF = AF:CF [11] & IF:DF = IA:CD [12] & AG:BG = AH:BD [14] & (CF:AF) * (AE:CB) * (BD:ED) = 1 [15] & (BG:AG) * (AE:CB) * (CD:ED) = 1 [16] (Ratio chase)⇒ IA = AH +========================== \ No newline at end of file diff --git a/output_new/example2_4.txt b/output_new/example2_4.txt new file mode 100644 index 0000000..caa29d6 --- /dev/null +++ b/output_new/example2_4.txt @@ -0,0 +1,62 @@ + * From theorem premises: +A B C D E F G H I : Points +C,B,D are collinear [00] +CA = DC [01] +EC = ED [02] +EA = EC [03] +FB = FC [04] +C,B,F are collinear [05] +FG = FC [06] +EG = EC [07] +B,G,H are collinear [08] +A,C,H are collinear [09] +A,B,I are collinear [10] +C,G,I are collinear [11] + + * Auxiliary Constructions: +J : Points +J,C,H are collinear [12] +JH = JC [13] + + * Proof steps: +001. FG = FC [06] & FB = FC [04] ⇒ FB = FG [14] +002. FG = FC [06] & FB = FC [04] ⇒ F is the circumcenter of \Delta BGC [15] +003. FB = FG [14] ⇒ ∠FBG = ∠BGF [16] +004. EG = EC [07] & FG = FC [06] ⇒ GC ⟂ EF [17] +005. EG = EC [07] & FG = FC [06] (SSS)⇒ ∠GEF = ∠FEC [18] +006. F is the circumcenter of \Delta BGC [15] & C,B,F are collinear [05] ⇒ BG ⟂ CG [19] +007. C,B,D are collinear [00] & ∠FBG = ∠BGF [16] & C,B,F are collinear [05] & GC ⟂ EF [17] & BG ⟂ CG [19] ⇒ ∠GBD = ∠GFE [20] +008. EC = ED [02] & EA = EC [03] ⇒ EA = ED [21] +009. CD = CA [01] & EA = ED [21] ⇒ AD ⟂ CE [22] +010. CD = CA [01] & EA = ED [21] (SSS)⇒ ∠ACE = ∠ECD [23] +011. C,B,F are collinear [05] & FB = FC [04] ⇒ F is midpoint of CB [24] +012. J,C,H are collinear [12] & JH = JC [13] ⇒ J is midpoint of CH [25] +013. F is midpoint of CB [24] & J is midpoint of CH [25] ⇒ FJ ∥ BH [26] +014. BG ⟂ CG [19] & AD ⟂ CE [22] & FJ ∥ BH [26] & B,G,H are collinear [08] ⇒ ∠(CE-AD) = ∠(JF-CG) [27] +015. EC = ED [02] & EG = EC [07] & EA = EC [03] ⇒ A,C,G,D are concyclic [28] +016. A,C,G,D are concyclic [28] ⇒ ∠CAD = ∠CGD [29] +017. A,C,G,D are concyclic [28] ⇒ ∠AGC = ∠ADC [30] +018. CD = CA [01] ⇒ ∠CAD = ∠ADC [31] +019. ∠CAD = ∠CGD [29] & ∠CAD = ∠ADC [31] & C,B,D are collinear [00] ⇒ ∠(AD-CB) = ∠CGD [32] +020. ∠(CE-AD) = ∠(JF-CG) [27] & ∠(AD-CB) = ∠CGD [32] ⇒ ∠(CE-FJ) = ∠(BC-DG) [33] +021. C,B,D are collinear [00] & ∠GEF = ∠FEC [18] & GC ⟂ EF [17] & BG ⟂ CG [19] & ∠(CE-FJ) = ∠(BC-DG) [33] & FJ ∥ BH [26] & B,G,H are collinear [08] ⇒ ∠GDB = ∠GEF [34] +022. ∠GBD = ∠GFE [20] & ∠GDB = ∠GEF [34] (Similar Triangles)⇒ BG:FG = BD:FE [35] +023. BG:FG = BD:FE [35] & FG = FC [06] & BF = CF [04] ⇒ EF:BD = BF:BG [36] +024. J,C,H are collinear [12] & A,C,H are collinear [09] & C,B,F are collinear [05] & ∠ACE = ∠ECD [23] & C,B,D are collinear [00] ⇒ ∠JCE = ∠ECF [37] +025. GC ⟂ EF [17] & BG ⟂ CG [19] & FJ ∥ BH [26] & B,G,H are collinear [08] ⇒ FJ ∥ FE [38] +026. FJ ∥ FE [38] ⇒ J,E,F are collinear [39] +027. ∠JCE = ∠ECF [37] & J,E,F are collinear [39] ⇒ JE:EF = JC:CF [40] +028. B,G,H are collinear [08] & CG ⟂ BG [19] ⇒ CG ⟂ GH [41] +029. CG ⟂ GH [41] & J is midpoint of CH [25] ⇒ CJ = GJ [42] +030. JE:EF = JC:CF [40] & JG = JC [42] & BF = CF [04] ⇒ JE:EF = JG:BF [43] +031. J,C,H are collinear [12] & A,C,H are collinear [09] & ∠AGC = ∠ADC [30] & C,B,D are collinear [00] & ∠CAD = ∠ADC [31] ⇒ ∠DAJ = ∠CGA [44] +032. ∠(CE-AD) = ∠(JF-CG) [27] & ∠DAJ = ∠CGA [44] ⇒ ∠(CE-AJ) = ∠(JF-AG) [45] +033. J,E,F are collinear [39] & A,C,H are collinear [09] & ∠(CE-AJ) = ∠(JF-AG) [45] & J,C,H are collinear [12] & FJ ∥ BH [26] & B,G,H are collinear [08] & ∠GEF = ∠FEC [18] & GC ⟂ EF [17] & BG ⟂ CG [19] ⇒ ∠GEJ = ∠GAH [46] +034. C,B,F are collinear [05] & ∠FBG = ∠BGF [16] & FJ ∥ BH [26] & B,G,H are collinear [08] ⇒ ∠GFJ = ∠JFC [47] +035. FG = FC [06] & ∠GFJ = ∠JFC [47] (SAS)⇒ ∠GJF = ∠FJC [48] +036. J,E,F are collinear [39] & B,G,H are collinear [08] & A,C,H are collinear [09] & ∠GJF = ∠FJC [48] & J,C,H are collinear [12] & GC ⟂ EF [17] & BG ⟂ CG [19] ⇒ ∠GJE = ∠GHA [49] +037. ∠GEJ = ∠GAH [46] & ∠GJE = ∠GHA [49] (Similar Triangles)⇒ JG:HG = JE:HA [50] +038. JE:EF = JG:BF [43] & JG:GH = JE:AH [50] ⇒ BF:GH = EF:AH [51] +039. EF:BD = BF:BG [36] & EF:AH = BF:GH [51] ⇒ HG:GB = AH:BD [52] +040. CA = DC [01] & HG:GB = AH:BD [52] ⇒ (HG:GB) * (BD:DC) * (CA:AH) = 1 [53] +041. B,G,H are collinear [08] & C,B,D are collinear [00] & A,C,H are collinear [09] & A,B,I are collinear [10] & C,G,I are collinear [11] & (HG:GB) * (BD:DC) * (CA:AH) = 1 [53] ⇒ I,H,D are collinear \ No newline at end of file diff --git a/problem.py b/problem.py index 0023660..ce2073a 100644 --- a/problem.py +++ b/problem.py @@ -517,14 +517,14 @@ def why_eqratio( def why_eqratio30( l1: gm.Length, l2: gm.Length, - lp46: gm.Length_Pro, lp35: gm.Length_Pro, + lp46: gm.Length_Pro, level: int, ) -> list[Dependency]: """Why two ratios are equal, returns a Dependency objects.""" all12 = list(gm.all_ratios(l1, l2, level)) all43 = list(gm.all_ratios2(lp46, lp35, level)) - + print(all12,all43) min_why = None for rat12, l1s, l2s in all12: for ratp43, lp4s, lp3s in all43: @@ -532,7 +532,7 @@ def why_eqratio30( if why0 is None: continue l1_, l2_ = rat12._l - lp46_, lp35_ = ratp43._l + lp46_, lp35_ = ratp43._lp why1 = gm.bfs_backtrack(l1, [l1_], l1s) why2 = gm.bfs_backtrack(l2, [l2_], l2s) why3 = gm.bfs_backtrack(lp35, [lp35_], lp3s) @@ -546,7 +546,7 @@ def why_eqratio30( _, rat12, ratp43, why0, why1, why2, why3, why4 = min_why l1_, l2_ = rat12._l - lp46_, lp35_ = ratp43._l + lp46_, lp35_ = ratp43._lp if l1 == l1_ and l2 == l2_ and lp35 == lp35_ and lp46 == lp46_: return why0 diff --git a/trace_back.py b/trace_back.py index 2543918..06eb5f5 100644 --- a/trace_back.py +++ b/trace_back.py @@ -279,7 +279,9 @@ def get_logs( set[gm.Point], ]: """Given a DAG and conclusion N, return the premise, aux, proof.""" + print(query.hashed()) query = query.why_me_or_cache(g, query.level) + print(query) log = recursive_traceback(query) log, setup, aux_setup, setup_points, _ = separate_dependency_difference( query, log From bc481d52c9b401bb41c2b08801655a39331de1d7 Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.cn> Date: Fri, 28 Mar 2025 21:52:01 +0800 Subject: [PATCH 22/27] easy_menelaus --- chiaya.sh | 2 +- graph.py | 7 +++ kirine.txt | 48 ++++++++++--------- newpros.txt | 11 +++-- nothing.txt | 1 - output_new/menelaus_a2.txt | 39 +++++++++++++++ output_new/menelaus_c22w.txt | 34 +++++++++++++ output_new/menelaus_c3.txt | 42 ++++++++++++++++ .../{Menelaus_c32.txt => menelaus_c32.txt} | 0 9 files changed, 156 insertions(+), 28 deletions(-) create mode 100644 output_new/menelaus_a2.txt create mode 100644 output_new/menelaus_c22w.txt create mode 100644 output_new/menelaus_c3.txt rename output_new/{Menelaus_c32.txt => menelaus_c32.txt} (100%) diff --git a/chiaya.sh b/chiaya.sh index e84daa5..9077bf9 100644 --- a/chiaya.sh +++ b/chiaya.sh @@ -42,7 +42,7 @@ SERIES=Menelaus_a python -m alphageometry \ --alsologtostderr \ --problems_file=$(pwd)/$INPUT_FILE \ ---problem_name=example2_1 \ +--problem_name=Menelaus_c22 \ --mode=alphageometry \ "${DDAR_ARGS[@]}" \ "${SEARCH_ARGS[@]}" \ diff --git a/graph.py b/graph.py index 6705d54..a9950ca 100644 --- a/graph.py +++ b/graph.py @@ -652,10 +652,13 @@ def build_problem( g.plevel = plevel except (nm.InvalidLineIntersectError, nm.InvalidQuadSolveError): + print("InvalidError") continue except DepCheckFailError: + print("CheckFailError") continue except (PointTooCloseError, PointTooFarError): + print("PointError") continue if not pr.goal: @@ -2727,6 +2730,7 @@ def _add_eqratio30( z, w = lzw._obj.points is_eq1 = self.is_equal(ab_cd, pqzw_mnxy) + #is_eq1 = self.is_equal(ab_cd, mnxy_pqzw) deps1 = None if deps: deps1 = deps.populate('eqratio30', [a, b, c, d, m, n, p, q, x, y, z, w]) @@ -2735,8 +2739,10 @@ def _add_eqratio30( add += [deps1] self.cache_dep('eqratio30', [a, b, c, d, m, n, p, q, x, y, z, w], deps1) self.make_equal(ab_cd, pqzw_mnxy, deps=deps1) + #self.make_equal(ab_cd, mnxy_pqzw, deps=deps1) is_eq2 = self.is_equal(cd_ab, mnxy_pqzw) + #is_eq2 = self.is_equal(cd_ab, pqzw_mnxy) deps2 = None if deps: deps2 = deps.populate('eqratio30', [c, d, a, b, p, q, m, n, z, w, x, y]) @@ -2745,6 +2751,7 @@ def _add_eqratio30( add += [deps2] self.cache_dep('eqratio30', [c, d, a, b, p, q, m, n, z, w, x, y], deps2) self.make_equal(cd_ab, mnxy_pqzw, deps=deps2) + #self.make_equal(cd_ab, pqzw_mnxy, deps=deps2) return add def add_eqratio30( diff --git a/kirine.txt b/kirine.txt index 4e1bda9..07a6779 100644 --- a/kirine.txt +++ b/kirine.txt @@ -1,33 +1,35 @@ ========================== * From theorem premises: -A B C D E F G : Points -∠DAB = ∠CAD [00] -∠ACD = ∠DCB [01] -A,E,D are collinear [02] -E,C,B are collinear [03] -F,D,B are collinear [04] -A,C,F are collinear [05] -G,A,B are collinear [06] -CG ⟂ CD [07] +A B C D E F G H I : Points +B,D,C are collinear [00] +A,C,E are collinear [01] +F,D,E are collinear [02] +DE = DF [03] +F,B,G are collinear [04] +A,D,G are collinear [05] +E,D,H are collinear [06] +B,A,H are collinear [07] +D,E,I are collinear [08] +I,C,G are collinear [09] * Auxiliary Constructions: : Points * Proof steps: -001. A,C,F are collinear [05] & ∠CAD = ∠DAB [00] ⇒ ∠FAD = ∠DAB [08] -002. ∠FAD = ∠DAB [08] & F,D,B are collinear [04] ⇒ FD:DB = AF:AB [09] -003. A,C,F are collinear [05] & ∠ACD = ∠DCB [01] ⇒ ∠FCD = ∠DCB [10] -004. ∠FCD = ∠DCB [10] & F,D,B are collinear [04] ⇒ FD:DB = CF:CB [11] -005. F,D,B are collinear [04] & A,E,D are collinear [02] & A,C,F are collinear [05] & E,C,B are collinear [03] (Menelaus)⇒ (FB:DB) * (AC:AE) * (ED:CF) = 1 [12] -006. F,D,B are collinear [04] & A,E,D are collinear [02] & A,C,F are collinear [05] & E,C,B are collinear [03] (Menelaus)⇒ (FD:FB) * (AE:AD) * (CB:EC) = 1 [13] -007. ∠ACD = ∠DCB [01] & CG ⟂ CD [07] (Angle chase)⇒ ∠ACG = ∠GCB [14] -008. ∠ACG = ∠GCB [14] & G,A,B are collinear [06] ⇒ GA:GB = AC:CB [15] -009. FD:DB = AF:AB [09] & FD:DB = CF:CB [11] & (FB:DB) * (AC:AE) * (ED:CF) = 1 [12] & GA:GB = AC:CB [15] (Ratio chase)⇒ (AF:AB) * (DB:FB) * (AE:GA) * (GB:ED) = 1 [16] -010. E,C,B are collinear [03] & ∠ACD = ∠DCB [01] ⇒ ∠ACD = ∠DCE [17] -011. ∠ACD = ∠DCE [17] & A,E,D are collinear [02] ⇒ AD:ED = AC:EC [18] -012. AD:ED = AC:EC [18] & FD:DB = AF:AB [09] & FD:DB = CF:CB [11] & (FB:DB) * (AC:AE) * (ED:CF) = 1 [12] (Ratio chase)⇒ (AF:AB) * (DB:FB) * (AE:AD) * (CB:EC) = 1 [19] -013. (AF:AB) * (DB:FB) * (AE:GA) * (GB:ED) = 1 [16] & (AF:AB) * (DB:FB) * (AE:AD) * (CB:EC) = 1 [19] & (FD:FB) * (AE:AD) * (CB:EC) = 1 [13] ⇒ (DF:FB) * (BG:GA) * (AE:ED) = 1 [20] -014. F,D,B are collinear [04] & G,A,B are collinear [06] & A,E,D are collinear [02] & (DF:FB) * (BG:GA) * (AE:ED) = 1 [20] (Menelaus)⇒ G,E,F are collinear +001. E,D,H are collinear [06] & F,D,E are collinear [02] ⇒ F,H,D are collinear [10] +002. F,B,G are collinear [04] & F,H,D are collinear [10] & A,D,G are collinear [05] & B,A,H are collinear [07] (Menelaus)⇒ (DH:FH) * (AG:AD) * (FB:BG) = 1 [11] +003. D,H,E are collinear [06] & B,D,C are collinear [00] & A,C,E are collinear [01] & B,A,H are collinear [07] (Menelaus)⇒ (HE:DH) * (AC:AE) * (BD:BC) = 1 [12] +004. D,E,I are collinear [08] & F,D,E are collinear [02] ⇒ D,I,F are collinear [13] +005. F,B,G are collinear [04] & B,D,C are collinear [00] & D,I,F are collinear [13] & I,C,G are collinear [09] (Menelaus)⇒ (FG:BG) * (BC:DC) * (DI:FI) = 1 [14] +006. F,B,G are collinear [04] & B,D,C are collinear [00] & D,I,F are collinear [13] & I,C,G are collinear [09] (Menelaus)⇒ (IG:CG) * (BC:BD) * (FD:FI) = 1 [15] +007. F,B,G are collinear [04] & B,D,C are collinear [00] & D,I,F are collinear [13] & I,C,G are collinear [09] (Menelaus)⇒ (IG:CI) * (FB:BD) * (DC:FG) = 1 [16] +008. A,D,G are collinear [05] & A,C,E are collinear [01] & D,E,I are collinear [08] & I,C,G are collinear [09] (Menelaus)⇒ (DG:AG) * (AC:CE) * (EI:DI) = 1 [17] +009. A,D,G are collinear [05] & A,C,E are collinear [01] & D,E,I are collinear [08] & I,C,G are collinear [09] (Menelaus)⇒ (IG:GC) * (CA:AE) * (ED:DI) = 1 [18] +010. A,D,G are collinear [05] & A,C,E are collinear [01] & D,E,I are collinear [08] & I,C,G are collinear [09] (Menelaus)⇒ (IG:CI) * (AD:AE) * (CE:DG) = 1 [19] +011. (IG:GC) * (CA:AE) * (ED:DI) = 1 [18] & DE = DF [03] ⇒ (IG:CG) * (AC:AE) * (FD:DI) = 1 [20] +012. (HE:DH) * (AC:AE) * (BD:BC) = 1 [12] & (FG:BG) * (BC:DC) * (DI:FI) = 1 [14] & (IG:CG) * (BC:BD) * (FD:FI) = 1 [15] & (IG:CI) * (FB:BD) * (DC:FG) = 1 [16] & (DG:AG) * (AC:CE) * (EI:DI) = 1 [17] & (IG:CG) * (AC:AE) * (FD:DI) = 1 [20] & (IG:CI) * (AD:AE) * (CE:DG) = 1 [19] (Ratio chase)⇒ (AD:AG) * (BG:FB) * (HE:DH) * (EI:FI) = 1 [21] +013. (HE:DH) * (AC:AE) * (BD:BC) = 1 [12] & (IG:CG) * (BC:BD) * (FD:FI) = 1 [15] & (DG:AG) * (AC:CE) * (EI:DI) = 1 [17] & (IG:CG) * (AC:AE) * (FD:DI) = 1 [20] (Ratio chase)⇒ (AC:AG) * (DG:CE) * (HE:DH) * (EI:FI) = 1 [22] +014. (DH:FH) * (AG:AD) * (FB:BG) = 1 [11] & (AD:AG) * (BG:FB) * (HE:DH) * (EI:FI) = 1 [21] & (AC:AG) * (DG:CE) * (HE:DH) * (EI:FI) = 1 [22] & (DI:EI) * (AG:AC) * (CE:DG) = 1 [17] ⇒ DI:EI = DH:FH ========================== diff --git a/newpros.txt b/newpros.txt index 24bef8b..87f185a 100644 --- a/newpros.txt +++ b/newpros.txt @@ -1,7 +1,12 @@ Menelaus_c32 a b c = triangle a b c; i = incenter i a b c; d = on_line d a i, on_line d b c; e = on_line e b i, on_line e c a; f = on_tline f c c i, on_line f a b ? coll d e f -Menelaus_a -a b c = triangle a b c ? eqratio30 a b a c a c b c b c a b example2_1 a b c = triangle a b c; d = foot d a b c; h = on_line h a d; e = on_line e a c, on_line e b h; f = on_line f a b, on_line f c h; p = on_pline p a b c, on_line p d f; q = on_line q p a, on_line q d e ? cong a p a q -why_eqangle +tangent +a b c = triangle a b c; o = circle o a b c; p = on_tline p a o a, on_line p b c ? eqratio30 a b a c a b a c p c p b +Menelaus_a2 +a b c = triangle a b c; o = circle o a b c; p = on_line p b c, on_tline p a o a; q = on_line q a c, on_tline q b o b; r = on_line r a b, on_tline r c o c ? coll p q r +Menelaus_c3 +a b = segment a b; c = on_tline c b a b, on_circle c b a; d = midpoint d b c; e = foot e b a d; f = on_line f b e, on_line f a c; g = midpoint g a f ? cong a g c f +Menelaus_c22 +a b c = triangle a b c; d = on_line d b c; f = on_line f a c; e = mirror e f d; p = on_line p a d, on_line p b e; m = on_line m a b, on_line m d f; n = on_line n p c, on_line n d f ? eqratio d n f n d m e m \ No newline at end of file diff --git a/nothing.txt b/nothing.txt index 14e4b86..255f81a 100644 --- a/nothing.txt +++ b/nothing.txt @@ -734,7 +734,6 @@ I,D,F are collinear [09] 008. IF:DF = AF:CF [11] & IF:DF = IA:CD [12] & AG:BG = AH:BD [14] & (CF:AF) * (AE:CB) * (BD:ED) = 1 [15] & (BG:AG) * (AE:CB) * (CD:ED) = 1 [16] (Ratio chase)⇒ IA = AH ========================== - Menelaus_a2 a b c = triangle a b c; o = circle o a b c; p = on_line p b c, on_tline p a o a; q = on_line q a c, on_tline q b o b; r = on_line r a b, on_tline r c o c ? coll p q r Menelaus_a7 diff --git a/output_new/menelaus_a2.txt b/output_new/menelaus_a2.txt new file mode 100644 index 0000000..0557f02 --- /dev/null +++ b/output_new/menelaus_a2.txt @@ -0,0 +1,39 @@ + +========================== + * From theorem premises: +A B C D E F G : Points +DA = DB [00] +DB = DC [01] +C,E,B are collinear [02] +AE ⟂ AD [03] +A,C,F are collinear [04] +BF ⟂ BD [05] +A,G,B are collinear [06] +CG ⟂ CD [07] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. DA = DB [00] & DB = DC [01] ⇒ D is the circumcenter of \Delta BAC [08] +002. D is the circumcenter of \Delta BAC [08] & BF ⟂ BD [05] & A,C,F are collinear [04] (Circle Power)⇒ FB:AF = CF:FB [09] +003. D is the circumcenter of \Delta BAC [08] & AE ⟂ AD [03] & C,E,B are collinear [02] (Circle Power)⇒ AE:EB = CE:AE [10] +004. D is the circumcenter of \Delta BAC [08] & CG ⟂ CD [07] & A,G,B are collinear [06] (Circle Power)⇒ CG:GB = AG:CG [11] +005. D is the circumcenter of \Delta BAC [08] & BF ⟂ BD [05] ⇒ ∠FBA = ∠BCA [12] +006. D is the circumcenter of \Delta BAC [08] & BF ⟂ BD [05] ⇒ ∠CBF = ∠CAB [13] +007. A,C,F are collinear [04] & ∠FBA = ∠BCA [12] ⇒ ∠FBA = ∠BCF [14] +008. A,F,C are collinear [04] & ∠CAB = ∠CBF [13] ⇒ ∠FAB = ∠CBF [15] +009. ∠FBA = ∠BCF [14] & ∠FAB = ∠CBF [15] (Similar Triangles)⇒ FB:AB = CF:CB [16] +010. D is the circumcenter of \Delta BAC [08] & AE ⟂ AD [03] ⇒ ∠BAE = ∠BCA [17] +011. C,E,B are collinear [02] & ∠BAE = ∠BCA [17] ⇒ ∠BAE = ∠ECA [18] +012. C,E,B are collinear [02] ⇒ ∠BEA = ∠CEA [19] +013. ∠BAE = ∠ECA [18] & ∠BEA = ∠CEA [19] (Similar Triangles)⇒ AB:EB = AC:AE [20] +014. D is the circumcenter of \Delta BAC [08] & CG ⟂ CD [07] ⇒ ∠BCG = ∠BAC [21] +015. D is the circumcenter of \Delta BAC [08] & CG ⟂ CD [07] ⇒ ∠GCA = ∠CBA [22] +016. A,G,B are collinear [06] & ∠BAC = ∠BCG [21] ⇒ ∠GAC = ∠BCG [23] +017. A,G,B are collinear [06] & ∠GCA = ∠CBA [22] ⇒ ∠GCA = ∠CBG [24] +018. ∠GAC = ∠BCG [23] & ∠GCA = ∠CBG [24] (Similar Triangles)⇒ AG:AC = CG:CB [25] +019. FB:AF = CF:FB [09] & AE:EB = CE:AE [10] & CG:GB = AG:CG [11] & FB:AB = CF:CB [16] & AB:EB = AC:AE [20] & AG:AC = CG:CB [25] (Ratio chase)⇒ (GB:AG) * (AF:EB) * (CE:CF) = 1 [26] +020. A,G,B are collinear [06] & C,E,B are collinear [02] & A,C,F are collinear [04] & (GB:AG) * (AF:EB) * (CE:CF) = 1 [26] (Menelaus)⇒ F,G,E are collinear +========================== diff --git a/output_new/menelaus_c22w.txt b/output_new/menelaus_c22w.txt new file mode 100644 index 0000000..0351113 --- /dev/null +++ b/output_new/menelaus_c22w.txt @@ -0,0 +1,34 @@ +========================== + * From theorem premises: +A B C D E F G H I : Points +B,D,C are collinear [00] +A,C,E are collinear [01] +F,D,E are collinear [02] +DE = DF [03] +F,B,G are collinear [04] +A,D,G are collinear [05] +E,D,H are collinear [06] +B,A,H are collinear [07] +D,E,I are collinear [08] +I,C,G are collinear [09] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. E,D,H are collinear [06] & F,D,E are collinear [02] ⇒ F,H,D are collinear [10] +002. F,B,G are collinear [04] & F,H,D are collinear [10] & A,D,G are collinear [05] & B,A,H are collinear [07] (Menelaus)⇒ (DH:FH) * (AG:AD) * (FB:BG) = 1 [11] +003. D,H,E are collinear [06] & B,D,C are collinear [00] & A,C,E are collinear [01] & B,A,H are collinear [07] (Menelaus)⇒ (HE:DH) * (AC:AE) * (BD:BC) = 1 [12] +004. D,E,I are collinear [08] & F,D,E are collinear [02] ⇒ D,I,F are collinear [13] +005. F,B,G are collinear [04] & B,D,C are collinear [00] & D,I,F are collinear [13] & I,C,G are collinear [09] (Menelaus)⇒ (FG:BG) * (BC:DC) * (DI:FI) = 1 [14] +006. F,B,G are collinear [04] & B,D,C are collinear [00] & D,I,F are collinear [13] & I,C,G are collinear [09] (Menelaus)⇒ (IG:CG) * (BC:BD) * (FD:FI) = 1 [15] +007. F,B,G are collinear [04] & B,D,C are collinear [00] & D,I,F are collinear [13] & I,C,G are collinear [09] (Menelaus)⇒ (IG:CI) * (FB:BD) * (DC:FG) = 1 [16] +008. A,D,G are collinear [05] & A,C,E are collinear [01] & D,E,I are collinear [08] & I,C,G are collinear [09] (Menelaus)⇒ (DG:AG) * (AC:CE) * (EI:DI) = 1 [17] +009. A,D,G are collinear [05] & A,C,E are collinear [01] & D,E,I are collinear [08] & I,C,G are collinear [09] (Menelaus)⇒ (IG:GC) * (CA:AE) * (ED:DI) = 1 [18] +010. A,D,G are collinear [05] & A,C,E are collinear [01] & D,E,I are collinear [08] & I,C,G are collinear [09] (Menelaus)⇒ (IG:CI) * (AD:AE) * (CE:DG) = 1 [19] +011. (IG:GC) * (CA:AE) * (ED:DI) = 1 [18] & DE = DF [03] ⇒ (IG:CG) * (AC:AE) * (FD:DI) = 1 [20] +012. (HE:DH) * (AC:AE) * (BD:BC) = 1 [12] & (FG:BG) * (BC:DC) * (DI:FI) = 1 [14] & (IG:CG) * (BC:BD) * (FD:FI) = 1 [15] & (IG:CI) * (FB:BD) * (DC:FG) = 1 [16] & (DG:AG) * (AC:CE) * (EI:DI) = 1 [17] & (IG:CG) * (AC:AE) * (FD:DI) = 1 [20] & (IG:CI) * (AD:AE) * (CE:DG) = 1 [19] (Ratio chase)⇒ (AD:AG) * (BG:FB) * (HE:DH) * (EI:FI) = 1 [21] +013. (HE:DH) * (AC:AE) * (BD:BC) = 1 [12] & (IG:CG) * (BC:BD) * (FD:FI) = 1 [15] & (DG:AG) * (AC:CE) * (EI:DI) = 1 [17] & (IG:CG) * (AC:AE) * (FD:DI) = 1 [20] (Ratio chase)⇒ (AC:AG) * (DG:CE) * (HE:DH) * (EI:FI) = 1 [22] +014. (DH:FH) * (AG:AD) * (FB:BG) = 1 [11] & (AD:AG) * (BG:FB) * (HE:DH) * (EI:FI) = 1 [21] & (AC:AG) * (DG:CE) * (HE:DH) * (EI:FI) = 1 [22] & (DI:EI) * (AG:AC) * (CE:DG) = 1 [17] ⇒ DI:EI = DH:FH +========================== \ No newline at end of file diff --git a/output_new/menelaus_c3.txt b/output_new/menelaus_c3.txt new file mode 100644 index 0000000..8921e73 --- /dev/null +++ b/output_new/menelaus_c3.txt @@ -0,0 +1,42 @@ +========================== + * From theorem premises: +A B C D E F G : Points +BC = BA [00] +BC ⟂ AB [01] +D,B,C are collinear [02] +DB = DC [03] +E,D,A are collinear [04] +BE ⟂ AD [05] +F,C,A are collinear [06] +E,B,F are collinear [07] +F,A,G are collinear [08] +GA = GF [09] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. F,C,A are collinear [06] & D,B,C are collinear [02] & E,D,A are collinear [04] & E,B,F are collinear [07] (Menelaus)⇒ (AF:FC) * (CB:BD) * (DE:EA) = 1 [10] +002. (AF:FC) * (CB:BD) * (DE:EA) = 1 [10] & BC = BA [00] & DB = DC [03] ⇒ (FC:FA) * (EA:BA) * (DC:ED) = 1 [11] +003. D,B,C are collinear [02] & E,D,A are collinear [04] & BE ⟂ AD [05] & BC ⟂ AB [01] ⇒ ∠ABD = ∠DEB [12] +004. D,B,C are collinear [02] & E,D,A are collinear [04] ⇒ ∠ADB = ∠EDB [13] +005. ∠ABD = ∠DEB [12] & ∠ADB = ∠EDB [13] (Similar Triangles)⇒ BA:BD = EB:ED [14] +006. ∠ABD = ∠DEB [12] & ∠ADB = ∠EDB [13] (Similar Triangles)⇒ AB:AD = BE:BD [15] +007. BA:BD = EB:ED [14] & DB = DC [03] ⇒ BA:DC = EB:ED [16] +008. D,B,C are collinear [02] & BC ⟂ AB [01] ⇒ DB ⟂ BA [17] +009. DB ⟂ BA [17] & BE ⟂ AD [05] & E,D,A are collinear [04] ⇒ BA:EA = DA:BA [18] +010. BA:DC = EB:ED [16] & BA:EA = DA:BA [18] (Ratio chase)⇒ (DA:BA) * (EB:ED) * (EA:BA) * (DC:BA) = 1 [19] +011. AB:AD = BE:BD [15] & DB = DC [03] ⇒ BA:DA = EB:DC [20] +012. DB = DC [03] & BA:DA = EB:DC [20] & (FA:FC) * (BA:EA) * (ED:DC) = 1 [11] (Ratio chase)⇒ (DA:FA) * (EB:ED) * (EA:BA) * (FC:BA) = 1 [21] +013. D,B,C are collinear [02] & DB = DC [03] ⇒ D is midpoint of BC [22] +014. G,F,A are collinear [08] & GA = GF [09] ⇒ G is midpoint of FA [23] +015. D is midpoint of BC [22] & G is midpoint of FA [23] ⇒ DB:BC = GF:FA [24] +016. E,B,F are collinear [07] & E,D,A are collinear [04] & BE ⟂ AD [05] ⇒ FE ⟂ EA [25] +017. FE ⟂ EA [25] & G is midpoint of FA [23] ⇒ FG = EG [26] +018. FE ⟂ EA [25] & G is midpoint of FA [23] ⇒ AG = EG [27] +019. (FC:FA) * (EA:BA) * (DC:ED) = 1 [11] & (DA:BA) * (EB:ED) * (EA:BA) * (DC:BA) = 1 [19] & (DA:FA) * (EB:ED) * (EA:BA) * (FC:BA) = 1 [21] & DB:BC = GF:FA [24] & DB = DC [03] & BC = BA [00] & EG = FG [26] ⇒ EG:FA = FC:FA [28] +020. BC = BA [00] ⇒ FA:BC = FA:BC [29] +021. EG:FA = FC:FA [28] & FA:BC = FA:BC [29] ⇒ EG = FC [30] +022. EG = FC [30] & AG = EG [27] ⇒ AG = CF +========================== \ No newline at end of file diff --git a/output_new/Menelaus_c32.txt b/output_new/menelaus_c32.txt similarity index 100% rename from output_new/Menelaus_c32.txt rename to output_new/menelaus_c32.txt From 698c348a25bd0bea27795d08b1370a6e654da5f9 Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.cn> Date: Sat, 29 Mar 2025 19:16:44 +0800 Subject: [PATCH 23/27] desargues_pappus --- chiaya.sh | 6 ++-- dd.py | 31 +++++++++++++++-- graph.py | 3 +- kirine.txt | 65 +++++++++++++++++++++--------------- newpros.txt | 20 ++++++++++- nothing.txt | 4 +++ output_new/Desargues.txt | 26 +++++++++++++++ output_new/Pappus.txt | 48 ++++++++++++++++++++++++++ output_new/menelaus_b15w.txt | 48 ++++++++++++++++++++++++++ output_new/menelaus_b6.txt | 42 +++++++++++++++++++++++ output_new/menelaus_c22.txt | 37 ++++++++++++++++++++ problem.py | 2 +- rules.txt | 3 +- test.py | 9 ++--- 14 files changed, 304 insertions(+), 40 deletions(-) create mode 100644 output_new/Desargues.txt create mode 100644 output_new/Pappus.txt create mode 100644 output_new/menelaus_b15w.txt create mode 100644 output_new/menelaus_b6.txt create mode 100644 output_new/menelaus_c22.txt diff --git a/chiaya.sh b/chiaya.sh index 9077bf9..af59baa 100644 --- a/chiaya.sh +++ b/chiaya.sh @@ -11,8 +11,8 @@ DDAR_ARGS=( SIZE=4 -BATCH_SIZE=2 -BEAM_SIZE=2 +BATCH_SIZE=8 +BEAM_SIZE=16 DEPTH=2 SEARCH_ARGS=( @@ -42,7 +42,7 @@ SERIES=Menelaus_a python -m alphageometry \ --alsologtostderr \ --problems_file=$(pwd)/$INPUT_FILE \ ---problem_name=Menelaus_c22 \ +--problem_name=Menelaus_b15 \ --mode=alphageometry \ "${DDAR_ARGS[@]}" \ "${SEARCH_ARGS[@]}" \ diff --git a/dd.py b/dd.py index 69249cc..757b09a 100644 --- a/dd.py +++ b/dd.py @@ -1112,12 +1112,38 @@ def match_ceva_rev( tb = time.time() #print(tb-ta) +def match_eqratio6_coll_coll_eqratio( + g: gh.Graph, + g_matcher: Callable[str, list[tuple[gm.Point, ...]]], + theorem: pr.Theorem, +) -> Generator[dict[str, gm.Point], None, None]: + """Match eqratio6 B A B C Q P Q R, coll A B C, coll P Q R => eqratio B A A C Q P P R""" + """Avoid harmonic""" + enums = g_matcher('eqratio6') + + record = set() + for b, a, b, c, q, p, q, r in enums: # pylint: disable=redeclared-assigned-name,unused-variable + if (a, b, c) == (p, q, r): + continue + if any([x in record for x in rotate_simtri(a, b, c, p, q, r)]): + continue + if not (g.check_coll([a, b, c]) and g.check_coll([p, q, r])): + continue + if not (g.check_onseg([b, a, c]) == g.check_onseg([q, p, r])): # Avoid harmonic + continue + + record.add((a, b, c, p, q, r)) + debugname([a, b, c, p, q, r]) + yield dict(zip('ABCPQR', [a, b, c, p, q, r])) + yield dict(zip('ABCPQR', [c, b, a, r, q, p])) + def rotate_simtri( a: gm.Point, b: gm.Point, c: gm.Point, x: gm.Point, y: gm.Point, z: gm.Point ) -> Generator[tuple[gm.Point, ...], None, None]: """Rotate points around for similar triangle predicates.""" - yield (z, y, x, c, b, a) + #yield (z, y, x, c, b, a) for p in [ + (a, b, c, x, y, z), (b, c, a, y, z, x), (c, a, b, z, x, y), (x, y, z, a, b, c), @@ -1690,6 +1716,7 @@ def match_test( 'coll_coll_coll_coll_coll_coll_eqratio30': match_ceva, 'coll_coll_coll_eqratio30_coll': match_menelaus_rev, 'coll_coll_coll_coll_coll_eqratio30_coll': match_ceva_rev, + 'eqratio6_coll_coll_eqratio': match_eqratio6_coll_coll_eqratio, #'circle_perp_coll_eqratio': match_generic_debug, #'cyclic_cyclic_cong': match_test, } @@ -1849,8 +1876,6 @@ def bfs_one_level( hash_conclusion = pr.hashed(name, args) if hash_conclusion in g.cache: continue - if name == 'cyclic': - print(theorem.name,mp,args) add = g.add_piece(name, args, deps=deps) added += add diff --git a/graph.py b/graph.py index a9950ca..17cc245 100644 --- a/graph.py +++ b/graph.py @@ -1480,6 +1480,7 @@ def add_perp( self.connect_val(cd, deps=None) if ab.val == cd.val: + return [] raise ValueError(f'{ab.name} and {cd.name} Cannot be perp.') args = [a, b, c, d] @@ -1719,7 +1720,7 @@ def add_cyclic( """Add a new cyclic predicate that 4 points are concyclic.""" points = list(set(points)) og_points = list(points) - print([p.name for p in points]) + #print([p.name for p in points]) all_circles = [] for p1, p2, p3 in utils.comb3(points): diff --git a/kirine.txt b/kirine.txt index 07a6779..710d39d 100644 --- a/kirine.txt +++ b/kirine.txt @@ -2,34 +2,47 @@ ========================== * From theorem premises: A B C D E F G H I : Points -B,D,C are collinear [00] -A,C,E are collinear [01] -F,D,E are collinear [02] -DE = DF [03] -F,B,G are collinear [04] -A,D,G are collinear [05] -E,D,H are collinear [06] -B,A,H are collinear [07] -D,E,I are collinear [08] -I,C,G are collinear [09] +A,E,C are collinear [00] +D,B,F are collinear [01] +A,G,B are collinear [02] +G,D,E are collinear [03] +H,B,C are collinear [04] +E,H,F are collinear [05] +D,I,C are collinear [06] +A,I,F are collinear [07] * Auxiliary Constructions: -: Points - +J K L : Points +E,F,J are collinear [08] +D,J,C are collinear [09] +A,K,B are collinear [10] +E,K,F are collinear [11] +D,L,C are collinear [12] +A,L,B are collinear [13] * Proof steps: -001. E,D,H are collinear [06] & F,D,E are collinear [02] ⇒ F,H,D are collinear [10] -002. F,B,G are collinear [04] & F,H,D are collinear [10] & A,D,G are collinear [05] & B,A,H are collinear [07] (Menelaus)⇒ (DH:FH) * (AG:AD) * (FB:BG) = 1 [11] -003. D,H,E are collinear [06] & B,D,C are collinear [00] & A,C,E are collinear [01] & B,A,H are collinear [07] (Menelaus)⇒ (HE:DH) * (AC:AE) * (BD:BC) = 1 [12] -004. D,E,I are collinear [08] & F,D,E are collinear [02] ⇒ D,I,F are collinear [13] -005. F,B,G are collinear [04] & B,D,C are collinear [00] & D,I,F are collinear [13] & I,C,G are collinear [09] (Menelaus)⇒ (FG:BG) * (BC:DC) * (DI:FI) = 1 [14] -006. F,B,G are collinear [04] & B,D,C are collinear [00] & D,I,F are collinear [13] & I,C,G are collinear [09] (Menelaus)⇒ (IG:CG) * (BC:BD) * (FD:FI) = 1 [15] -007. F,B,G are collinear [04] & B,D,C are collinear [00] & D,I,F are collinear [13] & I,C,G are collinear [09] (Menelaus)⇒ (IG:CI) * (FB:BD) * (DC:FG) = 1 [16] -008. A,D,G are collinear [05] & A,C,E are collinear [01] & D,E,I are collinear [08] & I,C,G are collinear [09] (Menelaus)⇒ (DG:AG) * (AC:CE) * (EI:DI) = 1 [17] -009. A,D,G are collinear [05] & A,C,E are collinear [01] & D,E,I are collinear [08] & I,C,G are collinear [09] (Menelaus)⇒ (IG:GC) * (CA:AE) * (ED:DI) = 1 [18] -010. A,D,G are collinear [05] & A,C,E are collinear [01] & D,E,I are collinear [08] & I,C,G are collinear [09] (Menelaus)⇒ (IG:CI) * (AD:AE) * (CE:DG) = 1 [19] -011. (IG:GC) * (CA:AE) * (ED:DI) = 1 [18] & DE = DF [03] ⇒ (IG:CG) * (AC:AE) * (FD:DI) = 1 [20] -012. (HE:DH) * (AC:AE) * (BD:BC) = 1 [12] & (FG:BG) * (BC:DC) * (DI:FI) = 1 [14] & (IG:CG) * (BC:BD) * (FD:FI) = 1 [15] & (IG:CI) * (FB:BD) * (DC:FG) = 1 [16] & (DG:AG) * (AC:CE) * (EI:DI) = 1 [17] & (IG:CG) * (AC:AE) * (FD:DI) = 1 [20] & (IG:CI) * (AD:AE) * (CE:DG) = 1 [19] (Ratio chase)⇒ (AD:AG) * (BG:FB) * (HE:DH) * (EI:FI) = 1 [21] -013. (HE:DH) * (AC:AE) * (BD:BC) = 1 [12] & (IG:CG) * (BC:BD) * (FD:FI) = 1 [15] & (DG:AG) * (AC:CE) * (EI:DI) = 1 [17] & (IG:CG) * (AC:AE) * (FD:DI) = 1 [20] (Ratio chase)⇒ (AC:AG) * (DG:CE) * (HE:DH) * (EI:FI) = 1 [22] -014. (DH:FH) * (AG:AD) * (FB:BG) = 1 [11] & (AD:AG) * (BG:FB) * (HE:DH) * (EI:FI) = 1 [21] & (AC:AG) * (DG:CE) * (HE:DH) * (EI:FI) = 1 [22] & (DI:EI) * (AG:AC) * (CE:DG) = 1 [17] ⇒ DI:EI = DH:FH +001. L,D,C are collinear [12] & D,I,C are collinear [06] ⇒ D,L,I are collinear [14] +002. D,L,C are collinear [12] & D,L,I are collinear [14] ⇒ C,I,L are collinear [15] +003. A,L,B are collinear [13] & A,G,B are collinear [02] ⇒ A,L,G are collinear [16] +004. A,L,B are collinear [13] & A,L,G are collinear [16] ⇒ L,G,B are collinear [17] +005. G,D,E are collinear [03] & A,E,C are collinear [00] & A,L,G are collinear [16] & L,D,C are collinear [12] (Menelaus)⇒ (GD:DE) * (AL:AC) * (EC:LG) = 1 [18] +006. G,D,E are collinear [03] & A,E,C are collinear [00] & A,L,G are collinear [16] & L,D,C are collinear [12] (Menelaus)⇒ (LD:LC) * (AC:AE) * (GE:GD) = 1 [19] +007. E,H,F are collinear [05] & E,K,F are collinear [11] ⇒ E,K,H are collinear [20] +008. H,B,C are collinear [04] & A,E,C are collinear [00] & A,K,B are collinear [10] & E,K,H are collinear [20] (Menelaus)⇒ (HB:HC) * (AK:AE) * (EC:KB) = 1 [21] +009. E,F,J are collinear [08] & E,K,F are collinear [11] ⇒ K,J,E are collinear [22] +010. A,L,B are collinear [13] & A,K,B are collinear [10] ⇒ A,L,K are collinear [23] +011. D,L,C are collinear [12] & D,J,C are collinear [09] ⇒ C,L,J are collinear [24] +012. K,J,E are collinear [22] & A,E,C are collinear [00] & A,L,K are collinear [23] & C,L,J are collinear [24] (Menelaus)⇒ (JK:EJ) * (AL:AC) * (EC:LK) = 1 [25] +013. K,J,E are collinear [22] & A,E,C are collinear [00] & A,L,K are collinear [23] & C,L,J are collinear [24] (Menelaus)⇒ (LJ:JC) * (AK:AE) * (EC:LK) = 1 [26] +014. K,J,E are collinear [22] & A,E,C are collinear [00] & A,L,K are collinear [23] & C,L,J are collinear [24] (Menelaus)⇒ (LJ:LC) * (AC:AE) * (EK:JK) = 1 [27] +015. D,I,C are collinear [06] & D,J,C are collinear [09] ⇒ J,I,C are collinear [28] +016. J,I,C are collinear [28] & A,E,C are collinear [00] & E,F,J are collinear [08] & A,I,F are collinear [07] (Menelaus)⇒ (IJ:IC) * (AC:AE) * (EF:JF) = 1 [29] +017. J,I,C are collinear [28] & A,E,C are collinear [00] & E,F,J are collinear [08] & A,I,F are collinear [07] (Menelaus)⇒ (IF:AI) * (AC:EC) * (EJ:JF) = 1 [30] +018. J,I,C are collinear [28] & A,E,C are collinear [00] & E,F,J are collinear [08] & A,I,F are collinear [07] (Menelaus)⇒ (IF:AF) * (AE:EC) * (JC:IJ) = 1 [31] +019. A,G,B are collinear [02] & A,K,B are collinear [10] ⇒ B,K,G are collinear [32] +020. G,D,E are collinear [03] & D,B,F are collinear [01] & B,K,G are collinear [32] & E,K,F are collinear [11] (Menelaus)⇒ (GE:DE) * (KB:BF) * (DF:GK) = 1 [33] +021. G,D,E are collinear [03] & D,B,F are collinear [01] & B,K,G are collinear [32] & E,K,F are collinear [11] (Menelaus)⇒ (EK:EF) * (GB:DB) * (DF:GK) = 1 [34] +022. A,I,F are collinear [07] & D,B,F are collinear [01] & L,I,D are collinear [14] & A,L,B are collinear [13] (Menelaus)⇒ (AI:AF) * (BF:DB) * (LD:LI) = 1 [35] +023. (GD:DE) * (AL:AC) * (EC:LG) = 1 [18] & (HB:HC) * (AK:AE) * (EC:KB) = 1 [21] & (JK:EJ) * (AL:AC) * (EC:LK) = 1 [25] & (LJ:JC) * (AK:AE) * (EC:LK) = 1 [26] & (LD:LC) * (AC:AE) * (GE:GD) = 1 [19] & (LJ:LC) * (AC:AE) * (EK:JK) = 1 [27] & (IJ:IC) * (AC:AE) * (EF:JF) = 1 [29] & (IF:AI) * (AC:EC) * (EJ:JF) = 1 [30] & (IF:AF) * (AE:EC) * (JC:IJ) = 1 [31] & (GE:DE) * (KB:BF) * (DF:GK) = 1 [33] & (EK:EF) * (GB:DB) * (DF:GK) = 1 [34] & (AI:AF) * (BF:DB) * (LD:LI) = 1 [35] (Ratio chase)⇒ (LG:GB) * (HB:HC) * (IC:LI) = 1 [36] +024. C,I,L are collinear [15] & L,G,B are collinear [17] & H,B,C are collinear [04] & (LG:GB) * (HB:HC) * (IC:LI) = 1 [36] (Menelaus)⇒ G,H,I are collinear ========================== diff --git a/newpros.txt b/newpros.txt index 87f185a..9c4c021 100644 --- a/newpros.txt +++ b/newpros.txt @@ -9,4 +9,22 @@ a b c = triangle a b c; o = circle o a b c; p = on_line p b c, on_tline p a o a; Menelaus_c3 a b = segment a b; c = on_tline c b a b, on_circle c b a; d = midpoint d b c; e = foot e b a d; f = on_line f b e, on_line f a c; g = midpoint g a f ? cong a g c f Menelaus_c22 -a b c = triangle a b c; d = on_line d b c; f = on_line f a c; e = mirror e f d; p = on_line p a d, on_line p b e; m = on_line m a b, on_line m d f; n = on_line n p c, on_line n d f ? eqratio d n f n d m e m \ No newline at end of file +a b c = triangle a b c; d = on_line d b c; f = on_line f a c; e = mirror e f d; p = on_line p a d, on_line p b e; m = on_line m a b, on_line m d f; n = on_line n p c, on_line n d f ? cong d m d n +Menelaus_b3 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; q = on_line q a c, on_line q b d; e = foot e q a b; f = foot f q b c; g = foot g q c d; h = foot h q d a; p = on_line p e h, on_line p b d ? coll p f g +Menelaus_b10 +a b c = triangle a b c; d = foot d a b c; x e g o1 = excenter2 x e g o1 c a b; y f h o2 = excenter2 y f h o2 b a c; q = on_line q a d, on_line q f h ? coll q e g +Menelaus_a11 +a b c = triangle a b c; d = on_line d a b; e = on_line e a c; f = midpoint f d e; g = on_line g d e; h = mirror h g f; i = on_line i a b; j = on_line j g i, on_line j a c; k = on_line k a b; l = on_line l k h, on_line l a c; m = on_line m j k, on_line m d e; n = on_line n i l, on_line n d e ? cong f m f n +Menelaus_Desargues +a b c = triangle a b c; d e = segment d e; g = on_line g a d, on_line g b e; f = on_line f g c; l = on_line l a b, on_line l d e; m = on_line m b c, on_line m e f; n = on_line n a c, on_line n d f ? coll l m n +Menelaus_Pappus +a b = segment a b; c d = segment c d; e = on_line e a c; f = on_line f b d; g = on_line g a b, on_line g d e; h = on_line h b c, on_line h e f; i = on_line i c d, on_line i f a; j = on_line j c d, on_line j e f; k = on_line k a b, on_line k e f; l = on_line l a b, on_line l c d ? coll g h i +Menelaus_Newton +a b c = triangle a b c; d = free; e = on_line e a b, on_line e c d; f = on_line f a d, on_line f b c; g = midpoint g a c; h = midpoint h b d; i = midpoint i e f ? coll g h i +Menelaus_b6 +a b c = triangle a b c; h = orthocenter h a b c; e = on_line e a b; f = on_line f b c, on_line f e h; d = on_line d a c, on_line d e h; m = on_tline m h e h, on_line m b c; n = on_line n a b, on_line n m h; p = on_line p a c, on_line p m h ? eqratio d e e f p n m n +Menelaus_b15 +a b c = triangle a b c; m = midpoint m b c; i = incenter i a b c; d = on_line d m i, on_line d a c; o = circle o a b c; e = on_line e b i, on_circle e o a ? eqratio e d e i i c i b +Menelaus_b15w +a b c = triangle a b c; m = midpoint m b c; i = incenter i a b c; d = on_line d m i, on_line d a c; o = circle o a b c; e = on_line e b i, on_circle e o a; f = on_line f b i, on_line f a c ? eqratio e d e i i c i b diff --git a/nothing.txt b/nothing.txt index 255f81a..b0bd170 100644 --- a/nothing.txt +++ b/nothing.txt @@ -742,6 +742,10 @@ Menelaus_a9 a b c = triangle a b c; e = midpoint e b c; f = angle_bisector f b a c, on_line f b c; k = on_line k a e, on_pline k f a c ? perp a f k c Menelaus_a9w a b c = triangle a b c; e = midpoint e b c; f = angle_bisector f b a c, on_line f b c; k = on_line k a e, on_pline k f a c; d = on_line d a b, on_line d c k ? cong a d a c +Menelaus_b2a +a b c = triangle a b c; d = midpoint d b c; e = midpoint e c a; f = midpoint f a b; g = on_line g b e, on_line g c f; x = on_pline x g b c, on_line x a b; y = on_line y g h, on_line y a c; p = on_line p b y, on_line p c g; q = on_line q c x, on_line q b g ? eqratio m p a b m q a c +Menelaus_b2b +a b c = triangle a b c; d = midpoint d b c; e = midpoint e c a; f = midpoint f a b; g = on_line g b e, on_line g c f; x = on_pline x g b c, on_line x a b; y = on_line y g h, on_line y a c; p = on_line p b y, on_line p c g; q = on_line q c x, on_line q b g ? eqratio m p a b p q b c Menelaus_b3 a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; q = on_line q a c, on_line q b d; e = foot e q a b; f = foot f q b c; g = foot g q c d; h = foot h q d a; p = on_line p e h, on_line p b d ? coll p f g Menelaus_b6 diff --git a/output_new/Desargues.txt b/output_new/Desargues.txt new file mode 100644 index 0000000..23218da --- /dev/null +++ b/output_new/Desargues.txt @@ -0,0 +1,26 @@ + +========================== + * From theorem premises: +A B C D E F G H I J : Points +D,F,A are collinear [00] +B,F,E are collinear [01] +F,C,G are collinear [02] +B,H,A are collinear [03] +D,H,E are collinear [04] +B,I,C are collinear [05] +I,E,G are collinear [06] +J,C,A are collinear [07] +D,J,G are collinear [08] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. B,H,A are collinear [03] & D,F,A are collinear [00] & B,F,E are collinear [01] & D,H,E are collinear [04] (Menelaus)⇒ (BH:HA) * (DA:BE) * (FE:DF) = 1 [09] +002. B,I,C are collinear [05] & B,F,E are collinear [01] & F,C,G are collinear [02] & I,E,G are collinear [06] (Menelaus)⇒ (IC:BI) * (BE:CG) * (FG:FE) = 1 [10] +003. (BH:HA) * (DA:BE) * (FE:DF) = 1 [09] & (IC:BI) * (BE:CG) * (FG:FE) = 1 [10] (Ratio chase)⇒ (DA:HA) * (FG:BI) * (BH:CG) * (IC:DF) = 1 [11] +004. J,C,A are collinear [07] & D,F,A are collinear [00] & F,C,G are collinear [02] & D,J,G are collinear [08] (Menelaus)⇒ (CJ:JA) * (DA:CG) * (FG:DF) = 1 [12] +005. (DA:HA) * (FG:BI) * (BH:CG) * (IC:DF) = 1 [11] & (CJ:JA) * (DA:CG) * (FG:DF) = 1 [12] ⇒ (CJ:JA) * (AH:HB) * (BI:IC) = 1 [13] +006. J,C,A are collinear [07] & B,H,A are collinear [03] & B,I,C are collinear [05] & (CJ:JA) * (AH:HB) * (BI:IC) = 1 [13] (Menelaus)⇒ I,H,J are collinear +========================== diff --git a/output_new/Pappus.txt b/output_new/Pappus.txt new file mode 100644 index 0000000..710d39d --- /dev/null +++ b/output_new/Pappus.txt @@ -0,0 +1,48 @@ + +========================== + * From theorem premises: +A B C D E F G H I : Points +A,E,C are collinear [00] +D,B,F are collinear [01] +A,G,B are collinear [02] +G,D,E are collinear [03] +H,B,C are collinear [04] +E,H,F are collinear [05] +D,I,C are collinear [06] +A,I,F are collinear [07] + + * Auxiliary Constructions: +J K L : Points +E,F,J are collinear [08] +D,J,C are collinear [09] +A,K,B are collinear [10] +E,K,F are collinear [11] +D,L,C are collinear [12] +A,L,B are collinear [13] + + * Proof steps: +001. L,D,C are collinear [12] & D,I,C are collinear [06] ⇒ D,L,I are collinear [14] +002. D,L,C are collinear [12] & D,L,I are collinear [14] ⇒ C,I,L are collinear [15] +003. A,L,B are collinear [13] & A,G,B are collinear [02] ⇒ A,L,G are collinear [16] +004. A,L,B are collinear [13] & A,L,G are collinear [16] ⇒ L,G,B are collinear [17] +005. G,D,E are collinear [03] & A,E,C are collinear [00] & A,L,G are collinear [16] & L,D,C are collinear [12] (Menelaus)⇒ (GD:DE) * (AL:AC) * (EC:LG) = 1 [18] +006. G,D,E are collinear [03] & A,E,C are collinear [00] & A,L,G are collinear [16] & L,D,C are collinear [12] (Menelaus)⇒ (LD:LC) * (AC:AE) * (GE:GD) = 1 [19] +007. E,H,F are collinear [05] & E,K,F are collinear [11] ⇒ E,K,H are collinear [20] +008. H,B,C are collinear [04] & A,E,C are collinear [00] & A,K,B are collinear [10] & E,K,H are collinear [20] (Menelaus)⇒ (HB:HC) * (AK:AE) * (EC:KB) = 1 [21] +009. E,F,J are collinear [08] & E,K,F are collinear [11] ⇒ K,J,E are collinear [22] +010. A,L,B are collinear [13] & A,K,B are collinear [10] ⇒ A,L,K are collinear [23] +011. D,L,C are collinear [12] & D,J,C are collinear [09] ⇒ C,L,J are collinear [24] +012. K,J,E are collinear [22] & A,E,C are collinear [00] & A,L,K are collinear [23] & C,L,J are collinear [24] (Menelaus)⇒ (JK:EJ) * (AL:AC) * (EC:LK) = 1 [25] +013. K,J,E are collinear [22] & A,E,C are collinear [00] & A,L,K are collinear [23] & C,L,J are collinear [24] (Menelaus)⇒ (LJ:JC) * (AK:AE) * (EC:LK) = 1 [26] +014. K,J,E are collinear [22] & A,E,C are collinear [00] & A,L,K are collinear [23] & C,L,J are collinear [24] (Menelaus)⇒ (LJ:LC) * (AC:AE) * (EK:JK) = 1 [27] +015. D,I,C are collinear [06] & D,J,C are collinear [09] ⇒ J,I,C are collinear [28] +016. J,I,C are collinear [28] & A,E,C are collinear [00] & E,F,J are collinear [08] & A,I,F are collinear [07] (Menelaus)⇒ (IJ:IC) * (AC:AE) * (EF:JF) = 1 [29] +017. J,I,C are collinear [28] & A,E,C are collinear [00] & E,F,J are collinear [08] & A,I,F are collinear [07] (Menelaus)⇒ (IF:AI) * (AC:EC) * (EJ:JF) = 1 [30] +018. J,I,C are collinear [28] & A,E,C are collinear [00] & E,F,J are collinear [08] & A,I,F are collinear [07] (Menelaus)⇒ (IF:AF) * (AE:EC) * (JC:IJ) = 1 [31] +019. A,G,B are collinear [02] & A,K,B are collinear [10] ⇒ B,K,G are collinear [32] +020. G,D,E are collinear [03] & D,B,F are collinear [01] & B,K,G are collinear [32] & E,K,F are collinear [11] (Menelaus)⇒ (GE:DE) * (KB:BF) * (DF:GK) = 1 [33] +021. G,D,E are collinear [03] & D,B,F are collinear [01] & B,K,G are collinear [32] & E,K,F are collinear [11] (Menelaus)⇒ (EK:EF) * (GB:DB) * (DF:GK) = 1 [34] +022. A,I,F are collinear [07] & D,B,F are collinear [01] & L,I,D are collinear [14] & A,L,B are collinear [13] (Menelaus)⇒ (AI:AF) * (BF:DB) * (LD:LI) = 1 [35] +023. (GD:DE) * (AL:AC) * (EC:LG) = 1 [18] & (HB:HC) * (AK:AE) * (EC:KB) = 1 [21] & (JK:EJ) * (AL:AC) * (EC:LK) = 1 [25] & (LJ:JC) * (AK:AE) * (EC:LK) = 1 [26] & (LD:LC) * (AC:AE) * (GE:GD) = 1 [19] & (LJ:LC) * (AC:AE) * (EK:JK) = 1 [27] & (IJ:IC) * (AC:AE) * (EF:JF) = 1 [29] & (IF:AI) * (AC:EC) * (EJ:JF) = 1 [30] & (IF:AF) * (AE:EC) * (JC:IJ) = 1 [31] & (GE:DE) * (KB:BF) * (DF:GK) = 1 [33] & (EK:EF) * (GB:DB) * (DF:GK) = 1 [34] & (AI:AF) * (BF:DB) * (LD:LI) = 1 [35] (Ratio chase)⇒ (LG:GB) * (HB:HC) * (IC:LI) = 1 [36] +024. C,I,L are collinear [15] & L,G,B are collinear [17] & H,B,C are collinear [04] & (LG:GB) * (HB:HC) * (IC:LI) = 1 [36] (Menelaus)⇒ G,H,I are collinear +========================== diff --git a/output_new/menelaus_b15w.txt b/output_new/menelaus_b15w.txt new file mode 100644 index 0000000..68bbb41 --- /dev/null +++ b/output_new/menelaus_b15w.txt @@ -0,0 +1,48 @@ + +========================== + * From theorem premises: +A B C D E F G H : Points +B,D,C are collinear [00] +DB = DC [01] +∠ACE = ∠ECB [02] +∠BAE = ∠EAC [03] +F,A,C are collinear [04] +F,D,E are collinear [05] +GB = GC [06] +GA = GB [07] +GH = GA [08] +H,B,E are collinear [09] + + * Auxiliary Constructions: +I : Points +A,I,C are collinear [10] +B,I,E are collinear [11] + + * Proof steps: +001. GB = GC [06] & GA = GB [07] & GH = GA [08] ⇒ H,B,A,C are concyclic [12] +002. H,B,A,C are concyclic [12] ⇒ ∠HBA = ∠HCA [13] +003. ∠HBA = ∠HCA [13] & H,B,E are collinear [09] ⇒ ∠EBA = ∠HCA [14] +004. A,I,C are collinear [10] & ∠BAE = ∠EAC [03] ⇒ ∠BAE = ∠EAI [15] +005. ∠BAE = ∠EAI [15] & B,I,E are collinear [11] ⇒ BE:BA = IE:AI [16] +006. ∠BAE = ∠EAI [15] & B,I,E are collinear [11] ⇒ IE:BE = AI:BA [17] +007. A,I,C are collinear [10] & ∠BCE = ∠ECA [02] ⇒ ∠BCE = ∠ECI [18] +008. ∠BCE = ∠ECI [18] & B,I,E are collinear [11] ⇒ BE:BC = IE:IC [19] +009. BE:BA = IE:AI [16] & BE:BC = IE:IC [19] ⇒ AI:IC = BA:BC [20] +010. AI:IC = BA:BC [20] & A,I,C are collinear [10] ⇒ ∠ABI = ∠IBC [21] +011. ∠ABI = ∠IBC [21] & B,I,E are collinear [11] ⇒ ∠ABE = ∠EBC [22] +012. A,I,C are collinear [10] & B,I,E are collinear [11] & ∠HCA = ∠EBA [14] ⇒ ∠HCI = ∠IBA [23] +013. B,I,E are collinear [11] & H,B,E are collinear [09] & A,I,C are collinear [10] ⇒ ∠HIC = ∠BIA [24] +014. ∠HCI = ∠IBA [23] & ∠HIC = ∠BIA [24] (Similar Triangles)⇒ HI:HC = AI:BA [25] +015. A,I,C are collinear [10] & F,A,C are collinear [04] ⇒ C,I,F are collinear [26] +016. B,I,E are collinear [11] & B,D,C are collinear [00] & C,I,F are collinear [26] & F,D,E are collinear [05] (Menelaus)⇒ (BD:DC) * (IE:EB) * (CF:FI) = 1 [27] +017. HI:HC = AI:BA [25] & IE:BE = AI:BA [17] & (BD:DC) * (IE:EB) * (CF:FI) = 1 [27] & DB = DC [01] ⇒ FI:FC = HI:HC [28] +018. FI:FC = HI:HC [28] & C,I,F are collinear [26] ⇒ ∠IHF = ∠FHC [29] +019. ∠IHF = ∠FHC [29] & B,I,E are collinear [11] & H,B,E are collinear [09] ⇒ ∠(BE-FH) = ∠FHC [30] +020. ∠ACE = ∠ECB [02] & ∠EBA = ∠HCA [14] & ∠ABE = ∠EBC [22] & ∠(BE-FH) = ∠FHC [30] (Angle chase)⇒ CE ∥ FH [31] +021. F,A,C are collinear [04] & ∠ACE = ∠ECB [02] & CE ∥ FH [31] ⇒ ∠CFH = ∠ECB [32] +022. ∠CHF = ∠(FH-BE) [30] & FH ∥ CE [31] ⇒ ∠CHF = ∠CEB [33] +023. ∠CFH = ∠ECB [32] & ∠CHF = ∠CEB [33] (Similar Triangles)⇒ FH:HC = EC:BE [34] +024. H,B,E are collinear [09] & ∠CHF = ∠(FH-BE) [30] & FH ∥ CE [31] ⇒ ∠HCE = ∠CEH [35] +025. ∠HCE = ∠CEH [35] ⇒ HC = HE [36] +026. FH:HC = EC:BE [34] & HE = HC [36] ⇒ HF:HE = EC:EB +========================== diff --git a/output_new/menelaus_b6.txt b/output_new/menelaus_b6.txt new file mode 100644 index 0000000..2f9fcac --- /dev/null +++ b/output_new/menelaus_b6.txt @@ -0,0 +1,42 @@ + +========================== + * From theorem premises: +A B C D E F G H I J : Points +AD ⟂ BC [00] +BD ⟂ AC [01] +E,A,B are collinear [02] +D,F,E are collinear [03] +C,F,B are collinear [04] +D,E,G are collinear [05] +C,A,G are collinear [06] +C,H,B are collinear [07] +DH ⟂ DE [08] +D,H,I are collinear [09] +I,A,B are collinear [10] +D,J,H are collinear [11] +C,J,A are collinear [12] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. D,F,E are collinear [03] & D,E,G are collinear [05] ⇒ F,G,E are collinear [13] +002. F,G,E are collinear [13] & C,F,B are collinear [04] & C,A,G are collinear [06] & E,A,B are collinear [02] (Menelaus)⇒ (EG:FE) * (CA:AG) * (FB:CB) = 1 [14] +003. D,J,H are collinear [11] & D,H,I are collinear [09] ⇒ H,J,I are collinear [15] +004. H,J,I are collinear [15] & C,H,B are collinear [07] & C,J,A are collinear [12] & I,A,B are collinear [10] (Menelaus)⇒ (JI:HI) * (CA:JA) * (HB:CB) = 1 [16] +005. C,F,B are collinear [04] & AD ⟂ BC [00] ⇒ DA ⟂ CF [17] +006. D,F,E are collinear [03] & D,J,H are collinear [11] & DE ⟂ DH [08] ⇒ DF ⟂ DJ [18] +007. DA ⟂ CF [17] & DF ⟂ DJ [18] ⇒ ∠ADF = ∠(CF-DJ) [19] +008. DA ⟂ CF [17] & DF ⟂ DJ [18] ⇒ ∠ADJ = ∠CFD [20] +009. D,E,G are collinear [05] & C,H,B are collinear [07] & ∠ADF = ∠(CF-DJ) [19] & D,F,E are collinear [03] & C,F,B are collinear [04] & D,J,H are collinear [11] ⇒ ∠ADG = ∠BHD [21] +010. C,J,A are collinear [12] & BD ⟂ AC [01] ⇒ DB ⟂ CJ [22] +011. DF ⟂ DJ [18] & DB ⟂ CJ [22] ⇒ ∠(DF-CJ) = ∠JDB [23] +012. DF ⟂ DJ [18] & DB ⟂ CJ [22] ⇒ ∠FDB = ∠DJC [24] +013. C,A,G are collinear [06] & D,E,G are collinear [05] & ∠(DF-CJ) = ∠JDB [23] & D,F,E are collinear [03] & C,J,A are collinear [12] & D,J,H are collinear [11] ⇒ ∠AGD = ∠BDH [25] +014. ∠ADG = ∠BHD [21] & ∠AGD = ∠BDH [25] (Similar Triangles)⇒ DA:AG = HB:DB [26] +015. C,F,B are collinear [04] & D,F,E are collinear [03] & D,J,H are collinear [11] & ∠ADJ = ∠CFD [20] ⇒ ∠BFD = ∠ADJ [27] +016. D,F,E are collinear [03] & C,J,A are collinear [12] & D,J,H are collinear [11] & ∠FDB = ∠DJC [24] ⇒ ∠BDF = ∠AJD [28] +017. ∠BFD = ∠ADJ [27] & ∠BDF = ∠AJD [28] (Similar Triangles)⇒ FB:DB = DA:JA [29] +018. (EG:FE) * (CA:AG) * (FB:CB) = 1 [14] & (JI:HI) * (CA:JA) * (HB:CB) = 1 [16] & DA:AG = HB:DB [26] & FB:DB = DA:JA [29] (Ratio chase)⇒ FE:EG = HI:JI +========================== diff --git a/output_new/menelaus_c22.txt b/output_new/menelaus_c22.txt new file mode 100644 index 0000000..e6e4b27 --- /dev/null +++ b/output_new/menelaus_c22.txt @@ -0,0 +1,37 @@ + +========================== + * From theorem premises: +A B C D E F G H I : Points +C,D,B are collinear [00] +A,E,C are collinear [01] +E,D,F are collinear [02] +DE = DF [03] +G,F,B are collinear [04] +A,G,D are collinear [05] +E,D,H are collinear [06] +A,B,H are collinear [07] +E,I,D are collinear [08] +G,I,C are collinear [09] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. E,D,H are collinear [06] & C,D,B are collinear [00] & A,E,C are collinear [01] & A,B,H are collinear [07] (Menelaus)⇒ (EH:DH) * (AC:AE) * (DB:CB) = 1 [10] +002. E,I,D are collinear [08] & E,D,F are collinear [02] ⇒ D,I,F are collinear [11] +003. G,F,B are collinear [04] & C,D,B are collinear [00] & D,I,F are collinear [11] & G,I,C are collinear [09] (Menelaus)⇒ (GF:GB) * (CB:DC) * (ID:IF) = 1 [12] +004. G,F,B are collinear [04] & C,D,B are collinear [00] & D,I,F are collinear [11] & G,I,C are collinear [09] (Menelaus)⇒ (GI:GC) * (CB:DB) * (DF:IF) = 1 [13] +005. G,F,B are collinear [04] & C,D,B are collinear [00] & D,I,F are collinear [11] & G,I,C are collinear [09] (Menelaus)⇒ (GI:IC) * (FB:DB) * (DC:GF) = 1 [14] +006. A,G,D are collinear [05] & A,E,C are collinear [01] & E,I,D are collinear [08] & G,I,C are collinear [09] (Menelaus)⇒ (GD:AG) * (AC:EC) * (EI:ID) = 1 [15] +007. A,G,D are collinear [05] & A,E,C are collinear [01] & E,I,D are collinear [08] & G,I,C are collinear [09] (Menelaus)⇒ (IG:GC) * (CA:AE) * (ED:DI) = 1 [16] +008. A,G,D are collinear [05] & A,E,C are collinear [01] & E,I,D are collinear [08] & G,I,C are collinear [09] (Menelaus)⇒ (GI:IC) * (AD:AE) * (EC:GD) = 1 [17] +009. (IG:GC) * (CA:AE) * (ED:DI) = 1 [16] & DE = DF [03] ⇒ (GI:GC) * (AC:AE) * (DF:ID) = 1 [18] +010. E,D,F are collinear [02] & E,D,H are collinear [06] ⇒ F,H,D are collinear [19] +011. G,F,B are collinear [04] & F,H,D are collinear [19] & A,G,D are collinear [05] & A,B,H are collinear [07] (Menelaus)⇒ (GB:FB) * (AD:AG) * (FH:DH) = 1 [20] +012. (GF:GB) * (CB:DC) * (ID:IF) = 1 [12] & (GI:GC) * (CB:DB) * (DF:IF) = 1 [13] & (GI:IC) * (FB:DB) * (DC:GF) = 1 [14] & (GD:AG) * (AC:EC) * (EI:ID) = 1 [15] & (GI:GC) * (AC:AE) * (DF:ID) = 1 [18] & (GI:IC) * (AD:AE) * (EC:GD) = 1 [17] & (GB:FB) * (AD:AG) * (FH:DH) = 1 [20] (Ratio chase)⇒ (AE:AC) * (CB:DB) * (DH:FH) * (EI:IF) = 1 [21] +013. (GI:GC) * (CB:DB) * (DF:IF) = 1 [13] & (GI:IC) * (FB:DB) * (DC:GF) = 1 [14] & (GD:AG) * (AC:EC) * (EI:ID) = 1 [15] & (GI:GC) * (AC:AE) * (DF:ID) = 1 [18] & (GI:IC) * (AD:AE) * (EC:GD) = 1 [17] & (GB:FB) * (AD:AG) * (FH:DH) = 1 [20] (Ratio chase)⇒ (CB:GB) * (GF:DC) * (DH:FH) * (EI:IF) = 1 [22] +014. (EH:DH) * (AC:AE) * (DB:CB) = 1 [10] & (AE:AC) * (CB:DB) * (DH:FH) * (EI:IF) = 1 [21] & (CB:GB) * (GF:DC) * (DH:FH) * (EI:IF) = 1 [22] & (IF:ID) * (GB:CB) * (DC:GF) = 1 [12] ⇒ IF:ID = EH:DH [23] +015. IF:ID = EH:DH [23] & D,I,F are collinear [11] & E,D,H are collinear [06] ⇒ DF:DE = ID:HD [24] +016. DF:DE = ID:HD [24] & DE = DF [03] ⇒ ID = HD +========================== diff --git a/problem.py b/problem.py index ce2073a..22c46f2 100644 --- a/problem.py +++ b/problem.py @@ -524,7 +524,7 @@ def why_eqratio30( """Why two ratios are equal, returns a Dependency objects.""" all12 = list(gm.all_ratios(l1, l2, level)) all43 = list(gm.all_ratios2(lp46, lp35, level)) - print(all12,all43) + #print(all12,all43) min_why = None for rat12, l1s, l2s in all12: for ratp43, lp4s, lp3s in all43: diff --git a/rules.txt b/rules.txt index 125524f..8e6d4ab 100644 --- a/rules.txt +++ b/rules.txt @@ -56,4 +56,5 @@ circle O A B C, cong O A O D, perp O A A G, coll G B C, coll H A B, coll H C D, circle O A B C, cong O A O D, perp O A A G, perp O B B G, coll H A C, coll H B D, coll I C B, coll I D A => coll G H I circle O A B C, cong O A O D, cong O A O E, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A, coll G H I => cong O A O F perp A B A C, perp A D B C, coll B C D => eqratio B A B D B C B A -perp A B A C, coll B C D, perp A D B C => eqratio D A D B D C D A \ No newline at end of file +perp A B A C, coll B C D, perp A D B C => eqratio D A D B D C D A +eqratio6 B A B C Q P Q R, coll A B C, coll P Q R => eqratio B A A C Q P P R \ No newline at end of file diff --git a/test.py b/test.py index e9c69c5..b5b39e0 100644 --- a/test.py +++ b/test.py @@ -1,5 +1,6 @@ -a = [1,2,3] -b = [2,3,4] +a = True +b = False +c = True +d = False -c = [x for x in a if x in b] -print(c != []) +print(a==b, a==c,b==c,b==d) From 490e6af85b7e343da35366b354bed44ed65beb15 Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.cn> Date: Sat, 29 Mar 2025 21:48:04 +0800 Subject: [PATCH 24/27] east_ceva --- alphageometry.py | 2 +- chiaya.sh | 4 +-- kirine.txt | 54 ++++++++++------------------------- newpros.txt | 36 +++++++++++++++--------- nothing.txt | 62 +++++++++++++++++++++++------------------ output_new/ceva_c2.txt | 21 ++++++++++++++ output_new/ceva_c3.txt | 30 ++++++++++++++++++++ output_new/ceva_c32.txt | 22 +++++++++++++++ output_new/ceva_c5.txt | 33 ++++++++++++++++++++++ 9 files changed, 181 insertions(+), 83 deletions(-) create mode 100644 output_new/ceva_c2.txt create mode 100644 output_new/ceva_c3.txt create mode 100644 output_new/ceva_c32.txt create mode 100644 output_new/ceva_c5.txt diff --git a/alphageometry.py b/alphageometry.py index 3a04b87..8262114 100644 --- a/alphageometry.py +++ b/alphageometry.py @@ -586,7 +586,7 @@ def run_alphageometry( # Update the constructive statement of the problem with the aux point: candidate_pstring = insert_aux_to_premise(pstring, translation) - + print(candidate_pstring) logging.info('Solving: "%s"', candidate_pstring) p_new = pr.Problem.from_txt(candidate_pstring) diff --git a/chiaya.sh b/chiaya.sh index af59baa..e34230e 100644 --- a/chiaya.sh +++ b/chiaya.sh @@ -13,7 +13,7 @@ SIZE=4 BATCH_SIZE=8 BEAM_SIZE=16 -DEPTH=2 +DEPTH=4 SEARCH_ARGS=( --beam_size=$BEAM_SIZE @@ -42,7 +42,7 @@ SERIES=Menelaus_a python -m alphageometry \ --alsologtostderr \ --problems_file=$(pwd)/$INPUT_FILE \ ---problem_name=Menelaus_b15 \ +--problem_name=Menelaus_Newton \ --mode=alphageometry \ "${DDAR_ARGS[@]}" \ "${SEARCH_ARGS[@]}" \ diff --git a/kirine.txt b/kirine.txt index 710d39d..9f05a4f 100644 --- a/kirine.txt +++ b/kirine.txt @@ -1,48 +1,22 @@ ========================== * From theorem premises: -A B C D E F G H I : Points -A,E,C are collinear [00] -D,B,F are collinear [01] -A,G,B are collinear [02] -G,D,E are collinear [03] -H,B,C are collinear [04] -E,H,F are collinear [05] -D,I,C are collinear [06] -A,I,F are collinear [07] +A B C D E F G : Points +C,B,D are collinear [00] +C,A,E are collinear [01] +∠ADE = ∠EDC [02] +B,F,A are collinear [03] +∠ADF = ∠FDB [04] +G,B,E are collinear [05] +G,F,C are collinear [06] * Auxiliary Constructions: -J K L : Points -E,F,J are collinear [08] -D,J,C are collinear [09] -A,K,B are collinear [10] -E,K,F are collinear [11] -D,L,C are collinear [12] -A,L,B are collinear [13] +: Points + * Proof steps: -001. L,D,C are collinear [12] & D,I,C are collinear [06] ⇒ D,L,I are collinear [14] -002. D,L,C are collinear [12] & D,L,I are collinear [14] ⇒ C,I,L are collinear [15] -003. A,L,B are collinear [13] & A,G,B are collinear [02] ⇒ A,L,G are collinear [16] -004. A,L,B are collinear [13] & A,L,G are collinear [16] ⇒ L,G,B are collinear [17] -005. G,D,E are collinear [03] & A,E,C are collinear [00] & A,L,G are collinear [16] & L,D,C are collinear [12] (Menelaus)⇒ (GD:DE) * (AL:AC) * (EC:LG) = 1 [18] -006. G,D,E are collinear [03] & A,E,C are collinear [00] & A,L,G are collinear [16] & L,D,C are collinear [12] (Menelaus)⇒ (LD:LC) * (AC:AE) * (GE:GD) = 1 [19] -007. E,H,F are collinear [05] & E,K,F are collinear [11] ⇒ E,K,H are collinear [20] -008. H,B,C are collinear [04] & A,E,C are collinear [00] & A,K,B are collinear [10] & E,K,H are collinear [20] (Menelaus)⇒ (HB:HC) * (AK:AE) * (EC:KB) = 1 [21] -009. E,F,J are collinear [08] & E,K,F are collinear [11] ⇒ K,J,E are collinear [22] -010. A,L,B are collinear [13] & A,K,B are collinear [10] ⇒ A,L,K are collinear [23] -011. D,L,C are collinear [12] & D,J,C are collinear [09] ⇒ C,L,J are collinear [24] -012. K,J,E are collinear [22] & A,E,C are collinear [00] & A,L,K are collinear [23] & C,L,J are collinear [24] (Menelaus)⇒ (JK:EJ) * (AL:AC) * (EC:LK) = 1 [25] -013. K,J,E are collinear [22] & A,E,C are collinear [00] & A,L,K are collinear [23] & C,L,J are collinear [24] (Menelaus)⇒ (LJ:JC) * (AK:AE) * (EC:LK) = 1 [26] -014. K,J,E are collinear [22] & A,E,C are collinear [00] & A,L,K are collinear [23] & C,L,J are collinear [24] (Menelaus)⇒ (LJ:LC) * (AC:AE) * (EK:JK) = 1 [27] -015. D,I,C are collinear [06] & D,J,C are collinear [09] ⇒ J,I,C are collinear [28] -016. J,I,C are collinear [28] & A,E,C are collinear [00] & E,F,J are collinear [08] & A,I,F are collinear [07] (Menelaus)⇒ (IJ:IC) * (AC:AE) * (EF:JF) = 1 [29] -017. J,I,C are collinear [28] & A,E,C are collinear [00] & E,F,J are collinear [08] & A,I,F are collinear [07] (Menelaus)⇒ (IF:AI) * (AC:EC) * (EJ:JF) = 1 [30] -018. J,I,C are collinear [28] & A,E,C are collinear [00] & E,F,J are collinear [08] & A,I,F are collinear [07] (Menelaus)⇒ (IF:AF) * (AE:EC) * (JC:IJ) = 1 [31] -019. A,G,B are collinear [02] & A,K,B are collinear [10] ⇒ B,K,G are collinear [32] -020. G,D,E are collinear [03] & D,B,F are collinear [01] & B,K,G are collinear [32] & E,K,F are collinear [11] (Menelaus)⇒ (GE:DE) * (KB:BF) * (DF:GK) = 1 [33] -021. G,D,E are collinear [03] & D,B,F are collinear [01] & B,K,G are collinear [32] & E,K,F are collinear [11] (Menelaus)⇒ (EK:EF) * (GB:DB) * (DF:GK) = 1 [34] -022. A,I,F are collinear [07] & D,B,F are collinear [01] & L,I,D are collinear [14] & A,L,B are collinear [13] (Menelaus)⇒ (AI:AF) * (BF:DB) * (LD:LI) = 1 [35] -023. (GD:DE) * (AL:AC) * (EC:LG) = 1 [18] & (HB:HC) * (AK:AE) * (EC:KB) = 1 [21] & (JK:EJ) * (AL:AC) * (EC:LK) = 1 [25] & (LJ:JC) * (AK:AE) * (EC:LK) = 1 [26] & (LD:LC) * (AC:AE) * (GE:GD) = 1 [19] & (LJ:LC) * (AC:AE) * (EK:JK) = 1 [27] & (IJ:IC) * (AC:AE) * (EF:JF) = 1 [29] & (IF:AI) * (AC:EC) * (EJ:JF) = 1 [30] & (IF:AF) * (AE:EC) * (JC:IJ) = 1 [31] & (GE:DE) * (KB:BF) * (DF:GK) = 1 [33] & (EK:EF) * (GB:DB) * (DF:GK) = 1 [34] & (AI:AF) * (BF:DB) * (LD:LI) = 1 [35] (Ratio chase)⇒ (LG:GB) * (HB:HC) * (IC:LI) = 1 [36] -024. C,I,L are collinear [15] & L,G,B are collinear [17] & H,B,C are collinear [04] & (LG:GB) * (HB:HC) * (IC:LI) = 1 [36] (Menelaus)⇒ G,H,I are collinear +001. ∠CDE = ∠EDA [02] & C,A,E are collinear [01] ⇒ CE:AE = CD:DA [07] +002. ∠BDF = ∠FDA [04] & B,F,A are collinear [03] ⇒ FB:FA = DB:DA [08] +003. CE:AE = CD:DA [07] & FB:FA = DB:DA [08] (Ratio chase)⇒ (AE:FA) * (FB:DB) * (CD:CE) = 1 [09] +004. B,F,A are collinear [03] & C,B,D are collinear [00] & C,A,E are collinear [01] & G,B,E are collinear [05] & G,F,C are collinear [06] & (AE:FA) * (FB:DB) * (CD:CE) = 1 [09] (Ceva)⇒ G,D,A are collinear ========================== diff --git a/newpros.txt b/newpros.txt index 9c4c021..9d54016 100644 --- a/newpros.txt +++ b/newpros.txt @@ -1,30 +1,40 @@ -Menelaus_c32 -a b c = triangle a b c; i = incenter i a b c; d = on_line d a i, on_line d b c; e = on_line e b i, on_line e c a; f = on_tline f c c i, on_line f a b ? coll d e f -example2_1 -a b c = triangle a b c; d = foot d a b c; h = on_line h a d; e = on_line e a c, on_line e b h; f = on_line f a b, on_line f c h; p = on_pline p a b c, on_line p d f; q = on_line q p a, on_line q d e ? cong a p a q -tangent -a b c = triangle a b c; o = circle o a b c; p = on_tline p a o a, on_line p b c ? eqratio30 a b a c a b a c p c p b -Menelaus_a2 -a b c = triangle a b c; o = circle o a b c; p = on_line p b c, on_tline p a o a; q = on_line q a c, on_tline q b o b; r = on_line r a b, on_tline r c o c ? coll p q r Menelaus_c3 a b = segment a b; c = on_tline c b a b, on_circle c b a; d = midpoint d b c; e = foot e b a d; f = on_line f b e, on_line f a c; g = midpoint g a f ? cong a g c f Menelaus_c22 a b c = triangle a b c; d = on_line d b c; f = on_line f a c; e = mirror e f d; p = on_line p a d, on_line p b e; m = on_line m a b, on_line m d f; n = on_line n p c, on_line n d f ? cong d m d n +Menelaus_c32 +a b c = triangle a b c; i = incenter i a b c; d = on_line d a i, on_line d b c; e = on_line e b i, on_line e c a; f = on_tline f c c i, on_line f a b ? coll d e f +Menelaus_a2 +a b c = triangle a b c; o = circle o a b c; p = on_line p b c, on_tline p a o a; q = on_line q a c, on_tline q b o b; r = on_line r a b, on_tline r c o c ? coll p q r +Menelaus_a11 +a b c = triangle a b c; d = on_line d a b; e = on_line e a c; f = midpoint f d e; g = on_line g d e; h = mirror h g f; i = on_line i a b; j = on_line j g i, on_line j a c; k = on_line k a b; l = on_line l k h, on_line l a c; m = on_line m j k, on_line m d e; n = on_line n i l, on_line n d e ? cong f m f n Menelaus_b3 a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; q = on_line q a c, on_line q b d; e = foot e q a b; f = foot f q b c; g = foot g q c d; h = foot h q d a; p = on_line p e h, on_line p b d ? coll p f g Menelaus_b10 a b c = triangle a b c; d = foot d a b c; x e g o1 = excenter2 x e g o1 c a b; y f h o2 = excenter2 y f h o2 b a c; q = on_line q a d, on_line q f h ? coll q e g -Menelaus_a11 -a b c = triangle a b c; d = on_line d a b; e = on_line e a c; f = midpoint f d e; g = on_line g d e; h = mirror h g f; i = on_line i a b; j = on_line j g i, on_line j a c; k = on_line k a b; l = on_line l k h, on_line l a c; m = on_line m j k, on_line m d e; n = on_line n i l, on_line n d e ? cong f m f n Menelaus_Desargues a b c = triangle a b c; d e = segment d e; g = on_line g a d, on_line g b e; f = on_line f g c; l = on_line l a b, on_line l d e; m = on_line m b c, on_line m e f; n = on_line n a c, on_line n d f ? coll l m n Menelaus_Pappus a b = segment a b; c d = segment c d; e = on_line e a c; f = on_line f b d; g = on_line g a b, on_line g d e; h = on_line h b c, on_line h e f; i = on_line i c d, on_line i f a; j = on_line j c d, on_line j e f; k = on_line k a b, on_line k e f; l = on_line l a b, on_line l c d ? coll g h i Menelaus_Newton -a b c = triangle a b c; d = free; e = on_line e a b, on_line e c d; f = on_line f a d, on_line f b c; g = midpoint g a c; h = midpoint h b d; i = midpoint i e f ? coll g h i +a b c = triangle a b c; d = free; e = on_line e a b, on_line e c d; f = on_line f a d, on_line f b c; g = midpoint g a c; h = midpoint h b d; i = midpoint i e f; j = midpoint j c e; k = midpoint k b c; l = midpoint l b e ? coll g h i Menelaus_b6 a b c = triangle a b c; h = orthocenter h a b c; e = on_line e a b; f = on_line f b c, on_line f e h; d = on_line d a c, on_line d e h; m = on_tline m h e h, on_line m b c; n = on_line n a b, on_line n m h; p = on_line p a c, on_line p m h ? eqratio d e e f p n m n Menelaus_b15 -a b c = triangle a b c; m = midpoint m b c; i = incenter i a b c; d = on_line d m i, on_line d a c; o = circle o a b c; e = on_line e b i, on_circle e o a ? eqratio e d e i i c i b -Menelaus_b15w a b c = triangle a b c; m = midpoint m b c; i = incenter i a b c; d = on_line d m i, on_line d a c; o = circle o a b c; e = on_line e b i, on_circle e o a; f = on_line f b i, on_line f a c ? eqratio e d e i i c i b +Ceva_a1 +a b c = triangle a b c; d = foot d a b c; h = on_line h a d; e = on_line e a c, on_line e b h; f = on_line f a b, on_line f c h; p = on_pline p a b c, on_line p d f; q = on_line q p a, on_line q d e ? cong a p a q +tangent +a b c = triangle a b c; o = circle o a b c; p = on_tline p a o a, on_line p b c ? eqratio30 a b a c a b a c p c p b +Ceva_c2 +a b c = triangle a b c; d = midpoint d b c; e = on_line e a d; f = on_line f a b, on_line f e c; g = on_line g a c, on_line g e b ? para f g b c +Ceva_c3 +a b c = triangle a b c; o = circle o a b c; d = on_tline d b o b, on_tline d c o c; e = on_tline e a o a, on_tline e c o c; f = on_tline f a o a, on_tline f b o b; g = on_line g a d, on_line g b e ? coll g c f +Ceva_c5 +a b c = triangle a b c; d = angle_bisector d b a c, on_line d b c; e = on_line e a d, on_tline e b a d; m = midpoint m b c; n = on_line n a m, on_line n b e ? para d n a b +Ceva_c22 +a b d = triangle a b d; c = angle_bisector c b a d; e = on_line e c d; f = on_line f b e, on_line f a c; g = on_line g d f, on_line g b c; h = on_line h a c, on_line h b d ? eqangle a g a c a c a e +Ceva_c32 +a b c = triangle a b c; d = on_line d b c; e = angle_bisector e a d c, on_line e a c; f = angle_bisector f a d b, on_line f a b; g = on_line g b e, on_line g c f ? coll g a d +Ceva_b2 +c d = segment c d; o = midpoint o c d; a = on_line a c d, on_tline a d o d; b = on_line b c d, on_tline b c o c; e = on_line e a c, on_line e b d; r = on_line r a d, on_line r b c; h = foot h r a b ? coll r e h diff --git a/nothing.txt b/nothing.txt index b0bd170..e3cffbb 100644 --- a/nothing.txt +++ b/nothing.txt @@ -734,49 +734,57 @@ I,D,F are collinear [09] 008. IF:DF = AF:CF [11] & IF:DF = IA:CD [12] & AG:BG = AH:BD [14] & (CF:AF) * (AE:CB) * (BD:ED) = 1 [15] & (BG:AG) * (AE:CB) * (CD:ED) = 1 [16] (Ratio chase)⇒ IA = AH ========================== -Menelaus_a2 +Menelaus_a2 v a b c = triangle a b c; o = circle o a b c; p = on_line p b c, on_tline p a o a; q = on_line q a c, on_tline q b o b; r = on_line r a b, on_tline r c o c ? coll p q r -Menelaus_a7 +Menelaus_a7 o a b c = triangle a b c; d e f i = incenter2 d e f i a b c; o = on_bline o a b; m = midpoint m a b; p = on_line p d e, on_circle p o a; q = on_line q d e, on_circle q o a; x = on_line x a b, on_line x d e ? cyclic p q f m -Menelaus_a9 -a b c = triangle a b c; e = midpoint e b c; f = angle_bisector f b a c, on_line f b c; k = on_line k a e, on_pline k f a c ? perp a f k c -Menelaus_a9w +Menelaus_a9 o a b c = triangle a b c; e = midpoint e b c; f = angle_bisector f b a c, on_line f b c; k = on_line k a e, on_pline k f a c; d = on_line d a b, on_line d c k ? cong a d a c -Menelaus_b2a +Menelaus_b2a x a b c = triangle a b c; d = midpoint d b c; e = midpoint e c a; f = midpoint f a b; g = on_line g b e, on_line g c f; x = on_pline x g b c, on_line x a b; y = on_line y g h, on_line y a c; p = on_line p b y, on_line p c g; q = on_line q c x, on_line q b g ? eqratio m p a b m q a c -Menelaus_b2b +Menelaus_b2b x a b c = triangle a b c; d = midpoint d b c; e = midpoint e c a; f = midpoint f a b; g = on_line g b e, on_line g c f; x = on_pline x g b c, on_line x a b; y = on_line y g h, on_line y a c; p = on_line p b y, on_line p c g; q = on_line q c x, on_line q b g ? eqratio m p a b p q b c -Menelaus_b3 +Menelaus_b3 x a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; q = on_line q a c, on_line q b d; e = foot e q a b; f = foot f q b c; g = foot g q c d; h = foot h q d a; p = on_line p e h, on_line p b d ? coll p f g -Menelaus_b6 +Menelaus_b6 v a b c = triangle a b c; h = orthocenter h a b c; e = on_line e a b; f = on_line f b c, on_line f e h; d = on_line d a c, on_line d e h; m = on_tline m h e h, on_line m b c; n = on_line n a b, on_line n m h; p = on_line p a c, on_line p m h ? eqratio d e e f p n m n -Menelaus_b9 +Menelaus_b9 x a b c = triangle a b c; d e f i = incenter2 d e f i a b c; x = on_tline x d b c; i2 = incenter i2 x b c; y = foot y i2 x c; z = foot z i2 x b ? cyclic x y e f -Menelaus_b9w +Menelaus_b9w x a b c = triangle a b c; d e f i = incenter2 d e f i a b c; x = on_tline x d b c; i2 = incenter i2 x b c; y = foot y i2 x c; z = foot z i2 x b; p = on_line p b c, on_line p e f ? coll p x y -Menelaus_b10 +Menelaus_b10 x a b c = triangle a b c; d = foot d a b c; x e g o1 = excenter2 x e g o1 c a b; y f h o2 = excenter2 y f h o2 b a c; q = on_line q a d, on_line q f h ? coll q e g -Menelaus_b11 +Menelaus_b11 x a b c = triangle a b c; o = circle o a b c; p = on_tline p a o a, on_tline p b o b; d = on_line d p c, on_circle d o a; e = on_pline e c p a, on_line e a b; f = on_line f c e, on_line f a d; k = on_line k c d, on_line k a b ? cong e c e f -Menelaus_b11w +Menelaus_b11w x a b c = triangle a b c; o = circle o a b c; p = on_tline p a o a, on_tline p b o b; d = on_line d p c, on_circle d o a; e = on_pline e c p a, on_line e a b; f = on_line f c e, on_line f a d; k = on_line k c d, on_line k a b; m = on_line m o p, on_line m a b ? cyclic o m c d -Menelaus_b12 +Menelaus_b12 x a b c = triangle a b c; m = midpoint m a b; d = on_line d b c; e = mirror e m d; f = on_line f a b; g = on_line g a c; k = on_line k f e, on_line k g d; v = on_line v f d, on_line v g e; l = on_line l a k, on_line l b c; t = on_line t a v, on_line t b c ? cong d t e l -Menelaus_b13 +Menelaus_b13 x x y = segment x y; p = on_line p x y; a = on_circle a x p; b c = tangent b c a y p; d = on_line d a b, on_circle d x a; e = on_line e a c, on_circle e x a; r = on_line r d e, on_line r b c; q = on_line q p r, on_circle q x a ? coll a q y -Menelaus_b15 -a b c = triangle a b c; m = midpoint m b c; i = incenter i a b c; d = on_line d m i, on_line d a c; o = circle o a b c; e = on_line e b i, on_circle e o a ? eqratio e d e i i c i b -Menelaus_b15w +Menelaus_b15w v a b c = triangle a b c; m = midpoint m b c; i = incenter i a b c; d = on_line d m i, on_line d a c; o = circle o a b c; e = on_line e b i, on_circle e o a; f = on_line f b i, on_line f a c ? eqratio e d e i i c i b -Menelaus_c3 +Menelaus_c3 v a b = segment a b; c = on_tline c b a b, on_circle c b a; d = midpoint d b c; e = foot e b a d; f = on_line f b e, on_line f a c; g = midpoint g a f ? cong a g c f -Menelaus_cDesargues +Menelaus_cDesargues v a b c = triangle a b c; d e = segment d e; g = on_line g a d, on_line g b e; f = on_line f g c; l = on_line l a b, on_line l d e; m = on_line m b c, on_line m e f; n = on_line n a c, on_line n d f ? coll l m n -Menelaus_cNewton -a b c = triangle a b c; d = free; e = on_line e a b, on_line e c d; f = on_line f a d, on_line f b c; g = midpoint g a c; h = midpoint h b d; i = midpoint i e f ? coll g h i -Menelaus_cPappus +Menelaus_cNewton x +a b c = triangle a b c; d = free; e = on_line e a b, on_line e c d; f = on_line f a d, on_line f b c; g = midpoint g a c; h = midpoint h b d; i = midpoint i e f; j = midpoint j c e; k = midpoint k b c; l = midpoint l b e ? coll g h i +Menelaus_cPappus v a b = segment; c = on_line c a b; d e = segment; f = on_line f d e; g = on_line g a e, on_line g b d; h = on_line h a f, on_line h c d; i = on_line i b f, on_line p c e ? coll g h i -Menelaus_c22 +Menelaus_c22 v a b c = triangle a b c; d = on_line d a b; f = on_line f a c; e = mirror e d f; p = on_line p a d, on_line p b e; m = on_line m a b, on_line m d f; n = on_line n p c, on_line n d f ? cong d m d n -Menelaus_c32 -a b c = triangle a b c; i = incenter i a b c; d = on_line d a i, on_line d b c; e = on_line e b i, on_line e c a; f = on_tline f c c i, on_line f a b ? coll d e f \ No newline at end of file +Menelaus_c32 v +a b c = triangle a b c; i = incenter i a b c; d = on_line d a i, on_line d b c; e = on_line e b i, on_line e c a; f = on_tline f c c i, on_line f a b ? coll d e f +Ceva_c2 v +a b c = triangle a b c; d = midpoint d b c; e = on_line e a d; f = on_line f a b, on_line f e c; g = on_line g a c, on_line g e b ? perp f g b c +Ceva_c3 v +a b c = triangle a b c; o = circle o a b c; d = on_tline d b o b, on_tline d c o c; e = on_tline e a o a, on_tline e c o c; f = on_tline f a o a, on_tline f b o b; g = on_line g a d, on_line g b e ? coll g c f +Ceva_c5 v +a b c = triangle a b c; d = angle_bisector d b a c, on_line d b c; e = on_line e a d, on_tline e b a d; m = midpoint m b c; n = on_line n a m, on_line n b e ? perp d n a B +Ceva_c22 o +a b d = triangle a b d; c = angle_bisector c b a d; e = on_line e c d; f = on_line f b e, on_line f a c; g = on_line g d f, on_line g b c; h = on_line h a c, on_line h b d ? eqangle a g a c a c a e +Ceva_c32 v +a b c = triangle a b c; d = on_line d b c; e = angle_bisector e a d c, on_line e a c; f = angle_bisector f a d b, on_line f a b; g = on_line g b e, on_line g c f ? coll g a d +Ceva_b2 x +c d = segment c d; o = midpoint o c d; a = on_line a c d, on_tline a d o d; b = on_line b c d, on_tline b c o c; e = on_line e a c, on_line e b d; r = on_line r a d, on_line r b c; h = foot h r a b ? coll r e h diff --git a/output_new/ceva_c2.txt b/output_new/ceva_c2.txt new file mode 100644 index 0000000..e0c6ccd --- /dev/null +++ b/output_new/ceva_c2.txt @@ -0,0 +1,21 @@ + +========================== + * From theorem premises: +A B C D E F G : Points +D,B,C are collinear [00] +DB = DC [01] +D,A,E are collinear [02] +A,B,F are collinear [03] +E,F,C are collinear [04] +A,G,C are collinear [05] +G,B,E are collinear [06] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. A,G,C are collinear [05] & D,B,C are collinear [00] & A,B,F are collinear [03] & E,F,C are collinear [04] & G,B,E are collinear [06] & D,A,E are collinear [02] (Ceva)⇒ (CD:DB) * (AG:GC) * (BF:FA) = 1 [07] +002. (CD:DB) * (AG:GC) * (BF:FA) = 1 [07] & DB = DC [01] ⇒ AG:GC = FA:BF [08] +003. AG:GC = FA:BF [08] & A,G,C are collinear [05] & A,B,F are collinear [03] ⇒ GF ∥ CB +========================== diff --git a/output_new/ceva_c3.txt b/output_new/ceva_c3.txt new file mode 100644 index 0000000..1cab7f3 --- /dev/null +++ b/output_new/ceva_c3.txt @@ -0,0 +1,30 @@ + +========================== + * From theorem premises: +A B C D E F G H : Points +DA = DB [00] +DB = DC [01] +BE ⟂ BD [02] +CE ⟂ CD [03] +DC ⟂ FC [04] +AF ⟂ AD [05] +DB ⟂ GB [06] +DA ⟂ GA [07] +A,H,E are collinear [08] +B,H,F are collinear [09] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. DB ⟂ GB [06] & BE ⟂ BD [02] ⇒ B,G,E are collinear [10] +002. DC ⟂ FC [04] & CE ⟂ CD [03] ⇒ E,F,C are collinear [11] +003. DA ⟂ GA [07] & AF ⟂ AD [05] ⇒ A,F,G are collinear [12] +004. DA = DB [00] & DA ⟂ AG [07] & BG ⟂ DB [06] (Circle Power)⇒ GB = AG [13] +005. DB = DC [01] & CE ⟂ CD [03] & BE ⟂ BD [02] (Circle Power)⇒ EC = BE [14] +006. DB = DC [01] & DA = DB [00] ⇒ DA = DC [15] +007. DA = DC [15] & AF ⟂ AD [05] & DC ⟂ CF [04] (Circle Power)⇒ CF = FA [16] +008. GB = AG [13] & EC = BE [14] & CF = FA [16] ⇒ (GB:BE) * (EC:CF) * (FA:AG) = 1 [17] +009. B,G,E are collinear [10] & E,F,C are collinear [11] & A,F,G are collinear [12] & A,H,E are collinear [08] & B,H,F are collinear [09] & (GB:BE) * (EC:CF) * (FA:AG) = 1 [17] (Ceva)⇒ G,H,C are collinear +========================== diff --git a/output_new/ceva_c32.txt b/output_new/ceva_c32.txt new file mode 100644 index 0000000..9f05a4f --- /dev/null +++ b/output_new/ceva_c32.txt @@ -0,0 +1,22 @@ + +========================== + * From theorem premises: +A B C D E F G : Points +C,B,D are collinear [00] +C,A,E are collinear [01] +∠ADE = ∠EDC [02] +B,F,A are collinear [03] +∠ADF = ∠FDB [04] +G,B,E are collinear [05] +G,F,C are collinear [06] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. ∠CDE = ∠EDA [02] & C,A,E are collinear [01] ⇒ CE:AE = CD:DA [07] +002. ∠BDF = ∠FDA [04] & B,F,A are collinear [03] ⇒ FB:FA = DB:DA [08] +003. CE:AE = CD:DA [07] & FB:FA = DB:DA [08] (Ratio chase)⇒ (AE:FA) * (FB:DB) * (CD:CE) = 1 [09] +004. B,F,A are collinear [03] & C,B,D are collinear [00] & C,A,E are collinear [01] & G,B,E are collinear [05] & G,F,C are collinear [06] & (AE:FA) * (FB:DB) * (CD:CE) = 1 [09] (Ceva)⇒ G,D,A are collinear +========================== diff --git a/output_new/ceva_c5.txt b/output_new/ceva_c5.txt new file mode 100644 index 0000000..0bc5460 --- /dev/null +++ b/output_new/ceva_c5.txt @@ -0,0 +1,33 @@ + +========================== + * From theorem premises: +A B C D E F G : Points +C,D,B are collinear [00] +∠DAB = ∠CAD [01] +E,D,A are collinear [02] +BE ⟂ AD [03] +C,B,F are collinear [04] +FB = FC [05] +G,A,F are collinear [06] +G,E,B are collinear [07] + + * Auxiliary Constructions: +H : Points +B,H,A are collinear [08] +HB = HA [09] + + * Proof steps: +001. C,B,F are collinear [04] & C,D,B are collinear [00] ⇒ D,F,B are collinear [10] +002. E,D,A are collinear [02] & AD ⟂ BE [03] ⇒ AE ⟂ EB [11] +003. B,H,A are collinear [08] & HB = HA [09] ⇒ H is midpoint of BA [12] +004. AE ⟂ EB [11] & H is midpoint of BA [12] ⇒ AH = EH [13] +005. AH = EH [13] ⇒ ∠HAE = ∠AEH [14] +006. C,B,F are collinear [04] & FB = FC [05] ⇒ F is midpoint of BC [15] +007. H is midpoint of BA [12] & F is midpoint of BC [15] ⇒ HF ∥ AC [16] +008. E,D,A are collinear [02] & ∠HAE = ∠AEH [14] & B,H,A are collinear [08] & ∠DAB = ∠CAD [01] & AC ∥ FH [16] ⇒ ∠(HF-ED) = ∠HED [17] +009. ∠(HF-ED) = ∠HED [17] ⇒ HF ∥ EH [18] +010. FH ∥ EH [18] ⇒ E,H,F are collinear [19] +011. G,A,F are collinear [06] & B,H,A are collinear [08] & D,F,B are collinear [10] & E,D,A are collinear [02] & G,E,B are collinear [07] & E,H,F are collinear [19] (Ceva)⇒ (AH:HB) * (FG:GA) * (BD:DF) = 1 [20] +012. (AH:HB) * (FG:GA) * (BD:DF) = 1 [20] & HB = HA [09] ⇒ FG:GA = DF:BD [21] +013. FG:GA = DF:BD [21] & G,A,F are collinear [06] & D,F,B are collinear [10] ⇒ GD ∥ AB +========================== From f2a409761256986063fb14810b19066f835bb6db Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973.stu.pku.edu.cn> Date: Sun, 30 Mar 2025 21:04:14 +0800 Subject: [PATCH 25/27] hard_ratio --- chiaya.sh | 2 +- dd.py | 21 +-- graph.py | 7 +- kirine.txt | 53 ++++++-- newpros.txt | 48 ++++--- nothing.txt | 71 +++++++++- output_new/{example2_1.txt => ceva_a1.txt} | 4 +- output_new/ceva_b2.txt | 34 +++++ output_new/menelaus_a11.txt | 54 ++++++++ output_new/menelaus_b10.txt | 151 +++++++++++++++++++++ output_new/menelaus_b12.txt | 36 +++++ output_new/menelaus_b13.txt | 59 ++++++++ output_new/menelaus_b3.txt | 54 ++++++++ output_new/menelaus_b9.txt | 64 +++++++++ output_new/menelaus_b9w.txt | 97 +++++++++++++ problem.py | 17 ++- test.py | 9 +- 17 files changed, 724 insertions(+), 57 deletions(-) rename output_new/{example2_1.txt => ceva_a1.txt} (97%) create mode 100644 output_new/ceva_b2.txt create mode 100644 output_new/menelaus_a11.txt create mode 100644 output_new/menelaus_b10.txt create mode 100644 output_new/menelaus_b12.txt create mode 100644 output_new/menelaus_b13.txt create mode 100644 output_new/menelaus_b3.txt create mode 100644 output_new/menelaus_b9.txt create mode 100644 output_new/menelaus_b9w.txt diff --git a/chiaya.sh b/chiaya.sh index e34230e..8d78a68 100644 --- a/chiaya.sh +++ b/chiaya.sh @@ -42,7 +42,7 @@ SERIES=Menelaus_a python -m alphageometry \ --alsologtostderr \ --problems_file=$(pwd)/$INPUT_FILE \ ---problem_name=Menelaus_Newton \ +--problem_name=Menelaus_b9w \ --mode=alphageometry \ "${DDAR_ARGS[@]}" \ "${SEARCH_ARGS[@]}" \ diff --git a/dd.py b/dd.py index 757b09a..5f59707 100644 --- a/dd.py +++ b/dd.py @@ -1026,9 +1026,9 @@ def match_menelaus_rev( recordp.add((f, d, e)) recordp.add((f, e, d)) - x1 = g.check_onseg([d, b, c]) - x2 = g.check_onseg([e, c, a]) - x3 = g.check_onseg([f, a, b]) + x1 = int(g.check_onseg([d, b, c])) + x2 = int(g.check_onseg([e, c, a])) + x3 = int(g.check_onseg([f, a, b])) if x1 + x2 + x3 not in {0, 2}: continue if g.check_eqratio30([a, f, f, b, b, d, d, c, c, e, e, a]): @@ -1079,11 +1079,12 @@ def match_ceva_rev( recordp.add((f, d, e)) recordp.add((f, e, d)) - x1 = g.check_onseg([d, b, c]) - x2 = g.check_onseg([e, c, a]) - x3 = g.check_onseg([f, a, b]) + x1 = int(g.check_onseg([d, b, c])) + x2 = int(g.check_onseg([e, c, a])) + x3 = int(g.check_onseg([f, a, b])) if x1 + x2 + x3 not in {1, 3}: continue + #print(x1+x2+x3) if g.check_eqratio30([a, f, f, b, b, d, d, c, c, e, e, a]): ad = g._get_line(a, d) be = g._get_line(b, e) @@ -1093,21 +1094,21 @@ def match_ceva_rev( bes = be.neighbors(gm.Point, return_set=True) pab = intersect1(ads, bes) if pab: - #debugname([pab, c, a, b, f, d, e]) + #debugname([pab, c, a, b, f, d, e],(x3,x1,x2)) yield dict(zip('PABCDEF', [pab, c, a, b, f, d, e])) if be and cf: bes = be.neighbors(gm.Point, return_set=True) cfs = cf.neighbors(gm.Point, return_set=True) pbc = intersect1(bes, cfs) if pbc: - #debugname([pbc, a, b, c, d, e, f]) + #debugname([pbc, a, b, c, d, e, f],(x1,x2,x3)) yield dict(zip('PABCDEF', [pbc, a, b, c, d, e, f])) if cf and ad: cfs = cf.neighbors(gm.Point, return_set=True) ads = ad.neighbors(gm.Point, return_set=True) pca = intersect1(cfs, ads) if pca: - #debugname([pca, b, c, a, e, f, d]) + #debugname([pca, b, c, a, e, f, d],(x2,x3,x1)) yield dict(zip('PABCDEF', [pca, b, c, a, e, f, d])) tb = time.time() #print(tb-ta) @@ -1133,7 +1134,7 @@ def match_eqratio6_coll_coll_eqratio( continue record.add((a, b, c, p, q, r)) - debugname([a, b, c, p, q, r]) + #debugname([a, b, c, p, q, r]) yield dict(zip('ABCPQR', [a, b, c, p, q, r])) yield dict(zip('ABCPQR', [c, b, a, r, q, p])) diff --git a/graph.py b/graph.py index 17cc245..e068c6c 100644 --- a/graph.py +++ b/graph.py @@ -667,8 +667,9 @@ def build_problem( args = list(map(lambda x: g.get(x, lambda: int(x)), pr.goal.args)) check = nm.check(pr.goal.name, args) print(check) - if not check: - return + #check = True + #if not check: + #return g.url = pr.url g.build_def = (pr, definitions) @@ -1720,7 +1721,7 @@ def add_cyclic( """Add a new cyclic predicate that 4 points are concyclic.""" points = list(set(points)) og_points = list(points) - #print([p.name for p in points]) + print([p.name for p in points]) all_circles = [] for p1, p2, p3 in utils.comb3(points): diff --git a/kirine.txt b/kirine.txt index 9f05a4f..88cebeb 100644 --- a/kirine.txt +++ b/kirine.txt @@ -1,22 +1,47 @@ ========================== * From theorem premises: -A B C D E F G : Points -C,B,D are collinear [00] -C,A,E are collinear [01] -∠ADE = ∠EDC [02] -B,F,A are collinear [03] -∠ADF = ∠FDB [04] -G,B,E are collinear [05] -G,F,C are collinear [06] +A B C G D E F H I J L : Points +∠GAB = ∠CAG [00] +∠ACG = ∠GCB [01] +DG ⟂ BC [02] +C,B,D are collinear [03] +C,E,A are collinear [04] +EG ⟂ AC [05] +B,F,A are collinear [06] +FG ⟂ AB [07] +BC ⟂ HD [08] +HI = HD [09] +CI = CD [10] +HJ = HD [11] +BJ = BD [12] +C,B,L are collinear [13] +F,E,L are collinear [14] * Auxiliary Constructions: -: Points - +K : Points +C,K,I are collinear [15] +B,J,K are collinear [16] * Proof steps: -001. ∠CDE = ∠EDA [02] & C,A,E are collinear [01] ⇒ CE:AE = CD:DA [07] -002. ∠BDF = ∠FDA [04] & B,F,A are collinear [03] ⇒ FB:FA = DB:DA [08] -003. CE:AE = CD:DA [07] & FB:FA = DB:DA [08] (Ratio chase)⇒ (AE:FA) * (FB:DB) * (CD:CE) = 1 [09] -004. B,F,A are collinear [03] & C,B,D are collinear [00] & C,A,E are collinear [01] & G,B,E are collinear [05] & G,F,C are collinear [06] & (AE:FA) * (FB:DB) * (CD:CE) = 1 [09] (Ceva)⇒ G,D,A are collinear +001. HJ = HD [11] & HI = HD [09] ⇒ HI = HJ [17] +002. HI = HD [09] & CI = CD [10] (SSS)⇒ ∠HDC = ∠CIH [18] +003. I,K,C are collinear [15] & ∠HDC = ∠CIH [18] & BC ⟂ HD [08] & DG ⟂ BC [02] & C,B,D are collinear [03] ⇒ HI ⟂ IK [19] +004. HJ = HD [11] & BJ = BD [12] (SSS)⇒ ∠HDB = ∠BJH [20] +005. B,K,J are collinear [16] & ∠HDB = ∠BJH [20] & BC ⟂ HD [08] & DG ⟂ BC [02] & C,B,D are collinear [03] ⇒ HJ ⟂ JK [21] +006. HI = HJ [17] & HI ⟂ IK [19] & HJ ⟂ JK [21] (Circle Power)⇒ KI = JK [22] +007. C,B,L are collinear [13] & B,F,A are collinear [06] & C,E,A are collinear [04] & F,E,L are collinear [14] (Menelaus)⇒ (AE:FA) * (BF:LB) * (CL:EC) = 1 [23] +008. B,F,A are collinear [06] & C,E,A are collinear [04] & EG ⟂ AC [05] & FG ⟂ AB [07] ⇒ ∠GFA = ∠AEG [24] +009. B,F,A are collinear [06] & C,E,A are collinear [04] & ∠GAB = ∠CAG [00] ⇒ ∠GAF = ∠EAG [25] +010. ∠GFA = ∠AEG [24] & ∠GAF = ∠EAG [25] (Similar Triangles)⇒ AF = AE [26] +011. ∠GFA = ∠AEG [24] & ∠GAF = ∠EAG [25] (Similar Triangles)⇒ GF = GE [27] +012. C,B,D are collinear [03] & C,E,A are collinear [04] & EG ⟂ AC [05] & DG ⟂ BC [02] ⇒ ∠GDC = ∠CEG [28] +013. C,B,D are collinear [03] & C,E,A are collinear [04] & ∠GCB = ∠ACG [01] ⇒ ∠GCD = ∠ECG [29] +014. ∠GDC = ∠CEG [28] & ∠GCD = ∠ECG [29] (Similar Triangles)⇒ GD = GE [30] +015. GD = GE [30] & GF = GE [27] ⇒ GF = GD [31] +016. B,F,A are collinear [06] & FG ⟂ AB [07] ⇒ FG ⟂ BF [32] +017. C,B,D are collinear [03] & DG ⟂ BC [02] ⇒ GD ⟂ DB [33] +018. GF = GD [31] & FG ⟂ BF [32] & GD ⟂ DB [33] (Circle Power)⇒ BF = BD [34] +019. KI = JK [22] & (AE:FA) * (BF:LB) * (CL:EC) = 1 [23] & AF = AE [26] & CI = CD [10] & BF = BD [34] & BJ = BD [12] ⇒ (KI:IC) * (CL:LB) * (BJ:JK) = 1 [35] +020. C,K,I are collinear [15] & C,B,L are collinear [13] & B,J,K are collinear [16] & (KI:IC) * (CL:LB) * (BJ:JK) = 1 [35] (Menelaus)⇒ I,J,L are collinear ========================== diff --git a/newpros.txt b/newpros.txt index 9d54016..de8fc44 100644 --- a/newpros.txt +++ b/newpros.txt @@ -4,28 +4,16 @@ Menelaus_c22 a b c = triangle a b c; d = on_line d b c; f = on_line f a c; e = mirror e f d; p = on_line p a d, on_line p b e; m = on_line m a b, on_line m d f; n = on_line n p c, on_line n d f ? cong d m d n Menelaus_c32 a b c = triangle a b c; i = incenter i a b c; d = on_line d a i, on_line d b c; e = on_line e b i, on_line e c a; f = on_tline f c c i, on_line f a b ? coll d e f -Menelaus_a2 -a b c = triangle a b c; o = circle o a b c; p = on_line p b c, on_tline p a o a; q = on_line q a c, on_tline q b o b; r = on_line r a b, on_tline r c o c ? coll p q r -Menelaus_a11 -a b c = triangle a b c; d = on_line d a b; e = on_line e a c; f = midpoint f d e; g = on_line g d e; h = mirror h g f; i = on_line i a b; j = on_line j g i, on_line j a c; k = on_line k a b; l = on_line l k h, on_line l a c; m = on_line m j k, on_line m d e; n = on_line n i l, on_line n d e ? cong f m f n -Menelaus_b3 -a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; q = on_line q a c, on_line q b d; e = foot e q a b; f = foot f q b c; g = foot g q c d; h = foot h q d a; p = on_line p e h, on_line p b d ? coll p f g -Menelaus_b10 -a b c = triangle a b c; d = foot d a b c; x e g o1 = excenter2 x e g o1 c a b; y f h o2 = excenter2 y f h o2 b a c; q = on_line q a d, on_line q f h ? coll q e g Menelaus_Desargues a b c = triangle a b c; d e = segment d e; g = on_line g a d, on_line g b e; f = on_line f g c; l = on_line l a b, on_line l d e; m = on_line m b c, on_line m e f; n = on_line n a c, on_line n d f ? coll l m n Menelaus_Pappus a b = segment a b; c d = segment c d; e = on_line e a c; f = on_line f b d; g = on_line g a b, on_line g d e; h = on_line h b c, on_line h e f; i = on_line i c d, on_line i f a; j = on_line j c d, on_line j e f; k = on_line k a b, on_line k e f; l = on_line l a b, on_line l c d ? coll g h i Menelaus_Newton a b c = triangle a b c; d = free; e = on_line e a b, on_line e c d; f = on_line f a d, on_line f b c; g = midpoint g a c; h = midpoint h b d; i = midpoint i e f; j = midpoint j c e; k = midpoint k b c; l = midpoint l b e ? coll g h i -Menelaus_b6 -a b c = triangle a b c; h = orthocenter h a b c; e = on_line e a b; f = on_line f b c, on_line f e h; d = on_line d a c, on_line d e h; m = on_tline m h e h, on_line m b c; n = on_line n a b, on_line n m h; p = on_line p a c, on_line p m h ? eqratio d e e f p n m n -Menelaus_b15 -a b c = triangle a b c; m = midpoint m b c; i = incenter i a b c; d = on_line d m i, on_line d a c; o = circle o a b c; e = on_line e b i, on_circle e o a; f = on_line f b i, on_line f a c ? eqratio e d e i i c i b -Ceva_a1 -a b c = triangle a b c; d = foot d a b c; h = on_line h a d; e = on_line e a c, on_line e b h; f = on_line f a b, on_line f c h; p = on_pline p a b c, on_line p d f; q = on_line q p a, on_line q d e ? cong a p a q -tangent -a b c = triangle a b c; o = circle o a b c; p = on_tline p a o a, on_line p b c ? eqratio30 a b a c a b a c p c p b +Menelaus_a2 +a b c = triangle a b c; o = circle o a b c; p = on_line p b c, on_tline p a o a; q = on_line q a c, on_tline q b o b; r = on_line r a b, on_tline r c o c ? coll p q r +Menelaus_a11 +a b c = triangle a b c; d = on_line d a b; e = on_line e a c; f = midpoint f d e; g = on_line g d e; h = mirror h g f; i = on_line i a b; j = on_line j g i, on_line j a c; k = on_line k a b; l = on_line l k h, on_line l a c; m = on_line m j k, on_line m d e; n = on_line n i l, on_line n d e ? cong f m f n Ceva_c2 a b c = triangle a b c; d = midpoint d b c; e = on_line e a d; f = on_line f a b, on_line f e c; g = on_line g a c, on_line g e b ? para f g b c Ceva_c3 @@ -37,4 +25,30 @@ a b d = triangle a b d; c = angle_bisector c b a d; e = on_line e c d; f = on_li Ceva_c32 a b c = triangle a b c; d = on_line d b c; e = angle_bisector e a d c, on_line e a c; f = angle_bisector f a d b, on_line f a b; g = on_line g b e, on_line g c f ? coll g a d Ceva_b2 -c d = segment c d; o = midpoint o c d; a = on_line a c d, on_tline a d o d; b = on_line b c d, on_tline b c o c; e = on_line e a c, on_line e b d; r = on_line r a d, on_line r b c; h = foot h r a b ? coll r e h +c d = segment c d; o = on_bline o c d; a = on_tline a d o d; b = on_tline b c o c, on_line b o a; e = on_line e a c, on_line e b d; r = on_line r a d, on_line r b c; f = foot f r a b ? coll r e f +Menelaus_b3 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; q = on_line q a c, on_line q b d; e = foot e q a b; f = foot f q b c; g = foot g q c d; h = foot h q d a; p = on_line p e h, on_line p b d ? coll p f g +Menelaus_b6 +a b c = triangle a b c; h = orthocenter h a b c; e = on_line e a b; f = on_line f b c, on_line f e h; d = on_line d a c, on_line d e h; m = on_tline m h e h, on_line m b c; n = on_line n a b, on_line n m h; p = on_line p a c, on_line p m h ? eqratio d e e f p n m n +Menelaus_b10 +a b c = triangle a b c; d = foot d a b c; x e g o1 = excenter2 x e g o1 c a b; y f h o2 = excenter2 y f h o2 b a c; q = on_line q a d, on_line q f h ? coll q e g +Menelaus_b15 +a b c = triangle a b c; m = midpoint m b c; i = incenter i a b c; d = on_line d m i, on_line d a c; o = circle o a b c; e = on_line e b i, on_circle e o a; f = on_line f b i, on_line f a c ? eqratio e d e i i c i b +Ceva_a1 +a b c = triangle a b c; d = foot d a b c; h = on_line h a d; e = on_line e a c, on_line e b h; f = on_line f a b, on_line f c h; p = on_pline p a b c, on_line p d f; q = on_line q p a, on_line q d e ? cong a p a q +tangent +a b c = triangle a b c; o = circle o a b c; p = on_tline p a o a, on_line p b c ? eqratio30 a b a c a b a c p c p b +Menelaus_b11 +a b c = triangle a b c; o = circle o a b c; p = on_tline p a o a, on_tline p b o b; d = on_line d p c, on_circle d o a; e = on_pline e c p a, on_line e a b; f = on_line f c e, on_line f a d; k = on_line k c d, on_line k a b; m = on_line m o p, on_line m a b ? cyclic o m c d +Menelaus_b12 +a b c = triangle a b c; m = midpoint m b c; d = on_line d b c; e = mirror e d m; f = on_line f a b; g = on_line g a c; k = on_line k f e, on_line k g d; v = on_line v f d, on_line v g e; l = on_line l a k, on_line l b c; t = on_line t a v, on_line t b c ? cong d t e l +Menelaus_b13 +x y = segment x y; p = on_line p x y; a = on_circle a x p; b c = tangent b c a y p; d = on_line d a b, on_circle d x a; e = on_line e a c, on_circle e x a; r = on_line r d e, on_line r b c; q = on_line q p r, on_circle q x a ? coll a q y +Menelaus_b2a +a b c = triangle a b c; d = midpoint d b c; e = midpoint e c a; f = midpoint f a b; g = on_line g b e, on_line g c f; x = on_pline x g b c, on_line x a b; y = on_line y g x, on_line y a c; p = on_line p b y, on_line p c g; q = on_line q c x, on_line q b g ? eqratio d p a b d q a c +Menelaus_b2b +a b c = triangle a b c; d = midpoint d b c; e = midpoint e c a; f = midpoint f a b; g = on_line g b e, on_line g c f; x = on_pline x g b c, on_line x a b; y = on_line y g x, on_line y a c; p = on_line p b y, on_line p c g; q = on_line q c x, on_line q b g ? eqratio d p a b p q b c +Menelaus_b9w +a b c = triangle a b c; d e f i = incenter2 d e f i a b c; j = on_tline j d b c; y = on_circle y j d, on_circle y c d; z = on_circle z j d, on_circle z b d; x = on_line x z b, on_line x y c; p = on_line p b c, on_line p e f ? coll p y z +Menelaus_b9 +a b c = triangle a b c; d e f i = incenter2 d e f i a b c; j = on_tline j d b c; y = on_circle y j d, on_circle y c d; z = on_circle z j d, on_circle z b d; x = on_line x z b, on_line x y c; p = on_line p b c, on_line p e f ? cyclic e f y z \ No newline at end of file diff --git a/nothing.txt b/nothing.txt index e3cffbb..b27c836 100644 --- a/nothing.txt +++ b/nothing.txt @@ -744,7 +744,7 @@ Menelaus_b2a x a b c = triangle a b c; d = midpoint d b c; e = midpoint e c a; f = midpoint f a b; g = on_line g b e, on_line g c f; x = on_pline x g b c, on_line x a b; y = on_line y g h, on_line y a c; p = on_line p b y, on_line p c g; q = on_line q c x, on_line q b g ? eqratio m p a b m q a c Menelaus_b2b x a b c = triangle a b c; d = midpoint d b c; e = midpoint e c a; f = midpoint f a b; g = on_line g b e, on_line g c f; x = on_pline x g b c, on_line x a b; y = on_line y g h, on_line y a c; p = on_line p b y, on_line p c g; q = on_line q c x, on_line q b g ? eqratio m p a b p q b c -Menelaus_b3 x +Menelaus_b3 v a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; q = on_line q a c, on_line q b d; e = foot e q a b; f = foot f q b c; g = foot g q c d; h = foot h q d a; p = on_line p e h, on_line p b d ? coll p f g Menelaus_b6 v a b c = triangle a b c; h = orthocenter h a b c; e = on_line e a b; f = on_line f b c, on_line f e h; d = on_line d a c, on_line d e h; m = on_tline m h e h, on_line m b c; n = on_line n a b, on_line n m h; p = on_line p a c, on_line p m h ? eqratio d e e f p n m n @@ -752,15 +752,15 @@ Menelaus_b9 x a b c = triangle a b c; d e f i = incenter2 d e f i a b c; x = on_tline x d b c; i2 = incenter i2 x b c; y = foot y i2 x c; z = foot z i2 x b ? cyclic x y e f Menelaus_b9w x a b c = triangle a b c; d e f i = incenter2 d e f i a b c; x = on_tline x d b c; i2 = incenter i2 x b c; y = foot y i2 x c; z = foot z i2 x b; p = on_line p b c, on_line p e f ? coll p x y -Menelaus_b10 x +Menelaus_b10 ? a b c = triangle a b c; d = foot d a b c; x e g o1 = excenter2 x e g o1 c a b; y f h o2 = excenter2 y f h o2 b a c; q = on_line q a d, on_line q f h ? coll q e g Menelaus_b11 x a b c = triangle a b c; o = circle o a b c; p = on_tline p a o a, on_tline p b o b; d = on_line d p c, on_circle d o a; e = on_pline e c p a, on_line e a b; f = on_line f c e, on_line f a d; k = on_line k c d, on_line k a b ? cong e c e f Menelaus_b11w x a b c = triangle a b c; o = circle o a b c; p = on_tline p a o a, on_tline p b o b; d = on_line d p c, on_circle d o a; e = on_pline e c p a, on_line e a b; f = on_line f c e, on_line f a d; k = on_line k c d, on_line k a b; m = on_line m o p, on_line m a b ? cyclic o m c d -Menelaus_b12 x +Menelaus_b12 v a b c = triangle a b c; m = midpoint m a b; d = on_line d b c; e = mirror e m d; f = on_line f a b; g = on_line g a c; k = on_line k f e, on_line k g d; v = on_line v f d, on_line v g e; l = on_line l a k, on_line l b c; t = on_line t a v, on_line t b c ? cong d t e l -Menelaus_b13 x +Menelaus_b13 v x y = segment x y; p = on_line p x y; a = on_circle a x p; b c = tangent b c a y p; d = on_line d a b, on_circle d x a; e = on_line e a c, on_circle e x a; r = on_line r d e, on_line r b c; q = on_line q p r, on_circle q x a ? coll a q y Menelaus_b15w v a b c = triangle a b c; m = midpoint m b c; i = incenter i a b c; d = on_line d m i, on_line d a c; o = circle o a b c; e = on_line e b i, on_circle e o a; f = on_line f b i, on_line f a c ? eqratio e d e i i c i b @@ -786,5 +786,66 @@ Ceva_c22 o a b d = triangle a b d; c = angle_bisector c b a d; e = on_line e c d; f = on_line f b e, on_line f a c; g = on_line g d f, on_line g b c; h = on_line h a c, on_line h b d ? eqangle a g a c a c a e Ceva_c32 v a b c = triangle a b c; d = on_line d b c; e = angle_bisector e a d c, on_line e a c; f = angle_bisector f a d b, on_line f a b; g = on_line g b e, on_line g c f ? coll g a d -Ceva_b2 x +Ceva_b2 v c d = segment c d; o = midpoint o c d; a = on_line a c d, on_tline a d o d; b = on_line b c d, on_tline b c o c; e = on_line e a c, on_line e b d; r = on_line r a d, on_line r b c; h = foot h r a b ? coll r e h + + +========================== + * From theorem premises: +A B C D E F : Points +D,B,C are collinear [00] +D,E,A are collinear [01] +C,F,A are collinear [02] +B,E,F are collinear [03] + + * Auxiliary Constructions: +G H I : Points +G,C,E are collinear [04] +G,B,A are collinear [05] +G,H,D are collinear [06] +HA ∥ BC [07] +D,F,I are collinear [08] +H,I,A are collinear [09] + + * Proof steps: +001. C,F,A are collinear [02] & D,E,A are collinear [01] & D,B,C are collinear [00] & B,E,F are collinear [03] (Menelaus)⇒ (CF:FA) * (EA:BC) * (BD:DE) = 1 [10] +002. D,B,C are collinear [00] & C,F,A are collinear [02] & D,E,A are collinear [01] & G,C,E are collinear [04] & G,B,A are collinear [05] & (CF:FA) * (EA:BC) * (BD:DE) = 1 [10] (Ceva)⇒ G,D,F are collinear [11] +003. B,C,D are collinear [00] & C,F,A are collinear [02] & G,D,F are collinear [11] & G,H,D are collinear [06] & D,F,I are collinear [08] & H,I,A are collinear [09] & AH ∥ BC [07] ⇒ ∠ACD = ∠AFD +========================== + + +========================== + * From theorem premises: +A B C G D E F H I J L : Points +∠GAB = ∠CAG [00] +∠GCA = ∠BCG [01] +D,B,C are collinear [02] +DG ⟂ BC [03] +C,A,E are collinear [04] +EG ⟂ AC [05] +B,F,A are collinear [06] +FG ⟂ AB [07] +BC ⟂ HD [08] +HI = HD [09] +CI = CD [10] +HJ = HD [11] +BJ = BD [12] +B,C,L are collinear [13] +F,L,E are collinear [14] + + * Auxiliary Constructions: +K : Points +K,C,I are collinear [15] +K,J,B are collinear [16] + + * Proof steps: +001. HI = HD [09] & HJ = HD [11] ⇒ HJ = HI [17] +002. HJ = HD [11] & BJ = BD [12] (SSS)⇒ ∠HJB = ∠BDH [18] +003. K,J,B are collinear [16] & ∠HJB = ∠BDH [18] & D,B,C are collinear [02] & BC ⟂ HD [08] & DG ⟂ BC [03] ⇒ JH ⟂ KJ [19] +004. HI = HD [09] & CI = CD [10] (SSS)⇒ ∠HDC = ∠CIH [20] +005. K,C,I are collinear [15] & ∠HDC = ∠CIH [20] & BC ⟂ HD [08] & DG ⟂ BC [03] & D,B,C are collinear [02] ⇒ HI ⟂ IK [21] +006. HJ = HI [17] & JH ⟂ KJ [19] & HI ⟂ IK [21] (Circle Power)⇒ KI = JK [22] +007. B,C,L are collinear [13] & B,F,A are collinear [06] & C,A,E are collinear [04] & F,L,E are collinear [14] (Menelaus)⇒ (AE:FA) * (BF:LB) * (CL:EC) = 1 [23] +008. B,F,A are collinear [06] & C,A,E are collinear [04] & EG ⟂ AC [05] & FG ⟂ AB [07] ⇒ ∠GFA = ∠AEG [24] +009. B,F,A are collinear [06] & C,A,E are collinear [04] & ∠GAB = ∠CAG [00] ⇒ ∠GAF = ∠EAG [25] +010. ∠GFA = ∠AEG [24] & ∠GAF = ∠EAG [25] (Similar Triangles)⇒ AF = AE [26] diff --git a/output_new/example2_1.txt b/output_new/ceva_a1.txt similarity index 97% rename from output_new/example2_1.txt rename to output_new/ceva_a1.txt index d250bc1..30dec97 100644 --- a/output_new/example2_1.txt +++ b/output_new/ceva_a1.txt @@ -26,4 +26,6 @@ I,D,F are collinear [09] 006. C,A,F are collinear [02] & E,A,D are collinear [01] & C,B,D are collinear [00] & B,E,F are collinear [03] (Menelaus)⇒ (CF:AF) * (AE:CB) * (BD:ED) = 1 [15] 007. A,B,G are collinear [04] & E,A,D are collinear [01] & C,B,D are collinear [00] & C,E,G are collinear [05] (Menelaus)⇒ (BG:AG) * (AE:CB) * (CD:ED) = 1 [16] 008. IF:DF = AF:CF [11] & IF:DF = IA:CD [12] & AG:BG = AH:BD [14] & (CF:AF) * (AE:CB) * (BD:ED) = 1 [15] & (BG:AG) * (AE:CB) * (CD:ED) = 1 [16] (Ratio chase)⇒ IA = AH -========================== \ No newline at end of file +========================== + + diff --git a/output_new/ceva_b2.txt b/output_new/ceva_b2.txt new file mode 100644 index 0000000..6c05b9b --- /dev/null +++ b/output_new/ceva_b2.txt @@ -0,0 +1,34 @@ + +========================== + * From theorem premises: +A B C D E F G H : Points +CA = CB [00] +BD ⟂ BC [01] +AE ⟂ AC [02] +C,E,D are collinear [03] +B,F,E are collinear [04] +A,F,D are collinear [05] +A,G,E are collinear [06] +B,G,D are collinear [07] +H,E,D are collinear [08] +HG ⟂ DE [09] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. A,G,E are collinear [06] & AC ⟂ AE [02] ⇒ AC ⟂ AG [10] +002. B,G,D are collinear [07] & BC ⟂ BD [01] ⇒ BC ⟂ BG [11] +003. CA = CB [00] & AC ⟂ AG [10] & BC ⟂ BG [11] (Circle Power)⇒ GA = BG [12] +004. H,E,D are collinear [08] & C,E,D are collinear [03] & HG ⟂ DE [09] & AE ⟂ AC [02] ⇒ ∠CAE = ∠EHG [13] +005. C,E,D are collinear [03] & H,E,D are collinear [08] & A,G,E are collinear [06] ⇒ ∠CEA = ∠HEG [14] +006. ∠CAE = ∠EHG [13] & ∠CEA = ∠HEG [14] (Similar Triangles)⇒ AC:AE = HG:HE [15] +007. H,E,D are collinear [08] & C,E,D are collinear [03] & HG ⟂ DE [09] & BD ⟂ BC [01] ⇒ ∠CBD = ∠DHG [16] +008. H,E,D are collinear [08] & C,E,D are collinear [03] & B,G,D are collinear [07] ⇒ ∠CDB = ∠HDG [17] +009. ∠CBD = ∠DHG [16] & ∠CDB = ∠HDG [17] (Similar Triangles)⇒ BC:BD = HG:HD [18] +010. HG:HD = BC:BD [18] & AC = BC [00] ⇒ HG:HD = AC:BD [19] +011. HG:HE = AC:AE [15] & HG:HD = AC:BD [19] ⇒ EH:AE = HD:DB [20] +012. GA = BG [12] & EH:AE = HD:DB [20] ⇒ (GA:AE) * (EH:HD) * (DB:BG) = 1 [21] +013. A,G,E are collinear [06] & E,H,D are collinear [08] & B,G,D are collinear [07] & B,F,E are collinear [04] & A,F,D are collinear [05] & (GA:AE) * (EH:HD) * (DB:BG) = 1 [21] (Ceva)⇒ H,G,F are collinear +========================== diff --git a/output_new/menelaus_a11.txt b/output_new/menelaus_a11.txt new file mode 100644 index 0000000..8fa3a33 --- /dev/null +++ b/output_new/menelaus_a11.txt @@ -0,0 +1,54 @@ + +========================== + * From theorem premises: +A B C D E F G H I J K L M N : Points +D,A,B are collinear [00] +E,A,C are collinear [01] +FD = FE [02] +D,E,F are collinear [03] +D,E,G are collinear [04] +G,H,F are collinear [05] +B,A,I are collinear [06] +A,J,C are collinear [07] +G,J,I are collinear [08] +K,A,B are collinear [09] +L,A,C are collinear [10] +K,L,H are collinear [11] +K,M,J are collinear [12] +D,E,M are collinear [13] +D,N,E are collinear [14] +N,L,I are collinear [15] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. B,A,I are collinear [06] & D,A,B are collinear [00] ⇒ D,I,A are collinear [16] +002. L,A,C are collinear [10] & E,A,C are collinear [01] ⇒ L,A,E are collinear [17] +003. D,N,E are collinear [14] & D,I,A are collinear [16] & A,L,E are collinear [17] & N,L,I are collinear [15] (Menelaus)⇒ (DN:NE) * (AI:LA) * (LE:DI) = 1 [18] +004. A,J,C are collinear [07] & E,A,C are collinear [01] ⇒ A,J,E are collinear [19] +005. D,E,G are collinear [04] & D,I,A are collinear [16] & A,J,E are collinear [19] & G,J,I are collinear [08] (Menelaus)⇒ (EG:DG) * (AJ:AI) * (DI:EJ) = 1 [20] +006. D,E,G are collinear [04] & D,I,A are collinear [16] & A,J,E are collinear [19] & G,J,I are collinear [08] (Menelaus)⇒ (GJ:GI) * (EA:DA) * (DI:EJ) = 1 [21] +007. D,E,G are collinear [04] & D,I,A are collinear [16] & A,J,E are collinear [19] & G,J,I are collinear [08] (Menelaus)⇒ (GJ:JI) * (AI:DA) * (DE:EG) = 1 [22] +008. D,A,B are collinear [00] & K,A,B are collinear [09] ⇒ K,A,D are collinear [23] +009. K,M,J are collinear [12] & D,K,A are collinear [23] & A,J,E are collinear [19] & D,E,M are collinear [13] (Menelaus)⇒ (MJ:KM) * (EA:DA) * (KD:EJ) = 1 [24] +010. K,M,J are collinear [12] & D,K,A are collinear [23] & A,J,E are collinear [19] & D,E,M are collinear [13] (Menelaus)⇒ (EM:DM) * (AJ:KA) * (KD:EJ) = 1 [25] +011. K,A,B are collinear [09] & K,A,D are collinear [23] & A,I,B are collinear [06] ⇒ I,K,D are collinear [26] +012. D,E,M are collinear [13] & D,E,G are collinear [04] ⇒ D,M,G are collinear [27] +013. G,J,I are collinear [08] & I,K,D are collinear [26] & D,M,G are collinear [27] & K,M,J are collinear [12] (Menelaus)⇒ (GJ:JI) * (DM:KD) * (KI:GM) = 1 [28] +014. G,J,I are collinear [08] & I,K,D are collinear [26] & D,M,G are collinear [27] & K,M,J are collinear [12] (Menelaus)⇒ (MJ:KJ) * (DG:DI) * (KI:GM) = 1 [29] +015. G,J,I are collinear [08] & I,K,D are collinear [26] & D,M,G are collinear [27] & K,M,J are collinear [12] (Menelaus)⇒ (KJ:KM) * (DM:DG) * (GI:JI) = 1 [30] +016. D,N,E are collinear [14] & G,H,F are collinear [05] & D,E,G are collinear [04] & D,E,F are collinear [03] ⇒ D,N,H are collinear [31] +017. K,L,H are collinear [11] & I,K,D are collinear [26] & D,N,H are collinear [31] & N,L,I are collinear [15] (Menelaus)⇒ (LH:KL) * (DN:DI) * (KI:NH) = 1 [32] +018. K,L,H are collinear [11] & I,K,D are collinear [26] & D,N,H are collinear [31] & N,L,I are collinear [15] (Menelaus)⇒ (NL:LI) * (DH:KD) * (KI:NH) = 1 [33] +019. G,H,F are collinear [05] & D,E,G are collinear [04] & D,E,F are collinear [03] ⇒ D,E,H are collinear [34] +020. K,L,H are collinear [11] & D,K,A are collinear [23] & D,E,H are collinear [34] & A,L,E are collinear [17] (Menelaus)⇒ (LH:KL) * (KA:DA) * (DE:EH) = 1 [35] +021. D,N,E are collinear [14] & D,E,G are collinear [04] ⇒ E,N,G are collinear [36] +022. L,A,C are collinear [10] & L,A,E are collinear [17] & A,J,C are collinear [07] ⇒ J,L,E are collinear [37] +023. N,L,I are collinear [15] & E,N,G are collinear [36] & G,J,I are collinear [08] & J,L,E are collinear [37] (Menelaus)⇒ (LI:NL) * (NE:EG) * (GJ:JI) = 1 [38] +024. (NE:DN) * (LA:AI) * (DI:LE) = 1 [18] & (EG:DG) * (AJ:AI) * (DI:EJ) = 1 [20] & (GJ:GI) * (EA:DA) * (DI:EJ) = 1 [21] & (MJ:KM) * (EA:DA) * (KD:EJ) = 1 [24] & (GJ:JI) * (DM:KD) * (KI:GM) = 1 [28] & (GJ:JI) * (AI:DA) * (DE:EG) = 1 [22] & (LH:KL) * (DN:DI) * (KI:NH) = 1 [32] & (LH:KL) * (KA:DA) * (DE:EH) = 1 [35] & (MJ:KJ) * (DG:DI) * (KI:GM) = 1 [29] & (NL:LI) * (DH:KD) * (KI:NH) = 1 [33] & (KJ:KM) * (DM:DG) * (GI:JI) = 1 [30] & (LI:NL) * (NE:EG) * (GJ:JI) = 1 [38] (Ratio chase)⇒ (KA:LA) * (EJ:DI) * (AI:AJ) * (LE:KD) = 1 [39] +025. (DN:NE) * (AI:LA) * (LE:DI) = 1 [18] & (KA:LA) * (EJ:DI) * (AI:AJ) * (LE:KD) = 1 [39] & (EM:DM) * (AJ:KA) * (KD:EJ) = 1 [25] ⇒ ME:MD = ND:NE [40] +026. ME:MD = ND:NE [40] & D,E,M are collinear [13] & D,N,E are collinear [14] ⇒ ME = ND [41] +027. FD = FE [02] & ME = ND [41] (Distance chase)⇒ FN = MF +========================== diff --git a/output_new/menelaus_b10.txt b/output_new/menelaus_b10.txt new file mode 100644 index 0000000..46d53d8 --- /dev/null +++ b/output_new/menelaus_b10.txt @@ -0,0 +1,151 @@ +========================== + * From theorem premises: +A B C D H F G L J K M : Points +AD ⟂ BC [00] +C,D,B are collinear [01] +∠ACH = ∠HCB [02] +∠HBC = ∠ABH [03] +C,B,F are collinear [04] +BC ⟂ HF [05] +GH ⟂ AC [06] +C,A,G are collinear [07] +∠ABL = ∠LBC [08] +∠LCB = ∠ACL [09] +C,B,J are collinear [10] +CB ⟂ LJ [11] +K,B,A are collinear [12] +BA ⟂ LK [13] +D,A,M are collinear [14] +K,J,M are collinear [15] + + * Auxiliary Constructions: +E I : Points +EH ⟂ AB [16] +B,E,A are collinear [17] +C,A,I are collinear [18] +AC ⟂ LI [19] + + * Proof steps: +001. C,B,J are collinear [10] & K,A,B are collinear [12] & EH ⟂ AB [16] & AD ⟂ BC [00] & CB ⟂ LJ [11] & BA ⟂ LK [13] ⇒ ∠LJB = ∠BKL [20] +002. C,B,J are collinear [10] & K,A,B are collinear [12] & ∠LBC = ∠ABL [08] ⇒ ∠LBJ = ∠KBL [21] +003. ∠LJB = ∠BKL [20] & ∠LBJ = ∠KBL [21] (Similar Triangles)⇒ LJ = LK [22] +004. ∠LJB = ∠BKL [20] & ∠LBJ = ∠KBL [21] (Similar Triangles)⇒ BK = BJ [23] +005. C,B,J are collinear [10] & C,A,I are collinear [18] & GH ⟂ AC [06] & AD ⟂ BC [00] & CB ⟂ LJ [11] & AC ⟂ LI [19] ⇒ ∠LJC = ∠CIL [24] +006. C,B,J are collinear [10] & C,A,I are collinear [18] & ∠LCB = ∠ACL [09] ⇒ ∠LCJ = ∠ICL [25] +007. ∠LJC = ∠CIL [24] & ∠LCJ = ∠ICL [25] (Similar Triangles)⇒ LJ = LI [26] +008. ∠LJC = ∠CIL [24] & ∠LCJ = ∠ICL [25] (Similar Triangles)⇒ CJ = CI [27] +009. LJ = LK [22] & LJ = LI [26] ⇒ L is the circumcenter of \Delta IKJ [28] +010. LJ = LK [22] & LJ = LI [26] ⇒ LI = LK [29] +011. C,B,J are collinear [10] & C,B,F are collinear [04] ⇒ C,J,F are collinear [30] +012. C,B,J are collinear [10] & C,B,F are collinear [04] ⇒ B,J,F are collinear [31] +013. C,B,F are collinear [04] & C,A,G are collinear [07] & GH ⟂ AC [06] & AD ⟂ BC [00] & BC ⟂ HF [05] ⇒ ∠HFC = ∠CGH [32] +014. C,B,F are collinear [04] & C,A,G are collinear [07] & ∠HCB = ∠ACH [02] ⇒ ∠HCF = ∠GCH [33] +015. ∠HFC = ∠CGH [32] & ∠HCF = ∠GCH [33] (Similar Triangles)⇒ HF = HG [34] +016. ∠HFC = ∠CGH [32] & ∠HCF = ∠GCH [33] (Similar Triangles)⇒ CF = CG [35] +017. HF = HG [34] & CF = CG [35] ⇒ FG ⟂ CH [36] +018. C,B,J are collinear [10] & C,B,F are collinear [04] & FG ⟂ CH [36] & AD ⟂ BC [00] & BC ⟂ HF [05] ⇒ ∠HFJ = ∠(FG-CH) [37] +019. C,B,F are collinear [04] & E,A,B are collinear [17] & EH ⟂ AB [16] & AD ⟂ BC [00] & BC ⟂ HF [05] ⇒ ∠HFB = ∠BEH [38] +020. C,B,F are collinear [04] & E,A,B are collinear [17] & ∠HBC = ∠ABH [03] ⇒ ∠HBF = ∠EBH [39] +021. ∠HFB = ∠BEH [38] & ∠HBF = ∠EBH [39] (Similar Triangles)⇒ HF = HE [40] +022. ∠HFB = ∠BEH [38] & ∠HBF = ∠EBH [39] (Similar Triangles)⇒ BF = BE [41] +023. HF = HE [40] & HF = HG [34] ⇒ H is the circumcenter of \Delta EFG [42] +024. HF = HE [40] & HF = HG [34] ⇒ HG = HE [43] +025. K,A,B are collinear [12] & B,E,A are collinear [17] ⇒ B,K,E are collinear [44] +026. K,A,B are collinear [12] & B,E,A are collinear [17] & EH ⟂ AB [16] ⇒ HE ⟂ EK [45] +027. H is the circumcenter of \Delta EFG [42] & HE ⟂ EK [45] ⇒ ∠KEF = ∠EGF [46] +028. LK = LJ [22] & BF = BE [41] ⇒ LK:LJ = BF:BE [47] +029. LK = LJ [22] & BF = BE [41] ⇒ LK:LJ = BE:BF [48] +030. K,A,B are collinear [12] & EH ⟂ AB [16] ⇒ EH ⟂ KB [49] +031. C,B,J are collinear [10] & C,B,F are collinear [04] & FH ⟂ BC [05] ⇒ HF ⟂ JF [50] +032. EH ⟂ KB [49] & HF ⟂ JF [50] ⇒ ∠EHF = ∠(KB-JF) [51] +033. E,A,B are collinear [17] & C,B,F are collinear [04] & ∠EHF = ∠(KB-JF) [51] & K,B,A are collinear [12] & C,B,J are collinear [10] & BC ⟂ HF [05] & AD ⟂ BC [00] & BA ⟂ LK [13] & EH ⟂ AB [16] & CB ⟂ LJ [11] ⇒ ∠KLJ = ∠EBF [52] +034. LK:LJ = BF:BE [47] & ∠KLJ = ∠EBF [52] (Similar Triangles)⇒ ∠KJL = ∠BEF [53] +035. LI = LK [29] & HG = HE [43] ⇒ LI:LK = HG:HE [54] +036. AC ⟂ LI [19] & GH ⟂ AC [06] & BA ⟂ LK [13] & EH ⟂ AB [16] ⇒ ∠ILK = ∠GHE [55] +037. LI:LK = HG:HE [54] & ∠ILK = ∠GHE [55] (Similar Triangles)⇒ ∠(IL-GH) = ∠(IK-EG) [56] +038. ∠KEF = ∠EGF [46] & K,A,B are collinear [12] & B,E,A are collinear [17] & ∠KJL = ∠BEF [53] & CB ⟂ LJ [11] & AD ⟂ BC [00] & BC ⟂ HF [05] & ∠(IL-GH) = ∠(IK-EG) [56] & AC ⟂ LI [19] & GH ⟂ AC [06] ⇒ ∠(HF-KJ) = ∠(FG-KI) [57] +039. ∠HFJ = ∠(FG-CH) [37] & ∠(HF-KJ) = ∠(FG-KI) [57] ⇒ ∠FJK = ∠(CH-KI) [58] +040. C,A,I are collinear [18] & C,A,G are collinear [07] ⇒ C,I,G are collinear [59] +041. CJ = CI [27] & CG = CF [35] ⇒ CJ:CI = CG:CF [60] +042. C,J,F are collinear [30] & C,I,G are collinear [59] & CJ:CI = CG:CF [60] (Circle Power)⇒ I,J,F,G are concyclic [61] +043. I,J,F,G are concyclic [61] ⇒ ∠IJF = ∠IGF [62] +044. CI = CJ [27] & HG = HF [34] ⇒ CI:CJ = HG:HF [63] +045. LI ⟂ CA [19] & HF ⟂ JF [50] ⇒ ∠(LI-HF) = ∠(CA-JF) [64] +046. C,A,I are collinear [18] & C,B,J are collinear [10] & ∠(LI-HF) = ∠(CA-JF) [64] & C,B,F are collinear [04] & AC ⟂ LI [19] & GH ⟂ AC [06] & BC ⟂ HF [05] & AD ⟂ BC [00] ⇒ ∠ICJ = ∠GHF [65] +047. CI:CJ = HG:HF [63] & ∠ICJ = ∠GHF [65] (Similar Triangles)⇒ ∠CIJ = ∠HGF [66] +048. LI = LJ [26] & CG = CF [35] ⇒ LI:LJ = CG:CF [67] +049. LI = LJ [26] & CG = CF [35] ⇒ LI:LJ = CF:CG [68] +050. C,A,G are collinear [07] & C,B,F are collinear [04] & ∠(LI-HF) = ∠(CA-JF) [64] & C,B,J are collinear [10] & AC ⟂ LI [19] & GH ⟂ AC [06] & BC ⟂ HF [05] & AD ⟂ BC [00] & CB ⟂ LJ [11] ⇒ ∠ILJ = ∠GCF [69] +051. LI:LJ = CG:CF [67] & ∠ILJ = ∠GCF [69] (Similar Triangles)⇒ ∠LIJ = ∠CGF [70] +052. ∠CIJ = ∠HGF [66] & C,A,I are collinear [18] & ∠LIJ = ∠CGF [70] & C,A,G are collinear [07] & AC ⟂ LI [19] & GH ⟂ AC [06] ⇒ JI ⟂ FG [71] +053. FG ⟂ CH [36] & JI ⟂ FG [71] ⇒ CH ∥ JI [72] +054. LJ = LI [26] & CJ = CI [27] ⇒ IJ ⟂ CL [73] +055. IJ ⟂ CL [73] & JI ⟂ FG [71] ⇒ CL ∥ FG [74] +056. C,A,I are collinear [18] & C,B,J are collinear [10] & GH ⟂ AC [06] & AD ⟂ BC [00] & AC ⟂ LI [19] & CB ⟂ LJ [11] ⇒ ∠CIL = ∠CJL [75] +057. ∠CIL = ∠CJL [75] ⇒ C,L,J,I are concyclic [76] +058. C,L,J,I are concyclic [76] ⇒ ∠CLJ = ∠CIJ [77] +059. C,L,J,I are concyclic [76] ⇒ ∠CLI = ∠CJI [78] +060. ∠FJK = ∠(CH-KI) [58] & C,B,J are collinear [10] & C,B,F are collinear [04] & ∠IJF = ∠IGF [62] & C,A,I are collinear [18] & C,A,G are collinear [07] & CH ∥ IJ [72] & CL ∥ FG [74] & ∠CLJ = ∠CIJ [77] & CB ⟂ LJ [11] & AD ⟂ BC [00] ⇒ ∠LJI = ∠JKI [79] +061. L is the circumcenter of \Delta IKJ [28] & ∠LJI = ∠JKI [79] ⇒ LJ ⟂ JL [80] +062. C,B,F are collinear [04] & C,A,I are collinear [18] & ∠(LI-HF) = ∠(CA-JF) [64] & C,B,J are collinear [10] ⇒ ∠CFH = ∠CIL [81] +063. LI:LJ = CF:CG [68] & ∠ILJ = ∠GCF [69] (Similar Triangles)⇒ ∠IJL = ∠CGF [82] +064. C,B,F are collinear [04] & C,A,G are collinear [07] & GH ⟂ AC [06] & AD ⟂ BC [00] & BC ⟂ HF [05] ⇒ ∠HFC = ∠HGC [83] +065. ∠HFC = ∠HGC [83] ⇒ C,H,F,G are concyclic [84] +066. C,H,F,G are concyclic [84] ⇒ ∠CHF = ∠CGF [85] +067. C,H,F,G are concyclic [84] ⇒ ∠CHG = ∠CFG [86] +068. C,A,I are collinear [18] & ∠CLJ = ∠CIJ [77] & CB ⟂ LJ [11] & AD ⟂ BC [00] & ∠IJL = ∠CGF [82] & C,A,G are collinear [07] & ∠CHF = ∠CGF [85] & BC ⟂ HF [05] ⇒ ∠CHF = ∠ICL [87] +069. ∠CFH = ∠CIL [81] & ∠CHF = ∠ICL [87] (Similar Triangles)⇒ ∠FCH = ∠CLI [88] +070. ∠FCH = ∠CLI [88] & C,B,F are collinear [04] & AC ⟂ LI [19] & GH ⟂ AC [06] & ∠IJF = ∠IGF [62] & C,B,J are collinear [10] & C,A,I are collinear [18] & C,A,G are collinear [07] & CH ∥ IJ [72] & CL ∥ FG [74] ⇒ ∠ACL = ∠ILC [89] +071. ∠ACL = ∠ILC [89] ⇒ CA ∥ LI [90] +072. HF = HE [40] & BF = BE [41] ⇒ EF ⟂ BH [91] +073. FG ⟂ CH [36] & EF ⟂ BH [91] ⇒ ∠(HB-EF) = ∠(CH-FG) [92] +074. C,A,G are collinear [07] & GH ⟂ AC [06] ⇒ HG ⟂ GC [93] +075. H is the circumcenter of \Delta EFG [42] & HG ⟂ GC [93] ⇒ ∠CGE = ∠GFE [94] +076. ∠CGE = ∠GFE [94] & C,A,G are collinear [07] & ∠(IL-GH) = ∠(IK-EG) [56] & AC ⟂ LI [19] & GH ⟂ AC [06] ⇒ ∠(EF-KI) = ∠(FG-CA) [95] +077. ∠(HB-EF) = ∠(CH-FG) [92] & ∠(EF-KI) = ∠(FG-CA) [95] ⇒ ∠(BH-IK) = ∠HCA [96] +078. HE = HF [40] & BK = BJ [23] ⇒ HE:HF = BK:BJ [97] +079. K,A,B are collinear [12] & C,B,J are collinear [10] & ∠EHF = ∠(KB-JF) [51] & C,B,F are collinear [04] ⇒ ∠EHF = ∠KBJ [98] +080. HE:HF = BK:BJ [97] & ∠EHF = ∠KBJ [98] (Similar Triangles)⇒ ∠HEF = ∠BKJ [99] +081. LK:LJ = BE:BF [48] & ∠KLJ = ∠EBF [52] (Similar Triangles)⇒ ∠LKJ = ∠BEF [100] +082. ∠HEF = ∠BKJ [99] & K,B,A are collinear [12] & ∠LKJ = ∠BEF [100] & B,E,A are collinear [17] & BA ⟂ LK [13] & EH ⟂ AB [16] ⇒ EF ⟂ KJ [101] +083. EF ⟂ BH [91] & EF ⟂ KJ [101] ⇒ HB ∥ KJ [102] +084. ∠(BH-IK) = ∠HCA [96] & BH ∥ JK [102] & ∠IJF = ∠IGF [62] & C,B,J are collinear [10] & C,B,F are collinear [04] & C,A,I are collinear [18] & C,A,G are collinear [07] & CH ∥ IJ [72] & CL ∥ FG [74] & ∠CLI = ∠CJI [78] & AC ⟂ LI [19] & GH ⟂ AC [06] ⇒ ∠LIJ = ∠IKJ [103] +085. L is the circumcenter of \Delta IKJ [28] & ∠LIJ = ∠IKJ [103] ⇒ LI ⟂ IL [104] +086. E,B,A are collinear [17] & EH ⟂ AB [16] ⇒ HE ⟂ EA [105] +087. C,A,G are collinear [07] & GH ⟂ AC [06] ⇒ HG ⟂ GA [106] +088. HE = HG [43] & HE ⟂ EA [105] & HG ⟂ GA [106] (Circle Power)⇒ AE = AG [107] +089. HE = HG [43] & AE = AG [107] ⇒ EG ⟂ HA [108] +090. ∠ACH = ∠HCB [02] & ∠CHG = ∠CFG [86] & C,B,F are collinear [04] & AC ⟂ LI [19] & GH ⟂ AC [06] ⇒ ∠(LI-FG) = ∠ACH [109] +091. C,A,I are collinear [18] & K,B,A are collinear [12] & EH ⟂ AB [16] & GH ⟂ AC [06] & AC ⟂ LI [19] & BA ⟂ LK [13] ⇒ ∠AIL = ∠AKL [110] +092. ∠AIL = ∠AKL [110] ⇒ K,A,L,I are concyclic [111] +093. K,A,L,I are concyclic [111] ⇒ ∠KLA = ∠KIA [112] +094. K,A,L,I are concyclic [111] ⇒ ∠KAL = ∠KIL [113] +095. LI = LK [29] ⇒ ∠LIK = ∠IKL [114] +096. ∠KLA = ∠KIA [112] & C,A,I are collinear [18] & BA ⟂ LK [13] & EH ⟂ AB [16] & ∠LIK = ∠IKL [114] & AC ⟂ LI [19] & GH ⟂ AC [06] ⇒ ∠LIK = ∠CAL [115] +097. ∠(LI-FG) = ∠ACH [109] & ∠LIK = ∠CAL [115] ⇒ ∠(CH-FG) = ∠(AL-IK) [116] +098. C,A,I are collinear [18] & IL ⟂ AC [19] ⇒ LI ⟂ IC [117] +099. L is the circumcenter of \Delta IKJ [28] & LI ⟂ IC [117] ⇒ ∠CIK = ∠IJK [118] +100. K,A,B are collinear [12] & KL ⟂ AB [13] ⇒ LK ⟂ KB [119] +101. L is the circumcenter of \Delta IKJ [28] & LK ⟂ KB [119] ⇒ ∠BKI = ∠KJI [120] +102. ∠CIK = ∠IJK [118] & C,A,I are collinear [18] & ∠BKI = ∠KJI [120] & K,B,A are collinear [12] & ∠KAL = ∠KIL [113] & AC ⟂ LI [19] & GH ⟂ AC [06] ⇒ ∠ILA = ∠(CA-KI) [121] +103. ∠(LI-FG) = ∠ACH [109] & ∠ILA = ∠(CA-KI) [121] ⇒ ∠(CH-FG) = ∠(IK-AL) [122] +104. LJ = LK [22] & BJ = BK [23] ⇒ JK ⟂ BL [123] +105. C,B,J are collinear [10] & C,B,F are collinear [04] & JK ⟂ BL [123] & AD ⟂ BC [00] & BC ⟂ HF [05] ⇒ ∠JFH = ∠(BL-KJ) [124] +106. ∠CLJ = ∠CIJ [77] & C,A,I are collinear [18] & CB ⟂ LJ [11] & AD ⟂ BC [00] & ∠CIK = ∠IJK [118] & BC ⟂ HF [05] ⇒ ∠JKI = ∠(HF-CL) [125] +107. ∠JFH = ∠(BL-KJ) [124] & ∠JKI = ∠(HF-CL) [125] ⇒ ∠(JF-CL) = ∠(BL-KI) [126] +108. EF ⟂ KJ [101] & JK ⟂ BL [123] ⇒ EF ∥ BL [127] +109. ∠(JF-CL) = ∠(BL-KI) [126] & C,B,J are collinear [10] & C,B,F are collinear [04] & EF ∥ BL [127] & ∠(IL-GH) = ∠(IK-EG) [56] & AC ⟂ LI [19] & GH ⟂ AC [06] & ∠IJF = ∠IGF [62] & C,A,I are collinear [18] & C,A,G are collinear [07] & CH ∥ IJ [72] & CL ∥ FG [74] & ∠CHF = ∠CGF [85] & BC ⟂ HF [05] & AD ⟂ BC [00] ⇒ ∠HFG = ∠FEG [128] +110. H is the circumcenter of \Delta EFG [42] & ∠HFG = ∠FEG [128] ⇒ HF ⟂ FH [129] +111. BJ = BK [23] & BE = BF [41] ⇒ BJ:BK = BE:BF [130] +112. B,J,F are collinear [31] & B,K,E are collinear [44] & BJ:BK = BE:BF [130] (Circle Power)⇒ K,E,J,F are concyclic [131] +113. K,E,J,F are concyclic [131] ⇒ ∠KEF = ∠KJF [132] +114. A,D,M are collinear [14] & C,B,J are collinear [10] & C,D,B are collinear [01] & K,A,B are collinear [12] & ∠EHF = ∠(KB-JF) [51] & C,B,F are collinear [04] & BC ⟂ HF [05] & AD ⟂ BC [00] & BA ⟂ LK [13] & EH ⟂ AB [16] ⇒ ∠MDJ = ∠LKB [133] +115. K,A,B are collinear [12] & C,B,J are collinear [10] & ∠EHF = ∠(KB-JF) [51] & C,B,F are collinear [04] & BC ⟂ HF [05] & AD ⟂ BC [00] & BA ⟂ LK [13] & EH ⟂ AB [16] & CB ⟂ LJ [11] ⇒ ∠BKL = ∠BJL [134] +116. ∠BKL = ∠BJL [134] ⇒ K,L,B,J are concyclic [135] +117. K,L,B,J are concyclic [135] ⇒ ∠KLB = ∠KJB [136] +118. K,J,M are collinear [15] & C,B,J are collinear [10] & C,D,B are collinear [01] & ∠KLB = ∠KJB [136] ⇒ ∠MJD = ∠KLB [137] +119. ∠MDJ = ∠LKB [133] & ∠MJD = ∠KLB [137] (Similar Triangles)⇒ ∠DMJ = ∠LBK [138] +120. C,B,J are collinear [10] & C,B,F are collinear [04] & ∠KEF = ∠KJF [132] & K,A,B are collinear [12] & B,E,A are collinear [17] & EF ∥ BL [127] & BH ∥ JK [102] & ∠DMJ = ∠LBK [138] & D,A,M are collinear [14] & K,J,M are collinear [15] & BC ⟂ HF [05] & AD ⟂ BC [00] ⇒ ∠FHB = ∠(JF-HB) [139] +121. ∠FHB = ∠(JF-HB) [139] ⇒ HF ∥ JF [140] +122. LJ ⟂ JL [80] & AC ⟂ LI [19] & GH ⟂ AC [06] & AC ∥ IL [90] & LI ⟂ IL [104] & C,A,I are collinear [18] & EG ⟂ HA [108] & ∠(CH-FG) = ∠(AL-IK) [116] & CH ∥ IJ [72] & CL ∥ FG [74] & ∠(CH-FG) = ∠(IK-AL) [122] & ∠(IL-GH) = ∠(IK-EG) [56] & HF ⟂ FH [129] & BC ⟂ HF [05] & AD ⟂ BC [00] & HF ∥ JF [140] & C,B,J are collinear [10] & C,B,F are collinear [04] & CB ⟂ LJ [11] & C,J,F are collinear [30] & D,A,M are collinear [14] & C,D,B are collinear [01] & C,A,G are collinear [07] ⇒ M,F,G are collinear +========================== \ No newline at end of file diff --git a/output_new/menelaus_b12.txt b/output_new/menelaus_b12.txt new file mode 100644 index 0000000..41339d1 --- /dev/null +++ b/output_new/menelaus_b12.txt @@ -0,0 +1,36 @@ + +========================== + * From theorem premises: +A B C D E F G H I J K L : Points +D,C,B are collinear [00] +C,B,E are collinear [01] +D,F,E are collinear [02] +A,B,G are collinear [03] +A,H,C are collinear [04] +G,F,I are collinear [05] +I,H,E are collinear [06] +G,J,E are collinear [07] +J,F,H are collinear [08] +K,A,I are collinear [09] +K,C,B are collinear [10] +A,J,L are collinear [11] +C,B,L are collinear [12] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. K,C,B are collinear [10] & D,F,E are collinear [02] & C,B,E are collinear [01] & D,C,B are collinear [00] ⇒ F,K,B are collinear [13] +002. K,A,I are collinear [09] & F,K,B are collinear [13] & A,B,G are collinear [03] & G,F,I are collinear [05] (Menelaus)⇒ (AI:KI) * (GB:AG) * (KF:FB) = 1 [14] +003. C,B,L are collinear [12] & C,B,E are collinear [01] ⇒ E,L,B are collinear [15] +004. A,J,L are collinear [11] & E,L,B are collinear [15] & A,B,G are collinear [03] & G,J,E are collinear [07] (Menelaus)⇒ (AJ:JL) * (GB:AG) * (LE:BE) = 1 [16] +005. K,C,B are collinear [10] & C,B,E are collinear [01] ⇒ K,C,E are collinear [17] +006. K,A,I are collinear [09] & E,K,C are collinear [17] & A,H,C are collinear [04] & I,H,E are collinear [06] (Menelaus)⇒ (AI:KI) * (HC:AH) * (KE:CE) = 1 [18] +007. C,B,L are collinear [12] & D,F,E are collinear [02] & C,B,E are collinear [01] & D,C,B are collinear [00] ⇒ F,L,C are collinear [19] +008. A,J,L are collinear [11] & F,L,C are collinear [19] & A,H,C are collinear [04] & J,F,H are collinear [08] (Menelaus)⇒ (AJ:JL) * (HC:AH) * (FL:FC) = 1 [20] +009. (AI:KI) * (GB:AG) * (KF:FB) = 1 [14] & (AJ:JL) * (GB:AG) * (LE:BE) = 1 [16] & (AI:KI) * (HC:AH) * (KE:CE) = 1 [18] & (AJ:JL) * (HC:AH) * (FL:FC) = 1 [20] (Ratio chase)⇒ KF:KE = LE:FL [21] +010. D,F,E are collinear [02] & C,B,E are collinear [01] & D,C,B are collinear [00] & C,B,L are collinear [12] ⇒ E,L,F are collinear [22] +011. D,F,E are collinear [02] & C,B,E are collinear [01] & D,C,B are collinear [00] & K,C,B are collinear [10] & K,C,E are collinear [17] ⇒ F,K,E are collinear [23] +012. KF:KE = LE:FL [21] & E,L,F are collinear [22] & F,K,E are collinear [23] ⇒ LE = KF +========================== diff --git a/output_new/menelaus_b13.txt b/output_new/menelaus_b13.txt new file mode 100644 index 0000000..c7cf4d0 --- /dev/null +++ b/output_new/menelaus_b13.txt @@ -0,0 +1,59 @@ + +========================== + * From theorem premises: +A B C D E F G H I J : Points +C,A,B are collinear [00] +AD = AC [01] +BE = BC [02] +DE ⟂ BE [03] +BF = BC [04] +DF ⟂ BF [05] +AG = AD [06] +E,G,D are collinear [07] +AH = AD [08] +H,F,D are collinear [09] +I,E,F are collinear [10] +I,H,G are collinear [11] +AJ = AD [12] +I,C,J are collinear [13] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. BE = BC [02] & BF = BC [04] ⇒ BF = BE [14] +002. BF = BE [14] & DF ⟂ BF [05] & DE ⟂ BE [03] (Circle Power)⇒ DF = DE [15] +003. AD = AC [01] & AJ = AD [12] & AG = AD [06] ⇒ C,G,D,J are concyclic [16] +004. C,G,D,J are concyclic [16] & AD = AC [01] & AH = AD [08] & AG = AD [06] ⇒ J,C,H,D are concyclic [17] +005. J,C,H,D are concyclic [17] ⇒ ∠JCH = ∠JDH [18] +006. ∠JCH = ∠JDH [18] & I,C,J are collinear [13] & H,F,D are collinear [09] ⇒ ∠ICH = ∠JDF [19] +007. I,E,F are collinear [10] & E,G,D are collinear [07] & H,F,D are collinear [09] & I,H,G are collinear [11] (Menelaus)⇒ (IF:IE) * (HD:GD) * (EG:HF) = 1 [20] +008. I,E,F are collinear [10] & E,G,D are collinear [07] & H,F,D are collinear [09] & I,H,G are collinear [11] (Menelaus)⇒ (IF:EF) * (ED:GD) * (HG:IH) = 1 [21] +009. I,E,F are collinear [10] & E,G,D are collinear [07] & H,F,D are collinear [09] & I,H,G are collinear [11] (Menelaus)⇒ (IE:EF) * (FD:HD) * (HG:IG) = 1 [22] +010. (IF:IE) * (HD:GD) * (EG:HF) = 1 [20] & (IF:EF) * (ED:GD) * (HG:IH) = 1 [21] & (IE:EF) * (FD:HD) * (HG:IG) = 1 [22] (Ratio chase)⇒ EG:IG = HF:IH [23] +011. C,G,D,J are concyclic [16] ⇒ ∠JCG = ∠JDG [24] +012. ∠JCG = ∠JDG [24] & I,C,J are collinear [13] & E,G,D are collinear [07] ⇒ ∠ICG = ∠JDE [25] +013. AD = AC [01] ⇒ ∠ADC = ∠DCA [26] +014. ∠ADC = ∠DCA [26] & C,A,B are collinear [00] ⇒ ∠ADC = ∠(CD-AB) [27] +015. AJ = AD [12] ⇒ ∠ADJ = ∠DJA [28] +016. AJ = AD [12] & AD = AC [01] ⇒ AC = AJ [29] +017. AC = AJ [29] ⇒ ∠ACJ = ∠CJA [30] +018. ∠ACJ = ∠CJA [30] & C,A,B are collinear [00] & I,C,J are collinear [13] ⇒ ∠(AB-CI) = ∠(CI-AJ) [31] +019. BE = BC [02] ⇒ ∠BCE = ∠CEB [32] +020. ∠BCE = ∠CEB [32] & C,A,B are collinear [00] ⇒ ∠(AB-CE) = ∠CEB [33] +021. DE ⟂ BE [03] & ∠ICG = ∠JDE [25] & ∠ADC = ∠(CD-AB) [27] & ∠ADJ = ∠DJA [28] & ∠(AB-CI) = ∠(CI-AJ) [31] & ∠(AB-CE) = ∠CEB [33] (Angle chase)⇒ ∠GCE = ∠ECD [34] +022. ∠GCE = ∠ECD [34] & E,G,D are collinear [07] ⇒ EG:CG = ED:CD [35] +023. BF = BC [04] ⇒ ∠BFC = ∠FCB [36] +024. ∠BFC = ∠FCB [36] & C,A,B are collinear [00] ⇒ ∠BFC = ∠(CF-AB) [37] +025. DF ⟂ BF [05] & ∠ICH = ∠JDF [19] & ∠ADC = ∠(CD-AB) [27] & ∠ADJ = ∠DJA [28] & ∠(AB-CI) = ∠(CI-AJ) [31] & ∠BFC = ∠(CF-AB) [37] (Angle chase)⇒ ∠HCF = ∠FCD [38] +026. ∠HCF = ∠FCD [38] & H,F,D are collinear [09] ⇒ HF:CH = FD:CD [39] +027. EG:CG = ED:CD [35] & DF = DE [15] & HF:CH = FD:CD [39] ⇒ HF:CH = EG:CG [40] +028. EG:IG = HF:IH [23] & HF:CH = EG:CG [40] ⇒ IH:IG = CH:CG [41] +029. IH:IG = CH:CG [41] & I,H,G are collinear [11] ⇒ ∠ICH = ∠GCI [42] +030. ∠ICH = ∠JDF [19] & ∠ICH = ∠GCI [42] & ∠GCI = ∠EDJ [25] ⇒ ∠EDJ = ∠JDF [43] +031. DF = DE [15] & ∠EDJ = ∠JDF [43] (SAS)⇒ JE = JF [44] +032. BF = BE [14] & JE = JF [44] ⇒ FE ⟂ BJ [45] +033. BF = BE [14] & DF = DE [15] ⇒ EF ⟂ BD [46] +034. FE ⟂ BJ [45] & EF ⟂ BD [46] ⇒ J,D,B are collinear +========================== diff --git a/output_new/menelaus_b3.txt b/output_new/menelaus_b3.txt new file mode 100644 index 0000000..65defdd --- /dev/null +++ b/output_new/menelaus_b3.txt @@ -0,0 +1,54 @@ + +========================== + * From theorem premises: +A B C D E F G H I J K : Points +DA = DB [00] +DB = DC [01] +DE = DA [02] +C,F,A are collinear [03] +E,F,B are collinear [04] +G,B,A are collinear [05] +FG ⟂ AB [06] +C,H,B are collinear [07] +FH ⟂ BC [08] +C,E,I are collinear [09] +FI ⟂ CE [10] +J,E,A are collinear [11] +FJ ⟂ AE [12] +K,E,B are collinear [13] +G,K,J are collinear [14] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. J,E,A are collinear [11] & K,E,B are collinear [13] & G,B,A are collinear [05] & G,K,J are collinear [14] (Menelaus)⇒ (JA:EJ) * (GB:GA) * (KE:KB) = 1 [15] +002. C,B,H are collinear [07] & FH ⟂ BC [08] ⇒ FH ⟂ CH [16] +003. E,A,J are collinear [11] & FJ ⟂ AE [12] ⇒ FJ ⟂ JE [17] +004. FH ⟂ CH [16] & FJ ⟂ JE [17] ⇒ ∠(FH-JE) = ∠(CH-FJ) [18] +005. C,B,H are collinear [07] & E,A,J are collinear [11] & ∠(FH-JE) = ∠(CH-FJ) [18] ⇒ ∠FHC = ∠EJF [19] +006. DA = DB [00] & DE = DA [02] & DB = DC [01] ⇒ C,E,B,A are concyclic [20] +007. C,E,B,A are concyclic [20] ⇒ ∠ACB = ∠AEB [21] +008. C,E,B,A are concyclic [20] ⇒ ∠EBC = ∠EAC [22] +009. C,E,B,A are concyclic [20] ⇒ ∠BEC = ∠BAC [23] +010. C,E,B,A are concyclic [20] ⇒ ∠ACE = ∠ABE [24] +011. C,F,A are collinear [03] & C,B,H are collinear [07] & E,A,J are collinear [11] & E,F,B are collinear [04] & ∠ACB = ∠AEB [21] ⇒ ∠FCH = ∠JEF [25] +012. ∠FHC = ∠EJF [19] & ∠FCH = ∠JEF [25] (Similar Triangles)⇒ FH:CH = FJ:EJ [26] +013. C,B,H are collinear [07] & A,E,J are collinear [11] & ∠(FH-JE) = ∠(CH-FJ) [18] ⇒ ∠FHB = ∠AJF [27] +014. E,F,B are collinear [04] & C,H,B are collinear [07] & J,E,A are collinear [11] & C,F,A are collinear [03] & ∠EBC = ∠EAC [22] ⇒ ∠FBH = ∠JAF [28] +015. ∠FHB = ∠AJF [27] & ∠FBH = ∠JAF [28] (Similar Triangles)⇒ FH:HB = FJ:JA [29] +016. G,B,A are collinear [05] & AB ⟂ FG [06] ⇒ GB ⟂ GF [30] +017. FI ⟂ CE [10] & GB ⟂ GF [30] ⇒ ∠(CE-GF) = ∠(IF-GB) [31] +018. C,E,I are collinear [09] & G,B,A are collinear [05] & ∠(CE-GF) = ∠(IF-GB) [31] ⇒ ∠FIE = ∠AGF [32] +019. E,F,B are collinear [04] & C,E,I are collinear [09] & G,B,A are collinear [05] & C,F,A are collinear [03] & ∠BEC = ∠BAC [23] ⇒ ∠FEI = ∠GAF [33] +020. ∠FIE = ∠AGF [32] & ∠FEI = ∠GAF [33] (Similar Triangles)⇒ IF:EI = GF:GA [34] +021. (JA:EJ) * (GB:GA) * (KE:KB) = 1 [15] & FH:CH = FJ:EJ [26] & FH:HB = FJ:JA [29] & IF:EI = GF:GA [34] (Ratio chase)⇒ (GB:KB) * (IF:CH) * (HB:EI) * (KE:GF) = 1 [35] +022. (JA:EJ) * (GB:GA) * (KE:KB) = 1 [15] & IF:EI = GF:GA [34] (Ratio chase)⇒ (JA:EI) * (KE:GF) * (GB:KB) * (IF:EJ) = 1 [36] +023. C,E,I are collinear [09] & G,B,A are collinear [05] & ∠(CE-GF) = ∠(IF-GB) [31] ⇒ ∠FIC = ∠BGF [37] +024. C,F,A are collinear [03] & C,E,I are collinear [09] & G,B,A are collinear [05] & E,F,B are collinear [04] & ∠ACE = ∠ABE [24] ⇒ ∠FCI = ∠GBF [38] +025. ∠FIC = ∠BGF [37] & ∠FCI = ∠GBF [38] (Similar Triangles)⇒ IF:CI = GF:GB [39] +026. IF:CI = GF:GB [39] & IF:EI = GF:GA [34] ⇒ CI:EI = GB:GA [40] +027. (GB:KB) * (IF:CH) * (HB:EI) * (KE:GF) = 1 [35] & (JA:EI) * (KE:GF) * (GB:KB) * (IF:EJ) = 1 [36] & (GB:GA) * (JA:KB) * (KE:EJ) = 1 [15] & CI:EI = GB:GA [40] ⇒ (CI:IE) * (EK:KB) * (BH:HC) = 1 [41] +028. C,E,I are collinear [09] & K,E,B are collinear [13] & C,H,B are collinear [07] & (CI:IE) * (EK:KB) * (BH:HC) = 1 [41] (Menelaus)⇒ K,I,H are collinear +========================== diff --git a/output_new/menelaus_b9.txt b/output_new/menelaus_b9.txt new file mode 100644 index 0000000..505ad8f --- /dev/null +++ b/output_new/menelaus_b9.txt @@ -0,0 +1,64 @@ + +========================== + * From theorem premises: +A B C G D E F H I J : Points +∠ACG = ∠GCB [00] +∠BAG = ∠GAC [01] +C,B,D are collinear [02] +DG ⟂ BC [03] +C,E,A are collinear [04] +EG ⟂ AC [05] +B,F,A are collinear [06] +FG ⟂ AB [07] +BC ⟂ HD [08] +CI = CD [09] +HI = HD [10] +HJ = HD [11] +BJ = BD [12] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. D,C,B are collinear [02] & C,E,A are collinear [04] & EG ⟂ AC [05] & DG ⟂ BC [03] ⇒ ∠GDC = ∠CEG [13] +002. C,B,D are collinear [02] & C,E,A are collinear [04] & ∠GCB = ∠ACG [00] ⇒ ∠GCD = ∠ECG [14] +003. ∠GDC = ∠CEG [13] & ∠GCD = ∠ECG [14] (Similar Triangles)⇒ CD = CE [15] +004. ∠GDC = ∠CEG [13] & ∠GCD = ∠ECG [14] (Similar Triangles)⇒ GD = GE [16] +005. CD = CE [15] & GD = GE [16] ⇒ DE ⟂ CG [17] +006. HJ = HD [11] & BJ = BD [12] ⇒ DJ ⟂ BH [18] +007. DE ⟂ CG [17] & DJ ⟂ BH [18] ⇒ ∠(DJ-HB) = ∠(CG-DE) [19] +008. CI = CD [09] & CD = CE [15] ⇒ C is the circumcenter of \Delta DIE [20] +009. BC ⟂ HD [08] & DG ⟂ BC [03] & D,C,B are collinear [02] ⇒ HD ⟂ DC [21] +010. C is the circumcenter of \Delta DIE [20] & HD ⟂ DC [21] ⇒ ∠HDI = ∠DEI [22] +011. BC ⟂ HD [08] & DG ⟂ BC [03] & DJ ⟂ BH [18] ⇒ ∠(HB-DJ) = ∠(DH-CB) [23] +012. HI = HD [10] & HJ = HD [11] ⇒ H is the circumcenter of \Delta DIJ [24] +013. H is the circumcenter of \Delta DIJ [24] & HD ⟂ DC [21] ⇒ ∠CDI = ∠DJI [25] +014. ∠CDI = ∠DJI [25] & C,B,D are collinear [02] ⇒ ∠(BC-DI) = ∠DJI [26] +015. ∠(HB-DJ) = ∠(DH-CB) [23] & ∠(BC-DI) = ∠DJI [26] ⇒ ∠(HB-JI) = ∠HDI [27] +016. ∠HDI = ∠DEI [22] & BC ⟂ HD [08] & DG ⟂ BC [03] & ∠(HB-JI) = ∠HDI [27] ⇒ ∠(HB-JI) = ∠DEI [28] +017. ∠(DJ-HB) = ∠(CG-DE) [19] & ∠(HB-JI) = ∠DEI [28] ⇒ ∠DJI = ∠(CG-EI) [29] +018. C,E,A are collinear [04] & B,F,A are collinear [06] & FG ⟂ AB [07] & EG ⟂ AC [05] ⇒ ∠GEA = ∠AFG [30] +019. C,E,A are collinear [04] & B,F,A are collinear [06] & ∠GAC = ∠BAG [01] ⇒ ∠GAE = ∠FAG [31] +020. ∠GEA = ∠AFG [30] & ∠GAE = ∠FAG [31] (Similar Triangles)⇒ GE = GF [32] +021. ∠GEA = ∠AFG [30] & ∠GAE = ∠FAG [31] (Similar Triangles)⇒ AE = AF [33] +022. GD = GE [16] & GE = GF [32] ⇒ GF = GD [34] +023. GD = GE [16] & GE = GF [32] ⇒ G is the circumcenter of \Delta FDE [35] +024. B,F,A are collinear [06] & AB ⟂ FG [07] ⇒ BF ⟂ FG [36] +025. D,C,B are collinear [02] & DG ⟂ BC [03] ⇒ GD ⟂ DB [37] +026. GF = GD [34] & BF ⟂ FG [36] & GD ⟂ DB [37] (Circle Power)⇒ BF = BD [38] +027. BJ = BD [12] & BF = BD [38] ⇒ B is the circumcenter of \Delta DJF [39] +028. B is the circumcenter of \Delta DJF [39] & BF ⟂ FG [36] ⇒ ∠DFG = ∠DJF [40] +029. GE = GF [32] & AE = AF [33] ⇒ EF ⟂ AG [41] +030. DE ⟂ CG [17] & EF ⟂ AG [41] ⇒ ∠(GA-FE) = ∠(DE-CG) [42] +031. C,E,A are collinear [04] & AC ⟂ EG [05] ⇒ CE ⟂ GE [43] +032. G is the circumcenter of \Delta FDE [35] & CE ⟂ GE [43] ⇒ ∠CEF = ∠EDF [44] +033. B,F,A are collinear [06] & C,E,A are collinear [04] & FG ⟂ AB [07] & EG ⟂ AC [05] ⇒ ∠AFG = ∠AEG [45] +034. ∠AFG = ∠AEG [45] ⇒ G,F,E,A are concyclic [46] +035. G,F,E,A are concyclic [46] ⇒ ∠GFE = ∠GAE [47] +036. ∠CEF = ∠EDF [44] & C,E,A are collinear [04] & ∠GFE = ∠GAE [47] ⇒ ∠AGF = ∠EDF [48] +037. ∠(GA-FE) = ∠(DE-CG) [42] & ∠AGF = ∠EDF [48] ⇒ ∠(CG-EF) = ∠DFG [49] +038. ∠DFG = ∠DJF [40] & ∠(CG-EF) = ∠DFG [49] ⇒ ∠(CG-FE) = ∠DJF [50] +039. ∠DJI = ∠(CG-EI) [29] & ∠(CG-FE) = ∠DJF [50] ⇒ ∠EIJ = ∠EFJ [51] +040. ∠EIJ = ∠EFJ [51] ⇒ J,F,E,I are concyclic +========================== diff --git a/output_new/menelaus_b9w.txt b/output_new/menelaus_b9w.txt new file mode 100644 index 0000000..026aaf5 --- /dev/null +++ b/output_new/menelaus_b9w.txt @@ -0,0 +1,97 @@ + +========================== + * From theorem premises: +A B C G D E F H I J L : Points +∠GAB = ∠CAG [00] +∠GCA = ∠BCG [01] +D,B,C are collinear [02] +DG ⟂ BC [03] +C,A,E are collinear [04] +EG ⟂ AC [05] +B,F,A are collinear [06] +FG ⟂ AB [07] +BC ⟂ HD [08] +HI = HD [09] +CI = CD [10] +HJ = HD [11] +BJ = BD [12] +B,C,L are collinear [13] +F,L,E are collinear [14] + + * Auxiliary Constructions: +K : Points +K,C,I are collinear [15] +K,J,B are collinear [16] + + * Proof steps: +001. HI = HD [09] & HJ = HD [11] ⇒ HJ = HI [17] +002. HJ = HD [11] & BJ = BD [12] (SSS)⇒ ∠HJB = ∠BDH [18] +003. K,J,B are collinear [16] & ∠HJB = ∠BDH [18] & D,B,C are collinear [02] & BC ⟂ HD [08] & DG ⟂ BC [03] ⇒ JH ⟂ KJ [19] +004. HI = HD [09] & CI = CD [10] (SSS)⇒ ∠HDC = ∠CIH [20] +005. K,C,I are collinear [15] & ∠HDC = ∠CIH [20] & BC ⟂ HD [08] & DG ⟂ BC [03] & D,B,C are collinear [02] ⇒ HI ⟂ IK [21] +006. HJ = HI [17] & JH ⟂ KJ [19] & HI ⟂ IK [21] (Circle Power)⇒ KI = JK [22] +007. B,C,L are collinear [13] & B,F,A are collinear [06] & C,A,E are collinear [04] & F,L,E are collinear [14] (Menelaus)⇒ (AE:FA) * (BF:LB) * (CL:EC) = 1 [23] +008. B,F,A are collinear [06] & C,A,E are collinear [04] & EG ⟂ AC [05] & FG ⟂ AB [07] ⇒ ∠GFA = ∠AEG [24] +009. B,F,A are collinear [06] & C,A,E are collinear [04] & ∠GAB = ∠CAG [00] ⇒ ∠GAF = ∠EAG [25] +010. ∠GFA = ∠AEG [24] & ∠GAF = ∠EAG [25] (Similar Triangles)⇒ AF = AE [26] +011. ∠GFA = ∠AEG [24] & ∠GAF = ∠EAG [25] (Similar Triangles)⇒ GF = GE [27] +012. C,A,E are collinear [04] & D,B,C are collinear [02] & DG ⟂ BC [03] & EG ⟂ AC [05] ⇒ ∠GEC = ∠CDG [28] +013. C,A,E are collinear [04] & D,B,C are collinear [02] & ∠GCA = ∠BCG [01] ⇒ ∠GCE = ∠DCG [29] +014. ∠GEC = ∠CDG [28] & ∠GCE = ∠DCG [29] (Similar Triangles)⇒ CE = CD [30] +015. ∠GEC = ∠CDG [28] & ∠GCE = ∠DCG [29] (Similar Triangles)⇒ GE = GD [31] +016. GF = GE [27] & GE = GD [31] ⇒ GD = GF [32] +017. D,B,C are collinear [02] & DG ⟂ BC [03] ⇒ DG ⟂ DB [33] +018. B,F,A are collinear [06] & FG ⟂ AB [07] ⇒ GF ⟂ BF [34] +019. GD = GF [32] & DG ⟂ DB [33] & GF ⟂ BF [34] (Circle Power)⇒ BD = BF [35] +020. KI = JK [22] & (AE:FA) * (BF:LB) * (CL:EC) = 1 [23] & AF = AE [26] & CE = CD [30] & CI = CD [10] & BD = BF [35] & BJ = BD [12] ⇒ (KI:IC) * (CL:LB) * (BJ:JK) = 1 [36] +021. K,C,I are collinear [15] & B,C,L are collinear [13] & K,J,B are collinear [16] & (KI:IC) * (CL:LB) * (BJ:JK) = 1 [36] (Menelaus)⇒ J,I,L are collinear +========================== + + + +========================== + * From theorem premises: +A B C G D E F H I J L : Points +∠GAB = ∠CAG [00] +∠ACG = ∠GCB [01] +DG ⟂ BC [02] +C,B,D are collinear [03] +C,E,A are collinear [04] +EG ⟂ AC [05] +B,F,A are collinear [06] +FG ⟂ AB [07] +BC ⟂ HD [08] +HI = HD [09] +CI = CD [10] +HJ = HD [11] +BJ = BD [12] +C,B,L are collinear [13] +F,E,L are collinear [14] + + * Auxiliary Constructions: +K : Points +C,K,I are collinear [15] +B,J,K are collinear [16] + + * Proof steps: +001. HJ = HD [11] & HI = HD [09] ⇒ HI = HJ [17] +002. HI = HD [09] & CI = CD [10] (SSS)⇒ ∠HDC = ∠CIH [18] +003. I,K,C are collinear [15] & ∠HDC = ∠CIH [18] & BC ⟂ HD [08] & DG ⟂ BC [02] & C,B,D are collinear [03] ⇒ HI ⟂ IK [19] +004. HJ = HD [11] & BJ = BD [12] (SSS)⇒ ∠HDB = ∠BJH [20] +005. B,K,J are collinear [16] & ∠HDB = ∠BJH [20] & BC ⟂ HD [08] & DG ⟂ BC [02] & C,B,D are collinear [03] ⇒ HJ ⟂ JK [21] +006. HI = HJ [17] & HI ⟂ IK [19] & HJ ⟂ JK [21] (Circle Power)⇒ KI = JK [22] +007. C,B,L are collinear [13] & B,F,A are collinear [06] & C,E,A are collinear [04] & F,E,L are collinear [14] (Menelaus)⇒ (AE:FA) * (BF:LB) * (CL:EC) = 1 [23] +008. B,F,A are collinear [06] & C,E,A are collinear [04] & EG ⟂ AC [05] & FG ⟂ AB [07] ⇒ ∠GFA = ∠AEG [24] +009. B,F,A are collinear [06] & C,E,A are collinear [04] & ∠GAB = ∠CAG [00] ⇒ ∠GAF = ∠EAG [25] +010. ∠GFA = ∠AEG [24] & ∠GAF = ∠EAG [25] (Similar Triangles)⇒ AF = AE [26] +011. ∠GFA = ∠AEG [24] & ∠GAF = ∠EAG [25] (Similar Triangles)⇒ GF = GE [27] +012. C,B,D are collinear [03] & C,E,A are collinear [04] & EG ⟂ AC [05] & DG ⟂ BC [02] ⇒ ∠GDC = ∠CEG [28] +013. C,B,D are collinear [03] & C,E,A are collinear [04] & ∠GCB = ∠ACG [01] ⇒ ∠GCD = ∠ECG [29] +014. ∠GDC = ∠CEG [28] & ∠GCD = ∠ECG [29] (Similar Triangles)⇒ GD = GE [30] +015. GD = GE [30] & GF = GE [27] ⇒ GF = GD [31] +016. B,F,A are collinear [06] & FG ⟂ AB [07] ⇒ FG ⟂ BF [32] +017. C,B,D are collinear [03] & DG ⟂ BC [02] ⇒ GD ⟂ DB [33] +018. GF = GD [31] & FG ⟂ BF [32] & GD ⟂ DB [33] (Circle Power)⇒ BF = BD [34] +019. KI = JK [22] & (AE:FA) * (BF:LB) * (CL:EC) = 1 [23] & AF = AE [26] & CI = CD [10] & BF = BD [34] & BJ = BD [12] ⇒ (KI:IC) * (CL:LB) * (BJ:JK) = 1 [35] +020. C,K,I are collinear [15] & C,B,L are collinear [13] & B,J,K are collinear [16] & (KI:IC) * (CL:LB) * (BJ:JK) = 1 [35] (Menelaus)⇒ I,J,L are collinear +========================== diff --git a/problem.py b/problem.py index 22c46f2..adc64cc 100644 --- a/problem.py +++ b/problem.py @@ -1149,7 +1149,22 @@ def why_me(self, g: Any, level: int) -> None: if self.why is None: self.why = why_eqratio30(ab._val, cd._val, mn_xy, pq_zw, level) - + if self.why is None: + self.why = why_eqratio30(ab._val, pq._val, mn_xy, cd_zw, level) + if self.why is None: + self.why = why_eqratio30(ab._val, zw._val, mn_xy, cd_pq, level) + if self.why is None: + self.why = why_eqratio30(mn._val, cd._val, ab_xy, pq_zw, level) + if self.why is None: + self.why = why_eqratio30(mn._val, pq._val, ab_xy, cd_zw, level) + if self.why is None: + self.why = why_eqratio30(mn._val, zw._val, ab_xy, cd_pq, level) + if self.why is None: + self.why = why_eqratio30(xy._val, cd._val, ab_mn, pq_zw, level) + if self.why is None: + self.why = why_eqratio30(xy._val, pq._val, ab_mn, cd_zw, level) + if self.why is None: + self.why = why_eqratio30(xy._val, zw._val, ab_mn, cd_pq, level) if self.why is None: self.why = [] diff --git a/test.py b/test.py index b5b39e0..f013588 100644 --- a/test.py +++ b/test.py @@ -1,6 +1,5 @@ -a = True -b = False -c = True -d = False +import random -print(a==b, a==c,b==c,b==d) +for _ in range(10): + a = random.randint(1,50) + print(a) \ No newline at end of file From 9f5a74aec0d9cca5cf489eeeb58a1a9925706a84 Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.cn> Date: Mon, 31 Mar 2025 21:10:54 +0800 Subject: [PATCH 26/27] circle problem --- chiaya.sh | 2 +- kirine.txt | 102 +++++++++++------- newpros.txt | 50 +++++++-- nothing.txt | 38 ++++++- output_new/Newton.txt | 68 ++++++++++++ output_new/ceva_a4.txt | 0 output_new/ceva_a7.txt | 51 +++++++++ output_new/{exercise7_4.txt => circle_b4.txt} | 2 +- output_new/circle_c2.txt | 33 ++++++ output_new/cricle_c3.txt | 31 ++++++ output_new/example2_4.txt | 62 ----------- output_new/example6_1.txt | 36 ------- output_new/example7_1.txt | 36 ------- output_new/example7_2.txt | 41 ------- output_new/example7_7_1.txt | 34 ------ output_new/example7_7_2.txt | 34 ------ output_new/exercise7_1.txt | 75 ------------- output_new/exercise7_5.txt | 22 ---- output_new/pascal_a1.txt | 31 ++++++ output_new/pascal_b2.txt | 35 ++++++ 20 files changed, 388 insertions(+), 395 deletions(-) create mode 100644 output_new/Newton.txt create mode 100644 output_new/ceva_a4.txt create mode 100644 output_new/ceva_a7.txt rename output_new/{exercise7_4.txt => circle_b4.txt} (99%) create mode 100644 output_new/circle_c2.txt create mode 100644 output_new/cricle_c3.txt delete mode 100644 output_new/example2_4.txt delete mode 100644 output_new/example6_1.txt delete mode 100644 output_new/example7_1.txt delete mode 100644 output_new/example7_2.txt delete mode 100644 output_new/example7_7_1.txt delete mode 100644 output_new/example7_7_2.txt delete mode 100644 output_new/exercise7_1.txt delete mode 100644 output_new/exercise7_5.txt create mode 100644 output_new/pascal_a1.txt create mode 100644 output_new/pascal_b2.txt diff --git a/chiaya.sh b/chiaya.sh index 8d78a68..28c2ad5 100644 --- a/chiaya.sh +++ b/chiaya.sh @@ -42,7 +42,7 @@ SERIES=Menelaus_a python -m alphageometry \ --alsologtostderr \ --problems_file=$(pwd)/$INPUT_FILE \ ---problem_name=Menelaus_b9w \ +--problem_name=Ceva_a4 \ --mode=alphageometry \ "${DDAR_ARGS[@]}" \ "${SEARCH_ARGS[@]}" \ diff --git a/kirine.txt b/kirine.txt index 88cebeb..f25699b 100644 --- a/kirine.txt +++ b/kirine.txt @@ -1,47 +1,71 @@ ========================== * From theorem premises: -A B C G D E F H I J L : Points -∠GAB = ∠CAG [00] -∠ACG = ∠GCB [01] -DG ⟂ BC [02] -C,B,D are collinear [03] -C,E,A are collinear [04] -EG ⟂ AC [05] -B,F,A are collinear [06] -FG ⟂ AB [07] -BC ⟂ HD [08] -HI = HD [09] -CI = CD [10] -HJ = HD [11] -BJ = BD [12] -C,B,L are collinear [13] -F,E,L are collinear [14] +A B C D E F G H I : Points +C,D,B are collinear [00] +CD = CA [01] +EA = EC [02] +EC = ED [03] +FB = FC [04] +C,B,F are collinear [05] +FG = FC [06] +EG = EC [07] +G,H,B are collinear [08] +C,A,H are collinear [09] +C,G,I are collinear [10] +A,I,B are collinear [11] * Auxiliary Constructions: -K : Points -C,K,I are collinear [15] -B,J,K are collinear [16] +J : Points +JH = JC [12] +C,H,J are collinear [13] * Proof steps: -001. HJ = HD [11] & HI = HD [09] ⇒ HI = HJ [17] -002. HI = HD [09] & CI = CD [10] (SSS)⇒ ∠HDC = ∠CIH [18] -003. I,K,C are collinear [15] & ∠HDC = ∠CIH [18] & BC ⟂ HD [08] & DG ⟂ BC [02] & C,B,D are collinear [03] ⇒ HI ⟂ IK [19] -004. HJ = HD [11] & BJ = BD [12] (SSS)⇒ ∠HDB = ∠BJH [20] -005. B,K,J are collinear [16] & ∠HDB = ∠BJH [20] & BC ⟂ HD [08] & DG ⟂ BC [02] & C,B,D are collinear [03] ⇒ HJ ⟂ JK [21] -006. HI = HJ [17] & HI ⟂ IK [19] & HJ ⟂ JK [21] (Circle Power)⇒ KI = JK [22] -007. C,B,L are collinear [13] & B,F,A are collinear [06] & C,E,A are collinear [04] & F,E,L are collinear [14] (Menelaus)⇒ (AE:FA) * (BF:LB) * (CL:EC) = 1 [23] -008. B,F,A are collinear [06] & C,E,A are collinear [04] & EG ⟂ AC [05] & FG ⟂ AB [07] ⇒ ∠GFA = ∠AEG [24] -009. B,F,A are collinear [06] & C,E,A are collinear [04] & ∠GAB = ∠CAG [00] ⇒ ∠GAF = ∠EAG [25] -010. ∠GFA = ∠AEG [24] & ∠GAF = ∠EAG [25] (Similar Triangles)⇒ AF = AE [26] -011. ∠GFA = ∠AEG [24] & ∠GAF = ∠EAG [25] (Similar Triangles)⇒ GF = GE [27] -012. C,B,D are collinear [03] & C,E,A are collinear [04] & EG ⟂ AC [05] & DG ⟂ BC [02] ⇒ ∠GDC = ∠CEG [28] -013. C,B,D are collinear [03] & C,E,A are collinear [04] & ∠GCB = ∠ACG [01] ⇒ ∠GCD = ∠ECG [29] -014. ∠GDC = ∠CEG [28] & ∠GCD = ∠ECG [29] (Similar Triangles)⇒ GD = GE [30] -015. GD = GE [30] & GF = GE [27] ⇒ GF = GD [31] -016. B,F,A are collinear [06] & FG ⟂ AB [07] ⇒ FG ⟂ BF [32] -017. C,B,D are collinear [03] & DG ⟂ BC [02] ⇒ GD ⟂ DB [33] -018. GF = GD [31] & FG ⟂ BF [32] & GD ⟂ DB [33] (Circle Power)⇒ BF = BD [34] -019. KI = JK [22] & (AE:FA) * (BF:LB) * (CL:EC) = 1 [23] & AF = AE [26] & CI = CD [10] & BF = BD [34] & BJ = BD [12] ⇒ (KI:IC) * (CL:LB) * (BJ:JK) = 1 [35] -020. C,K,I are collinear [15] & C,B,L are collinear [13] & B,J,K are collinear [16] & (KI:IC) * (CL:LB) * (BJ:JK) = 1 [35] (Menelaus)⇒ I,J,L are collinear +001. C,G,I are collinear [10] & C,A,H are collinear [09] & G,H,B are collinear [08] & A,I,B are collinear [11] (Menelaus)⇒ (GI:CI) * (CA:AH) * (HB:GB) = 1 [14] +002. C,G,I are collinear [10] & C,A,H are collinear [09] & G,H,B are collinear [08] & A,I,B are collinear [11] (Menelaus)⇒ (IB:AI) * (CA:GB) * (GH:CH) = 1 [15] +003. C,G,I are collinear [10] & C,A,H are collinear [09] & G,H,B are collinear [08] & A,I,B are collinear [11] (Menelaus)⇒ (GI:CG) * (AB:AH) * (CH:IB) = 1 [16] +004. C,G,I are collinear [10] & C,A,H are collinear [09] & G,H,B are collinear [08] & A,I,B are collinear [11] (Menelaus)⇒ (HB:GH) * (AI:AB) * (CG:CI) = 1 [17] +005. FG = FC [06] & FB = FC [04] ⇒ F is the circumcenter of \Delta BGC [18] +006. FG = FC [06] & FB = FC [04] ⇒ FB = FG [19] +007. F is the circumcenter of \Delta BGC [18] & C,B,F are collinear [05] ⇒ BG ⟂ CG [20] +008. G,H,B are collinear [08] & BG ⟂ CG [20] ⇒ HG ⟂ GC [21] +009. J,C,H are collinear [13] & JH = JC [12] ⇒ J is midpoint of CH [22] +010. HG ⟂ GC [21] & J is midpoint of CH [22] ⇒ HJ = GJ [23] +011. EA = EC [02] & EC = ED [03] ⇒ ED = EA [24] +012. CD = CA [01] & ED = EA [24] (SSS)⇒ ∠ACE = ∠ECD [25] +013. CD = CA [01] & ED = EA [24] ⇒ AD ⟂ CE [26] +014. C,H,J are collinear [13] & C,A,H are collinear [09] & C,B,F are collinear [05] & ∠ACE = ∠ECD [25] & C,D,B are collinear [00] ⇒ ∠JCE = ∠ECF [27] +015. EG = EC [07] & FG = FC [06] ⇒ GC ⟂ EF [28] +016. EG = EC [07] & FG = FC [06] (SSS)⇒ ∠GEF = ∠FEC [29] +017. C,B,F are collinear [05] & FB = FC [04] ⇒ F is midpoint of CB [30] +018. F is midpoint of CB [30] & J is midpoint of CH [22] ⇒ FJ ∥ BH [31] +019. GC ⟂ EF [28] & BG ⟂ CG [20] & FJ ∥ BH [31] & G,H,B are collinear [08] ⇒ FJ ∥ FE [32] +020. FJ ∥ FE [32] ⇒ E,J,F are collinear [33] +021. ∠JCE = ∠ECF [27] & E,J,F are collinear [33] ⇒ EJ:EF = CJ:CF [34] +022. FB = FG [19] ⇒ ∠FBG = ∠BGF [35] +023. C,D,B are collinear [00] & ∠FBG = ∠BGF [35] & C,B,F are collinear [05] & GC ⟂ EF [28] & BG ⟂ CG [20] ⇒ ∠GBD = ∠GFE [36] +024. BG ⟂ CG [20] & AD ⟂ CE [26] & FJ ∥ BH [31] & G,H,B are collinear [08] ⇒ ∠(CE-AD) = ∠(JF-CG) [37] +025. EC = ED [03] & EG = EC [07] & EA = EC [02] ⇒ C,A,D,G are concyclic [38] +026. C,A,D,G are concyclic [38] ⇒ ∠DAC = ∠DGC [39] +027. C,A,D,G are concyclic [38] ⇒ ∠CDA = ∠CGA [40] +028. CD = CA [01] ⇒ ∠CAD = ∠ADC [41] +029. C,D,B are collinear [00] & ∠DAC = ∠DGC [39] & ∠CAD = ∠ADC [41] ⇒ ∠CDA = ∠DGC [42] +030. ∠(CE-AD) = ∠(JF-CG) [37] & ∠CDA = ∠DGC [42] ⇒ ∠ECD = ∠(JF-GD) [43] +031. C,D,B are collinear [00] & ∠GEF = ∠FEC [29] & GC ⟂ EF [28] & BG ⟂ CG [20] & ∠ECD = ∠(JF-GD) [43] & FJ ∥ BH [31] & G,H,B are collinear [08] ⇒ ∠GDB = ∠GEF [44] +032. ∠GBD = ∠GFE [36] & ∠GDB = ∠GEF [44] (Similar Triangles)⇒ BG:BD = FG:FE [45] +033. BG:BD = FG:FE [45] & FG = FC [06] ⇒ GB:DB = CF:EF [46] +034. FG = FC [06] & JH = JC [12] & (GI:CI) * (CA:AH) * (HB:GB) = 1 [14] & HJ = GJ [23] & EJ:EF = CJ:CF [34] & GB:DB = CF:EF [46] (Ratio chase)⇒ (CA:AH) * (GI:GJ) * (HB:DB) * (EJ:CI) = 1 [47] +035. ∠CAD = ∠ADC [41] & C,D,B are collinear [00] & ∠CDA = ∠CGA [40] ⇒ ∠CGA = ∠DAC [48] +036. ∠(CE-AD) = ∠(JF-CG) [37] & ∠CGA = ∠DAC [48] ⇒ ∠(CE-FJ) = ∠CAG [49] +037. F,E,J are collinear [33] & C,A,H are collinear [09] & ∠(CE-FJ) = ∠CAG [49] & FJ ∥ BH [31] & G,H,B are collinear [08] & ∠GEF = ∠FEC [29] & GC ⟂ EF [28] & BG ⟂ CG [20] ⇒ ∠GEJ = ∠GAH [50] +038. C,B,F are collinear [05] & ∠FBG = ∠BGF [35] & FJ ∥ BH [31] & G,H,B are collinear [08] ⇒ ∠CFJ = ∠JFG [51] +039. FG = FC [06] & ∠CFJ = ∠JFG [51] (SAS)⇒ ∠CJF = ∠FJG [52] +040. F,E,J are collinear [33] & G,H,B are collinear [08] & C,A,H are collinear [09] & ∠CJF = ∠FJG [52] & C,H,J are collinear [13] & GC ⟂ EF [28] & BG ⟂ CG [20] ⇒ ∠GJE = ∠GHA [53] +041. ∠GEJ = ∠GAH [50] & ∠GJE = ∠GHA [53] (Similar Triangles)⇒ GE:GJ = GA:GH [54] +042. ∠GEJ = ∠GAH [50] & ∠GJE = ∠GHA [53] (Similar Triangles)⇒ EG:EJ = AG:AH [55] +043. GE:GJ = GA:GH [54] & EG = EC [07] ⇒ CE:GJ = AG:GH [56] +044. EG:EJ = AG:AH [55] & EG = EC [07] ⇒ CE:EJ = AG:AH [57] +045. (IB:AI) * (CA:GB) * (GH:CH) = 1 [15] & (GI:CI) * (CA:AH) * (HB:GB) = 1 [14] & (GI:CG) * (AB:AH) * (CH:IB) = 1 [16] & CE:GJ = AG:GH [56] & CE:EJ = AG:AH [57] (Ratio chase)⇒ (AI:AH) * (CG:GJ) * (HB:AB) * (EJ:CI) = 1 [58] +046. (CA:AH) * (GI:GJ) * (HB:DB) * (EJ:CI) = 1 [47] & (AI:AH) * (CG:GJ) * (HB:AB) * (EJ:CI) = 1 [58] & (HB:GH) * (AI:AB) * (CG:CI) = 1 [17] ⇒ (GI:IC) * (CD:DB) * (BH:HG) = 1 [59] +047. C,G,I are collinear [10] & C,D,B are collinear [00] & G,H,B are collinear [08] & (GI:IC) * (CD:DB) * (BH:HG) = 1 [59] (Menelaus)⇒ I,H,D are collinear ========================== diff --git a/newpros.txt b/newpros.txt index de8fc44..8dfedf7 100644 --- a/newpros.txt +++ b/newpros.txt @@ -30,25 +30,55 @@ Menelaus_b3 a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; q = on_line q a c, on_line q b d; e = foot e q a b; f = foot f q b c; g = foot g q c d; h = foot h q d a; p = on_line p e h, on_line p b d ? coll p f g Menelaus_b6 a b c = triangle a b c; h = orthocenter h a b c; e = on_line e a b; f = on_line f b c, on_line f e h; d = on_line d a c, on_line d e h; m = on_tline m h e h, on_line m b c; n = on_line n a b, on_line n m h; p = on_line p a c, on_line p m h ? eqratio d e e f p n m n +Menelaus_b9w +a b c = triangle a b c; d e f i = incenter2 d e f i a b c; j = on_tline j d b c; y = on_circle y j d, on_circle y c d; z = on_circle z j d, on_circle z b d; x = on_line x z b, on_line x y c; p = on_line p b c, on_line p e f ? coll p y z +Menelaus_b9 +a b c = triangle a b c; d e f i = incenter2 d e f i a b c; j = on_tline j d b c; y = on_circle y j d, on_circle y c d; z = on_circle z j d, on_circle z b d; x = on_line x z b, on_line x y c; p = on_line p b c, on_line p e f ? cyclic e f y z Menelaus_b10 a b c = triangle a b c; d = foot d a b c; x e g o1 = excenter2 x e g o1 c a b; y f h o2 = excenter2 y f h o2 b a c; q = on_line q a d, on_line q f h ? coll q e g -Menelaus_b15 -a b c = triangle a b c; m = midpoint m b c; i = incenter i a b c; d = on_line d m i, on_line d a c; o = circle o a b c; e = on_line e b i, on_circle e o a; f = on_line f b i, on_line f a c ? eqratio e d e i i c i b -Ceva_a1 -a b c = triangle a b c; d = foot d a b c; h = on_line h a d; e = on_line e a c, on_line e b h; f = on_line f a b, on_line f c h; p = on_pline p a b c, on_line p d f; q = on_line q p a, on_line q d e ? cong a p a q -tangent -a b c = triangle a b c; o = circle o a b c; p = on_tline p a o a, on_line p b c ? eqratio30 a b a c a b a c p c p b Menelaus_b11 a b c = triangle a b c; o = circle o a b c; p = on_tline p a o a, on_tline p b o b; d = on_line d p c, on_circle d o a; e = on_pline e c p a, on_line e a b; f = on_line f c e, on_line f a d; k = on_line k c d, on_line k a b; m = on_line m o p, on_line m a b ? cyclic o m c d Menelaus_b12 a b c = triangle a b c; m = midpoint m b c; d = on_line d b c; e = mirror e d m; f = on_line f a b; g = on_line g a c; k = on_line k f e, on_line k g d; v = on_line v f d, on_line v g e; l = on_line l a k, on_line l b c; t = on_line t a v, on_line t b c ? cong d t e l Menelaus_b13 x y = segment x y; p = on_line p x y; a = on_circle a x p; b c = tangent b c a y p; d = on_line d a b, on_circle d x a; e = on_line e a c, on_circle e x a; r = on_line r d e, on_line r b c; q = on_line q p r, on_circle q x a ? coll a q y +Menelaus_b15 +a b c = triangle a b c; m = midpoint m b c; i = incenter i a b c; d = on_line d m i, on_line d a c; o = circle o a b c; e = on_line e b i, on_circle e o a; f = on_line f b i, on_line f a c ? eqratio e d e i i c i b +Ceva_a1 +a b c = triangle a b c; d = foot d a b c; h = on_line h a d; e = on_line e a c, on_line e b h; f = on_line f a b, on_line f c h; p = on_pline p a b c, on_line p d f; q = on_line q p a, on_line q d e ? cong a p a q +tangent +a b c = triangle a b c; o = circle o a b c; p = on_tline p a o a, on_line p b c ? eqratio30 a b a c a b a c p c p b Menelaus_b2a a b c = triangle a b c; d = midpoint d b c; e = midpoint e c a; f = midpoint f a b; g = on_line g b e, on_line g c f; x = on_pline x g b c, on_line x a b; y = on_line y g x, on_line y a c; p = on_line p b y, on_line p c g; q = on_line q c x, on_line q b g ? eqratio d p a b d q a c Menelaus_b2b a b c = triangle a b c; d = midpoint d b c; e = midpoint e c a; f = midpoint f a b; g = on_line g b e, on_line g c f; x = on_pline x g b c, on_line x a b; y = on_line y g x, on_line y a c; p = on_line p b y, on_line p c g; q = on_line q c x, on_line q b g ? eqratio d p a b p q b c -Menelaus_b9w -a b c = triangle a b c; d e f i = incenter2 d e f i a b c; j = on_tline j d b c; y = on_circle y j d, on_circle y c d; z = on_circle z j d, on_circle z b d; x = on_line x z b, on_line x y c; p = on_line p b c, on_line p e f ? coll p y z -Menelaus_b9 -a b c = triangle a b c; d e f i = incenter2 d e f i a b c; j = on_tline j d b c; y = on_circle y j d, on_circle y c d; z = on_circle z j d, on_circle z b d; x = on_line x z b, on_line x y c; p = on_line p b c, on_line p e f ? cyclic e f y z \ No newline at end of file +Ceva_a4 +a b c = triangle a b c; d = on_circle d c a, on_line d b c; o = circle o a c d; m = midpoint m b c; p = on_circle p o c, on_circle p m c; e = on_line e a c, on_line e b p; f = on_line f a b, on_line f c p ? coll d e f +Ceva_a7 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_line e a b, on_line e d c; f = on_line f a d, on_line f b c; p = on_circle p o a; r = on_line r p e, on_circle r o a; s = on_line s p f, on_circle s o a; t = on_line t a c, on_line t b d ? eqratio30 a s s d d c r c b r b a +Circle_a2 +b c = segment b c; a = on_bline a b c; i = incenter i a b c; o = on_bline o b i; p = on_circle p a b, on_circle p o b; q = on_circle q i b, on_circle q o b; r = on_line r i p, on_line r b q ? perp b r c r +Circle_a5 +a b c = triangle a b c; d e f x = excenter2 d e f x a b c; o1 = circle o1 a e f; p = on_line p b c, on_circle p o1 a; q = on_line q b c, on_circle q o1 a; m = midpoint m a d; o2 = circle o2 m p q; t = on_circle t o2 m, on_circle t x d ? coll o2 x t +Circle_a6 +a b c = triangle a b c; o = circle o a b c; h = orthocenter h a b c; s = on_circle s o a; p = on_line p b c, on_tline p s a s; o2 = circle o2 a s p; x = on_line x s h, on_circle x o2 a; r = on_line r a b, on_line r o p; q = on_line q a c, on_line q o p; y = foot y q a r; z = foot z r a q ? coll x y z +Circle_a8 +a b c = triangle a b c; o = circle o a b c; d = on_line d a o, on_line d b c; u = foot u d a c; v = foot v d a b; e = on_tline e a a o, on_line e d u; f = on_tline f a a o, on_line f d v; p = on_line p e c, on_line p f b; x = on_line x b p, on_circle x o a; y = on_line y c p, on_circle y o a ? perp p d b c +Circle_b4 +a b c = triangle a b c; o = circle o a b c; i = circle i o b c; g = on_circle g i o; x = circle x a b g; y = circle y a c g; e = on_line e a c, on_circle e x a; f = on_line f a b, on_circle f y a; k = on_line k b e, on_line k c f; t = on_line t a k, on_line t b c ? coll t o g +Circle_b5 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_line e a d, on_line e b c; m = midpoint m a d; n = midpoint n b c; w = circle w e m n; x = on_circle x o a, on_circle x w e; y = on_circle y o a, on_circle y w e; z = on_line z a b, on_line z c d ? coll x y z +Circle_b7w +a b c = triangle a b c; d e f i = incenter2 d e f i a b c; p = on_line p a d, on_circle p i d; q = on_line q e f, on_tline q p a d; x = on_line x d e, on_line x a q; y = on_line y d f, on_line y a q; u = on_line u d i, on_pline u a b c; v = on_line v d i, on_circle v i d ? cong a x a y +Circle_b13 +a b c = triangle a b c; d = foot d a b c; e = foot e b c a; m = midpoint a b; o = circle o a b c; f = on_line f d e, on_circle f o a; k = on_line k d e, on_circle k o a; w = circle w m d e; p = on_line p m k, on_circle p w m; q = on_line q m f, on_circle q w m ? cyclic a p q b +Circle_b15 +a b = segment a b; o = on_bline o a b; p = on_tline p a o a, on_tline p b o b; c = on_circle c o a; d = on_line d p c, on_circle d o a; e = on_pline e c p b, on_circle e o a; f = on_line f a e, on_line f p b; g = on_line g d e, on_line g p b ? cong g f g b +Circle_c2 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_line e a b, on_line e c d; f = on_line f b c, on_pline f e a d; m = midpoint m o f; g = on_circle g o a, on_circle g m f ? cong f e f g +Circle_c3 +a b c = triangle a b c; d = angle_bisector d b a c, on_line d b c; m = midpoint m b c; o = circle o a d m; l = on_line l a b, on_circle l o a; n = on_line n a c, on_circle n o a ? cong b l c n +Pascal_a1 +a b c = triangle a b c; o = circle o a b c; p = free; a1 = on_line a1 a p, on_circle a1 o a; b1 = on_line b1 b p, on_circle b1 o b; c1 = on_line c1 c p, on_circle c1 o c; q = on_circle q o a; x = on_line x q a1, on_line x b c; y = on_line y q b1, on_line y a c; z = on_line z q c1, on_line z a b ? coll x y z +Pascal_b2 +a c = segment a c; o = midpoint o a c; b = on_circle b o a; d = on_circle d o a; m = on_line m a d, on_line m b c; n = on_tline n b o b, on_tline n d o d; p = on_line p a b, on_line p c d ? perp a c m n \ No newline at end of file diff --git a/nothing.txt b/nothing.txt index b27c836..d1b723b 100644 --- a/nothing.txt +++ b/nothing.txt @@ -748,15 +748,15 @@ Menelaus_b3 v a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; q = on_line q a c, on_line q b d; e = foot e q a b; f = foot f q b c; g = foot g q c d; h = foot h q d a; p = on_line p e h, on_line p b d ? coll p f g Menelaus_b6 v a b c = triangle a b c; h = orthocenter h a b c; e = on_line e a b; f = on_line f b c, on_line f e h; d = on_line d a c, on_line d e h; m = on_tline m h e h, on_line m b c; n = on_line n a b, on_line n m h; p = on_line p a c, on_line p m h ? eqratio d e e f p n m n -Menelaus_b9 x +Menelaus_b9 v a b c = triangle a b c; d e f i = incenter2 d e f i a b c; x = on_tline x d b c; i2 = incenter i2 x b c; y = foot y i2 x c; z = foot z i2 x b ? cyclic x y e f -Menelaus_b9w x +Menelaus_b9w v a b c = triangle a b c; d e f i = incenter2 d e f i a b c; x = on_tline x d b c; i2 = incenter i2 x b c; y = foot y i2 x c; z = foot z i2 x b; p = on_line p b c, on_line p e f ? coll p x y Menelaus_b10 ? a b c = triangle a b c; d = foot d a b c; x e g o1 = excenter2 x e g o1 c a b; y f h o2 = excenter2 y f h o2 b a c; q = on_line q a d, on_line q f h ? coll q e g -Menelaus_b11 x +Menelaus_b11 o a b c = triangle a b c; o = circle o a b c; p = on_tline p a o a, on_tline p b o b; d = on_line d p c, on_circle d o a; e = on_pline e c p a, on_line e a b; f = on_line f c e, on_line f a d; k = on_line k c d, on_line k a b ? cong e c e f -Menelaus_b11w x +Menelaus_b11w o a b c = triangle a b c; o = circle o a b c; p = on_tline p a o a, on_tline p b o b; d = on_line d p c, on_circle d o a; e = on_pline e c p a, on_line e a b; f = on_line f c e, on_line f a d; k = on_line k c d, on_line k a b; m = on_line m o p, on_line m a b ? cyclic o m c d Menelaus_b12 v a b c = triangle a b c; m = midpoint m a b; d = on_line d b c; e = mirror e m d; f = on_line f a b; g = on_line g a c; k = on_line k f e, on_line k g d; v = on_line v f d, on_line v g e; l = on_line l a k, on_line l b c; t = on_line t a v, on_line t b c ? cong d t e l @@ -849,3 +849,33 @@ K,J,B are collinear [16] 008. B,F,A are collinear [06] & C,A,E are collinear [04] & EG ⟂ AC [05] & FG ⟂ AB [07] ⇒ ∠GFA = ∠AEG [24] 009. B,F,A are collinear [06] & C,A,E are collinear [04] & ∠GAB = ∠CAG [00] ⇒ ∠GAF = ∠EAG [25] 010. ∠GFA = ∠AEG [24] & ∠GAF = ∠EAG [25] (Similar Triangles)⇒ AF = AE [26] + + +Circle_a2 +b c = segment b c; a = on_bline a b c; i = incenter i a b c; o = on_bline o b i; p = on_circle p a b, on_circle p o b; q = on_circle q i b, on_circle q o b; r = on_line r i p, on_line r b q ? perp b r c r +Circle_a5 +a b c = triangle a b c; d e f x = excenter2 d e f x a b c; o1 = circle o1 a e f; p = on_line p b c, on_circle p o1 a; q = on_line q b c, on_circle q o1 a; m = midpoint m a d; o2 = circle o2 m p q; t = on_circle t o2 m, on_circle t x d ? coll o2 x t +Circle_a6 +a b c = triangle a b c; o = circle o a b c; h = orthocenter h a b c; s = on_circle s o a; p = on_line p b c, on_tline p s a s; o2 = circle o2 a s p; x = on_line x s h, on_circle x o2 a; r = on_line r a b, on_line r o p; q = on_line q a c, on_line q o p; y = foot y q a r; z = foot z r a q ? coll x y z +Circle_a8 +a b c = triangle a b c; o = circle o a b c; d = on_line d a o, on_line d b c; u = foot u d a c; v = foot v d a b; e = on_tline e a a o, on_line e d u; f = on_tline f a a o, on_line f d v; p = on_line p e c, on_line p f b ? perp p d b c +Circle_b2 +a b c = segment a b c; d = foot d a b c; e = foot e b c a; f = foot f c a b; h = on_line h a d, on_line h b e; p = on_line p b e, on_line p d f; q = on_line q a b, on_tline q p b c; n = on_line n e q, on_line n a d ? cong a n a h +Circle_b4 +a b c = triangle a b c; o = circle o a b c; i = circle i o b c; g = on_circle g i o; x = circle x a b g; y = circle y a c g; e = on_line e a c, on_circle e x a; f = on_line f a b, on_circle f y a; k = on_line k b e, on_line k c f; t = on_line t a k, on_line t b c ? coll t o g +Circle_b5 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_line e a d, on_line e b c; m = midpoint m a d; n = midpoint n b c; w = circle w e m n; x = on_circle x o a, on_circle x w e; y = on_circle y o a, on_circle y w e; z = on_line z a b, on_line z c d ? coll x y z +Circle_b7w +a b c = triangle a b c; d e f i = incenter2 d e f i a b c; p = on_line p a d, on_circle p i d; q = on_line q e f, on_tline q p a d; x = on_line x d e, on_line x a q; y = on_line y d f, on_line y a q; u = on_line u d i, on_pline u a b c; v = on_line v d i, on_circle v i d ? cong a x a y +Circle_b13 +a b c = triangle a b c; d = foot d a b c; e = foot e b c a; m = midpoint a b; o = circle o a b c; f = on_line f d e, on_circle f o a; k = on_line k d e, on_circle k o a; w = circle w m d e; p = on_line p m k, on_circle p w m; q = on_line q m f, on_circle q w m ? cyclic a p q b +Circle_b15 +a b = segment a b; o = on_bline o a b; p = on_tline p a o a, on_tline p b o b; c = on_circle c o a; d = on_line d p c, on_circle d o a; e = on_pline e c p b, on_circle e o a; f = on_line f a e, on_line f p b; g = on_line g d e, on_line g p b ? cong g f g b +Circle_c2 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_line e a b, on_line e c d; f = on_line f b c, on_pline f e a d; m = midpoint m o f; g = on_circle g o a, on_circle g m f ? cong f e f g +Circle_c3 +a b c = triangle a b c; d = angle_bisector d b a c, on_line d b c; m = midpoint m b c; o = circle o a d m; l = on_line l a b, on_circle l o a; n = on_line n a c, on_circle n o a ? cong b l c n +Pascal_a1 +a b c = triangle a b c; o = circle o a b c; p = free; a1 = on_line a1 a p, on_circle a1 o a; b1 = on_line b1 b p, on_circle b1 o b; c1 = on_line c1 c p, on_circle c1 o c; q = on_circle q o a; x = on_line x q a1, on_line x b c; y = on_line y q b1, on_line y a c; z = on_line z q c1, on_line z a b ? coll x y z +Pascal_b2 +a c = segment a c; o = midpoint o a c; m = on_line m a d, on_line m b c; n = on_tline n b o b, on_tline o d o d ? perp a c m n \ No newline at end of file diff --git a/output_new/Newton.txt b/output_new/Newton.txt new file mode 100644 index 0000000..e2d0d79 --- /dev/null +++ b/output_new/Newton.txt @@ -0,0 +1,68 @@ + +========================== + * From theorem premises: +A B C D E F G H I : Points +D,E,C are collinear [00] +B,A,E are collinear [01] +B,F,C are collinear [02] +D,A,F are collinear [03] +A,C,G are collinear [04] +GA = GC [05] +B,D,H are collinear [06] +HB = HD [07] +F,I,E are collinear [08] +IE = IF [09] + + * Auxiliary Constructions: +J K L : Points +J,E,C are collinear [10] +JC = JE [11] +B,K,C are collinear [12] +KB = KC [13] +B,E,L are collinear [14] +LB = LE [15] + + * Proof steps: +001. B,K,C are collinear [12] & KB = KC [13] ⇒ K is midpoint of BC [16] +002. B,D,H are collinear [06] & HB = HD [07] ⇒ H is midpoint of BD [17] +003. K is midpoint of BC [16] & H is midpoint of BD [17] ⇒ KH ∥ CD [18] +004. L,B,E are collinear [14] & LB = LE [15] ⇒ L is midpoint of BE [19] +005. L is midpoint of BE [19] & K is midpoint of BC [16] ⇒ LK ∥ EC [20] +006. HK ∥ CD [18] & LK ∥ EC [20] & D,E,C are collinear [00] ⇒ KL ∥ KH [21] +007. KL ∥ KH [21] ⇒ K,H,L are collinear [22] +008. F,I,E are collinear [08] & IE = IF [09] ⇒ I is midpoint of EF [23] +009. L is midpoint of BE [19] & I is midpoint of EF [23] ⇒ LI ∥ BF [24] +010. J,E,C are collinear [10] & JC = JE [11] ⇒ J is midpoint of EC [25] +011. L is midpoint of BE [19] & J is midpoint of EC [25] ⇒ LJ ∥ BC [26] +012. LI ∥ BF [24] & B,F,C are collinear [02] & JL ∥ BC [26] ⇒ LJ ∥ LI [27] +013. LJ ∥ LI [27] ⇒ I,J,L are collinear [28] +014. A,C,G are collinear [04] & GA = GC [05] ⇒ G is midpoint of CA [29] +015. K is midpoint of BC [16] & G is midpoint of CA [29] ⇒ KG ∥ BA [30] +016. J is midpoint of EC [25] & G is midpoint of CA [29] ⇒ JG ∥ EA [31] +017. GK ∥ AB [30] & JG ∥ EA [31] & B,A,E are collinear [01] ⇒ GJ ∥ GK [32] +018. GJ ∥ GK [32] ⇒ J,K,G are collinear [33] +019. J is midpoint of EC [25] & H is midpoint of BD [17] ⇒ JE:EC = HB:BD [34] +020. JE:EC = HB:BD [34] & HB = HD [07] ⇒ JE:EC = DH:BD [35] +021. K is midpoint of BC [16] & I is midpoint of EF [23] ⇒ KB:BC = IF:FE [36] +022. KB:BC = IF:FE [36] & KB = KC [13] ⇒ KC:BC = FI:FE [37] +023. G is midpoint of CA [29] & H is midpoint of BD [17] ⇒ GA:AC = HB:BD [38] +024. GA:AC = HB:BD [38] & GA = GC [05] & HB = HD [07] ⇒ CG:AC = DH:BD [39] +025. G is midpoint of CA [29] & I is midpoint of EF [23] ⇒ GA:AC = IF:FE [40] +026. GA:AC = IF:FE [40] & GA = GC [05] ⇒ CG:AC = FI:FE [41] +027. IL ∥ FB [24] & F,I,E are collinear [08] & B,L,E are collinear [14] ⇒ EI:EF = IL:FB [42] +028. EI:EF = IL:FB [42] & IE = IF [09] ⇒ FI:FE = IL:BF [43] +029. J is midpoint of EC [25] & I is midpoint of EF [23] ⇒ JI ∥ CF [44] +030. FC ∥ IJ [44] & F,I,E are collinear [08] & C,J,E are collinear [10] ⇒ EF:EI = FC:IJ [45] +031. EF:EI = FC:IJ [45] & IE = IF [09] ⇒ FE:FI = FC:IJ [46] +032. JG ∥ EA [31] & C,J,E are collinear [10] & A,C,G are collinear [04] ⇒ CJ:CE = JG:EA [47] +033. CJ:CE = JG:EA [47] & JC = JE [11] ⇒ JE:EC = JG:AE [48] +034. GK ∥ AB [30] & B,K,C are collinear [12] & A,C,G are collinear [04] ⇒ BC:KC = BA:KG [49] +035. JC = JE [11] & KB = KC [13] & JE:EC = DH:BD [35] & KC:BC = FI:FE [37] & CG:AC = DH:BD [39] & CG:AC = FI:FE [41] & FI:FE = IL:BF [43] & FE:FI = FC:IJ [46] & JE:EC = JG:AE [48] & BC:KC = BA:KG [49] (Ratio chase)⇒ (BA:AE) * (FC:BF) * (JG:KG) * (IL:IJ) = 1 [50] +036. B,F,C are collinear [02] & B,A,E are collinear [01] & D,E,C are collinear [00] & D,A,F are collinear [03] (Menelaus)⇒ (DC:DE) * (AE:BA) * (BF:FC) = 1 [51] +037. HK ∥ CD [18] & B,D,H are collinear [06] & B,K,C are collinear [12] ⇒ BH:HK = BD:DC [52] +038. L is midpoint of BE [19] & H is midpoint of BD [17] ⇒ LH ∥ ED [53] +039. HL ∥ DE [53] & B,D,H are collinear [06] & B,L,E are collinear [14] ⇒ BH:HL = BD:DE [54] +040. BD:DC = BH:KH [52] & BD:DE = BH:HL [54] ⇒ KH:HL = DC:DE [55] +041. (BA:AE) * (FC:BF) * (JG:KG) * (IL:IJ) = 1 [50] & (DC:DE) * (AE:BA) * (BF:FC) = 1 [51] & KH:HL = DC:DE [55] ⇒ (KH:HL) * (LI:IJ) * (JG:GK) = 1 [56] +042. K,H,L are collinear [22] & I,J,L are collinear [28] & J,K,G are collinear [33] & (KH:HL) * (LI:IJ) * (JG:GK) = 1 [56] (Menelaus)⇒ I,H,G are collinear +========================== diff --git a/output_new/ceva_a4.txt b/output_new/ceva_a4.txt new file mode 100644 index 0000000..e69de29 diff --git a/output_new/ceva_a7.txt b/output_new/ceva_a7.txt new file mode 100644 index 0000000..e27a0c3 --- /dev/null +++ b/output_new/ceva_a7.txt @@ -0,0 +1,51 @@ +3 [171.88209223747253, 3241.3160371780396, 25048.504298210144] +solved +('eqratio30', 'a', 'b', 'a', 'j', 'c', 'i', 'b', 'i', 'e', 'j', 'c', 'e') + + +========================== + * From theorem premises: +A B C D E F G H I J : Points +DA = DB [00] +DB = DC [01] +DE = DA [02] +B,A,F are collinear [03] +E,C,F are collinear [04] +E,G,A are collinear [05] +G,C,B are collinear [06] +DH = DA [07] +DI = DA [08] +I,F,H are collinear [09] +DJ = DA [10] +G,H,J are collinear [11] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. E,G,A are collinear [05] & B,A,F are collinear [03] & E,C,F are collinear [04] & G,C,B are collinear [06] (Menelaus)⇒ (EG:GA) * (BA:FB) * (CF:EC) = 1 [12] +002. E,G,A are collinear [05] & B,A,F are collinear [03] & E,C,F are collinear [04] & G,C,B are collinear [06] (Menelaus)⇒ (GC:GB) * (BA:FA) * (EF:EC) = 1 [13] +003. DE = DA [02] & DJ = DA [10] & DA = DB [00] & DB = DC [01] & DH = DA [07] ⇒ E,A,H,J are concyclic [14] +004. E,A,H,J are concyclic [14] & E,G,A are collinear [05] & G,H,J are collinear [11] (Circle Power)⇒ EG:GH = GJ:GA [15] +005. E,A,H,J are concyclic [14] ⇒ ∠EAJ = ∠EHJ [16] +006. E,A,H,J are concyclic [14] ⇒ ∠EAH = ∠EJH [17] +007. E,G,A are collinear [05] & G,H,J are collinear [11] & ∠EAJ = ∠EHJ [16] ⇒ ∠GEH = ∠AJG [18] +008. G,E,A are collinear [05] & ∠EAJ = ∠EHJ [16] & G,H,J are collinear [11] ⇒ ∠GHE = ∠JAG [19] +009. ∠GEH = ∠AJG [18] & ∠GHE = ∠JAG [19] (Similar Triangles)⇒ EG:EH = GJ:AJ [20] +010. E,G,A are collinear [05] & ∠EAH = ∠EJH [17] & G,H,J are collinear [11] ⇒ ∠GEJ = ∠AHG [21] +011. G,H,J are collinear [11] & G,E,A are collinear [05] & ∠EAH = ∠EJH [17] ⇒ ∠GJE = ∠HAG [22] +012. ∠GEJ = ∠AHG [21] & ∠GJE = ∠HAG [22] (Similar Triangles)⇒ EG:EJ = GH:HA [23] +013. DE = DA [02] & DI = DA [08] & DA = DB [00] & DB = DC [01] & DH = DA [07] ⇒ A,H,I,B are concyclic [24] +014. A,H,I,B are concyclic [24] ⇒ ∠AHI = ∠ABI [25] +015. A,F,B are collinear [03] & ∠AHI = ∠ABI [25] & I,F,H are collinear [09] ⇒ ∠FBI = ∠AHF [26] +016. I,H,F are collinear [09] & B,F,A are collinear [03] & ∠AHI = ∠ABI [25] ⇒ ∠FIB = ∠HAF [27] +017. ∠FBI = ∠AHF [26] & ∠FIB = ∠HAF [27] (Similar Triangles)⇒ FB:IB = FH:HA [28] +018. DE = DA [02] & DI = DA [08] & DA = DB [00] & DB = DC [01] & DH = DA [07] ⇒ E,C,H,I are concyclic [29] +019. E,C,H,I are concyclic [29] ⇒ ∠ECI = ∠EHI [30] +020. I,H,F are collinear [09] & E,C,F are collinear [04] & ∠ECI = ∠EHI [30] ⇒ ∠CIF = ∠FEH [31] +021. E,C,F are collinear [04] & I,F,H are collinear [09] ⇒ ∠CFI = ∠EFH [32] +022. ∠CIF = ∠FEH [31] & ∠CFI = ∠EFH [32] (Similar Triangles)⇒ CI:CF = EH:FH [33] +023. (EG:GA) * (BA:FB) * (CF:EC) = 1 [12] & (GC:GB) * (BA:FA) * (EF:EC) = 1 [13] & EG:GH = GJ:GA [15] & EG:EH = GJ:AJ [20] & EG:EJ = GH:HA [23] & FB:IB = FH:HA [28] & CI:CF = EH:FH [33] (Ratio chase)⇒ (FA:AJ) * (GB:IB) * (CI:GC) * (EJ:EF) = 1 [34] +024. (FA:AJ) * (GB:IB) * (CI:GC) * (EJ:EF) = 1 [34] & (EC:BA) * (FA:GC) * (GB:EF) = 1 [13] ⇒ (AJ:JE) * (EC:IC) * (BI:BA) = 1 +========================== \ No newline at end of file diff --git a/output_new/exercise7_4.txt b/output_new/circle_b4.txt similarity index 99% rename from output_new/exercise7_4.txt rename to output_new/circle_b4.txt index 92dd3f3..0aed604 100644 --- a/output_new/exercise7_4.txt +++ b/output_new/circle_b4.txt @@ -96,5 +96,5 @@ A,K,L are collinear [16] 069. ∠(GI-AC) = ∠CAG [67] & ∠(IG-FK) = ∠(AC-FD) [84] ⇒ ∠(AC-FK) = ∠(AG-DF) [85] 070. ∠CAK = ∠GAD [65] & ∠(AC-FK) = ∠(AG-DF) [85] ⇒ ∠KAD = ∠KFD [86] 071. ∠KAD = ∠KFD [86] ⇒ A,F,D,K are concyclic [87] -072. A,B,K,C are concyclic [44] & A,F,D,K are concyclic [87] & F,D,B,C are concyclic [22] & A,K,L are collinear [16] & B,L,C are collinear [15] ⇒ F,D,L are collinear +072. A,B,K,C are concyclic [44] & A,F,D,K are concyclic [87] & F,D,B,C are concyclic [22] & A,K,L are collinear [16] & B,L,C are collinear [15] (Radical Axis) ⇒ F,D,L are collinear ========================== diff --git a/output_new/circle_c2.txt b/output_new/circle_c2.txt new file mode 100644 index 0000000..9f59fe4 --- /dev/null +++ b/output_new/circle_c2.txt @@ -0,0 +1,33 @@ + +========================== + * From theorem premises: +A B C D E F G H I : Points +DA = DB [00] +DB = DC [01] +DE = DA [02] +E,F,C are collinear [03] +B,F,A are collinear [04] +B,G,C are collinear [05] +GF ∥ AE [06] +HD = HG [07] +D,H,G are collinear [08] +DI = DA [09] +HI = HG [10] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. DA = DB [00] & DE = DA [02] & DB = DC [01] ⇒ E,B,A,C are concyclic [11] +002. E,B,A,C are concyclic [11] ⇒ ∠BCE = ∠BAE [12] +003. E,B,A,C are concyclic [11] ⇒ ∠ABC = ∠AEC [13] +004. B,G,C are collinear [05] & E,F,C are collinear [03] & B,F,A are collinear [04] & ∠BCE = ∠BAE [12] & AE ∥ FG [06] ⇒ ∠GCF = ∠BFG [14] +005. E,F,C are collinear [03] & B,F,A are collinear [04] & B,G,C are collinear [05] & ∠AEC = ∠ABC [13] & AE ∥ FG [06] ⇒ ∠GFC = ∠FBG [15] +006. ∠GCF = ∠BFG [14] & ∠GFC = ∠FBG [15] (Similar Triangles)⇒ GC:FG = FG:BG [16] +007. DI = DA [09] & DA = DB [00] & DB = DC [01] ⇒ D is the circumcenter of \Delta IBC [17] +008. HI = HG [10] & HD = HG [07] ⇒ H is the circumcenter of \Delta DIG [18] +009. H is the circumcenter of \Delta DIG [18] & D,H,G are collinear [08] ⇒ DI ⟂ GI [19] +010. D is the circumcenter of \Delta IBC [17] & DI ⟂ GI [19] & B,G,C are collinear [05] (Circle Power)⇒ IG:BG = GC:IG [20] +011. GC:FG = FG:BG [16] & IG:BG = GC:IG [20] (Ratio chase)⇒ FG = IG +========================== diff --git a/output_new/cricle_c3.txt b/output_new/cricle_c3.txt new file mode 100644 index 0000000..d17d776 --- /dev/null +++ b/output_new/cricle_c3.txt @@ -0,0 +1,31 @@ + +========================== + * From theorem premises: +A B C D E F G H : Points +B,D,C are collinear [00] +∠BAD = ∠DAC [01] +B,E,C are collinear [02] +EB = EC [03] +FD = FE [04] +FA = FD [05] +FG = FA [06] +B,G,A are collinear [07] +FH = FA [08] +H,C,A are collinear [09] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. FD = FE [04] & FA = FD [05] & FG = FA [06] ⇒ E,D,G,A are concyclic [10] +002. B,D,C are collinear [00] & B,E,C are collinear [02] ⇒ B,D,E are collinear [11] +003. B,D,C are collinear [00] & B,E,C are collinear [02] ⇒ C,D,E are collinear [12] +004. E,D,G,A are concyclic [10] & B,D,E are collinear [11] & B,G,A are collinear [07] (Circle Power)⇒ BD:BA = BG:BE [13] +005. ∠BAD = ∠DAC [01] & B,D,C are collinear [00] ⇒ BD:BA = DC:CA [14] +006. FD = FE [04] & FA = FD [05] & FH = FA [08] & FG = FA [06] & E,D,G,A are concyclic [10] ⇒ H,E,D,A are concyclic [15] +007. H,E,D,A are concyclic [15] & C,D,E are collinear [12] & H,C,A are collinear [09] (Circle Power)⇒ DC:CA = CH:EC [16] +008. BD:BA = BG:BE [13] & EB = EC [03] & BD:BA = DC:CA [14] & DC:CA = CH:EC [16] ⇒ CH:BE = BG:BE [17] +009. BE = EC [03] ⇒ BE:BA = BE:BA [18] +010. CH:BE = BG:BE [17] & BE:BA = BE:BA [18] ⇒ CH = BG +========================== diff --git a/output_new/example2_4.txt b/output_new/example2_4.txt deleted file mode 100644 index caa29d6..0000000 --- a/output_new/example2_4.txt +++ /dev/null @@ -1,62 +0,0 @@ - * From theorem premises: -A B C D E F G H I : Points -C,B,D are collinear [00] -CA = DC [01] -EC = ED [02] -EA = EC [03] -FB = FC [04] -C,B,F are collinear [05] -FG = FC [06] -EG = EC [07] -B,G,H are collinear [08] -A,C,H are collinear [09] -A,B,I are collinear [10] -C,G,I are collinear [11] - - * Auxiliary Constructions: -J : Points -J,C,H are collinear [12] -JH = JC [13] - - * Proof steps: -001. FG = FC [06] & FB = FC [04] ⇒ FB = FG [14] -002. FG = FC [06] & FB = FC [04] ⇒ F is the circumcenter of \Delta BGC [15] -003. FB = FG [14] ⇒ ∠FBG = ∠BGF [16] -004. EG = EC [07] & FG = FC [06] ⇒ GC ⟂ EF [17] -005. EG = EC [07] & FG = FC [06] (SSS)⇒ ∠GEF = ∠FEC [18] -006. F is the circumcenter of \Delta BGC [15] & C,B,F are collinear [05] ⇒ BG ⟂ CG [19] -007. C,B,D are collinear [00] & ∠FBG = ∠BGF [16] & C,B,F are collinear [05] & GC ⟂ EF [17] & BG ⟂ CG [19] ⇒ ∠GBD = ∠GFE [20] -008. EC = ED [02] & EA = EC [03] ⇒ EA = ED [21] -009. CD = CA [01] & EA = ED [21] ⇒ AD ⟂ CE [22] -010. CD = CA [01] & EA = ED [21] (SSS)⇒ ∠ACE = ∠ECD [23] -011. C,B,F are collinear [05] & FB = FC [04] ⇒ F is midpoint of CB [24] -012. J,C,H are collinear [12] & JH = JC [13] ⇒ J is midpoint of CH [25] -013. F is midpoint of CB [24] & J is midpoint of CH [25] ⇒ FJ ∥ BH [26] -014. BG ⟂ CG [19] & AD ⟂ CE [22] & FJ ∥ BH [26] & B,G,H are collinear [08] ⇒ ∠(CE-AD) = ∠(JF-CG) [27] -015. EC = ED [02] & EG = EC [07] & EA = EC [03] ⇒ A,C,G,D are concyclic [28] -016. A,C,G,D are concyclic [28] ⇒ ∠CAD = ∠CGD [29] -017. A,C,G,D are concyclic [28] ⇒ ∠AGC = ∠ADC [30] -018. CD = CA [01] ⇒ ∠CAD = ∠ADC [31] -019. ∠CAD = ∠CGD [29] & ∠CAD = ∠ADC [31] & C,B,D are collinear [00] ⇒ ∠(AD-CB) = ∠CGD [32] -020. ∠(CE-AD) = ∠(JF-CG) [27] & ∠(AD-CB) = ∠CGD [32] ⇒ ∠(CE-FJ) = ∠(BC-DG) [33] -021. C,B,D are collinear [00] & ∠GEF = ∠FEC [18] & GC ⟂ EF [17] & BG ⟂ CG [19] & ∠(CE-FJ) = ∠(BC-DG) [33] & FJ ∥ BH [26] & B,G,H are collinear [08] ⇒ ∠GDB = ∠GEF [34] -022. ∠GBD = ∠GFE [20] & ∠GDB = ∠GEF [34] (Similar Triangles)⇒ BG:FG = BD:FE [35] -023. BG:FG = BD:FE [35] & FG = FC [06] & BF = CF [04] ⇒ EF:BD = BF:BG [36] -024. J,C,H are collinear [12] & A,C,H are collinear [09] & C,B,F are collinear [05] & ∠ACE = ∠ECD [23] & C,B,D are collinear [00] ⇒ ∠JCE = ∠ECF [37] -025. GC ⟂ EF [17] & BG ⟂ CG [19] & FJ ∥ BH [26] & B,G,H are collinear [08] ⇒ FJ ∥ FE [38] -026. FJ ∥ FE [38] ⇒ J,E,F are collinear [39] -027. ∠JCE = ∠ECF [37] & J,E,F are collinear [39] ⇒ JE:EF = JC:CF [40] -028. B,G,H are collinear [08] & CG ⟂ BG [19] ⇒ CG ⟂ GH [41] -029. CG ⟂ GH [41] & J is midpoint of CH [25] ⇒ CJ = GJ [42] -030. JE:EF = JC:CF [40] & JG = JC [42] & BF = CF [04] ⇒ JE:EF = JG:BF [43] -031. J,C,H are collinear [12] & A,C,H are collinear [09] & ∠AGC = ∠ADC [30] & C,B,D are collinear [00] & ∠CAD = ∠ADC [31] ⇒ ∠DAJ = ∠CGA [44] -032. ∠(CE-AD) = ∠(JF-CG) [27] & ∠DAJ = ∠CGA [44] ⇒ ∠(CE-AJ) = ∠(JF-AG) [45] -033. J,E,F are collinear [39] & A,C,H are collinear [09] & ∠(CE-AJ) = ∠(JF-AG) [45] & J,C,H are collinear [12] & FJ ∥ BH [26] & B,G,H are collinear [08] & ∠GEF = ∠FEC [18] & GC ⟂ EF [17] & BG ⟂ CG [19] ⇒ ∠GEJ = ∠GAH [46] -034. C,B,F are collinear [05] & ∠FBG = ∠BGF [16] & FJ ∥ BH [26] & B,G,H are collinear [08] ⇒ ∠GFJ = ∠JFC [47] -035. FG = FC [06] & ∠GFJ = ∠JFC [47] (SAS)⇒ ∠GJF = ∠FJC [48] -036. J,E,F are collinear [39] & B,G,H are collinear [08] & A,C,H are collinear [09] & ∠GJF = ∠FJC [48] & J,C,H are collinear [12] & GC ⟂ EF [17] & BG ⟂ CG [19] ⇒ ∠GJE = ∠GHA [49] -037. ∠GEJ = ∠GAH [46] & ∠GJE = ∠GHA [49] (Similar Triangles)⇒ JG:HG = JE:HA [50] -038. JE:EF = JG:BF [43] & JG:GH = JE:AH [50] ⇒ BF:GH = EF:AH [51] -039. EF:BD = BF:BG [36] & EF:AH = BF:GH [51] ⇒ HG:GB = AH:BD [52] -040. CA = DC [01] & HG:GB = AH:BD [52] ⇒ (HG:GB) * (BD:DC) * (CA:AH) = 1 [53] -041. B,G,H are collinear [08] & C,B,D are collinear [00] & A,C,H are collinear [09] & A,B,I are collinear [10] & C,G,I are collinear [11] & (HG:GB) * (BD:DC) * (CA:AH) = 1 [53] ⇒ I,H,D are collinear \ No newline at end of file diff --git a/output_new/example6_1.txt b/output_new/example6_1.txt deleted file mode 100644 index 334a516..0000000 --- a/output_new/example6_1.txt +++ /dev/null @@ -1,36 +0,0 @@ - -========================== - * From theorem premises: -A B C D E F G H I J K L : Points -DA = DB [00] -DB = DC [01] -DF = DA [02] -E,F,A are collinear [03] -DG = DB [04] -G,E,B are collinear [05] -DH = DC [06] -E,H,C are collinear [07] -DI = DA [08] -J,F,I are collinear [09] -B,J,C are collinear [10] -K,A,C are collinear [11] -I,L,H are collinear [12] - - * Auxiliary Constructions: -: Points - - - * Proof steps: -001. DA = DB [00] & DF = DA [02] & DB = DC [01] & DG = DB [04] ⇒ G,B,F,A are concyclic [13] -002. DF = DA [02] & DI = DA [08] & DB = DC [01] & DA = DB [00] ⇒ F,I,A,C are concyclic [14] -003. F,I,A,C are concyclic [14] & DA = DB [00] & DF = DA [02] & DB = DC [01] & DG = DB [04] & G,B,F,A are concyclic [13] ⇒ G,B,I,C are concyclic [15] -004. G,B,F,A are concyclic [13] & G,B,I,C are concyclic [15] & I,C,F,A are concyclic [14] & G,E,B are collinear [05] & E,F,A are collinear [03] ⇒ E,I,C are collinear [16] -005. DF = DA [02] & DA = DB [00] & DB = DC [01] & DH = DC [06] & DG = DB [04] & G,B,F,A are concyclic [13] ⇒ G,B,C,H are concyclic [17] -006. F,I,A,C are concyclic [14] & DA = DB [00] & DF = DA [02] & DB = DC [01] & DG = DB [04] & G,B,F,A are concyclic [13] ⇒ G,B,I,F are concyclic [18] -007. F,I,A,C are concyclic [14] & DA = DB [00] & DF = DA [02] & DB = DC [01] & DH = DC [06] ⇒ F,I,A,H are concyclic [19] -008. F,I,A,C are concyclic [14] & DA = DB [00] & DF = DA [02] & DB = DC [01] & F,I,A,H are concyclic [19] ⇒ I,C,H,F are concyclic [20] -009. G,B,C,H are concyclic [17] & G,B,I,F are concyclic [18] & I,C,H,F are concyclic [20] & G,E,B are collinear [05] & E,H,C are collinear [07] ⇒ E,F,I are collinear [21] -010. F,I,A,C are concyclic [14] & DA = DB [00] & DF = DA [02] & DB = DC [01] & DG = DB [04] & G,B,F,A are concyclic [13] & F,I,A,H are concyclic [19] ⇒ G,B,I,H are concyclic [22] -011. G,B,F,A are concyclic [13] & G,B,I,H are concyclic [22] & I,H,F,A are concyclic [19] & G,E,B are collinear [05] & E,F,A are collinear [03] ⇒ E,I,H are collinear [23] -012. K,A,C are collinear [11] & E,I,C are collinear [16] & E,F,I are collinear [21] & J,F,I are collinear [09] & E,F,A are collinear [03] & E,I,H are collinear [23] & B,J,C are collinear [10] & I,L,H are collinear [12] ⇒ J,K,L are collinear -========================== diff --git a/output_new/example7_1.txt b/output_new/example7_1.txt deleted file mode 100644 index 3910c8e..0000000 --- a/output_new/example7_1.txt +++ /dev/null @@ -1,36 +0,0 @@ - -========================== - * From theorem premises: -A B C D E F G H I J : Points -∠CAB = ∠ABC [00] -A,D,C are collinear [01] -ED ∥ AB [02] -E,B,C are collinear [03] -E,F,B are collinear [04] -BE = BF [05] -A,G,B are collinear [06] -G,F,D are collinear [07] -HA = HD [08] -HD = HG [09] -IF = IG [10] -IB = IF [11] -IJ = IG [12] -HJ = HG [13] - - * Auxiliary Constructions: -: Points - - - * Proof steps: -001. A,G,B are collinear [06] & DE ∥ AB [02] ⇒ ED ∥ BG [14] -002. ED ∥ BG [14] & F,E,B are collinear [04] & G,F,D are collinear [07] ⇒ BF:BE = GF:GD [15] -003. BF:BE = GF:GD [15] & BE = BF [05] ⇒ GF = GD [16] -004. IF = IG [10] & IJ = IG [12] & IB = IF [11] ⇒ G,J,F,B are concyclic [17] -005. G,J,F,B are concyclic [17] ⇒ ∠GJF = ∠GBF [18] -006. HA = HD [08] & HD = HG [09] & HJ = HG [13] ⇒ J,A,G,D are concyclic [19] -007. J,A,G,D are concyclic [19] ⇒ ∠JGA = ∠JDA [20] -008. ∠GJF = ∠GBF [18] & A,G,B are collinear [06] & E,F,B are collinear [04] & E,B,C are collinear [03] & ∠CAB = ∠ABC [00] & ∠JGA = ∠JDA [20] & A,D,C are collinear [01] ⇒ ∠DJG = ∠GJF [21] -009. ∠DJG = ∠GJF [21] & G,F,D are collinear [07] ⇒ GF:GD = JF:JD [22] -010. GF:GD = JF:JD [22] & GF = GD [16] ⇒ JF = JD [23] -011. GF = GD [16] & JF = JD [23] ⇒ DF ⟂ GJ -========================== diff --git a/output_new/example7_2.txt b/output_new/example7_2.txt deleted file mode 100644 index 0810f1a..0000000 --- a/output_new/example7_2.txt +++ /dev/null @@ -1,41 +0,0 @@ - -========================== - * From theorem premises: -A B C D E F G H : Points -∠CAB = ∠ABC [00] -CA = CB [01] -∠CBD = ∠DBA [02] -∠ACD = ∠DCB [03] -EA = ED [04] -EF = EA [05] -CF = CA [06] -∠ADF = ∠ADF [07] -EG = EA [08] -DG = DA [09] -A,G,H are collinear [10] -F,D,H are collinear [11] - - * Auxiliary Constructions: -: Points - - - * Proof steps: -001. EF = EA [05] & EG = EA [08] & EA = ED [04] ⇒ A,D,G,F are concyclic [12] -002. A,D,G,F are concyclic [12] ⇒ ∠AGD = ∠AFD [13] -003. CF = CA [06] ⇒ ∠CFA = ∠FAC [14] -004. CA = CB [01] & CF = CA [06] ⇒ CF = CB [15] -005. CF = CB [15] ⇒ ∠CFB = ∠FBC [16] -006. DG = DA [09] ⇒ ∠DAG = ∠AGD [17] -007. CA = CB [01] & ∠ACD = ∠DCB [03] (SAS)⇒ ∠CAD = ∠DBC [18] -008. CA = CB [01] & ∠ACD = ∠DCB [03] (SAS)⇒ DA = DB [19] -009. A,G,H are collinear [10] & ∠DAG = ∠AGD [17] & ∠AGD = ∠AFD [13] ⇒ ∠AFD = ∠DAH [20] -010. F,D,H are collinear [11] & ∠ADF = ∠ADF [07] ⇒ ∠ADF = ∠ADH [21] -011. ∠AFD = ∠DAH [20] & ∠ADF = ∠ADH [21] (Similar Triangles)⇒ AD:FD = DH:AD [22] -012. DH:AD = AD:FD [22] & BD = AD [19] ⇒ DH:DB = DB:DF [23] -013. F,D,H are collinear [11] ⇒ ∠HDB = ∠FDB [24] -014. DH:DB = DB:DF [23] & ∠HDB = ∠FDB [24] (Similar Triangles)⇒ ∠DHB = ∠FBD [25] -015. ∠DHB = ∠FBD [25] & F,D,H are collinear [11] ⇒ ∠(DF-BH) = ∠FBD [26] -016. ∠CAB = ∠ABC [00] & ∠CBD = ∠DBA [02] & ∠AGD = ∠AFD [13] & ∠CFA = ∠FAC [14] & ∠CFB = ∠FBC [16] & ∠DAG = ∠AGD [17] & ∠CAD = ∠DBC [18] & ∠(DF-BH) = ∠FBD [26] (Angle chase)⇒ ∠(BH-AG) = 1_PI/2 [27] -017. ∠CAB = ∠ABC [00] & ∠CBD = ∠DBA [02] & ∠AGD = ∠AFD [13] & ∠CFA = ∠FAC [14] & ∠CFB = ∠FBC [16] & ∠DAG = ∠AGD [17] & ∠CAD = ∠DBC [18] & ∠(DF-BH) = ∠FBD [26] (Angle chase)⇒ ∠(AG-BH) = 1_PI/2 [28] -018. A,G,H are collinear [10] & ∠(BH-AG) = 1_PI/2 [27] & ∠(AG-BH) = 1_PI/2 [28] ⇒ AH ⟂ BH -========================== diff --git a/output_new/example7_7_1.txt b/output_new/example7_7_1.txt deleted file mode 100644 index b80cccf..0000000 --- a/output_new/example7_7_1.txt +++ /dev/null @@ -1,34 +0,0 @@ - -========================== - * From theorem premises: -A B C D E F G H I : Points -BA ⟂ DB [00] -CE = CA [01] -DE = DB [02] -CF = CA [03] -DF = DB [04] -EG ⟂ CE [05] -DG = DB [06] -A,E,H are collinear [07] -H,B,G are collinear [08] -IE = IF [09] -IF = IH [10] - - * Auxiliary Constructions: -: Points - - - * Proof steps: -001. IE = IF [09] & IF = IH [10] ⇒ I is the circumcenter of \Delta EFH [11] -002. CF = CA [03] & CE = CA [01] ⇒ C is the circumcenter of \Delta EFA [12] -003. C is the circumcenter of \Delta EFA [12] & EG ⟂ CE [05] ⇒ ∠GEF = ∠EAF [13] -004. DF = DB [04] & DG = DB [06] & DE = DB [02] ⇒ E,B,G,F are concyclic [14] -005. E,B,G,F are concyclic [14] ⇒ ∠GEF = ∠GBF [15] -006. H,B,G are collinear [08] & A,E,H are collinear [07] & ∠GEF = ∠EAF [13] & ∠GEF = ∠GBF [15] ⇒ ∠HBF = ∠HAF [16] -007. ∠HBF = ∠HAF [16] ⇒ H,A,B,F are concyclic [17] -008. H,A,B,F are concyclic [17] ⇒ ∠HAB = ∠HFB [18] -009. DE = DB [02] & DF = DB [04] ⇒ D is the circumcenter of \Delta BEF [19] -010. D is the circumcenter of \Delta BEF [19] & DB ⟂ BA [00] ⇒ ∠ABF = ∠BEF [20] -011. A,H,E are collinear [07] & ∠HAB = ∠HFB [18] & ∠ABF = ∠BEF [20] ⇒ ∠BEF = ∠EHF [21] -012. I is the circumcenter of \Delta EFH [11] & ∠BEF = ∠EHF [21] ⇒ EI ⟂ BE -========================== diff --git a/output_new/example7_7_2.txt b/output_new/example7_7_2.txt deleted file mode 100644 index 7b369c5..0000000 --- a/output_new/example7_7_2.txt +++ /dev/null @@ -1,34 +0,0 @@ - -========================== - * From theorem premises: -A B C D E F G H I : Points -AC ⟂ AB [00] -CE = CA [01] -DE = DB [02] -CF = CA [03] -DF = DB [04] -EG ⟂ CE [05] -DG = DB [06] -H,G,B are collinear [07] -H,E,A are collinear [08] -IE = IF [09] -IF = IH [10] - - * Auxiliary Constructions: -: Points - - - * Proof steps: -001. IE = IF [09] & IF = IH [10] ⇒ I is the circumcenter of \Delta EFH [11] -002. CE = CA [01] & CF = CA [03] ⇒ C is the circumcenter of \Delta AEF [12] -003. C is the circumcenter of \Delta AEF [12] & EG ⟂ CE [05] ⇒ ∠GEF = ∠EAF [13] -004. DF = DB [04] & DG = DB [06] & DE = DB [02] ⇒ E,G,F,B are concyclic [14] -005. E,G,F,B are concyclic [14] ⇒ ∠GEF = ∠GBF [15] -006. G,H,B are collinear [07] & H,A,E are collinear [08] & ∠GEF = ∠EAF [13] & ∠GEF = ∠GBF [15] ⇒ ∠HBF = ∠HAF [16] -007. ∠HBF = ∠HAF [16] ⇒ H,A,F,B are concyclic [17] -008. H,A,F,B are concyclic [17] ⇒ ∠HFA = ∠HBA [18] -009. C is the circumcenter of \Delta AEF [12] & AC ⟂ AB [00] ⇒ ∠FAB = ∠FEA [19] -010. E,H,A are collinear [08] & G,H,B are collinear [07] & ∠HFA = ∠HBA [18] & ∠FAB = ∠FEA [19] ⇒ ∠FEH = ∠FHG [20] -011. I is the circumcenter of \Delta EFH [11] & ∠FEH = ∠FHG [20] ⇒ IH ⟂ HG [21] -012. G,H,B are collinear [07] & IH ⟂ HG [21] ⇒ BH ⟂ HI -========================== diff --git a/output_new/exercise7_1.txt b/output_new/exercise7_1.txt deleted file mode 100644 index 8e91573..0000000 --- a/output_new/exercise7_1.txt +++ /dev/null @@ -1,75 +0,0 @@ - -========================== - * From theorem premises: -A B C D E F G H I : Points -CA = CB [00] -DA = DB [01] -∠DAB = ∠ABD [02] -CE = CA [03] -B,E,F are collinear [04] -DF = DA [05] -A,G,F are collinear [06] -CG = CA [07] -DH = DA [08] -A,E,H are collinear [09] -IA = IG [10] -IG = IH [11] - - * Auxiliary Constructions: -: Points - - - * Proof steps: -001. DA = DB [01] & DF = DA [05] ⇒ DF = DB [12] -002. DF = DB [12] ⇒ ∠DFB = ∠FBD [13] -003. ∠DFB = ∠FBD [13] & B,E,F are collinear [04] ⇒ ∠(DF-BE) = ∠EBD [14] -004. CG = CA [07] & IA = IG [10] ⇒ GA ⟂ CI [15] -005. CA = CB [00] & CG = CA [07] & CE = CA [03] ⇒ A,G,B,E are concyclic [16] -006. A,G,B,E are concyclic [16] ⇒ ∠ABG = ∠AEG [17] -007. A,G,B,E are concyclic [16] ⇒ ∠AGB = ∠AEB [18] -008. A,G,B,E are concyclic [16] ⇒ ∠AGE = ∠ABE [19] -009. ∠AGB = ∠AEB [18] & A,G,F are collinear [06] ⇒ ∠(AF-BG) = ∠AEB [20] -010. DF = DA [05] ⇒ ∠DFA = ∠FAD [21] -011. ∠DAB = ∠ABD [02] & ∠ABG = ∠AEG [17] & ∠(AF-BG) = ∠AEB [20] & ∠DFA = ∠FAD [21] & ∠(DF-BE) = ∠EBD [14] (Angle chase)⇒ EG ⟂ DF [22] -012. A,G,F are collinear [06] & GA ⟂ CI [15] & EG ⟂ DF [22] ⇒ ∠(GE-DF) = ∠(CI-AG) [23] -013. CA = CB [00] & DA = DB [01] ⇒ AB ⟂ CD [24] -014. CA = CB [00] & DA = DB [01] (SSS)⇒ ∠(BC-AD) = ∠(BD-AC) [25] -015. A,G,F are collinear [06] & AB ⟂ CD [24] & GA ⟂ CI [15] ⇒ ∠(CI-AG) = ∠(CD-AB) [26] -016. ∠(CI-AG) = ∠(CD-AB) [26] & ∠AGE = ∠ABE [19] ⇒ ∠ICD = ∠GEB [27] -017. ∠(GE-DF) = ∠(CI-AG) [23] & ∠ICD = ∠GEB [27] ⇒ ∠(AG-CD) = ∠(DF-BE) [28] -018. A,G,F are collinear [06] & ∠(DF-BE) = ∠EBD [14] & ∠(AG-CD) = ∠(DF-BE) [28] ⇒ ∠(AG-CD) = ∠EBD [29] -019. A,G,F are collinear [06] & ∠DFA = ∠FAD [21] ⇒ ∠(DF-AG) = ∠GAD [30] -020. ∠(GE-DF) = ∠(CI-AG) [23] & ∠(DF-AG) = ∠GAD [30] ⇒ ∠EGA = ∠(CI-AD) [31] -021. DF = DA [05] & DH = DA [08] & DA = DB [01] ⇒ A,B,H,F are concyclic [32] -022. A,B,H,F are concyclic [32] ⇒ ∠ABF = ∠AHF [33] -023. A,B,H,F are concyclic [32] ⇒ ∠AHB = ∠AFB [34] -024. A,B,H,F are concyclic [32] ⇒ ∠ABH = ∠AFH [35] -025. ∠ABF = ∠AHF [33] & B,E,F are collinear [04] & A,E,H are collinear [09] ⇒ ∠BAE = ∠(BE-FH) [36] -026. A,G,F are collinear [06] & ∠AGE = ∠ABE [19] ⇒ ∠GEB = ∠GAB [37] -027. ∠BAE = ∠(BE-FH) [36] & ∠GEB = ∠GAB [37] ⇒ ∠(FH-GE) = ∠EAG [38] -028. IA = IG [10] & IG = IH [11] ⇒ IH = IA [39] -029. DH = DA [08] & IH = IA [39] ⇒ AH ⟂ DI [40] -030. ∠AHB = ∠AFB [34] & A,E,H are collinear [09] & B,E,F are collinear [04] ⇒ ∠(AE-BH) = ∠(AF-BE) [41] -031. CG = CA [07] & CA = CB [00] ⇒ CB = CG [42] -032. CB = CG [42] ⇒ ∠CBG = ∠BGC [43] -033. CE = CA [03] & CA = CB [00] ⇒ CB = CE [44] -034. CB = CE [44] ⇒ ∠CBE = ∠BEC [45] -035. CE = CA [03] & CG = CA [07] ⇒ CG = CE [46] -036. CG = CE [46] ⇒ ∠CGE = ∠GEC [47] -037. ∠ABG = ∠AEG [17] & ∠(AE-BH) = ∠(AF-BE) [41] & ∠ABH = ∠AFH [35] & ∠CBG = ∠BGC [43] & ∠CBE = ∠BEC [45] & ∠CGE = ∠GEC [47] (Angle chase)⇒ FH ⟂ CE [48] -038. AH ⟂ DI [40] & A,E,H are collinear [09] & FH ⟂ CE [48] ⇒ ∠(FH-CE) = ∠(DI-AE) [49] -039. CE = CA [03] ⇒ ∠CEA = ∠EAC [50] -040. ∠(FH-CE) = ∠(DI-AE) [49] & ∠CEA = ∠EAC [50] ⇒ ∠(FH-AE) = ∠(DI-AC) [51] -041. ∠EGA = ∠(CI-AD) [31] & A,G,F are collinear [06] & ∠(FH-GE) = ∠EAG [38] & ∠(FH-AE) = ∠(DI-AC) [51] ⇒ ∠(DI-AC) = ∠(CI-AD) [52] -042. ∠(BC-AD) = ∠(BD-AC) [25] & ∠(DI-AC) = ∠(CI-AD) [52] ⇒ ∠CBD = ∠CID [53] -043. ∠CBD = ∠CID [53] ⇒ C,B,D,I are concyclic [54] -044. C,B,D,I are concyclic [54] ⇒ ∠DCI = ∠DBI [55] -045. C,B,D,I are concyclic [54] ⇒ ∠CDB = ∠CIB [56] -046. ∠(AG-CD) = ∠EBD [29] & ∠DCI = ∠DBI [55] ⇒ ∠(AG-CI) = ∠EBI [57] -047. A,G,F are collinear [06] & GA ⟂ CI [15] ⇒ ∠(AG-CI) = ∠(CI-AG) [58] -048. A,G,F are collinear [06] & ∠(AG-CD) = ∠(DF-BE) [28] ⇒ ∠(CD-BE) = ∠(AG-DF) [59] -049. ∠(CD-BE) = ∠(AG-DF) [59] & ∠(DF-BE) = ∠EBD [14] ⇒ ∠(AG-BE) = ∠CDB [60] -050. A,G,F are collinear [06] & ∠(AG-BE) = ∠CDB [60] & ∠CDB = ∠CIB [56] ⇒ ∠CIB = ∠(AG-BE) [61] -051. ∠(AG-CI) = ∠(CI-AG) [58] & ∠CIB = ∠(AG-BE) [61] ⇒ ∠(AG-BI) = ∠(CI-BE) [62] -052. F,E,B are collinear [04] & ∠(AG-CI) = ∠EBI [57] & A,G,F are collinear [06] & ∠(AG-BI) = ∠(CI-BE) [62] ⇒ IB ⟂ EF -========================== diff --git a/output_new/exercise7_5.txt b/output_new/exercise7_5.txt deleted file mode 100644 index 9fbdf35..0000000 --- a/output_new/exercise7_5.txt +++ /dev/null @@ -1,22 +0,0 @@ - -========================== - * From theorem premises: -A B C D E J K L : Points -DB = DC [00] -DA = DB [01] -DE = DA [02] -DJ = DA [03] -DK = DA [04] -A,L,B are collinear [05] -L,E,C are collinear [06] - - * Auxiliary Constructions: -: Points - - - * Proof steps: -001. DB = DC [00] & DA = DB [01] & DE = DA [02] ⇒ A,E,C,B are concyclic [07] -002. DA = DB [01] & DK = DA [04] & DB = DC [00] & DJ = DA [03] ⇒ B,J,A,K are concyclic [08] -003. DA = DB [01] & DK = DA [04] & DB = DC [00] & A,E,C,B are concyclic [07] & DJ = DA [03] ⇒ J,E,C,K are concyclic [09] -004. A,E,C,B are concyclic [07] & B,J,A,K are concyclic [08] & J,E,C,K are concyclic [09] & A,L,B are collinear [05] & L,E,C are collinear [06] ⇒ L,K,J are collinear -========================== diff --git a/output_new/pascal_a1.txt b/output_new/pascal_a1.txt new file mode 100644 index 0000000..bccbb88 --- /dev/null +++ b/output_new/pascal_a1.txt @@ -0,0 +1,31 @@ + +========================== + * From theorem premises: +A B C D E F G H I J K L : Points +DB = DC [00] +DA = DB [01] +DF = DA [02] +E,F,A are collinear [03] +DG = DB [04] +G,E,B are collinear [05] +DH = DC [06] +H,E,C are collinear [07] +DI = DA [08] +F,J,I are collinear [09] +C,J,B are collinear [10] +C,K,A are collinear [11] +I,K,G are collinear [12] +L,B,A are collinear [13] +H,L,I are collinear [14] + + * Auxiliary Constructions: +: Points + + + * Proof steps: +001. DH = DC [06] & DB = DC [00] & DA = DB [01] & DI = DA [08] & DG = DB [04] & DF = DA [02] ⇒ C,A,G,B,H,I are concyclic [15] +002. C,A,G,B,H,I are concyclic [15] & C,K,A are collinear [11] & I,K,G are collinear [12] & L,B,A are collinear [13] & H,L,I are collinear [14] & G,E,B are collinear [05] & H,E,C are collinear [07] (Pascal)⇒ E,L,K are collinear [16] +003. DH = DC [06] & DB = DC [00] & DA = DB [01] & DI = DA [08] & DG = DB [04] & DF = DA [02] ⇒ C,F,A,G,B,I are concyclic [17] +004. C,F,A,G,B,I are concyclic [17] & C,K,A are collinear [11] & I,K,G are collinear [12] & E,F,A are collinear [03] & G,E,B are collinear [05] & F,J,I are collinear [09] & C,J,B are collinear [10] (Pascal)⇒ K,E,J are collinear [18] +005. E,L,K are collinear [16] & K,E,J are collinear [18] ⇒ J,K,L are collinear +========================== diff --git a/output_new/pascal_b2.txt b/output_new/pascal_b2.txt new file mode 100644 index 0000000..6537506 --- /dev/null +++ b/output_new/pascal_b2.txt @@ -0,0 +1,35 @@ + +========================== + * From theorem premises: +A B C D E F G : Points +CA = CB [00] +B,C,A are collinear [01] +CD = CA [02] +CE = CA [03] +B,F,D are collinear [04] +E,F,A are collinear [05] +DG ⟂ CD [06] +EG ⟂ CE [07] + + * Auxiliary Constructions: +H : Points +B,E,H are collinear [08] +H,D,A are collinear [09] + + * Proof steps: +001. CE = CA [03] & CD = CA [02] & CA = CB [00] ⇒ C is the circumcenter of \Delta DEB [10] +002. CE = CA [03] & CD = CA [02] & CA = CB [00] ⇒ B,D,E,A are concyclic [11] +003. C is the circumcenter of \Delta DEB [10] & CD = CA [02] & DG ⟂ CD [06] & EG ⟂ CE [07] & B,F,D are collinear [04] & E,F,A are collinear [05] & B,E,H are collinear [08] & H,D,A are collinear [09] (Pascal)⇒ H,G,F are collinear [12] +004. B,D,E,A are concyclic [11] ⇒ ∠DEB = ∠DAB [13] +005. CA = CB [00] & CD = CA [02] ⇒ C is the circumcenter of \Delta DBA [14] +006. C is the circumcenter of \Delta DBA [14] & B,C,A are collinear [01] ⇒ BD ⟂ AD [15] +007. CA = CB [00] & CE = CA [03] ⇒ C is the circumcenter of \Delta EBA [16] +008. C is the circumcenter of \Delta EBA [16] & B,C,A are collinear [01] ⇒ BE ⟂ AE [17] +009. H,E,B are collinear [08] & E,F,A are collinear [05] & H,D,A are collinear [09] & B,F,D are collinear [04] & BD ⟂ AD [15] & BE ⟂ AE [17] ⇒ ∠HEF = ∠HDF [18] +010. ∠HEF = ∠HDF [18] ⇒ H,E,F,D are concyclic [19] +011. H,E,F,D are concyclic [19] ⇒ ∠HED = ∠HFD [20] +012. B,F,D are collinear [04] & H,G,F are collinear [12] & H,D,A are collinear [09] & B,C,A are collinear [01] & ∠DEB = ∠DAB [13] & ∠HED = ∠HFD [20] & B,E,H are collinear [08] ⇒ ∠(BF-HG) = ∠(HD-BC) [21] +013. H,D,A are collinear [09] & B,F,D are collinear [04] & AD ⟂ BD [15] ⇒ HD ⟂ BF [22] +014. ∠(BF-HG) = ∠(HD-BC) [21] & HD ⟂ BF [22] ⇒ BC ⟂ HG [23] +015. BC ⟂ HG [23] & B,C,A are collinear [01] & H,G,F are collinear [12] ⇒ AB ⟂ FG +========================== From f68954a66c14c2d6bebfb536ea28fb0e78797bb4 Mon Sep 17 00:00:00 2001 From: MiniwaChiaya <2100012973@stu.pku.edu.cn> Date: Sat, 26 Apr 2025 16:52:39 +0800 Subject: [PATCH 27/27] 426 --- chiaya.sh | 6 ++--- dd.py | 34 +++++++++++------------ kirine.txt | 79 +++++++++++------------------------------------------- pros2.txt | 4 ++- rules1.txt | 3 +-- speed.txt | 30 +++++++++++++++++++++ 6 files changed, 70 insertions(+), 86 deletions(-) create mode 100644 speed.txt diff --git a/chiaya.sh b/chiaya.sh index 28c2ad5..d542495 100644 --- a/chiaya.sh +++ b/chiaya.sh @@ -6,7 +6,7 @@ export PYTHONPATH=$PYTHONPATH:$MELIAD_PATH DDAR_ARGS=( --defs_file=$(pwd)/defs.txt \ - --rules_file=$(pwd)/rules.txt \ + --rules_file=$(pwd)/rules1.txt \ ); SIZE=4 @@ -36,13 +36,13 @@ LM_ARGS=( --gin_param=Trainer.restore_state_variables=False ); -INPUT_FILE=newpros.txt +INPUT_FILE=speed.txt SERIES=Menelaus_a python -m alphageometry \ --alsologtostderr \ --problems_file=$(pwd)/$INPUT_FILE \ ---problem_name=Ceva_a4 \ +--problem_name=test_pascal6_rev \ --mode=alphageometry \ "${DDAR_ARGS[@]}" \ "${SEARCH_ARGS[@]}" \ diff --git a/dd.py b/dd.py index 5f59707..d5dc879 100644 --- a/dd.py +++ b/dd.py @@ -496,7 +496,7 @@ def match_cyclic2power( if p: yield dict(zip('PABCD',[p,a,d,b,c])) tb = time.time() - #print("c2p",tb-ta) + print('c2p:',tb-ta) def match_cyclic2power_tan( g: gh.Graph, @@ -521,7 +521,7 @@ def match_cyclic2power_tan( yield dict(zip('OPABC', [o, p, a, b, c])) break tb = time.time() - #print(tb-ta) + print('c2pt:',tb-ta) def match_power2cyclic( @@ -545,7 +545,7 @@ def match_power2cyclic( if g.check_eqratio([p, a, p, c, p, d, p, b]) and not g.check_coll([p,a,c]): yield dict(zip('PABCD', [p, a, b, c, d])) tb = time.time() - #print("p2c",tb-ta) + print('p2c:',tb-ta) def match_pascal6( g: gh.Graph, @@ -599,7 +599,7 @@ def match_pascal6( if gg and h and i: yield dict(zip('ABCDEFGHI',[a,b,c,d,e,f,gg,h,i])) tb = time.time() - #print(tb-ta) + print(tb-ta) def match_pascal6_rev( g: gh.Graph, @@ -650,7 +650,7 @@ def match_pascal6_rev( if h and i and g.check_coll([gg,h,i]): yield dict(zip('OABCDEFGHI',[o,a,b,c,d,e,f,gg,h,i])) tb = time.time() - #print(tb-ta) + print(tb-ta) def match_pascal5( g: gh.Graph, @@ -702,7 +702,7 @@ def match_pascal5( if gg and h and i: yield dict(zip('OABCDEGHI',[o,a,b,c,d,e,gg,h,i])) tb = time.time() - #print(tb-ta) + print(tb-ta) def match_pascal41( g: gh.Graph, @@ -762,7 +762,7 @@ def match_pascal41( if gg and h and i: yield dict(zip('OABCDGHI',[o,a,b,c,d,gg,h,i])) tb = time.time() - #print(tb-ta) + print(tb-ta) def match_pascal42( g: gh.Graph, @@ -822,7 +822,7 @@ def match_pascal42( if gg and h and i: yield dict(zip('OABCDGHI',[o,a,b,c,d,gg,h,i])) tb = time.time() - #print(tb-ta) + print(tb-ta) def match_radical_axis( g: gh.Graph, @@ -876,7 +876,7 @@ def match_radical_axis( if p3: yield dict(zip('ABCDEFP',[c,d,e,f,a,b,p3])) tb = time.time() - #print(tb-ta) + print(tb-ta) def match_menelaus( g: gh.Graph, @@ -924,7 +924,7 @@ def match_menelaus( #debugname([a, b, c, d, e, f]) yield dict(zip('ABCDEF', [a, b, c, d, e, f])) tb = time.time() - #print(tb-ta) + print(tb-ta) def match_ceva( @@ -933,7 +933,7 @@ def match_ceva( theorem: pr.Theorem, ) -> Generator[dict[str, gm.Point], None, None]: """Match coll A F B, coll B D C, coll C E A, coll B P E, coll C P F, coll A P D => eqratio30 A F F B B D D C C E E A""" - #print("ceva") + print("ceva") recordl = set() ta = time.time() all_lines = g.type2nodes[gm.Line] @@ -981,7 +981,7 @@ def match_ceva( #debugname([p, a, b, c, d, e, f]) yield dict(zip('PABCDEF', [p, a, b, c, d, e, f])) tb = time.time() - #print(tb-ta) + print(tb-ta) def match_menelaus_rev( g: gh.Graph, @@ -1034,7 +1034,7 @@ def match_menelaus_rev( if g.check_eqratio30([a, f, f, b, b, d, d, c, c, e, e, a]): yield dict(zip('ABCDEF', [a, b, c, d, e, f])) tb = time.time() - #print(tb-ta) + print(tb-ta) def match_ceva_rev( g: gh.Graph, @@ -1111,7 +1111,7 @@ def match_ceva_rev( #debugname([pca, b, c, a, e, f, d],(x2,x3,x1)) yield dict(zip('PABCDEF', [pca, b, c, a, e, f, d])) tb = time.time() - #print(tb-ta) + print(tb-ta) def match_eqratio6_coll_coll_eqratio( g: gh.Graph, @@ -1557,7 +1557,7 @@ def match_generic( theorem: pr.Theorem ) -> Generator[dict[str, gm.Point], None, None]: """Match any generic rule that is not one of the above match_*() rules.""" - #debugname(theorem) + debugname(theorem) ta = time.time() clause2enum = {} @@ -1601,7 +1601,7 @@ def match_generic( yield mapping tb = time.time() - #print(tb-ta) + print(tb-ta) def match_generic_debug( @@ -1712,7 +1712,7 @@ def match_test( 'circle_cong_cong_perp_coll_coll_coll_coll_coll_coll' : match_pascal5, 'circle_cong_perp_coll_coll_coll_perp_coll_coll' : match_pascal41, 'circle_cong_perp_perp_coll_coll_coll_coll_coll' : match_pascal42, - 'circle_cong_cong_coll_coll_coll_coll_coll_coll_coll_cong' : match_pascal6_rev, + #'circle_cong_cong_coll_coll_coll_coll_coll_coll_coll_cong' : match_pascal6_rev, 'coll_coll_coll_coll_eqratio30': match_menelaus, 'coll_coll_coll_coll_coll_coll_eqratio30': match_ceva, 'coll_coll_coll_eqratio30_coll': match_menelaus_rev, diff --git a/kirine.txt b/kirine.txt index f25699b..32a2a44 100644 --- a/kirine.txt +++ b/kirine.txt @@ -1,71 +1,24 @@ ========================== * From theorem premises: -A B C D E F G H I : Points -C,D,B are collinear [00] -CD = CA [01] -EA = EC [02] -EC = ED [03] -FB = FC [04] -C,B,F are collinear [05] -FG = FC [06] -EG = EC [07] -G,H,B are collinear [08] -C,A,H are collinear [09] -C,G,I are collinear [10] -A,I,B are collinear [11] +A B C D E F G H I J : Points +DA = DB [00] +DB = DC [01] +DE = DA [02] +DF = DA [03] +A,G,B are collinear [04] +E,F,G are collinear [05] +C,B,H are collinear [06] +C,E,I are collinear [07] +H,I,G are collinear [08] +J,F,H are collinear [09] +A,J,I are collinear [10] * Auxiliary Constructions: -J : Points -JH = JC [12] -C,H,J are collinear [13] +: Points + * Proof steps: -001. C,G,I are collinear [10] & C,A,H are collinear [09] & G,H,B are collinear [08] & A,I,B are collinear [11] (Menelaus)⇒ (GI:CI) * (CA:AH) * (HB:GB) = 1 [14] -002. C,G,I are collinear [10] & C,A,H are collinear [09] & G,H,B are collinear [08] & A,I,B are collinear [11] (Menelaus)⇒ (IB:AI) * (CA:GB) * (GH:CH) = 1 [15] -003. C,G,I are collinear [10] & C,A,H are collinear [09] & G,H,B are collinear [08] & A,I,B are collinear [11] (Menelaus)⇒ (GI:CG) * (AB:AH) * (CH:IB) = 1 [16] -004. C,G,I are collinear [10] & C,A,H are collinear [09] & G,H,B are collinear [08] & A,I,B are collinear [11] (Menelaus)⇒ (HB:GH) * (AI:AB) * (CG:CI) = 1 [17] -005. FG = FC [06] & FB = FC [04] ⇒ F is the circumcenter of \Delta BGC [18] -006. FG = FC [06] & FB = FC [04] ⇒ FB = FG [19] -007. F is the circumcenter of \Delta BGC [18] & C,B,F are collinear [05] ⇒ BG ⟂ CG [20] -008. G,H,B are collinear [08] & BG ⟂ CG [20] ⇒ HG ⟂ GC [21] -009. J,C,H are collinear [13] & JH = JC [12] ⇒ J is midpoint of CH [22] -010. HG ⟂ GC [21] & J is midpoint of CH [22] ⇒ HJ = GJ [23] -011. EA = EC [02] & EC = ED [03] ⇒ ED = EA [24] -012. CD = CA [01] & ED = EA [24] (SSS)⇒ ∠ACE = ∠ECD [25] -013. CD = CA [01] & ED = EA [24] ⇒ AD ⟂ CE [26] -014. C,H,J are collinear [13] & C,A,H are collinear [09] & C,B,F are collinear [05] & ∠ACE = ∠ECD [25] & C,D,B are collinear [00] ⇒ ∠JCE = ∠ECF [27] -015. EG = EC [07] & FG = FC [06] ⇒ GC ⟂ EF [28] -016. EG = EC [07] & FG = FC [06] (SSS)⇒ ∠GEF = ∠FEC [29] -017. C,B,F are collinear [05] & FB = FC [04] ⇒ F is midpoint of CB [30] -018. F is midpoint of CB [30] & J is midpoint of CH [22] ⇒ FJ ∥ BH [31] -019. GC ⟂ EF [28] & BG ⟂ CG [20] & FJ ∥ BH [31] & G,H,B are collinear [08] ⇒ FJ ∥ FE [32] -020. FJ ∥ FE [32] ⇒ E,J,F are collinear [33] -021. ∠JCE = ∠ECF [27] & E,J,F are collinear [33] ⇒ EJ:EF = CJ:CF [34] -022. FB = FG [19] ⇒ ∠FBG = ∠BGF [35] -023. C,D,B are collinear [00] & ∠FBG = ∠BGF [35] & C,B,F are collinear [05] & GC ⟂ EF [28] & BG ⟂ CG [20] ⇒ ∠GBD = ∠GFE [36] -024. BG ⟂ CG [20] & AD ⟂ CE [26] & FJ ∥ BH [31] & G,H,B are collinear [08] ⇒ ∠(CE-AD) = ∠(JF-CG) [37] -025. EC = ED [03] & EG = EC [07] & EA = EC [02] ⇒ C,A,D,G are concyclic [38] -026. C,A,D,G are concyclic [38] ⇒ ∠DAC = ∠DGC [39] -027. C,A,D,G are concyclic [38] ⇒ ∠CDA = ∠CGA [40] -028. CD = CA [01] ⇒ ∠CAD = ∠ADC [41] -029. C,D,B are collinear [00] & ∠DAC = ∠DGC [39] & ∠CAD = ∠ADC [41] ⇒ ∠CDA = ∠DGC [42] -030. ∠(CE-AD) = ∠(JF-CG) [37] & ∠CDA = ∠DGC [42] ⇒ ∠ECD = ∠(JF-GD) [43] -031. C,D,B are collinear [00] & ∠GEF = ∠FEC [29] & GC ⟂ EF [28] & BG ⟂ CG [20] & ∠ECD = ∠(JF-GD) [43] & FJ ∥ BH [31] & G,H,B are collinear [08] ⇒ ∠GDB = ∠GEF [44] -032. ∠GBD = ∠GFE [36] & ∠GDB = ∠GEF [44] (Similar Triangles)⇒ BG:BD = FG:FE [45] -033. BG:BD = FG:FE [45] & FG = FC [06] ⇒ GB:DB = CF:EF [46] -034. FG = FC [06] & JH = JC [12] & (GI:CI) * (CA:AH) * (HB:GB) = 1 [14] & HJ = GJ [23] & EJ:EF = CJ:CF [34] & GB:DB = CF:EF [46] (Ratio chase)⇒ (CA:AH) * (GI:GJ) * (HB:DB) * (EJ:CI) = 1 [47] -035. ∠CAD = ∠ADC [41] & C,D,B are collinear [00] & ∠CDA = ∠CGA [40] ⇒ ∠CGA = ∠DAC [48] -036. ∠(CE-AD) = ∠(JF-CG) [37] & ∠CGA = ∠DAC [48] ⇒ ∠(CE-FJ) = ∠CAG [49] -037. F,E,J are collinear [33] & C,A,H are collinear [09] & ∠(CE-FJ) = ∠CAG [49] & FJ ∥ BH [31] & G,H,B are collinear [08] & ∠GEF = ∠FEC [29] & GC ⟂ EF [28] & BG ⟂ CG [20] ⇒ ∠GEJ = ∠GAH [50] -038. C,B,F are collinear [05] & ∠FBG = ∠BGF [35] & FJ ∥ BH [31] & G,H,B are collinear [08] ⇒ ∠CFJ = ∠JFG [51] -039. FG = FC [06] & ∠CFJ = ∠JFG [51] (SAS)⇒ ∠CJF = ∠FJG [52] -040. F,E,J are collinear [33] & G,H,B are collinear [08] & C,A,H are collinear [09] & ∠CJF = ∠FJG [52] & C,H,J are collinear [13] & GC ⟂ EF [28] & BG ⟂ CG [20] ⇒ ∠GJE = ∠GHA [53] -041. ∠GEJ = ∠GAH [50] & ∠GJE = ∠GHA [53] (Similar Triangles)⇒ GE:GJ = GA:GH [54] -042. ∠GEJ = ∠GAH [50] & ∠GJE = ∠GHA [53] (Similar Triangles)⇒ EG:EJ = AG:AH [55] -043. GE:GJ = GA:GH [54] & EG = EC [07] ⇒ CE:GJ = AG:GH [56] -044. EG:EJ = AG:AH [55] & EG = EC [07] ⇒ CE:EJ = AG:AH [57] -045. (IB:AI) * (CA:GB) * (GH:CH) = 1 [15] & (GI:CI) * (CA:AH) * (HB:GB) = 1 [14] & (GI:CG) * (AB:AH) * (CH:IB) = 1 [16] & CE:GJ = AG:GH [56] & CE:EJ = AG:AH [57] (Ratio chase)⇒ (AI:AH) * (CG:GJ) * (HB:AB) * (EJ:CI) = 1 [58] -046. (CA:AH) * (GI:GJ) * (HB:DB) * (EJ:CI) = 1 [47] & (AI:AH) * (CG:GJ) * (HB:AB) * (EJ:CI) = 1 [58] & (HB:GH) * (AI:AB) * (CG:CI) = 1 [17] ⇒ (GI:IC) * (CD:DB) * (BH:HG) = 1 [59] -047. C,G,I are collinear [10] & C,D,B are collinear [00] & G,H,B are collinear [08] & (GI:IC) * (CD:DB) * (BH:HG) = 1 [59] (Menelaus)⇒ I,H,D are collinear +001. DA = DB [00] & DB = DC [01] ⇒ D is the circumcenter of \Delta ABC [11] +002. D is the circumcenter of \Delta ABC [11] & DE = DA [02] & DF = DA [03] & A,G,B are collinear [04] & E,F,G are collinear [05] & C,B,H are collinear [06] & J,F,H are collinear [09] & C,E,I are collinear [07] & A,J,I are collinear [10] & H,I,G are collinear [08] ⇒ DA = DJ ========================== diff --git a/pros2.txt b/pros2.txt index 1d4e0b1..8dbee47 100644 --- a/pros2.txt +++ b/pros2.txt @@ -61,4 +61,6 @@ a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_line e a example2_4 a b c = triangle a b c; d = on_circle d c a, on_line d b c; o = circle o a c d; m = midpoint m b c; p = on_circle p o c, on_circle p m c; e = on_line e a c, on_line e b p; f = on_line f a b, on_line f c p ? coll d e f test_anglebi -a b c = triangle a b c; i = incenter i a b c; d = on_line d a i, on_line d b c; e = on_tline e a a i, on_line e b c ? eqratio b d c d b e c e \ No newline at end of file +a b c = triangle a b c; i = incenter i a b c; d = on_line d a i, on_line d b c; e = on_tline e a a i, on_line e b c ? eqratio b d c d b e c e +test_413 +a b = segment a b; c = on_circle c a b; d = midpoint d b c; e = foot e d a c; f = midpoint f d e; g = on_line g a f, on_line g b e ? perp a f b e \ No newline at end of file diff --git a/rules1.txt b/rules1.txt index ce7d3c3..139dfae 100644 --- a/rules1.txt +++ b/rules1.txt @@ -1,2 +1 @@ -coll A F B, coll B D C, coll C E A, coll D E F => eqratio30 A F F B B D D C C E E A -eqratio a b c d m n p q, eqratio c d e f p q r u => eqratio a b e f m n r u \ No newline at end of file +circle O A B C, cong O A O D, cong O A O E, coll G A B, coll G D E, coll H B C, coll H E F, coll I C D, coll I F A, coll G H I => cong O A O F \ No newline at end of file diff --git a/speed.txt b/speed.txt new file mode 100644 index 0000000..9366b02 --- /dev/null +++ b/speed.txt @@ -0,0 +1,30 @@ +test_ccc2p +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; p = on_line p a b, on_line p c d ? eqratio p a p c p d p b +test_ccc2pt +a b c = triangle a b c; o = circle o a b c; p = on_line p b c, on_tline p a o a; d = on_circle d o a; e = on_line e p d, on_circle e o a ? eqratio p a p b p c p a +test_p2ccc +a b = segment a b; o = on_bline o a b; w = on_bline w a b; c = on_circle c o a; d = on_circle d o a; p = on_line p a b, on_line p c d; e = on_circle e w a; f = on_circle f w a, on_line f p e ? cyclic c d e f +test_radical_axis1 +a b = segment a b; o1 = on_bline o1 a b; o2 = on_bline o2 a b; o3 = free; c = on_circle c o1 a; d = on_circle d o1 a, on_circle d o3 c; e = on_circle e o2 a, on_circle e o3 c; f = on_circle f o2 a, on_circle f o3 c; g = on_line g c d, on_line g e f ? coll g a b +test_radical_axis2 +a b c = triangle a b c; e = free; o1 = circle o1 a b c; o2 = circle o2 a b e; o3 = on_bline o3 c e; d = on_circle d o1 a, on_circle d o3 c; f = on_circle f o2 a, on_circle f o3 c; g = on_line g c d, on_line g e f ? coll g a b +test_pascal61 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_circle e o a; f = on_circle f o a; g = on_line g a b, on_line g d e; h = on_line h b c, on_line h e f; i = on_line i c d, on_line i f a ? coll g h i +test_pascal62 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_circle e o a; f = on_circle f o a; g = on_line g a b, on_line g d e; h = on_line h b c, on_line h e f; i = on_line i c d, on_line i f a; a1 b1 c1 = triangle a1 b1 c1; o1 = circle o1 a1 b1 c1; d1 = on_circle d1 o1 a1; e1 = on_circle e1 o1 a1; f1 = on_circle f1 o1 a1 ? coll g h i +test_pascal63 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_circle e o a; f = on_circle f o a; g = on_line g a b, on_line g d e; h = on_line h b c, on_line h e f; i = on_line i c d, on_line i f a; a1 = free; b1 = free; c1 = free; o1 = circle o1 a1 b1 c1; d1 = on_circle d1 o1 a1; e1 = on_circle e1 o1 a1; f1 = on_circle f1 o1 a1 ? coll g h i +test_pascal5 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_circle e o a; g = on_tline g a o a, on_line g c d; h = on_line h a b, on_line h d e; i = on_line i b c, on_line i e a ? coll g h i +test_pascal41 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; g = on_tline g a o a, on_line g b c; h = on_line h a b, on_line h c d; i = on_tline i b o b, on_line i d a ? coll g h i +test_pascal42 +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; g = on_tline g a o a, on_tline g b o b; h = on_line h a c, on_line h b d; i = on_line i c b, on_line i d a ? coll g h i +test_pascal6_rev +a b c = triangle a b c; o = circle o a b c; d = on_circle d o a; e = on_circle e o a; g = on_line g a b, on_line g d e; h = on_line h b c; i = on_line i g h, on_line i c d; f = on_line f h e, on_line f a i ? cong o a o f +test_gcenter1 +a b c = triangle a b c; d = midpoint d b c; e = midpoint e c a; g = on_line g b e, on_line g a d; f = on_line f a b, on_line f c g ? cong f a f b +test_gcenter2 +a b c = triangle a b c; d = midpoint d b c; e = midpoint e c a; f = midpoint f a b; g = on_line g b e, on_line g c f ? coll a g d +test_menelaus +a b c = triangle a b c; d = midpoint d b c; e = on_line e c a; f = on_line f a b, on_line f d e ? eqratio c e e a b f f a \ No newline at end of file